summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-09-15 06:50:04 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-09-15 06:50:04 +0000
commit147ed48e86bb4a13e42df35f1d1d800a7b564f4b (patch)
tree2412db1dcc7b46a214d2b7b46d21349ac08aa9b8
parent512771c8a42d2cde253f6df55ef552f7a0b4f792 (diff)
Removed more modules as in Oscar's TUSCANY-2440 reduced-set patch. Also removed newer modules added since r643746 and are not required to run the minimum set that we are porting to android. Set svn ignore properties to ignore Manifest files produced by the build.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@695356 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/pom.xml217
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/Collection.java81
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/MediaCollection.java55
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/NotFoundException.java45
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java485
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingListenerServlet.java879
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingProviderFactory.java74
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingUtil.java164
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java183
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java87
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java92
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java97
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java86
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java104
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomTestCaseUtils.java96
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/Consumer.java35
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java155
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java249
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClient.java29
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java99
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java149
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/Provider.java41
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTest.java436
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTest.java356
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTest.java184
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite32
-rw-r--r--branches/sca-android/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Provider.composite33
-rw-r--r--branches/sca-android/modules/binding-atom/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-atom/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-atom/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-atom/pom.xml82
-rw-r--r--branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/AtomBinding.java43
-rw-r--r--branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/AtomBindingFactory.java35
-rw-r--r--branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingFactoryImpl.java36
-rw-r--r--branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java115
-rw-r--r--branches/sca-android/modules/binding-atom/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.atom.AtomBindingFactory19
-rw-r--r--branches/sca-android/modules/binding-atom/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.java89
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/pom.xml143
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProviderFactory.java70
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaInvoker.java89
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaReferenceBindingProvider.java100
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java92
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/exceptions/CorbaException.java34
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/exceptions/RequestConfigurationException.java43
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/DynaCorbaRequest.java253
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/DynaCorbaResponse.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/InterfaceInstanceCreator.java70
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/InterfaceMethodInterceptor.java65
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/ComponentInvocationProxy.java120
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java137
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationException.java43
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.java46
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/OperationTypes.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/AnnotationAttributes.java46
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/NodeType.java28
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTree.java50
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeCreator.java497
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeNode.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/UnionAttributes.java59
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ArrayTypeHelper.java53
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/BooleanTypeHelper.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ByteTypeHelper.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/CharTypeHelper.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/DoubleTypeHelper.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/EnumTypeHelper.java41
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/FloatTypeHelper.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/IntTypeHelper.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/LongTypeHelper.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ReferenceTypeHelper.java42
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/SequenceTypeHelper.java70
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ShortTypeHelper.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/StringTypeHelper.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/StructTypeHelper.java69
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/TypeHelper.java47
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/TypeHelpersProxy.java119
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/UnionTypeHelper.java92
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/Utils.java40
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/util/MethodFinder.java97
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/util/OperationMapper.java578
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaArray.java34
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaUnionElement.java37
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaUnionElementType.java28
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaServantTestCase.java564
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaTypesTestCase.java841
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/MappingTestInterface.java46
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/MethodFinderTestCase.java70
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/OperationMappingTestCase.java67
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/TestConstants.java87
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests.java13
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsHelper.java85
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsHolder.java38
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsOperations.java16
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnion.java112
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnionHelper.java106
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnionHolder.java38
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnion.java177
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnionHelper.java157
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnionHolder.java38
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArrayHelper.java76
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArrayHolder.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStruct.java28
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStructHelper.java149
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStructHolder.java38
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/_ArraysUnionsTestsImplBase.java86
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/_ArraysUnionsTestsStub.java100
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/Color.java60
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHelper.java69
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager.java30
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHelper.java98
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerOperations.java32
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerImplBase.java76
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerStub.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc.java30
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcHelper.java98
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcOperations.java36
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/Arguments.java41
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/ArgumentsHelper.java94
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/ArgumentsHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZero.java52
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZeroHelper.java100
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZeroHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupported.java46
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupportedHelper.java93
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupportedHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/_CalcImplBase.java102
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/_CalcStub.java106
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter.java30
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterHelper.java100
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterOperations.java59
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter.java31
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterHelper.java100
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterOperations.java59
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObject.java30
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectHelper.java100
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectOperations.java30
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStruct.java41
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStructHelper.java93
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStructHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStruct.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStructHelper.java146
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStructHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObject.java30
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectHelper.java99
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectOperations.java44
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_ArraysSetterImplBase.java232
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_ArraysSetterStub.java343
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_PrimitivesSetterImplBase.java230
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_PrimitivesSetterStub.java341
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_RemoteObjectImplBase.java59
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_RemoteObjectStub.java55
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_TestObjectImplBase.java149
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_TestObjectStub.java182
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/boolean_listHelper.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/boolean_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/char_listHelper.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/char_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/double_listHelper.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/double_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/float_listHelper.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/float_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_listHelper.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_long_listHelper.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_long_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1Helper.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1Holder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2Helper.java83
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2Holder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3Helper.java89
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3Holder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/octet_listHelper.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/octet_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_listHelper.java80
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/short_listHelper.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/short_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/string_listHelper.java77
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/string_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_listHelper.java76
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_listHelper.java78
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_listHelper.java76
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wchar_listHelper.java75
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wchar_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wstring_listHelper.java77
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wstring_listHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/ArraysTestStruct.java45
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/Calc.java30
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/DummyObject.java28
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InnerUnion.java55
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidCorbaArray.java38
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum1.java36
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum2.java33
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum3.java33
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct1.java28
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct2.java31
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct3.java36
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion1.java37
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion2.java34
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion3.java35
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion4.java39
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion5.java42
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/NonCorbaException.java28
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/RichUnion.java91
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/SimpleStruct.java30
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/SomeStruct.java33
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObject.java30
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectHelper.java100
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectOperations.java33
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManager.java30
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerHelper.java100
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerHolder.java51
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerOperations.java33
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_DummyObjectImplBase.java84
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_DummyObjectStub.java92
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_ObjectManagerImplBase.java86
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_ObjectManagerStub.java94
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysSetterServant.java89
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsServant.java42
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsTuscanyServant.java43
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/CalcServant.java52
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/DummyObjectServant.java42
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/EnumManagerServant.java33
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/InvalidTestObjectServant.java24
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/InvalidTypesServant.java34
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/NonCorbaServant.java36
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ObjectManagerServant.java37
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/PrimitivesSetterServant.java89
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/TestObjectServant.java71
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestDataType.java88
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java139
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterfaceContract.java58
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java174
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java234
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java100
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/resources/arrays_unions.idl69
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/resources/enums.idl44
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/resources/exceptions.idl58
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/resources/general_tests.idl124
-rw-r--r--branches/sca-android/modules/binding-corba-runtime/src/test/resources/references.idl50
-rw-r--r--branches/sca-android/modules/binding-corba/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-corba/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-corba/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-corba/pom.xml71
-rw-r--r--branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/CorbaBinding.java46
-rw-r--r--branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/CorbaBindingFactory.java31
-rw-r--r--branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingFactoryImpl.java37
-rw-r--r--branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingImpl.java132
-rw-r--r--branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProcessor.java134
-rw-r--r--branches/sca-android/modules/binding-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.corba.CorbaBindingFactory19
-rw-r--r--branches/sca-android/modules/binding-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/pom.xml189
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/ClassLoadingUtil.java365
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/DynamicStubClassLoader.java150
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/Java2IDLUtil.java811
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/ObjectInputStreamExt.java61
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/StubMethodInterceptor.java154
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/UtilInitializer.java69
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java92
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingProviderFactory.java56
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingReferenceBindingProvider.java86
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBHandler.java338
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBLocator.java483
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBObjectFactory.java209
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBStubHelper.java69
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/InterfaceInfo.java117
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/JavaReflectionAdapter.java157
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/MethodInfo.java189
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/NamingEndpoint.java124
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/main/resources/binding-ejb-validation-messages.properties23
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/BankManagerFacade.java33
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/Customer.java36
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/CustomerImpl.java57
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/java/calculator/AddService.java27
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceHome.java31
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/geronimo/samples/bank/ejb/BankManagerFacade.java44
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/geronimo/samples/bank/ejb/BankManagerFacadeHome.java44
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/EJBReferenceTestCase.java67
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/MockServer.java151
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/SocketTracer.java138
-rw-r--r--branches/sca-android/modules/binding-ejb-runtime/src/test/resources/account/account.composite35
-rw-r--r--branches/sca-android/modules/binding-ejb/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-ejb/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-ejb/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-ejb/pom.xml84
-rw-r--r--branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBinding.java94
-rw-r--r--branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBindingException.java56
-rw-r--r--branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBindingFactory.java35
-rw-r--r--branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingFactoryImpl.java36
-rw-r--r--branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingImpl.java183
-rw-r--r--branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingProcessor.java182
-rw-r--r--branches/sca-android/modules/binding-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ejb.EJBBindingFactory19
-rw-r--r--branches/sca-android/modules/binding-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/binding-ejb/src/main/resources/binding-ejb-validation-messages.properties23
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/LICENSE202
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/NOTICE8
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/pom.xml79
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/GdataBinding.java49
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/GdataBindingFactory.java34
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingFactoryImpl.java35
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingImpl.java142
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java158
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.gdata.GdataBindingFactory18
-rw-r--r--branches/sca-android/modules/binding-gdata-gsoc/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/pom.xml210
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/Collection.java79
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/MediaCollection.java54
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/NotFoundException.java45
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingInvoker.java434
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java746
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingProviderFactory.java82
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingUtil.java170
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataReferenceBindingProvider.java232
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataServiceBindingProvider.java90
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/resources/tuscany-binding-gdata.xsd36
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/Consumer.java60
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/ConsumerProviderTestCase.java140
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClient.java40
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClientImpl.java123
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerCollectionImpl.java143
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleBloggerServiceTestCase.java149
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleCalendarServiceTestCase.java157
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java152
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/Provider.java41
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/StartLocalhostServlet.java41
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/log4j.properties25
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/Consumer.composite32
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleBlogger.composite32
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleCalendar.composite32
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleContacts.composite32
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/Provider.composite33
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/NOTICE6
-rwxr-xr-xbranches/sca-android/modules/binding-gdata-runtime/deployGdataToMaven.sh7
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/pom.xml183
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/Collection.java82
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/MediaCollection.java55
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingInvoker.java510
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingListenerServlet.java426
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingProviderFactory.java74
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataReferenceBindingProvider.java125
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataServiceBindingProvider.java85
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumer.java121
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumerImpl.java55
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumerTest.java203
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/Consumer.java36
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerClient.java25
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerClientImpl.java117
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerCollectionImpl.java116
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/Provider.java34
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/CalendarConsumer.composite32
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/Consumer.composite32
-rw-r--r--branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/Provider.composite33
-rw-r--r--branches/sca-android/modules/binding-gdata/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-gdata/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-gdata/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-gdata/pom.xml73
-rw-r--r--branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataBinding.java77
-rw-r--r--branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataBindingFactory.java35
-rw-r--r--branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataImplementationProcessor.java100
-rw-r--r--branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GDataBindingFactoryImpl.java36
-rw-r--r--branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GDataBindingImpl.java137
-rw-r--r--branches/sca-android/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.gdata.GDataBindingFactory19
-rw-r--r--branches/sca-android/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor21
-rw-r--r--branches/sca-android/modules/binding-http-runtime/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-http-runtime/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-http-runtime/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-http-runtime/pom.xml114
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java432
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingProviderFactory.java64
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPGetListenerServlet.java94
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java137
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceListenerServlet.java84
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java147
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestGetImpl.java38
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java61
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/test/resources/content/test.html21
-rw-r--r--branches/sca-android/modules/binding-http-runtime/src/test/resources/test.composite47
-rw-r--r--branches/sca-android/modules/binding-http/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-http/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-http/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-http/pom.xml87
-rw-r--r--branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/CacheContext.java257
-rw-r--r--branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBinding.java31
-rw-r--r--branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBindingFactory.java35
-rw-r--r--branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingFactoryImpl.java36
-rw-r--r--branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java69
-rw-r--r--branches/sca-android/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.http.HTTPBindingFactory19
-rw-r--r--branches/sca-android/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/pom.xml136
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java117
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingInvoker.java407
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java232
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingProviderFactory.java60
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java133
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java307
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSMessageProcessor.java55
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSMessageProcessorUtil.java75
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java220
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/ObjectMessageProcessor.java75
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/TextMessageProcessor.java68
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/XMLTextMessageProcessor.java90
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java43
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java31
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java32
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/OperationSelectionTestCaseFIXME.java238
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/test/resources/simple/client.composite38
-rw-r--r--branches/sca-android/modules/binding-jms-runtime/src/test/resources/simple/service.composite35
-rw-r--r--branches/sca-android/modules/binding-jms/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-jms/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-jms/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-jms/pom.xml66
-rw-r--r--branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java572
-rw-r--r--branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingConstants.java72
-rw-r--r--branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingException.java45
-rw-r--r--branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java684
-rw-r--r--branches/sca-android/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties47
-rw-r--r--branches/sca-android/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java211
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/pom.xml164
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java45
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingProviderFactory.java64
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java70
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java184
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java282
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JavaToSmd.java56
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/ScaDomainScriptServlet.java114
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/main/resources/org/apache/tuscany/sca/binding/jsonrpc/provider/jsonrpc.js493
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/bean/TestBean.java51
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/Echo.java62
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoBusinessException.java29
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoComponentImpl.java98
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java193
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCExceptionTestCase.java86
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java70
-rw-r--r--branches/sca-android/modules/binding-jsonrpc-runtime/src/test/resources/JSONRPCBinding.composite35
-rw-r--r--branches/sca-android/modules/binding-jsonrpc/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-jsonrpc/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-jsonrpc/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-jsonrpc/pom.xml72
-rw-r--r--branches/sca-android/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBinding.java63
-rw-r--r--branches/sca-android/modules/binding-jsonrpc/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/binding-rmi/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-rmi/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-rmi/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-rmi/pom.xml79
-rw-r--r--branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java77
-rw-r--r--branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingActivator.java58
-rw-r--r--branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvoker.java88
-rw-r--r--branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvokerFactory.java65
-rw-r--r--branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java199
-rw-r--r--branches/sca-android/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator18
-rw-r--r--branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloException.java60
-rw-r--r--branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldImpl.java42
-rw-r--r--branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiImpl.java50
-rw-r--r--branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiService.java31
-rw-r--r--branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldService.java31
-rw-r--r--branches/sca-android/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java75
-rw-r--r--branches/sca-android/modules/binding-rmi/src/test/resources/HelloWorldImpl.componentType23
-rw-r--r--branches/sca-android/modules/binding-rmi/src/test/resources/HelloWorldRmiImpl.componentType27
-rw-r--r--branches/sca-android/modules/binding-rmi/src/test/resources/RMIBindingTest.composite43
-rw-r--r--branches/sca-android/modules/binding-rss-rome/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-rss-rome/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-rss-rome/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-rss-rome/pom.xml171
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java49
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.java55
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/NotFoundException.java45
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingInvoker.java76
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java394
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.java74
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.java65
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.java85
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java35
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClient.java25
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java45
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java103
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java41
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/test/resources/org/apache/tuscany/sca/binding/feed/Consumer.composite32
-rw-r--r--branches/sca-android/modules/binding-rss-rome/src/test/resources/org/apache/tuscany/sca/binding/feed/Provider.composite33
-rw-r--r--branches/sca-android/modules/binding-rss/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-rss/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-rss/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-rss/pom.xml98
-rw-r--r--branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBinding.java28
-rw-r--r--branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBindingFactory.java35
-rw-r--r--branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingFactoryImpl.java36
-rw-r--r--branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingImpl.java99
-rw-r--r--branches/sca-android/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rss.RSSBindingFactory19
-rw-r--r--branches/sca-android/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/pom.xml110
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingInvoker.java100
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingProviderFactory.java67
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAReferenceBindingProvider.java184
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceBindingProvider.java122
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceProvider.java84
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java73
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BindingScaEndpointResolverFactoryImpl.java50
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BindingScaEndpointResolverImpl.java69
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java77
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java66
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java105
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestNode.java232
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java29
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java27
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java33
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java31
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java27
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java29
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java29
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java43
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java42
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java35
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java35
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java35
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java36
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java35
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java30
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java41
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java30
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory19
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeA/HelloWorld.composite75
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeA/META-INF/sca-contribution.xml24
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeB/HelloWorld.composite84
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeB/META-INF/sca-contribution.xml24
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorld.composite35
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorldComponent.composite37
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/META-INF/sca-contribution.xml24
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorld.composite35
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorldComponent.composite37
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/META-INF/sca-contribution.xml24
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeE/HelloWorld.composite36
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeE/META-INF/sca-contribution.xml24
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeF/HelloWorld.composite43
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeF/META-INF/sca-contribution.xml24
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite36
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeG/META-INF/sca-contribution.xml24
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.composite38
-rw-r--r--branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeH/META-INF/sca-contribution.xml24
-rw-r--r--branches/sca-android/modules/binding-sca-corba/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-sca-corba/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-sca-corba/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-sca-corba/pom.xml114
-rw-r--r--branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCABindingProviderFactory.java64
-rw-r--r--branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java112
-rw-r--r--branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvoker.java85
-rw-r--r--branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAReferenceBindingProvider.java95
-rw-r--r--branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAServiceBindingProvider.java97
-rw-r--r--branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/WrappedSCAException.java56
-rw-r--r--branches/sca-android/modules/binding-sca-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/pom.xml149
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicy.java67
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProcessor.java123
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProviderFactory.java75
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyInterceptor.java84
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyProvider.java90
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyInterceptor.java86
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyProvider.java89
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java54
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java79
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java157
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProviderFactory.java99
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor20
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java60
-rw-r--r--branches/sca-android/modules/binding-ws-axis2-policy/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/mock_policies.xml36
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/pom.xml580
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java273
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java81
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java71
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java87
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java84
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java503
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java79
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java103
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java796
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceServlet.java295
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java79
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java207
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java105
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java238
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/WSBindingDefinitionsProvider.java66
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferenceBindingConfigurator.java86
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServiceBindingConfigurator.java86
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider19
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml54
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml503
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/modules.list1
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.3.marbin2704 -> 0 bytes
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/services/services.list0
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java83
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java104
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java31
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java24
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java34
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java33
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Bar.java58
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java103
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java29
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java33
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoImpl.java29
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Foo.java36
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java29
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java33
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldMultiService.java51
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java77
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java30
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java30
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java34
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMService.java41
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java58
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldService.java28
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java46
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java58
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java96
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java96
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java124
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/UriPrecedenceTestCase.java68
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java64
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiServiceTestCase.java24
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleServiceTestCase.java24
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURITestCase.java24
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURITestCase.java24
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java47
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCase.java64
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java45
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java45
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java45
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java24
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java42
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCase.java24
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/AbstractHelloWorldOMTestCase.java64
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ClientPWCBHandler.java50
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/IntegrityPWCBHandler.java50
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ServerPWCBHandler.java49
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixedTestCase.java24
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCase.java64
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java45
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java45
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java45
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCase.java24
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java42
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCase.java24
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCase.java58
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCase.java138
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler20
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite50
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite61
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd36
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd27
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd31
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite51
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite51
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite49
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite49
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/helloworld-om-relative-uri.wsdl78
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite50
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-binding.wsdl45
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite42
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl59
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-uri.wsdl78
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite43
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.wsdl78
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite47
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.wsdl81
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld.wsdl86
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthentication.composite50
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentiality.composite49
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrity.composite49
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml101
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties4
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jksbin1379 -> 0 bytes
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml32
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixed.composite52
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/definitions.xml323
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties4
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jksbin1379 -> 0 bytes
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthentication.composite50
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentiality.composite49
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrity.composite50
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml203
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jksbin1379 -> 0 bytes
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl70
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import.wsdl49
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-include.wsdl94
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite31
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite31
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl.composite39
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.composite71
-rw-r--r--branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/questionmark-wsdl.composite40
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/pom.xml113
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java345
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java840
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java305
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLGenerationException.java54
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java533
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/main/resources/wsdlgen-validation-messages.properties31
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/Other.java34
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/package-info.java3
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java86
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java66
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestException.java47
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFault.java46
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFaultBean.java54
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaClass.java32
-rw-r--r--branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaInterface.java57
-rw-r--r--branches/sca-android/modules/binding-ws-xml/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-ws-xml/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-ws-xml/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-ws-xml/pom.xml100
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java51
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/EndPointReferenceHelper.java230
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java410
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java44
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties28
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java127
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java76
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite59
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite63
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType45
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite60
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl26
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl58
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd136
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl58
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl45
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd33
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl63
-rw-r--r--branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl76
-rw-r--r--branches/sca-android/modules/binding-ws/LICENSE205
-rw-r--r--branches/sca-android/modules/binding-ws/META-INF/README1
-rw-r--r--branches/sca-android/modules/binding-ws/NOTICE6
-rw-r--r--branches/sca-android/modules/binding-ws/pom.xml85
-rw-r--r--branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java31
-rw-r--r--branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java214
-rw-r--r--branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java35
-rw-r--r--branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/addressing/EndPointReference.java62
-rw-r--r--branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java35
-rw-r--r--branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java316
-rw-r--r--branches/sca-android/modules/binding-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory19
-rw-r--r--branches/sca-android/modules/contribution-namespace/LICENSE205
-rw-r--r--branches/sca-android/modules/contribution-namespace/META-INF/README1
-rw-r--r--branches/sca-android/modules/contribution-namespace/NOTICE6
-rw-r--r--branches/sca-android/modules/contribution-namespace/pom.xml76
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/DefaultNamespaceImportExportFactory.java30
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceExport.java46
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImport.java59
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImportExportFactory.java42
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportImpl.java54
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportModelResolver.java54
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java142
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportFactoryImpl.java41
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportListener.java98
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportImpl.java92
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java148
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory18
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener18
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties22
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java103
-rw-r--r--branches/sca-android/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java108
-rw-r--r--branches/sca-android/modules/contribution-osgi/LICENSE205
-rw-r--r--branches/sca-android/modules/contribution-osgi/META-INF/README1
-rw-r--r--branches/sca-android/modules/contribution-osgi/NOTICE6
-rw-r--r--branches/sca-android/modules/contribution-osgi/pom.xml96
-rw-r--r--branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/BundleReference.java161
-rw-r--r--branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionProcessor.java161
-rw-r--r--branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleProcessor.java141
-rw-r--r--branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleReferenceModelResolver.java154
-rw-r--r--branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiClassReferenceModelResolver.java137
-rw-r--r--branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiImportExportListener.java215
-rw-r--r--branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiModelResolverImpl.java119
-rw-r--r--branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.PackageProcessor18
-rw-r--r--branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver18
-rw-r--r--branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener18
-rw-r--r--branches/sca-android/modules/contribution-resource/META-INF/README1
-rw-r--r--branches/sca-android/modules/contribution-resource/pom.xml76
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceExport.java46
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImport.java59
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImportExportFactory.java42
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ArtifactModelResolver.java86
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportImpl.java58
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportModelResolver.java65
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java142
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportFactoryImpl.java41
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportListener.java97
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportImpl.java107
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java148
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver18
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory18
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener18
-rw-r--r--branches/sca-android/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties22
-rw-r--r--branches/sca-android/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java104
-rw-r--r--branches/sca-android/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java106
-rw-r--r--branches/sca-android/modules/data-api/LICENSE205
-rw-r--r--branches/sca-android/modules/data-api/META-INF/README1
-rw-r--r--branches/sca-android/modules/data-api/NOTICE6
-rw-r--r--branches/sca-android/modules/data-api/pom.xml58
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Collection.java78
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Entry.java85
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Item.java159
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/ItemCollection.java30
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/LocalItemCollection.java28
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/NotFoundException.java45
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.java31
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Entry.java29
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Item.java30
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/ItemCollection.java31
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/LocalItemCollection.java29
-rw-r--r--branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.java30
-rw-r--r--branches/sca-android/modules/data-engine-helper/LICENSE205
-rw-r--r--branches/sca-android/modules/data-engine-helper/META-INF/README1
-rw-r--r--branches/sca-android/modules/data-engine-helper/NOTICE6
-rw-r--r--branches/sca-android/modules/data-engine-helper/pom.xml142
-rw-r--r--branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/ConnectionInfoArtifactProcessor.java197
-rw-r--r--branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/DataAccessEngine.java286
-rw-r--r--branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/DataAccessEngineManager.java141
-rw-r--r--branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/MissingConfigFileException.java44
-rw-r--r--branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/config/ConnectionInfo.java47
-rw-r--r--branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/config/ConnectionProperties.java78
-rw-r--r--branches/sca-android/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.properties21
-rw-r--r--branches/sca-android/modules/databinding-axiom/LICENSE205
-rw-r--r--branches/sca-android/modules/databinding-axiom/META-INF/README1
-rw-r--r--branches/sca-android/modules/databinding-axiom/NOTICE6
-rw-r--r--branches/sca-android/modules/databinding-axiom/pom.xml122
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java63
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java142
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java95
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java77
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java79
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java69
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java50
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java64
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java66
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java251
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java63
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java64
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java70
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding20
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer30
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java129
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/test/resources/ipo.xml51
-rwxr-xr-xbranches/sca-android/modules/databinding-axiom/src/test/resources/ipo.xsd137
-rw-r--r--branches/sca-android/modules/databinding-axiom/src/test/resources/order.wsdl76
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/LICENSE202
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/META-INF/README1
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/NOTICE14
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/pom.xml87
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2Node.java70
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2SAX.java71
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2XMLStreamReader.java67
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/Node2FastInfoset.java71
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLInputStream2FastInfoset.java89
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLStreamReader2FastInfoset.java75
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer22
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer22
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/src/test/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfosetTransformerTestCase.java127
-rw-r--r--branches/sca-android/modules/databinding-fastinfoset/src/test/resources/ipo.xsd136
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/LICENSE205
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/META-INF/README1
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/NOTICE6
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/pom.xml189
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java140
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java78
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXBDataSource.java124
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java85
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java110
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java189
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java147
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java125
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStreamWriterWithOS.java246
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java88
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer26
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/JAXB2OMTestCase.java109
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/OMElement2JAXBTestCase.java71
-rw-r--r--branches/sca-android/modules/databinding-jaxb-axiom/src/test/resources/ipo.xsd136
-rw-r--r--branches/sca-android/modules/databinding-jaxb/LICENSE205
-rw-r--r--branches/sca-android/modules/databinding-jaxb/META-INF/README1
-rw-r--r--branches/sca-android/modules/databinding-jaxb/NOTICE6
-rw-r--r--branches/sca-android/modules/databinding-jaxb/pom.xml185
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DataConverter.java378
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DefaultXMLAdapterExtensionPoint.java60
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java75
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2SAX.java70
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2String.java77
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java293
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java429
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java132
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBPropertyDescriptor.java302
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTypeHelper.java276
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperException.java56
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java151
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHelper.java166
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java73
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java74
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/String2JAXB.java80
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLAdapterExtensionPoint.java52
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLRootElementUtil.java286
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java77
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding19
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer32
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint17
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/com/example/stock/StockQuoteOffer.java45
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/BeanXMLStreamReaderImpl.java324
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2XMLStreamReader.java84
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java123
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBindingTestCase.java130
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBReflectionTestCase.java94
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java175
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java90
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyBean.java162
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterface.java29
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterfaceImpl.java67
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MySubBean.java35
-rw-r--r--branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/POJOTestCase.java250
-rwxr-xr-xbranches/sca-android/modules/databinding-jaxb/src/test/resources/ipo.xsd136
-rw-r--r--branches/sca-android/modules/databinding-json/LICENSE202
-rw-r--r--branches/sca-android/modules/databinding-json/META-INF/README1
-rw-r--r--branches/sca-android/modules/databinding-json/NOTICE6
-rw-r--r--branches/sca-android/modules/databinding-json/pom.xml136
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2JavaBean.java73
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2String.java61
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2XMLStreamReader.java65
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONDataBinding.java75
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONHelper.java91
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSON.java82
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSONObject.java139
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/String2JSON.java64
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/XMLStreamReader2JSON.java77
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSON2OMElement.java94
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSONBadgerfishDataSource.java57
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSONDataSource.java176
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding19
-rw-r--r--branches/sca-android/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer31
-rw-r--r--branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/JSONTransformerTestCase.java128
-rw-r--r--branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSONTestCase.java170
-rw-r--r--branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/MyBean.java158
-rw-r--r--branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/MyInterface.java29
-rw-r--r--branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/MyInterfaceImpl.java67
-rw-r--r--branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/POJOTestCase.java87
-rw-r--r--branches/sca-android/modules/databinding-json/src/test/resources/ipo.xsd136
-rw-r--r--branches/sca-android/modules/databinding-saxon/LICENSE202
-rw-r--r--branches/sca-android/modules/databinding-saxon/META-INF/README1
-rw-r--r--branches/sca-android/modules/databinding-saxon/NOTICE6
-rw-r--r--branches/sca-android/modules/databinding-saxon/pom.xml125
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/DataObject2NodeInfoTransformer.java99
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/ItemList2ObjectTransformer.java153
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Node2NodeInfoTransformer.java77
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2DataObjectTransformer.java91
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2JavaArrayTransformer.java76
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2NodeTransformer.java71
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Object2ValueTransformer.java65
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonDataBindingHelper.java41
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonNodeDataBinding.java54
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonValueDataBinding.java53
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SimpleType2ValueTransformer.java87
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2JavaArray.java74
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2ObjectTransformer.java66
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2SimpleTypeTransformer.java65
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/collection/ItemList.java34
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding20
-rw-r--r--branches/sca-android/modules/databinding-saxon/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer34
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/LICENSE205
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/META-INF/README1
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/NOTICE6
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/pom.xml167
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/AxiomHelper.java142
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElement.java86
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/SDODataSource.java89
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElement.java65
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer20
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElementTestCase.java78
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/SDOTransformerTestCaseBase.java82
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElementTestCase.java63
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/src/test/resources/ipo.xsd136
-rw-r--r--branches/sca-android/modules/databinding-sdo-axiom/src/test/resources/stock.xsd33
-rw-r--r--branches/sca-android/modules/databinding-sdo/LICENSE205
-rw-r--r--branches/sca-android/modules/databinding-sdo/META-INF/README1
-rw-r--r--branches/sca-android/modules/databinding-sdo/NOTICE6
-rw-r--r--branches/sca-android/modules/databinding-sdo/pom.xml133
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2Node.java73
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java64
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java82
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java78
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java212
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/Node2DataObject.java69
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java208
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java153
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java68
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java235
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java177
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java61
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java65
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java69
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java72
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java66
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor18
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding19
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer27
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/main/resources/databinding-sdo-validation-messages.properties23
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java70
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2NodeTestCase.java60
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java65
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java75
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java89
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelperTestCase.java55
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java114
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java82
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java83
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java63
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java62
-rwxr-xr-xbranches/sca-android/modules/databinding-sdo/src/test/resources/ipo.xsd136
-rwxr-xr-xbranches/sca-android/modules/databinding-sdo/src/test/resources/model/sca-core.xsd233
-rwxr-xr-xbranches/sca-android/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd43
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/resources/stock.xsd33
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/resources/wrapper.xml27
-rw-r--r--branches/sca-android/modules/databinding-sdo/src/test/resources/wrapper.xsd38
-rwxr-xr-xbranches/sca-android/modules/databinding-xmlbeans/LICENSE202
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/META-INF/README1
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/NOTICE6
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/pom.xml125
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/Node2XmlObject.java61
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLBeansDataBinding.java82
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLBeansWrapperHandler.java110
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLStreamReader2XmlObject.java62
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObject2Node.java60
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObject2XMLStreamReader.java55
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding19
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer22
-rw-r--r--branches/sca-android/modules/databinding-xmlbeans/src/test/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObjectTestCase.java105
-rwxr-xr-xbranches/sca-android/modules/databinding-xmlbeans/src/test/resources/ipo.xsd136
-rwxr-xr-xbranches/sca-android/modules/databinding-xmlbeans/src/test/resources/ipo.xsdconfig21
-rw-r--r--branches/sca-android/modules/domain-manager/LICENSE205
-rw-r--r--branches/sca-android/modules/domain-manager/META-INF/README1
-rw-r--r--branches/sca-android/modules/domain-manager/NOTICE6
-rw-r--r--branches/sca-android/modules/domain-manager/pom.xml209
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationCollectionImpl.java127
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java518
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java255
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java656
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionServiceImpl.java77
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java403
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeServiceImpl.java128
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployedCompositeCollectionImpl.java378
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerConfiguration.java53
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerConfigurationImpl.java85
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java284
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/FileCollectionImpl.java136
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/FileServiceImpl.java153
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeConfigurationServiceImpl.java96
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java251
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java236
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java95
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/DomainManager.composite281
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/cloud-gadget.html408
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/cloud.html68
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/composite-gadget.html277
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/composite.html66
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/files-gadget.html124
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/files.html64
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/home-gadget.html45
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/home.html65
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/icons/feed-icon.pngbin818 -> 0 bytes
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/manager.css104
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/toolbar-gadget.html47
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/utils.js246
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/workspace-gadget.html232
-rw-r--r--branches/sca-android/modules/domain-manager/src/main/resources/workspace.html65
-rw-r--r--branches/sca-android/modules/domain-manager/src/test/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerTestCase.java117
-rw-r--r--branches/sca-android/modules/domain-manager/src/test/resources/contributions/assets/META-INF/sca-contribution.xml27
-rw-r--r--branches/sca-android/modules/domain-manager/src/test/resources/contributions/store/META-INF/sca-contribution.xml25
-rw-r--r--branches/sca-android/modules/domain-manager/src/test/resources/workspace.xml21
-rw-r--r--branches/sca-android/modules/extensibility-equinox/LICENSE205
-rw-r--r--branches/sca-android/modules/extensibility-equinox/META-INF/README1
-rw-r--r--branches/sca-android/modules/extensibility-equinox/NOTICE5
-rw-r--r--branches/sca-android/modules/extensibility-equinox/pom.xml112
-rw-r--r--branches/sca-android/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java281
-rw-r--r--branches/sca-android/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java46
-rw-r--r--branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java96
-rw-r--r--branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java152
-rw-r--r--branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java100
-rw-r--r--branches/sca-android/modules/extensibility-equinox/src/test/resources/test-bundle.jarbin1797 -> 0 bytes
-rw-r--r--branches/sca-android/modules/extension-helper/LICENSE205
-rw-r--r--branches/sca-android/modules/extension-helper/META-INF/README1
-rw-r--r--branches/sca-android/modules/extension-helper/NOTICE6
-rw-r--r--branches/sca-android/modules/extension-helper/pom.xml95
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/BindingActivator.java69
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/ComponentLifecycle.java32
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/ImplementationActivator.java64
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/InvokerFactory.java34
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/BindingSCDLProcessor.java194
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/BindingsActivator.java262
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/DiscoveryUtils.java113
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/ImplementationImplementationProvider.java99
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/ImplementationsActivator.java138
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/PojoBinding.java40
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/PojoImplementation.java58
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/SCDLProcessor.java248
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractBinding.java72
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractImplementation.java153
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractStAXArtifactProcessor.java132
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/DefaultPropertyValueObjectFactory.java231
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/DynamicImplementation.java96
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/PropertyValueObjectFactory.java33
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/ResourceHelper.java70
-rw-r--r--branches/sca-android/modules/extension-helper/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator20
-rw-r--r--branches/sca-android/modules/host-corba-jee/LICENSE205
-rw-r--r--branches/sca-android/modules/host-corba-jee/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-corba-jee/NOTICE6
-rw-r--r--branches/sca-android/modules/host-corba-jee/pom.xml63
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/main/java/org/apache/tuscany/sca/host/corba/jee/CorbaRuntimeModuleActivator.java52
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/main/java/org/apache/tuscany/sca/host/corba/jee/JEECorbaHost.java162
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/JEECorbaHostTestCase.java208
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/TestContext.java174
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/TestInitialContextFactory.java37
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterface.java30
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceHelper.java100
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceHolder.java51
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceOperations.java31
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/_TestInterfaceImplBase.java74
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/_TestInterfaceStub.java73
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/servants/TestInterfaceServant.java35
-rw-r--r--branches/sca-android/modules/host-corba-jee/src/test/resources/general.idl45
-rw-r--r--branches/sca-android/modules/host-corba-jse-tns/LICENSE205
-rw-r--r--branches/sca-android/modules/host-corba-jse-tns/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-corba-jse-tns/NOTICE6
-rw-r--r--branches/sca-android/modules/host-corba-jse-tns/pom.xml71
-rw-r--r--branches/sca-android/modules/host-corba-jse-tns/src/main/java/org/apache/tuscany/sca/host/corba/jse/tns/CorbaRuntimeModuleActivator.java53
-rw-r--r--branches/sca-android/modules/host-corba-jse-tns/src/main/java/org/apache/tuscany/sca/host/corba/jse/tns/TnsDefaultCorbaHost.java116
-rw-r--r--branches/sca-android/modules/host-corba-jse-tns/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--branches/sca-android/modules/host-corba-jse-tns/src/test/java/org/apache/tuscany/sca/host/corba/testing/TnsDefaultCorbaHostTestCase.java97
-rw-r--r--branches/sca-android/modules/host-corba-jse/LICENSE205
-rw-r--r--branches/sca-android/modules/host-corba-jse/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-corba-jse/NOTICE6
-rw-r--r--branches/sca-android/modules/host-corba-jse/pom.xml57
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/jse/CorbaRuntimeModuleActivator.java48
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/jse/DefaultCorbaHost.java181
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/NamingContextBase.java863
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameServer.java133
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameService.java200
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNamingContext.java440
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientServiceException.java44
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/DefaultCorbaHostTestCase.java250
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterface.java30
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHelper.java98
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHolder.java51
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceOperations.java31
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceImplBase.java74
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceStub.java73
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/servants/TestInterfaceServant.java35
-rw-r--r--branches/sca-android/modules/host-corba-jse/src/test/resources/general.idl43
-rw-r--r--branches/sca-android/modules/host-corba/LICENSE205
-rw-r--r--branches/sca-android/modules/host-corba/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-corba/NOTICE6
-rw-r--r--branches/sca-android/modules/host-corba/pom.xml57
-rw-r--r--branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHost.java56
-rw-r--r--branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostException.java47
-rw-r--r--branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostExtensionPoint.java51
-rw-r--r--branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostUtils.java61
-rw-r--r--branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbanameURL.java202
-rw-r--r--branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/DefaultCorbaHostExtensionPoint.java48
-rw-r--r--branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java55
-rwxr-xr-xbranches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/SocketUtil.java226
-rw-r--r--branches/sca-android/modules/host-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.corba.CorbaHostExtensionPoint18
-rw-r--r--branches/sca-android/modules/host-corba/src/test/java/org/apache/tuscany/sca/host/corba/UtilsTestCase.java145
-rw-r--r--branches/sca-android/modules/host-ejb/LICENSE205
-rw-r--r--branches/sca-android/modules/host-ejb/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-ejb/NOTICE6
-rw-r--r--branches/sca-android/modules/host-ejb/pom.xml57
-rw-r--r--branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/DefaultEJBHostExtensionPoint.java45
-rw-r--r--branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHost.java62
-rw-r--r--branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHostExtensionPoint.java51
-rw-r--r--branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBRegistrationException.java44
-rw-r--r--branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBSessionBean.java45
-rw-r--r--branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/ExtensibleEJBHost.java69
-rw-r--r--branches/sca-android/modules/host-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.ejb.EJBHostExtensionPoint18
-rw-r--r--branches/sca-android/modules/host-http/LICENSE205
-rw-r--r--branches/sca-android/modules/host-http/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-http/NOTICE6
-rw-r--r--branches/sca-android/modules/host-http/pom.xml65
-rw-r--r--branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultResourceServlet.java86
-rw-r--r--branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java45
-rw-r--r--branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java123
-rw-r--r--branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java111
-rw-r--r--branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostExtensionPoint.java51
-rw-r--r--branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletMappingException.java44
-rw-r--r--branches/sca-android/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.ServletHostExtensionPoint18
-rw-r--r--branches/sca-android/modules/host-jetty/LICENSE205
-rw-r--r--branches/sca-android/modules/host-jetty/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-jetty/NOTICE6
-rw-r--r--branches/sca-android/modules/host-jetty/pom.xml76
-rw-r--r--branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyDefaultServlet.java90
-rw-r--r--branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyLogger.java87
-rw-r--r--branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java486
-rw-r--r--branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/module/JettyRuntimeModuleActivator.java77
-rw-r--r--branches/sca-android/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--branches/sca-android/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java323
-rw-r--r--branches/sca-android/modules/host-jetty/src/test/resources/content/test.html21
-rw-r--r--branches/sca-android/modules/host-jetty/src/test/resources/tuscany.keyStorebin1265 -> 0 bytes
-rw-r--r--branches/sca-android/modules/host-openejb/LICENSE205
-rw-r--r--branches/sca-android/modules/host-openejb/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-openejb/NOTICE6
-rw-r--r--branches/sca-android/modules/host-openejb/pom.xml97
-rw-r--r--branches/sca-android/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBRuntimeModuleActivator.java52
-rw-r--r--branches/sca-android/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBServer.java127
-rw-r--r--branches/sca-android/modules/host-openejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator19
-rw-r--r--branches/sca-android/modules/host-openejb/src/test/java/org/apache/tuscany/sca/host/openejb/OpenEJBServerTestCase.java86
-rw-r--r--branches/sca-android/modules/host-rmi/LICENSE205
-rw-r--r--branches/sca-android/modules/host-rmi/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-rmi/NOTICE6
-rw-r--r--branches/sca-android/modules/host-rmi/pom.xml57
-rw-r--r--branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHost.java127
-rw-r--r--branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHostExtensionPoint.java49
-rw-r--r--branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java73
-rw-r--r--branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHost.java90
-rw-r--r--branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java45
-rw-r--r--branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostExtensionPoint.java51
-rw-r--r--branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java46
-rw-r--r--branches/sca-android/modules/host-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint18
-rw-r--r--branches/sca-android/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java90
-rw-r--r--branches/sca-android/modules/host-tomcat/LICENSE205
-rw-r--r--branches/sca-android/modules/host-tomcat/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-tomcat/NOTICE6
-rw-r--r--branches/sca-android/modules/host-tomcat/pom.xml87
-rw-r--r--branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/ServletWrapper.java58
-rw-r--r--branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/TomcatDefaultServlet.java114
-rw-r--r--branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/TomcatServer.java653
-rw-r--r--branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/module/TomcatRuntimeModuleActivator.java69
-rw-r--r--branches/sca-android/modules/host-tomcat/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--branches/sca-android/modules/host-tomcat/src/test/java/org/apache/tuscany/sca/http/tomcat/TomcatServerTestCase.java353
-rw-r--r--branches/sca-android/modules/host-tomcat/src/test/resources/content/test.html21
-rw-r--r--branches/sca-android/modules/host-tomcat/src/test/resources/tuscany.keyStorebin1265 -> 0 bytes
-rw-r--r--branches/sca-android/modules/host-webapp-junit/LICENSE205
-rw-r--r--branches/sca-android/modules/host-webapp-junit/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-webapp-junit/NOTICE6
-rw-r--r--branches/sca-android/modules/host-webapp-junit/pom.xml67
-rw-r--r--branches/sca-android/modules/host-webapp-junit/src/main/java/org/apache/tuscany/sca/host/webapp/junit/JUnitServletFilter.java355
-rw-r--r--branches/sca-android/modules/host-webapp-junit/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java286
-rw-r--r--branches/sca-android/modules/host-webapp/LICENSE205
-rw-r--r--branches/sca-android/modules/host-webapp/META-INF/README1
-rw-r--r--branches/sca-android/modules/host-webapp/NOTICE6
-rw-r--r--branches/sca-android/modules/host-webapp/pom.xml85
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/HotUpdateContextListener.java57
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/SCADomainHelper.java72
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyContextListener.java73
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServlet.java67
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java103
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppModuleActivator.java66
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppRequestDispatcher.java114
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java338
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebSCADomain.java53
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTEI.java45
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTag.java118
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/resources/META-INF/sca.tld59
-rw-r--r--branches/sca-android/modules/host-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--branches/sca-android/modules/implementation-bpel-jbpm/LICENSE251
-rw-r--r--branches/sca-android/modules/implementation-bpel-jbpm/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-bpel-jbpm/NOTICE17
-rw-r--r--branches/sca-android/modules/implementation-bpel-jbpm/pom.xml140
-rw-r--r--branches/sca-android/modules/implementation-bpel-jbpm/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory22
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/LICENSE251
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/NOTICE17
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/pom.xml441
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/BPELODEDeployFile.java226
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java270
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/GeronimoTxFactory.java48
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEBindingContext.java79
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEDeployment.java44
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEDeploymentException.java41
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java285
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEInitializationException.java41
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEMessageExchangeContext.java57
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEShutdownException.java41
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyEPR.java54
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java71
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyProcessConfImpl.java434
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProvider.java145
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProviderFactory.java69
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java251
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory19
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/test/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServerTestCase.java148
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/deploy.xml30
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/greetings.wsdl87
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/helloworld.bpel66
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/helloworld.wsdl82
-rw-r--r--branches/sca-android/modules/implementation-bpel-ode/src/test/resources/log4j.properties36
-rw-r--r--branches/sca-android/modules/implementation-bpel/LICENSE251
-rw-r--r--branches/sca-android/modules/implementation-bpel/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-bpel/NOTICE17
-rw-r--r--branches/sca-android/modules/implementation-bpel/pom.xml98
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELFactory.java42
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementation.java91
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELProcessDefinition.java109
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELFactoryImpl.java45
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationImpl.java132
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELProcessDefinitionImpl.java116
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentProcessor.java532
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java518
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImportElement.java65
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java130
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java112
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor19
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.bpel.BPELFactory18
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/main/resources/impl-bpel-validation-messages.properties34
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELDocumentProcessorTestCase.java59
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementationProcessorTestCase.java111
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/test/resources/helloworld/helloworld.bpel66
-rw-r--r--branches/sca-android/modules/implementation-bpel/src/test/resources/helloworld/helloworld.wsdl82
-rw-r--r--branches/sca-android/modules/implementation-das/LICENSE205
-rw-r--r--branches/sca-android/modules/implementation-das/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-das/NOTICE6
-rw-r--r--branches/sca-android/modules/implementation-das/README78
-rw-r--r--branches/sca-android/modules/implementation-das/build.xml51
-rw-r--r--branches/sca-android/modules/implementation-das/company.sql28
-rw-r--r--branches/sca-android/modules/implementation-das/pom.xml187
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java33
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java49
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java146
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java36
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.java271
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java46
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/annotations/Command.java36
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java75
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java47
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java87
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory19
-rw-r--r--branches/sca-android/modules/implementation-das/src/main/resources/impl-das-validation-messages.properties23
-rw-r--r--branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.java179
-rw-r--r--branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java73
-rw-r--r--branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java33
-rw-r--r--branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java62
-rw-r--r--branches/sca-android/modules/implementation-das/src/test/resources/company.componentType29
-rw-r--r--branches/sca-android/modules/implementation-das/src/test/resources/company.composite35
-rw-r--r--branches/sca-android/modules/implementation-das/src/test/resources/company.xml45
-rw-r--r--branches/sca-android/modules/implementation-das/src/test/resources/das.composite35
-rw-r--r--branches/sca-android/modules/implementation-data-api/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-data-xml/LICENSE205
-rw-r--r--branches/sca-android/modules/implementation-data-xml/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-data-xml/NOTICE6
-rw-r--r--branches/sca-android/modules/implementation-data-xml/README78
-rw-r--r--branches/sca-android/modules/implementation-data-xml/build.xml51
-rw-r--r--branches/sca-android/modules/implementation-data-xml/company.sql28
-rw-r--r--branches/sca-android/modules/implementation-data-xml/pom.xml209
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATA.java64
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATACollection.java28
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementation.java161
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationFactory.java44
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.java132
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCHelper.java215
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCResultSetStreamReader.java53
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/ResultSetXmlNodeImpl.java251
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProvider.java98
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProviderFactory.java47
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAInvoker.java583
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory19
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATACollectionTestCaseFIXME.java118
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.java133
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATATestCase.java133
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeed.java62
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeedTestCaseFIXME.java51
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/test/resources/data-feed.composite50
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/test/resources/data.composite36
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/test/resources/insert.xml9
-rw-r--r--branches/sca-android/modules/implementation-data-xml/src/test/resources/update.xml7
-rw-r--r--branches/sca-android/modules/implementation-ejb/LICENSE205
-rw-r--r--branches/sca-android/modules/implementation-ejb/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-ejb/NOTICE6
-rw-r--r--branches/sca-android/modules/implementation-ejb/pom.xml81
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/EJBImplementation.java44
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/EJBImplementationFactory.java36
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationFactoryImpl.java39
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java95
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java148
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory19
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/main/resources/impl-ejb-validation-messages.properties21
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java84
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java68
-rw-r--r--branches/sca-android/modules/implementation-ejb/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.composite29
-rw-r--r--branches/sca-android/modules/implementation-osgi/LICENSE203
-rw-r--r--branches/sca-android/modules/implementation-osgi/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-osgi/NOTICE6
-rw-r--r--branches/sca-android/modules/implementation-osgi/pom.xml164
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/OSGiImplementation.java45
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiAnnotations.java325
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiPropertyInjector.java293
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiPropertyValueObjectFactory.java226
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationImpl.java168
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java1254
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProviderFactory.java111
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiInstanceWrapper.java299
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiRemotableInvoker.java139
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTargetInvoker.java199
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java550
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory19
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.properties25
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiPropertyTestCase.java49
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTestCase.java74
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestBundles.java116
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestImpl.java51
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestInterface.java32
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestWithPropertyImpl.java66
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java132
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/TestModelResolver.java106
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/resources/OSGiTestService.componentType28
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/resources/osgiproptest.composite37
-rw-r--r--branches/sca-android/modules/implementation-osgi/src/test/resources/osgitest.composite36
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/LICENSE205
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/NOTICE6
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/pom.xml86
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/GetResourceInvoker.java67
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProvider.java75
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProviderFactory.java47
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory19
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/src/test/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationTestCase.java77
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/src/test/resources/content/test.html21
-rw-r--r--branches/sca-android/modules/implementation-resource-runtime/src/test/resources/resource.composite30
-rw-r--r--branches/sca-android/modules/implementation-resource/LICENSE205
-rw-r--r--branches/sca-android/modules/implementation-resource/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-resource/NOTICE6
-rw-r--r--branches/sca-android/modules/implementation-resource/pom.xml79
-rw-r--r--branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/Resource.java34
-rw-r--r--branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementation.java57
-rw-r--r--branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationFactory.java35
-rw-r--r--branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationFactoryImpl.java47
-rw-r--r--branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationImpl.java130
-rw-r--r--branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java167
-rw-r--r--branches/sca-android/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory19
-rw-r--r--branches/sca-android/modules/implementation-resource/src/main/resources/impl-resource-validation-messages.properties23
-rw-r--r--branches/sca-android/modules/implementation-script/LICENSE251
-rw-r--r--branches/sca-android/modules/implementation-script/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-script/NOTICE12
-rw-r--r--branches/sca-android/modules/implementation-script/pom.xml197
-rw-r--r--branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java99
-rw-r--r--branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationActivator.java49
-rw-r--r--branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptInvoker.java84
-rw-r--r--branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptInvokerFactory.java173
-rw-r--r--branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/engines/TuscanyJRubyScriptEngine.java697
-rw-r--r--branches/sca-android/modules/implementation-script/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.ImplementationActivator18
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/AbstractSCATestCase.java54
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/AbstractHelloWorldTestCase.java38
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/HelloWorld.java31
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptDynamicRefTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptHelloWorldTestCase.java34
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/AbstractHelloWorldTestCase.java38
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/GroovyHelloWorldTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/HelloWorld.java30
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/HelloWorldProxy.java37
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JRubyHelloWorldTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScripInlineHelloWorldTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScriptHelloWorldTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JythonHelloWorldTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/AbstractHelloWorldTestCase.java38
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/GroovyHelloWorldTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/HelloWorld.java30
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/HelloWorldProxy.java37
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JRubyHelloWorldTestCase.java28
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JavaScriptHelloWorldTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JythonHelloWorldTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/GroovyReferenceTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/HelloWorldTarget.java34
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JRubyReferenceTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JavaScriptReferenceTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JythonReferenceTestCase.java29
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptDynamicRef.composite35
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptHelloWorld.composite30
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworld.js26
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworldProxy.js22
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/GroovyHelloWorld.composite33
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JRubyHelloWorld.composite33
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScripInlineHelloWorld.composite34
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScriptHelloWorld.composite33
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JythonHelloWorld.composite33
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.componentType30
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.groovy22
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.js23
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.py20
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.rb21
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/GroovyHelloWorld.composite33
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JRubyHelloWorld.composite33
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JavaScriptHelloWorld.composite33
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JythonHelloWorld.composite33
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.componentType32
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.groovy22
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.js23
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.py20
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.rb21
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/GroovyReference.composite38
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JRubyReference.composite38
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JavaScriptReference.composite38
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JythonReference.composite38
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.componentType31
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.groovy22
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.js22
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.py20
-rw-r--r--branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.rb21
-rw-r--r--branches/sca-android/modules/implementation-spring/LICENSE205
-rw-r--r--branches/sca-android/modules/implementation-spring/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-spring/NOTICE6
-rw-r--r--branches/sca-android/modules/implementation-spring/pom.xml126
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAApplicationContext.java53
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCANamespaceHandlerResolver.java53
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAParentApplicationContext.java271
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaNamespaceHandler.java38
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaPropertyBeanDefinitionParser.java35
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaReferenceBeanDefinitionParser.java36
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaServiceBeanDefinitionParser.java36
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanNotFoundException.java39
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java149
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java227
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProvider.java87
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProviderFactory.java78
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvocationException.java40
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvoker.java127
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringOperationNotFoundException.java40
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyValueObjectFactory.java45
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/Constants.java64
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanElement.java67
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanIntrospector.java141
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringConstructorArgElement.java60
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringPropertyElement.java61
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAPropertyElement.java52
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAPropertyElement.java.orig44
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAReferenceElement.java54
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAServiceElement.java64
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLComponentTypeLoader.java635
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory19
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/spring.handlers1
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/spring.schemas1
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties23
-rw-r--r--branches/sca-android/modules/implementation-spring/src/main/resources/org/springframework/sca/xml/spring-sca.xsd99
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/AbstractSCATestCase.java55
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/AbstractHelloWorldTestCase.java43
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorld.java35
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorldImpl.java38
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorldProxy.java42
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringContextAccessTestCase.java35
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitHelloWorldTestCase.java34
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitReferenceTestCase.java39
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringHelloWorldTestCase.java32
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImplicitReferenceTestCase.java42
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImportHelloWorldTestCase.java32
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringSCAPropertyTestCase.java39
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestBean.java31
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestBeanImpl.java42
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestContextAccessBean.java77
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestHelloWorldBean.java39
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestReference.java27
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestReferenceBean.java57
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestSCAPropertyBean.java55
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringContextAccess-context.xml31
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringExplicitHelloWorld-context.xml39
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringExplicitReference-context.xml33
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringHelloWorld-Imported-context.xml31
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringHelloWorld-context.xml31
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringImplicitReference-context.xml34
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringImportHelloWorld-context.xml29
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/testReferenceContext.xml33
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/testServiceContext.xml31
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/SpringHelloWorld-Imported-context.xml31
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringContextAccess.composite35
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitHelloWorld.composite33
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitReference.composite32
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringHelloWorld.composite32
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImplicitReference.composite39
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImportHelloWorld.composite32
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringSCAProperty.composite39
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/spring/META-INF/MANIFEST.MF3
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/spring/META-INF/spring/SpringSCAProperty-context.xml34
-rw-r--r--branches/sca-android/modules/implementation-spring/src/test/resources/test.xml27
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/LICENSE205
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/NOTICE6
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/pom.xml122
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java250
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java67
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProviderFactory.java47
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetProxyHelper.java51
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory19
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-atom.js137
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-http.js105
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-jsonrpc.js492
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/test/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationTestCase.java48
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/Catalog.java32
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/CatalogImpl.java47
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/ShoppingCartImpl.java124
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/test/resources/content/store.html127
-rw-r--r--branches/sca-android/modules/implementation-widget-runtime/src/test/resources/widget.composite54
-rw-r--r--branches/sca-android/modules/implementation-widget/LICENSE205
-rw-r--r--branches/sca-android/modules/implementation-widget/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-widget/NOTICE6
-rw-r--r--branches/sca-android/modules/implementation-widget/pom.xml79
-rw-r--r--branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/Widget.java34
-rw-r--r--branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementation.java134
-rw-r--r--branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationFactory.java45
-rw-r--r--branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationIntrospector.java145
-rw-r--r--branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java176
-rw-r--r--branches/sca-android/modules/implementation-widget/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/implementation-widget/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.widget.WidgetImplementationFactory19
-rw-r--r--branches/sca-android/modules/implementation-widget/src/main/resources/impl-widget-validation-messages.properties23
-rw-r--r--branches/sca-android/modules/implementation-xquery/LICENSE202
-rw-r--r--branches/sca-android/modules/implementation-xquery/META-INF/README1
-rw-r--r--branches/sca-android/modules/implementation-xquery/NOTICE6
-rw-r--r--branches/sca-android/modules/implementation-xquery/pom.xml105
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementation.java75
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationFactory.java32
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationProvider.java166
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationProviderFactory.java54
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryInvokationException.java33
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryInvoker.java318
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/impl/XQueryImplementationFactoryImpl.java35
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/impl/XQueryImplementationImpl.java102
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java159
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryIntrospector.java307
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory19
-rw-r--r--branches/sca-android/modules/implementation-xquery/src/main/resources/impl-xquery-validation-messages.properties22
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/LICENSE205
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/META-INF/README1
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/NOTICE6
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/pom.xml274
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java539
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java280
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGenerator.java147
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedClassLoader.java69
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedDataTypeImpl.java143
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java370
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java379
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java238
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java27
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java40
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java40
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java62
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java119
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java48
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java62
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java52
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java40
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java66
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java79
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl142
-rw-r--r--branches/sca-android/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl149
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/LICENSE205
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/META-INF/README1
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/NOTICE6
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/pom.xml95
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java140
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELPartnerLinkTypeExt.java79
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java40
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java230
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java252
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java487
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor19
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver18
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/main/resources/interface-wsdlxml-validation-messages.properties24
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java68
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java83
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java117
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java87
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java70
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java97
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java86
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java104
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java83
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java52
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite55
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType36
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType33
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl26
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl58
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd136
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl58
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl45
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd33
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl63
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl76
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/policy/stockquote_policy.wsdl62
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl67
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl49
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd29
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd22
-rw-r--r--branches/sca-android/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd29
-rw-r--r--branches/sca-android/modules/interface-wsdl/LICENSE205
-rw-r--r--branches/sca-android/modules/interface-wsdl/META-INF/README1
-rw-r--r--branches/sca-android/modules/interface-wsdl/NOTICE6
-rw-r--r--branches/sca-android/modules/interface-wsdl/pom.xml103
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java35
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLDefinition.java140
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLFactory.java70
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java67
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterfaceContract.java43
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLObject.java54
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLOperation.java40
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/InvalidWSDLException.java35
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java289
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java75
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceContractImpl.java47
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java99
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java159
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLObjectImpl.java61
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationImpl.java81
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java602
-rw-r--r--branches/sca-android/modules/interface-wsdl/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory18
-rw-r--r--branches/sca-android/modules/monitor-logging/LICENSE205
-rw-r--r--branches/sca-android/modules/monitor-logging/META-INF/README1
-rw-r--r--branches/sca-android/modules/monitor-logging/NOTICE6
-rw-r--r--branches/sca-android/modules/monitor-logging/pom.xml68
-rw-r--r--branches/sca-android/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/DefaultLoggingMonitorImpl.java104
-rw-r--r--branches/sca-android/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/MonitorFactoryImpl.java41
-rw-r--r--branches/sca-android/modules/monitor-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.monitor.MonitorFactory18
-rw-r--r--branches/sca-android/modules/monitor-logging/src/test/java/org/apache/tuscany/sca/monitor/MonitorTestCase.java94
-rw-r--r--branches/sca-android/modules/monitor-logging/src/test/resources/tuscany-monitor-test-messages.properties24
-rw-r--r--branches/sca-android/modules/monitor-logging/src/test/resources/tuscany-monitor-test-messages_it.properties24
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/LICENSE205
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/META-INF/README1
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/NOTICE6
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/pom.xml122
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/Contribution.java48
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/DomainManagerLauncher.java172
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java249
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxLauncherBundleHelper.java113
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/JarFileFinder.java373
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherException.java55
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeDaemonLauncher.java159
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java232
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java377
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeMain.java44
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/test/java/hello/HelloWorld.java30
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java50
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java30
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java95
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java64
-rw-r--r--branches/sca-android/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite34
-rw-r--r--branches/sca-android/modules/node-launcher-webapp/LICENSE205
-rw-r--r--branches/sca-android/modules/node-launcher-webapp/META-INF/README1
-rw-r--r--branches/sca-android/modules/node-launcher-webapp/NOTICE6
-rw-r--r--branches/sca-android/modules/node-launcher-webapp/pom.xml62
-rw-r--r--branches/sca-android/modules/node-launcher-webapp/src/main/webapp/META-INF/sca-contribution.xml21
-rw-r--r--branches/sca-android/modules/node-launcher-webapp/src/main/webapp/WEB-INF/web.xml41
-rw-r--r--branches/sca-android/modules/node-launcher-webapp/src/main/webapp/index.jsp27
-rw-r--r--branches/sca-android/modules/node-manager/LICENSE205
-rw-r--r--branches/sca-android/modules/node-manager/META-INF/README1
-rw-r--r--branches/sca-android/modules/node-manager/NOTICE6
-rw-r--r--branches/sca-android/modules/node-manager/pom.xml138
-rw-r--r--branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeManagerUtil.java51
-rw-r--r--branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeProcessCollectionImpl.java338
-rw-r--r--branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/PingServiceImpl.java61
-rw-r--r--branches/sca-android/modules/node-manager/src/main/resources/NodeDaemon.composite39
-rw-r--r--branches/sca-android/modules/policy-logging/LICENSE205
-rw-r--r--branches/sca-android/modules/policy-logging/META-INF/README1
-rw-r--r--branches/sca-android/modules/policy-logging/NOTICE6
-rw-r--r--branches/sca-android/modules/policy-logging/pom.xml77
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/LoggingPolicyDefinitionsProvider.java67
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingImplementationPolicyProvider.java90
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java84
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyInterceptor.java130
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProcessor.java137
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProviderFactory.java75
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingReferencePolicyProvider.java89
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingServicePolicyProvider.java87
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory19
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider19
-rw-r--r--branches/sca-android/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml32
-rw-r--r--branches/sca-android/modules/policy-logging/src/test/java/org/apache/tuscany/sca/policy/logging/jdk/PolicyReadTestCase.java91
-rw-r--r--branches/sca-android/modules/policy-logging/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml23
-rw-r--r--branches/sca-android/modules/policy-security-jsr250/LICENSE205
-rw-r--r--branches/sca-android/modules/policy-security-jsr250/META-INF/README1
-rw-r--r--branches/sca-android/modules/policy-security-jsr250/NOTICE6
-rw-r--r--branches/sca-android/modules/policy-security-jsr250/pom.xml83
-rw-r--r--branches/sca-android/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JSR250Activator.java51
-rw-r--r--branches/sca-android/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JSR250PolicyProcessor.java178
-rw-r--r--branches/sca-android/modules/policy-security-jsr250/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--branches/sca-android/modules/policy-security-jsr250/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCaseFIXME.java418
-rw-r--r--branches/sca-android/modules/policy-security-ws/LICENSE205
-rw-r--r--branches/sca-android/modules/policy-security-ws/META-INF/README1
-rw-r--r--branches/sca-android/modules/policy-security-ws/NOTICE6
-rw-r--r--branches/sca-android/modules/policy-security-ws/pom.xml149
-rw-r--r--branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicy.java54
-rw-r--r--branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicyHandler.java79
-rw-r--r--branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicyProcessor.java157
-rw-r--r--branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicyProviderFactory.java99
-rw-r--r--branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/WSSecurityPolicyHandler.java71
-rw-r--r--branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler25
-rw-r--r--branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory18
-rw-r--r--branches/sca-android/modules/policy-security-ws/src/test/java/org/apache/tuscany/sca/policy/security/ws/PolicyReadTestCase.java59
-rw-r--r--branches/sca-android/modules/policy-security-ws/src/test/resources/org/apache/tuscany/sca/policy/security/ws/mock_policies.xml36
-rw-r--r--branches/sca-android/modules/policy-security/LICENSE205
-rw-r--r--branches/sca-android/modules/policy-security/META-INF/README1
-rw-r--r--branches/sca-android/modules/policy-security/NOTICE6
-rw-r--r--branches/sca-android/modules/policy-security/pom.xml70
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicy.java66
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProcessor.java129
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProviderFactory.java75
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyInterceptor.java87
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyProvider.java90
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyInterceptor.java89
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyProvider.java88
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicy.java84
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicyProcessor.java152
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicy.java76
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProcessor.java133
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityPolicyDefinitionsProvider.java86
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationImplementationPolicyProvider.java90
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationInterceptor.java76
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java73
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java72
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProcessor.java151
-rw-r--r--branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProviderFactory.java72
-rw-r--r--branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor26
-rw-r--r--branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory20
-rw-r--r--branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider19
-rw-r--r--branches/sca-android/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/definitions.xml55
-rw-r--r--branches/sca-android/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/tuscany_definitions.xml26
-rw-r--r--branches/sca-android/modules/policy-security/src/main/resources/policy-security-validation-messages.properties22
-rw-r--r--branches/sca-android/modules/policy-security/src/test/java/org/apache/tuscany/sca/policy/security/PolicyProcessorTestCase.java88
-rw-r--r--branches/sca-android/modules/policy-security/src/test/resources/org/apache/tuscany/sca/policy/security/mock_policy_definitions.xml78
-rw-r--r--branches/sca-android/modules/policy-transaction/LICENSE205
-rw-r--r--branches/sca-android/modules/policy-transaction/META-INF/README1
-rw-r--r--branches/sca-android/modules/policy-transaction/NOTICE6
-rw-r--r--branches/sca-android/modules/policy-transaction/pom.xml127
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/IncompatibleIntentException.java44
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionImplementationPolicyProvider.java61
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionIntent.java28
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionInterceptor.java122
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerHelper.java243
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerWrapper.java90
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionModuleActivator.java84
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicy.java46
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyDefinitionsProvider.java71
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyImpl.java59
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyProcessor.java96
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyProviderFactory.java92
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionReferencePolicyProvider.java61
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionServicePolicyProvider.java61
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionalAction.java31
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory19
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider19
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/resources/log4j.properties29
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/definitions.xml66
-rw-r--r--branches/sca-android/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/tuscany_definitions.xml54
-rw-r--r--branches/sca-android/modules/policy-transaction/src/test/java/org/apache/tuscany/sca/policy/transaction/PolicyReadTestCase.java54
-rw-r--r--branches/sca-android/modules/policy-transaction/src/test/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerHelperTestCase.java194
-rw-r--r--branches/sca-android/modules/policy-xml-ws/LICENSE205
-rw-r--r--branches/sca-android/modules/policy-xml-ws/META-INF/README1
-rw-r--r--branches/sca-android/modules/policy-xml-ws/NOTICE6
-rw-r--r--branches/sca-android/modules/policy-xml-ws/pom.xml142
-rw-r--r--branches/sca-android/modules/policy-xml-ws/src/main/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessor.java162
-rw-r--r--branches/sca-android/modules/policy-xml-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/TestModelResolver.java63
-rw-r--r--branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java74
-rw-r--r--branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/WSPolicyProcessorTestCase.java111
-rw-r--r--branches/sca-android/modules/policy-xml-ws/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml106
-rw-r--r--branches/sca-android/modules/pom.xml89
-rw-r--r--branches/sca-android/modules/thirdparty-library/META-INF/README1
-rw-r--r--branches/sca-android/modules/thirdparty-library/pom.xml76
-rw-r--r--branches/sca-android/modules/tracing-aspectj/LICENSE205
-rw-r--r--branches/sca-android/modules/tracing-aspectj/META-INF/README1
-rw-r--r--branches/sca-android/modules/tracing-aspectj/NOTICE6
-rw-r--r--branches/sca-android/modules/tracing-aspectj/launcher.bat5
-rw-r--r--branches/sca-android/modules/tracing-aspectj/pom.xml110
-rw-r--r--branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/LoggingAspect.java93
-rw-r--r--branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/SimpleTracingAspect.java82
-rw-r--r--branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/TracingAspect.java100
-rw-r--r--branches/sca-android/modules/tracing-aspectj/src/main/resources/META-INF/aop.xml17
-rw-r--r--branches/sca-android/modules/tracing-aspectj/src/test/java/org/apache/tuscany/sca/aspectj/TracingTestCase.java41
-rw-r--r--branches/sca-android/modules/workspace-impl/LICENSE205
-rw-r--r--branches/sca-android/modules/workspace-impl/META-INF/README1
-rw-r--r--branches/sca-android/modules/workspace-impl/NOTICE6
-rw-r--r--branches/sca-android/modules/workspace-impl/pom.xml83
-rw-r--r--branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java145
-rw-r--r--branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java230
-rw-r--r--branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java225
-rw-r--r--branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/DirectoryContributionScanner.java107
-rw-r--r--branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/JarContributionScanner.java121
-rw-r--r--branches/sca-android/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor20
-rw-r--r--branches/sca-android/modules/workspace-impl/src/main/resources/workspace-validation-messages.properties22
-rw-r--r--branches/sca-android/modules/workspace-impl/src/main/resources/workspace-validation-messages_it.properties21
-rw-r--r--branches/sca-android/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java100
-rw-r--r--branches/sca-android/modules/workspace-xml/LICENSE205
-rw-r--r--branches/sca-android/modules/workspace-xml/META-INF/README1
-rw-r--r--branches/sca-android/modules/workspace-xml/NOTICE6
-rw-r--r--branches/sca-android/modules/workspace-xml/pom.xml70
-rw-r--r--branches/sca-android/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceDocumentProcessor.java131
-rw-r--r--branches/sca-android/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceProcessor.java167
-rw-r--r--branches/sca-android/modules/workspace-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--branches/sca-android/modules/workspace-xml/src/main/resources/workspace-xml-validation-messages.properties22
-rw-r--r--branches/sca-android/modules/workspace-xml/src/test/java/org/apache/tuscany/sca/workspace/xml/ContributionWorkspaceProcessorTestCase.java89
-rw-r--r--branches/sca-android/modules/workspace/LICENSE205
-rw-r--r--branches/sca-android/modules/workspace/META-INF/README1
-rw-r--r--branches/sca-android/modules/workspace/NOTICE6
-rw-r--r--branches/sca-android/modules/workspace/pom.xml64
-rw-r--r--branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/DefaultWorkspaceFactory.java32
-rw-r--r--branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/Workspace.java39
-rw-r--r--branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/WorkspaceFactory.java36
-rw-r--r--branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionDependencyBuilder.java42
-rw-r--r--branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceFactoryImpl.java40
-rw-r--r--branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java142
-rw-r--r--branches/sca-android/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.WorkspaceFactory18
-rw-r--r--branches/sca-android/modules/xsd-xml/META-INF/README1
-rw-r--r--branches/sca-android/modules/xsd-xml/pom.xml82
-rw-r--r--branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelper.java186
-rw-r--r--branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessor.java99
-rw-r--r--branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java257
-rw-r--r--branches/sca-android/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor19
-rw-r--r--branches/sca-android/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver18
-rw-r--r--branches/sca-android/modules/xsd-xml/src/main/resources/xsd-xml-validation-messages.properties23
-rw-r--r--branches/sca-android/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelperTestCase.java49
-rw-r--r--branches/sca-android/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessorTestCase.java90
-rw-r--r--branches/sca-android/modules/xsd-xml/src/test/resources/xsd/greeting.xsd29
-rw-r--r--branches/sca-android/modules/xsd-xml/src/test/resources/xsd/name.xsd29
-rw-r--r--branches/sca-android/modules/xsd/META-INF/README1
-rw-r--r--branches/sca-android/modules/xsd/pom.xml79
-rw-r--r--branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/DefaultXSDFactory.java30
-rw-r--r--branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDFactory.java35
-rw-r--r--branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java117
-rw-r--r--branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDFactoryImpl.java35
-rw-r--r--branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java232
-rw-r--r--branches/sca-android/modules/xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.xsd.XSDFactory18
1989 files changed, 0 insertions, 177787 deletions
diff --git a/branches/sca-android/modules/binding-atom-abdera/LICENSE b/branches/sca-android/modules/binding-atom-abdera/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-atom-abdera/META-INF/README b/branches/sca-android/modules/binding-atom-abdera/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-atom-abdera/NOTICE b/branches/sca-android/modules/binding-atom-abdera/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/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/branches/sca-android/modules/binding-atom-abdera/pom.xml b/branches/sca-android/modules/binding-atom-abdera/pom.xml
deleted file mode 100644
index f10497c9c5..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/pom.xml
+++ /dev/null
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-atom-abdera</artifactId>
- <name>Apache Tuscany SCA Atom Feed Binding Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-atom</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.abdera</groupId>
- <artifactId>abdera-core</artifactId>
- <version>0.4.0-incubating</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.0.2_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.abdera</groupId>
- <artifactId>abdera-parser</artifactId>
- <version>0.4.0-incubating</version>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xom</groupId>
- <artifactId>xom</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.abdera</groupId>
- <artifactId>abdera-client</artifactId>
- <version>0.4.0-incubating</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.abdera</groupId>
- <artifactId>abdera-extensions-main</artifactId>
- <version>0.4.0-incubating</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.abdera</groupId>
- <artifactId>abdera-extensions-json</artifactId>
- <version>0.4.0-incubating</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- </exclusions>
- </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.atom.abdera</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.atom*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/Collection.java b/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/Collection.java
deleted file mode 100644
index 7356cd0d2a..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/Collection.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.atom.collection;
-
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.model.Feed;
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Provides access to a collection of resources using Atom.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface Collection {
-
- /**
- * Get an Atom feed for a collection of resources.
- *
- * @return the Atom feed
- */
- Feed getFeed();
-
- /**
- * Get an Atom feed for a collection of resources resulting
- * from a query.
- *
- * @param queryString a query string
- * @return the Atom feed
- */
- Feed query(String queryString);
-
- /**
- * Creates a new entry.
- *
- * @param entry
- * @return
- */
- Entry post(Entry entry);
-
- /**
- * Retrieves an entry.
- *
- * @param id
- * @return
- */
- Entry get(String id) throws NotFoundException;
-
- /**
- * Update an entry.
- *
- * @param id
- * @param entry
- * @return
- */
- void put(String id, Entry entry) throws NotFoundException;
-
- /**
- * Delete an entry.
- *
- * @param id
- */
- void delete(String id) throws NotFoundException;
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/MediaCollection.java b/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/MediaCollection.java
deleted file mode 100644
index cc351442e7..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/MediaCollection.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.binding.atom.collection;
-
-import java.io.InputStream;
-
-import org.osoa.sca.annotations.Remotable;
-
-import org.apache.abdera.model.Entry;
-
-/**
- * Provides access to a collection of resources using Atom.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface MediaCollection extends Collection {
-
- /**
- * Creates a new media entry
- *
- * @param title
- * @param slug
- * @param contentType
- * @param media
- */
- Entry postMedia(String title, String slug, String contentType, InputStream media);
-
- /**
- * Update a media entry.
- *
- * @param id
- * @param contentType
- * @param media
- * @return
- */
- void putMedia(String id, String contentType, InputStream media) throws NotFoundException;
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/NotFoundException.java b/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/NotFoundException.java
deleted file mode 100644
index b457840922..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/collection/NotFoundException.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.atom.collection;
-
-/**
- * Indicates that a resource could not be found.
- *
- * @version $Rev$ $Date$
- */
-public class NotFoundException extends Exception {
- private static final long serialVersionUID = -5046027674128627383L;
-
- public NotFoundException() {
- }
-
- public NotFoundException(String message) {
- super(message);
- }
-
- public NotFoundException(Throwable cause) {
- super(cause);
- }
-
- public NotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java b/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java
deleted file mode 100644
index dafcf57311..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.atom.provider;
-
-import static org.apache.tuscany.sca.binding.atom.provider.AtomBindingUtil.entry;
-import static org.apache.tuscany.sca.binding.atom.provider.AtomBindingUtil.feedEntry;
-
-import java.io.InputStreamReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.factory.Factory;
-import org.apache.abdera.model.Document;
-import org.apache.abdera.model.Feed;
-import org.apache.abdera.parser.Parser;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.DeleteMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.PutMethod;
-import org.apache.commons.httpclient.methods.StringRequestEntity;
-import org.apache.tuscany.sca.binding.atom.collection.NotFoundException;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * Invoker for the Atom binding.
- *
- * @version $Rev$ $Date$
- */
-class AtomBindingInvoker implements Invoker {
-
- private static final Factory abderaFactory = Abdera.getNewFactory();
- private static final Parser abderaParser = Abdera.getNewParser();
-
- Operation operation;
- String uri;
- HttpClient httpClient;
- String authorizationHeader;
- AtomReferenceBindingProvider provider;
-
- AtomBindingInvoker(Operation operation, String uri, HttpClient httpClient, String authorizationHeader, AtomReferenceBindingProvider bindingProvider) {
- this.operation = operation;
- this.uri = uri;
- this.httpClient = httpClient;
- this.authorizationHeader = authorizationHeader;
- this.provider = bindingProvider;
- }
-
- public Message invoke(Message msg) {
- // Shouldn't get here, as the only supported methods are
- // defined in the ResourceCollection interface, and implemented
- // by specific invoker subclasses
- throw new UnsupportedOperationException(operation.getName());
- }
-
- /**
- * Get operation invoker
- */
- public static class GetInvoker extends AtomBindingInvoker {
-
- public GetInvoker(Operation operation, String uri, HttpClient httpClient, String authorizationHeader, AtomReferenceBindingProvider bindingProvider) {
- super(operation, uri, httpClient, authorizationHeader, bindingProvider);
- }
-
- @Override
- public Message invoke(Message msg) {
- // Get an entry
- String id = (String)((Object[])msg.getBody())[0];
-
- // Send an HTTP GET
- GetMethod getMethod = new GetMethod(uri + "/" + id);
- getMethod.setRequestHeader("Authorization", authorizationHeader);
- boolean parsing = false;
- try {
- httpClient.executeMethod(getMethod);
- int status = getMethod.getStatusCode();
-
- // Read the Atom entry
- if (status == 200) {
- Document<org.apache.abdera.model.Entry> doc =
- abderaParser.parse(new InputStreamReader(getMethod.getResponseBodyAsStream()));
- parsing = true;
- org.apache.abdera.model.Entry feedEntry = doc.getRoot();
-
- if (provider.supportsFeedEntries()) {
-
- // Return the Atom entry
- msg.setBody(feedEntry);
-
- } else {
-
- // Convert the feed entry to a data entry and return the data item
- Entry<Object, Object> entry = entry(feedEntry, provider.getItemClassType(),
- provider.getItemXMLType(), provider.getMediator());
- msg.setBody(entry.getData());
- }
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- if (!parsing) {
- // Release the connection unless the Abdera parser is
- // parsing the response, in this case it will release it
- getMethod.releaseConnection();
- }
- }
-
- return msg;
- }
- }
-
- /**
- * Post operation invoker
- */
- public static class PostInvoker extends AtomBindingInvoker {
-
- public PostInvoker(Operation operation, String uri, HttpClient httpClient, String authorizationHeader, AtomReferenceBindingProvider bindingProvider) {
- super(operation, uri, httpClient, authorizationHeader, bindingProvider);
- }
-
- @Override
- public Message invoke(Message msg) {
- // Post an entry
- Object[] args = (Object[])msg.getBody();
- org.apache.abdera.model.Entry feedEntry;
- if (provider.supportsFeedEntries()) {
-
- // Expect an Atom entry
- feedEntry = (org.apache.abdera.model.Entry)args[0];
- } else {
-
- // Expect a key and data item
- Entry<Object, Object> entry = new Entry<Object, Object>(args[0], args[1]);
- feedEntry = feedEntry(entry, provider.getItemClassType(),
- provider.getItemXMLType(), provider.getMediator(), abderaFactory);
- }
-
- // Send an HTTP POST
- PostMethod postMethod = new PostMethod(uri);
- postMethod.setRequestHeader("Authorization", authorizationHeader);
- boolean parsing = false;
- try {
-
- // Write the Atom entry
- StringWriter writer = new StringWriter();
- feedEntry.writeTo(writer);
- // postMethod.setRequestHeader("Content-type", "application/atom+xml; charset=utf-8");
- postMethod.setRequestHeader("Content-type", "application/atom+xml;type=entry");
- postMethod.setRequestEntity(new StringRequestEntity(writer.toString()));
-
- httpClient.executeMethod(postMethod);
- int status = postMethod.getStatusCode();
-
- // Read the Atom entry
- if (status == 200 || status == 201) {
- Document<org.apache.abdera.model.Entry> doc = abderaParser.parse(new InputStreamReader(postMethod.getResponseBodyAsStream()));
- parsing = true;
- org.apache.abdera.model.Entry createdEntry = doc.getRoot();
-
- // Returns the created Atom entry ID
- if (provider.supportsFeedEntries()) {
-
- // Returns the created entry
- msg.setBody(createdEntry);
-
- } else {
-
- // Returns the id of the created entry
- msg.setBody(createdEntry.getId().toString());
- }
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- if (!parsing) {
- // Release the connection unless the Abdera parser is
- // parsing the response, in this case it will release it
- postMethod.releaseConnection();
- }
- }
-
- return msg;
- }
- }
-
- /**
- * Put operation invoker
- */
- public static class PutInvoker extends AtomBindingInvoker {
-
- public PutInvoker(Operation operation, String uri, HttpClient httpClient, String authorizationHeader, AtomReferenceBindingProvider bindingProvider) {
- super(operation, uri, httpClient, authorizationHeader, bindingProvider);
- }
-
- @Override
- public Message invoke(Message msg) {
- // Put an entry
- Object[] args = (Object[])msg.getBody();
- String id;
- org.apache.abdera.model.Entry feedEntry;
- if (provider.supportsFeedEntries()) {
-
- // Expect a key and Atom entry
- id = (String)args[0];
- feedEntry = (org.apache.abdera.model.Entry)args[1];
- } else {
-
- // Expect a key and data item
- id = (String)args[0];
- Entry<Object, Object> entry = new Entry<Object, Object>(id, args[1]);
- feedEntry = feedEntry(entry, provider.getItemClassType(),
- provider.getItemXMLType(), provider.getMediator(), abderaFactory);
- }
-
- // Send an HTTP PUT
- PutMethod putMethod = new PutMethod(uri + "/" + id);
- putMethod.setRequestHeader("Authorization", authorizationHeader);
-
- try {
-
- // Write the Atom entry
- StringWriter writer = new StringWriter();
- feedEntry.writeTo(writer);
- putMethod.setRequestHeader("Content-type", "application/atom+xml; charset=utf-8");
- putMethod.setRequestEntity(new StringRequestEntity(writer.toString()));
-
- httpClient.executeMethod(putMethod);
- int status = putMethod.getStatusCode();
- if (status == 200 || status == 201 || status == 412) {
-
- msg.setBody(null);
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- putMethod.releaseConnection();
- }
-
- return msg;
- }
- }
-
- /**
- * Delete operation invoker
- */
- public static class DeleteInvoker extends AtomBindingInvoker {
-
- public DeleteInvoker(Operation operation, String uri, HttpClient httpClient, String authorizationHeader, AtomReferenceBindingProvider bindingProvider) {
- super(operation, uri, httpClient, authorizationHeader, bindingProvider);
- }
-
- @Override
- public Message invoke(Message msg) {
- // Delete an entry
- String id = (String)((Object[])msg.getBody())[0];
-
- // Send an HTTP DELETE
- DeleteMethod deleteMethod = new DeleteMethod(uri + "/" + id);
- deleteMethod.setRequestHeader("Authorization", authorizationHeader);
- try {
- httpClient.executeMethod(deleteMethod);
- int status = deleteMethod.getStatusCode();
- if (status == 200) {
- msg.setBody(null);
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- deleteMethod.releaseConnection();
- }
-
- return msg;
- }
- }
-
- /**
- * GetAll operation invoker
- */
- public static class GetAllInvoker extends AtomBindingInvoker {
-
- public GetAllInvoker(Operation operation, String uri, HttpClient httpClient, String authorizationHeader, AtomReferenceBindingProvider bindingProvider) {
- super(operation, uri, httpClient, authorizationHeader, bindingProvider);
- }
-
- @Override
- public Message invoke(Message msg) {
- // Get a feed
-
- // Send an HTTP GET
- GetMethod getMethod = new GetMethod(uri);
- getMethod.setRequestHeader("Authorization", authorizationHeader);
- boolean parsing = false;
- try {
- httpClient.executeMethod(getMethod);
- int status = getMethod.getStatusCode();
- // AtomBindingInvoker.printResponseHeader( getMethod );
-
- // Read the Atom feed
- if (status == 200) {
- Document<Feed> doc = abderaParser.parse(new InputStreamReader(getMethod.getResponseBodyAsStream()));
- parsing = true;
- Feed feed = doc.getRoot();
-
- if (provider.supportsFeedEntries()) {
-
- // Returns the Atom feed
- msg.setBody(feed);
-
- } else {
-
- // Returns an array of data entries
- List<Entry<Object, Object>> entries = new ArrayList<Entry<Object,Object>>();
- for (org.apache.abdera.model.Entry feedEntry: feed.getEntries()) {
- Entry<Object, Object> entry = entry(feedEntry, provider.getItemClassType(),
- provider.getItemXMLType(), provider.getMediator());
- entries.add(entry);
- }
- msg.setBody(entries.toArray(new Entry[entries.size()]));
- }
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- if (!parsing) {
- // Release the connection unless the Abdera parser is
- // parsing the response, in this case it will release it
- getMethod.releaseConnection();
- }
- }
-
- return msg;
- }
- }
-
- /**
- * Query operation invoker
- */
- public static class QueryInvoker extends AtomBindingInvoker {
-
- public QueryInvoker(Operation operation, String uri, HttpClient httpClient, String authorizationHeader, AtomReferenceBindingProvider bindingProvider) {
- super(operation, uri, httpClient, authorizationHeader, bindingProvider);
- }
-
- @Override
- public Message invoke(Message msg) {
- // Get a feed from a query
- String queryString = (String)((Object[])msg.getBody())[0];
-
- // Send an HTTP GET
- GetMethod getMethod = new GetMethod(uri);
- getMethod.setRequestHeader("Authorization", authorizationHeader);
- getMethod.setQueryString(queryString);
- boolean parsing = false;
- try {
- httpClient.executeMethod(getMethod);
- int status = getMethod.getStatusCode();
-
- // Read the Atom feed
- if (status == 200) {
- Document<Feed> doc = abderaParser.parse(new InputStreamReader(getMethod.getResponseBodyAsStream()));
- parsing = true;
- Feed feed = doc.getRoot();
-
- if (provider.supportsFeedEntries()) {
-
- // Returns the Atom feed
- msg.setBody(feed);
-
- } else {
-
- // Returns an array of data entries
- List<Entry<Object, Object>> entries = new ArrayList<Entry<Object,Object>>();
- for (org.apache.abdera.model.Entry feedEntry: feed.getEntries()) {
- Entry<Object, Object> entry = entry(feedEntry, provider.getItemClassType(),
- provider.getItemXMLType(), provider.getMediator());
- entries.add(entry);
- }
- msg.setBody(entries.toArray(new Entry[entries.size()]));
- }
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- if (!parsing) {
- // Release the connection unless the Abdera parser is
- // parsing the response, in this case it will release it
- getMethod.releaseConnection();
- }
- }
-
- return msg;
- }
- }
-
- /**
- * PostMedia operation invoker
- */
- public static class PostMediaInvoker extends AtomBindingInvoker {
-
- public PostMediaInvoker(Operation operation, String uri, HttpClient httpClient, String authorizationHeader, AtomReferenceBindingProvider bindingProvider) {
- super(operation, uri, httpClient, authorizationHeader, bindingProvider);
- }
-
- @Override
- public Message invoke(Message msg) {
- // TODO implement
- return super.invoke(msg);
- }
- }
-
- /**
- * PutMedia operation invoker
- */
- public static class PutMediaInvoker extends AtomBindingInvoker {
-
- public PutMediaInvoker(Operation operation, String uri, HttpClient httpClient, String authorizationHeader, AtomReferenceBindingProvider bindingProvider) {
- super(operation, uri, httpClient, authorizationHeader, bindingProvider);
- }
-
- @Override
- public Message invoke(Message msg) {
- // TODO implement
- return super.invoke(msg);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingListenerServlet.java b/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingListenerServlet.java
deleted file mode 100644
index 4f76675b56..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingListenerServlet.java
+++ /dev/null
@@ -1,879 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.atom.provider;
-
-import static org.apache.tuscany.sca.binding.atom.provider.AtomBindingUtil.entry;
-import static org.apache.tuscany.sca.binding.atom.provider.AtomBindingUtil.feedEntry;
-
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.net.URL;
-import java.net.URLDecoder;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.logging.Logger;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.factory.Factory;
-import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.model.Category;
-import org.apache.abdera.model.Collection;
-import org.apache.abdera.model.Document;
-import org.apache.abdera.model.Feed;
-import org.apache.abdera.model.Link;
-import org.apache.abdera.model.Service;
-import org.apache.abdera.model.Workspace;
-import org.apache.abdera.parser.ParseException;
-import org.apache.abdera.parser.Parser;
-import org.apache.abdera.writer.WriterFactory;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.tuscany.sca.binding.http.CacheContext;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * A resource collection binding listener, implemented as a Servlet and
- * registered in a Servlet host provided by the SCA hosting runtime.
- *
- * @version $Rev$ $Date$
- */
-class AtomBindingListenerServlet extends HttpServlet {
- private static final Logger logger = Logger.getLogger(AtomBindingListenerServlet.class.getName());
- private static final long serialVersionUID = 1L;
-
- private static final Factory abderaFactory = Abdera.getNewFactory();
- private static final Parser abderaParser = Abdera.getNewParser();
- private static final String ETAG = "ETag";
- private static final String LASTMODIFIED = "Last-Modified";
- private static final String LOCATION = "Location";
- private static final String CONTENTLOCATION = "Content-Location";
- private static final SimpleDateFormat dateFormat = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss Z" ); // RFC 822 date time
-
- private RuntimeWire wire;
- private Invoker getFeedInvoker;
- private Invoker getAllInvoker;
- private Invoker queryInvoker;
- private Invoker getInvoker;
- private Invoker postInvoker;
- private Invoker postMediaInvoker;
- private Invoker putInvoker;
- private Invoker putMediaInvoker;
- private Invoker deleteInvoker;
- private MessageFactory messageFactory;
- private String title;
- private Mediator mediator;
- private DataType<?> itemClassType;
- private DataType<?> itemXMLType;
- private boolean supportsFeedEntries;
-
- /**
- * Constructs a new binding listener.
- *
- * @param wire
- * @param messageFactory
- * @param feedType
- */
- AtomBindingListenerServlet(RuntimeWire wire, MessageFactory messageFactory, Mediator mediator, String title) {
- this.wire = wire;
- this.messageFactory = messageFactory;
- this.mediator = mediator;
- this.title = title;
-
- // Get the invokers for the supported operations
- Operation getOperation = null;
- for (InvocationChain invocationChain : this.wire.getInvocationChains()) {
- invocationChain.setAllowsPassByReference(true);
- Operation operation = invocationChain.getTargetOperation();
- String operationName = operation.getName();
- if (operationName.equals("getFeed")) {
- getFeedInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("getAll")) {
- getAllInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("query")) {
- queryInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("get")) {
- getInvoker = invocationChain.getHeadInvoker();
- getOperation = operation;
- } else if (operationName.equals("put")) {
- putInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("putMedia")) {
- putMediaInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("post")) {
- postInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("postMedia")) {
- postMediaInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("delete")) {
- deleteInvoker = invocationChain.getHeadInvoker();
- }
- }
-
- // Determine the collection item type
- itemXMLType = new DataTypeImpl<Class<?>>(String.class.getName(), String.class, String.class);
- Class<?> itemClass = getOperation.getOutputType().getPhysical();
- if (itemClass == org.apache.abdera.model.Entry.class) {
- supportsFeedEntries = true;
- }
- DataType<XMLType> outputType = getOperation.getOutputType();
- QName qname = outputType.getLogical().getElementName();
- qname = new QName(qname.getNamespaceURI(), itemClass.getSimpleName());
- itemClassType = new DataTypeImpl<XMLType>("java:complexType", itemClass, new XMLType(qname, null));
-
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // No authentication required for a get request
-
- // Test for any cache info in the request
- CacheContext cacheContext = null;
- try {
- cacheContext = CacheContext.getCacheContextFromRequest( request );
- } catch ( java.text.ParseException e ) {
- }
- // System.out.println( "AtomBindingListener.doGet cache context=" + cacheContext );
-
- // Get the request path
- int servletPathLength = request.getContextPath().length() + request.getServletPath().length();
- String path = URLDecoder.decode(request.getRequestURI().substring(servletPathLength), "UTF-8");
-
- logger.fine("get " + request.getRequestURI());
-
- // Handle an Atom request
- if (path != null && path.equals("/atomsvc")) {
- /*
- <?xml version='1.0' encoding='UTF-8'?>
- <service xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom">
- <workspace>
- <atom:title type="text">resource</atom:title>
- <collection href="http://luck.ibm.com:8084/customer">
- <atom:title type="text">entries</atom:title>
- <accept>application/atom+xml;type=entry</accept>
- <categories />
- </collection>
- </workspace>
- </service>
- */
-
- // Return the Atom service document
- response.setContentType("application/atomsvc+xml; charset=utf-8");
-
- String href = request.getRequestURL().toString();
- href = href.substring(0, href.length() - "/atomsvc".length());
-
- String workspaceURL = new String( href );
- int pathIndex = workspaceURL.indexOf( request.getServletPath() );
- if ( -1 != pathIndex )
- workspaceURL = workspaceURL.substring( 0, pathIndex ) + "/";
-
- Service service = abderaFactory.newService();
- //service.setText("service");
-
- Workspace workspace = abderaFactory.newWorkspace();
- if ( title != null )
- workspace.setTitle(title);
- else
- workspace.setTitle("workspace");
- workspace.setBaseUri( new IRI( workspaceURL ));
-
- Collection collection = workspace.addCollection("collection", href );
- Feed feed = getFeed( request );
- if ( feed != null ) {
- String title = feed.getTitle();
- if ( title != null )
- collection.setTitle(title);
- else
- collection.setTitle("entries");
- collection.addAccepts("application/atom+xml;type=feed");
- collection.addAccepts("application/json;type=feed");
- collection.addAccepts("application/atom+xml;type=entry");
- collection.addAccepts("application/json;type=entry");
- List<Category> categories = feed.getCategories();
- if ( categories != null ) {
- collection.addCategories(categories, false, null);
- } else
- collection.addCategories().setFixed(false);
-
- } else {
- collection.setTitle("entries");
- // collection.addAccepts("application/atom+xml;type=feed");
- collection.addAccepts("application/atom+xml; type=entry");
- collection.addAccepts("application/json;type=entry");
- collection.addCategories().setFixed(false);
- }
- workspace.addCollection(collection);
-
- service.addWorkspace(workspace);
-
- //FIXME add prettyPrint support
- try {
- service.getDocument().writeTo(response.getOutputStream());
- } catch (IOException ioe) {
- throw new ServletException(ioe);
- }
-
- } else if (path == null || path.length() == 0 || path.equals("/")) {
-
- // Return a feed containing the entries in the collection
- Feed feed = getFeed( request );
- if (feed != null) {
- String feedETag = "\"" + generateFeedETag( feed ) + "\"";
- Date feedUpdated = feed.getUpdated();
- // Test request for predicates.
- String predicate = request.getHeader( "If-Match" );
- if (( predicate != null ) && ( !predicate.equals(feedETag) )) {
- // No match, should short circuit
- response.sendError(HttpServletResponse.SC_PRECONDITION_FAILED);
- return;
- }
- predicate = request.getHeader( "If-None-Match" );
- if (( predicate != null ) && ( predicate.equals(feedETag) )) {
- // Match, should short circuit
- response.sendError(HttpServletResponse.SC_NOT_MODIFIED);
- return;
- }
- if ( feedUpdated != null ) {
- predicate = request.getHeader( "If-Unmodified-Since" );
- if ( predicate != null ) {
- try {
- Date predicateDate = dateFormat.parse( predicate );
- if ( predicateDate.compareTo( feedUpdated ) < 0 ) {
- // Match, should short circuit
- response.sendError(HttpServletResponse.SC_NOT_MODIFIED);
- return;
- }
- } catch ( java.text.ParseException e ) {
- // Ignore and move on
- }
- }
- predicate = request.getHeader( "If-Modified-Since" );
- if ( predicate != null ) {
- try {
- Date predicateDate = dateFormat.parse( predicate );
- if ( predicateDate.compareTo( feedUpdated ) > 0 ) {
- // Match, should short circuit
- response.sendError(HttpServletResponse.SC_NOT_MODIFIED);
- return;
- }
- } catch ( java.text.ParseException e ) {
- // Ignore and move on
- }
- }
- }
- // Provide Etag based on Id and time.
- response.addHeader(ETAG, feedETag );
- if ( feedUpdated != null )
- response.addHeader(LASTMODIFIED, dateFormat.format( feedUpdated ));
-
- // Content negotiation
- String acceptType = request.getHeader( "Accept" );
- String preferredType = getContentPreference( acceptType );
- if (( preferredType != null ) && ((preferredType.indexOf( "json") > -1) || (preferredType.indexOf( "JSON") > -1 ))) {
- // JSON response body
- response.setContentType("application/json;type=feed");
-
- try {
- Abdera abdera = new Abdera();
- WriterFactory wf = abdera.getWriterFactory();
- org.apache.abdera.writer.Writer json = wf.getWriter("json");
- feed.writeTo(json, response.getWriter());
- } catch (Exception e) {
- throw new ServletException(e);
- }
-
- } else {
- // Write the Atom feed
- response.setContentType("application/atom+xml;type=feed");
- try {
- feed.getDocument().writeTo(response.getOutputStream());
- } catch (IOException ioe) {
- throw new ServletException(ioe);
- }
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- } else if (path.startsWith("/")) {
- // Return a specific entry in the collection
- org.apache.abdera.model.Entry feedEntry;
-
- // Invoke the get operation on the service implementation
- Message requestMessage = messageFactory.createMessage();
- String id = path.substring(1);
- requestMessage.setBody(new Object[] {id});
- Message responseMessage = getInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- if (supportsFeedEntries) {
- // The service implementation returns a feed entry
- feedEntry = responseMessage.getBody();
- } else {
- // The service implementation only returns a data item, create an entry
- // from it
- Entry<Object, Object> entry = new Entry<Object, Object>(id, responseMessage.getBody());
- feedEntry = feedEntry(entry, itemClassType, itemXMLType, mediator, abderaFactory);
- }
- // Write the Atom entry
- if (feedEntry != null) {
- String entryETag = "\"" + generateEntryETag( feedEntry ) + "\"";
- Date entryUpdated = feedEntry.getUpdated();
- if ( entryUpdated != null )
- response.addHeader(LASTMODIFIED, dateFormat.format( entryUpdated ));
- // TODO Check If-Modified-Since If-Unmodified-Since predicates against LASTMODIFIED.
- // If true return 304 and null body.
-
- Link link = feedEntry.getSelfLink();
- if (link != null) {
- response.addHeader(LOCATION, link.getHref().toString());
- } else {
- link = feedEntry.getLink( "Edit" );
- if (link != null) {
- response.addHeader(LOCATION, link.getHref().toString());
- }
- }
-
- // Test request for predicates.
- String predicate = request.getHeader( "If-Match" );
- if (( predicate != null ) && ( !predicate.equals(entryETag) )) {
- // No match, should short circuit
- response.sendError(HttpServletResponse.SC_PRECONDITION_FAILED);
- return;
- }
- predicate = request.getHeader( "If-None-Match" );
- if (( predicate != null ) && ( predicate.equals(entryETag) )) {
- // Match, should short circuit
- response.sendError(HttpServletResponse.SC_NOT_MODIFIED);
- return;
- }
- if ( entryUpdated != null ) {
- predicate = request.getHeader( "If-Unmodified-Since" );
- if ( predicate != null ) {
- try {
- Date predicateDate = dateFormat.parse( predicate );
- if ( predicateDate.compareTo( entryUpdated ) < 0 ) {
- // Match, should short circuit
- response.sendError(HttpServletResponse.SC_NOT_MODIFIED);
- return;
- }
- } catch ( java.text.ParseException e ) {
- // Ignore and move on
- }
- }
- predicate = request.getHeader( "If-Modified-Since" );
- if ( predicate != null ) {
- try {
- Date predicateDate = dateFormat.parse( predicate );
- if ( predicateDate.compareTo( entryUpdated ) > 0 ) {
- // Match, should short circuit
- response.sendError(HttpServletResponse.SC_NOT_MODIFIED);
- return;
- }
- } catch ( java.text.ParseException e ) {
- // Ignore and move on
- }
- }
- }
- // Provide Etag based on Id and time.
- response.addHeader(ETAG, entryETag );
- if ( entryUpdated != null )
- response.addHeader(LASTMODIFIED, dateFormat.format( entryUpdated ));
-
- // Content negotiation
- String acceptType = request.getHeader( "Accept" );
- String preferredType = getContentPreference( acceptType );
- if (( preferredType != null ) && ((preferredType.indexOf( "json") > -1) || (preferredType.indexOf( "JSON") > -1 ))) {
- // JSON response body
- response.setContentType("application/json;type=entry");
- try {
- Abdera abdera = new Abdera();
- WriterFactory wf = abdera.getWriterFactory();
- org.apache.abdera.writer.Writer json = wf.getWriter("json");
- feedEntry.writeTo(json, response.getWriter());
- } catch (Exception e) {
- throw new ServletException(e);
- }
- } else {
- // XML response body
- response.setContentType("application/atom+xml;type=entry");
- try {
- feedEntry.writeTo(getWriter(response));
- } catch (IOException ioe) {
- throw new ServletException(ioe);
- }
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- } else {
- // Path doesn't match any known pattern
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- }
-
- protected Feed getFeed( HttpServletRequest request ) throws ServletException {
- if (supportsFeedEntries) {
- // The service implementation supports feed entries, invoke its getFeed operation
- Message requestMessage = messageFactory.createMessage();
- Message responseMessage;
- if (request.getQueryString() != null) {
- requestMessage.setBody(new Object[] {request.getQueryString()});
- responseMessage = queryInvoker.invoke(requestMessage);
- } else {
- responseMessage = getFeedInvoker.invoke(requestMessage);
- }
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- return (Feed)responseMessage.getBody();
- } else {
-
- // The service implementation does not support feed entries,
- // invoke its getAll operation to get the data item collection, then create
- // feed entries from the items
- Message requestMessage = messageFactory.createMessage();
- Message responseMessage;
- if (request.getQueryString() != null) {
- requestMessage.setBody(new Object[] {request.getQueryString()});
- responseMessage = queryInvoker.invoke(requestMessage);
- } else {
- responseMessage = getAllInvoker.invoke(requestMessage);
- }
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- Entry<Object, Object>[] collection =
- (Entry<Object, Object>[])responseMessage.getBody();
- if (collection != null) {
-
- // Create the feed
- Feed feed = abderaFactory.newFeed();
-
- // Set the feed title
- if (title != null) {
- feed.setTitle(title);
- } else {
- feed.setTitle("Feed");
- }
- // All feeds must provide Id and updated elements.
- // However, some do not, so provide some program protection.
- feed.setId( "Feed" + feed.hashCode());
- Date responseLastModified = new Date( 0 );
-
- // Add entries to the feed
- for (Entry<Object, Object> entry: collection) {
- org.apache.abdera.model.Entry feedEntry = feedEntry(entry, itemClassType, itemXMLType, mediator, abderaFactory);
- // Use the most recent entry update as the feed update
- Date entryUpdated = feedEntry.getUpdated();
- if (( entryUpdated != null ) && (entryUpdated.compareTo( responseLastModified ) > 0 ))
- responseLastModified = entryUpdated;
- feed.addEntry(feedEntry);
- }
- // If no entries were newly updated,
- if ( responseLastModified.compareTo( new Date( 0 ) ) == 0 )
- responseLastModified = new Date();
- return feed;
- }
- }
- return null;
- }
-
- @Override
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
- IOException {
- // Authenticate the user
- String user = processAuthorizationHeader(request);
- if (user == null) {
- unauthorized(response);
- return;
- }
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
-
- if (path == null || path.length() == 0 || path.equals("/")) {
- org.apache.abdera.model.Entry createdFeedEntry = null;
-
- // Create a new Atom entry
- String contentType = request.getContentType();
- if (contentType != null && contentType.startsWith("application/atom+xml")) {
-
- // Read the entry from the request
- org.apache.abdera.model.Entry feedEntry;
- try {
- Document<org.apache.abdera.model.Entry> doc = abderaParser.parse(request.getReader());
- feedEntry = doc.getRoot();
- } catch (ParseException pe) {
- throw new ServletException(pe);
- }
-
- // Let the component implementation create it
- if (supportsFeedEntries) {
-
- // The service implementation supports feed entries, pass the entry to it
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[] {feedEntry});
- Message responseMessage = postInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- createdFeedEntry = responseMessage.getBody();
- } else {
-
- // The service implementation does not support feed entries, pass the data item to it
- Message requestMessage = messageFactory.createMessage();
- Entry<Object, Object> entry = entry(feedEntry, itemClassType, itemXMLType, mediator);
- requestMessage.setBody(new Object[] {entry.getKey(), entry.getData()});
- Message responseMessage = postInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- entry.setKey(responseMessage.getBody());
- createdFeedEntry = feedEntry(entry, itemClassType, itemXMLType, mediator, abderaFactory);
- }
-
- } else if (contentType != null) {
-
- // Create a new media entry
-
- // Get incoming headers
- String title = request.getHeader("Title");
- String slug = request.getHeader("Slug");
-
- // Let the component implementation create the media entry
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[] {title, slug, contentType, request.getInputStream()});
- Message responseMessage = postMediaInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- createdFeedEntry = responseMessage.getBody();
- } else {
- response.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- }
-
- // A new entry was created successfully
- if (createdFeedEntry != null) {
-
- // Set location of the created entry in the Location header
- IRI feedId = createdFeedEntry.getId();
- if ( feedId != null )
- response.addHeader(ETAG, "\"" + feedId.toString() + "\"" );
- Date entryUpdated = createdFeedEntry.getUpdated();
- if ( entryUpdated != null )
- response.addHeader(LASTMODIFIED, dateFormat.format( entryUpdated ));
- Link link = createdFeedEntry.getSelfLink();
- if (link != null) {
- response.addHeader(LOCATION, link.getHref().toString());
- } else {
- link = createdFeedEntry.getLink( "Edit" );
- if (link != null) {
- response.addHeader(LOCATION, link.getHref().toString());
- }
- }
-
- // Write the created Atom entry
- response.setStatus(HttpServletResponse.SC_CREATED);
- response.setContentType("application/atom+xml;type=entry");
- try {
- createdFeedEntry.writeTo(getWriter(response));
- } catch (ParseException pe) {
- throw new ServletException(pe);
- }
-
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- }
-
- private Writer getWriter(HttpServletResponse response) throws UnsupportedEncodingException, IOException {
- Writer writer = new OutputStreamWriter(response.getOutputStream(), "UTF-8");
- return writer;
- }
-
- @Override
- protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- // Authenticate the user
- String user = processAuthorizationHeader(request);
- if (user == null) {
- unauthorized(response);
- return;
- }
-
- // Get the request path
- String path = request.getRequestURI().substring(request.getServletPath().length());
-
- if (path != null && path.startsWith("/")) {
- String id = path.substring(1);
-
- // Update an Atom entry
- String contentType = request.getContentType();
- if (contentType != null && contentType.startsWith("application/atom+xml")) {
-
- // Read the entry from the request
- org.apache.abdera.model.Entry feedEntry;
- try {
- Document<org.apache.abdera.model.Entry> doc = abderaParser.parse(request.getReader());
- feedEntry = doc.getRoot();
- } catch (ParseException pe) {
- throw new ServletException(pe);
- }
-
- // Let the component implementation create it
- if (supportsFeedEntries) {
- // The service implementation supports feed entries, pass the entry to it
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[] {id, feedEntry});
- Message responseMessage = putInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- }
- } else {
- // The service implementation does not support feed entries, pass the data item to it
- Message requestMessage = messageFactory.createMessage();
- Entry<Object, Object> entry = entry(feedEntry, itemClassType, itemXMLType, mediator);
- requestMessage.setBody(new Object[] {entry.getKey(), entry.getData()});
- Message responseMessage = putInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- }
- }
-
- } else if (contentType != null) {
-
- // Updated a media entry
-
- // Let the component implementation create the media entry
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[] {id, contentType, request.getInputStream()});
- Message responseMessage = putMediaInvoker.invoke(requestMessage);
- Object body = responseMessage.getBody();
- if (responseMessage.isFault()) {
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- }
- } else {
- response.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- }
-
- @Override
- protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException,
- IOException {
-
- // Authenticate the user
- String user = processAuthorizationHeader(request);
- if (user == null) {
- unauthorized(response);
- return;
- }
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
-
- String id;
- if (path != null && path.startsWith("/")) {
- id = path.substring(1);
- } else {
- id = "";
- }
-
- // Delete a specific entry from the collection
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[] {id});
- Message responseMessage = deleteInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- }
- }
-
- /**
- * Process the authorization header
- *
- * @param request
- * @return
- * @throws ServletException
- */
- private String processAuthorizationHeader(HttpServletRequest request) throws ServletException {
-
- // FIXME temporarily disabling this as it doesn't work with all browsers
- if (true)
- return "admin";
-
- try {
- String authorization = request.getHeader("Authorization");
- if (authorization != null) {
- StringTokenizer tokens = new StringTokenizer(authorization);
- if (tokens.hasMoreTokens()) {
- String basic = tokens.nextToken();
- if (basic.equalsIgnoreCase("Basic")) {
- String credentials = tokens.nextToken();
- String userAndPassword = new String(Base64.decodeBase64(credentials.getBytes()));
- int colon = userAndPassword.indexOf(":");
- if (colon != -1) {
- String user = userAndPassword.substring(0, colon);
- String password = userAndPassword.substring(colon + 1);
-
- // Authenticate the User.
- if (authenticate(user, password)) {
- return user;
- }
- }
- }
- }
- }
- } catch (Exception e) {
- throw new ServletException(e);
- }
- return null;
- }
-
- /**
- * Authenticate a user.
- *
- * @param user
- * @param password
- * @return
- */
- private boolean authenticate(String user, String password) {
- // TODO Handle this using SCA security policies
- return ("admin".equals(user) && "admin".equals(password));
- }
-
- /**
- * Reject an unauthorized request.
- *
- * @param response
- */
- private void unauthorized(HttpServletResponse response) throws IOException {
- response.setHeader("WWW-Authenticate", "BASIC realm=\"Tuscany\"");
- response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
- }
-
- /**
- * Generate ETag based on feed Id and updated fields.
- * Note that the feed id should be unique per feed, immutable, and unchanging,
- * but the ETag should change whenever the feed contents change.
- * @param feed
- * @return ETag
- */
- public static String generateFeedETag( Feed feed ) {
- if ( feed == null ) {
- return null;
- }
-
- IRI feedIdIRI = feed.getId();
- String feedId = "ID";
- if ( feedIdIRI != null ) {
- feedId = feedIdIRI.toString();
- }
-
- Date feedUpdated = feed.getUpdated();
- if ( feedUpdated == null ) {
- return feedId;
- }
-
- return feedId + "-" + feedUpdated.hashCode();
- }
-
- /**
- * Generate ETag based on entry Id and updated fields.
- * Note that the entry id should be unique per entry, immutable, and unchanging,
- * but the ETag should change whenever the entry contents change.
- * @param feed
- * @return ETag
- */
- public static String generateEntryETag( org.apache.abdera.model.Entry entry ) {
- if ( entry == null ) {
- return null;
- }
-
- IRI entryIdIRI = entry.getId();
- String entryId = "ID";
- if ( entryIdIRI != null ) {
- entryId = entryIdIRI.toString();
- }
-
- Date entryUpdated = entry.getUpdated();
- if ( entryUpdated == null ) {
- return entryId;
- }
-
- return entryId + "-" + entryUpdated.hashCode();
- }
-
- public static String getContentPreference( String acceptType ) {
- if (( acceptType == null ) || ( acceptType.length() < 1 )) {
- return "application/atom+xml";
- }
- StringTokenizer st = new StringTokenizer( acceptType, "," );
- if ( st.hasMoreTokens() )
- return st.nextToken();
- return "application/atom+xml";
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingProviderFactory.java b/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingProviderFactory.java
deleted file mode 100644
index b6b805e383..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingProviderFactory.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.atom.provider;
-
-import org.apache.tuscany.sca.binding.atom.AtomBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.impl.MediatorImpl;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Implementation of a Binding provider factory for the Atom binding.
- *
- * @version $Rev$ $Date$
- */
-public class AtomBindingProviderFactory implements BindingProviderFactory<AtomBinding> {
-
- private MessageFactory messageFactory;
- private Mediator mediator;
- private ServletHost servletHost;
-
- public AtomBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- this.servletHost = servletHosts.getServletHosts().get(0);
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- this.messageFactory = modelFactories.getFactory(MessageFactory.class);
- this.mediator = new MediatorImpl(extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class),
- extensionPoints.getExtensionPoint(TransformerExtensionPoint.class));
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- AtomBinding binding) {
- return new AtomReferenceBindingProvider(component, reference, binding, mediator);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- AtomBinding binding) {
- return new AtomServiceBindingProvider(component, service, binding, servletHost, messageFactory, mediator);
- }
-
- public Class<AtomBinding> getModelType() {
- return AtomBinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingUtil.java b/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingUtil.java
deleted file mode 100644
index 62fde86122..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingUtil.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.atom.provider;
-
-import java.util.Date;
-
-import org.apache.abdera.factory.Factory;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Link;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.interfacedef.DataType;
-
-/**
- * Utility methods used in this package.
- *
- * @version $Rev$ $Date$
- */
-class AtomBindingUtil {
-
- /**
- * Create a data item from an Atom entry.
- * @param feedEntry
- * @param itemClassType
- * @param itemXMLType
- * @param mediator
- * @return
- */
- static Entry<Object, Object> entry(org.apache.abdera.model.Entry feedEntry,
- DataType<?> itemClassType, DataType<?> itemXMLType, Mediator mediator) {
- if (feedEntry != null) {
- if (itemClassType.getPhysical() == Item.class) {
- String key = feedEntry.getId().toString();
-
- Item item = new Item();
- item.setTitle(feedEntry.getTitle());
- item.setContents(feedEntry.getContent());
-
- for (Link link : feedEntry.getLinks()) {
- if (link.getRel() == null || "self".equals(link.getRel())) {
- if (item.getLink() == null) {
- item.setLink(link.getHref().toString());
- }
- } else if ("related".equals(link.getRel())) {
- item.setRelated(link.getHref().toString());
- } else if ("alternate".equals(link.getRel())) {
- item.setAlternate(link.getHref().toString());
- }
- }
-
- item.setDate(feedEntry.getUpdated());
-
- return new Entry<Object, Object>(key, item);
-
- } else {
- String key = null;
- if ( feedEntry.getId() != null) {
- key = feedEntry.getId().toString();
- }
-
- // Create the item from XML
- if (feedEntry.getContentElement().getElements().size() == 0) {
- return null;
- }
-
- String value = feedEntry.getContent();
- Object data = mediator.mediate(value, itemXMLType, itemClassType, null);
-
- return new Entry<Object, Object>(key, data);
- }
- } else {
- return null;
- }
- }
-
- /**
- * Create an Atom entry for a key and item from a collection.
- * @param entry
- * @param itemClassType
- * @param itemXMLType
- * @param mediator
- * @param factory
- * @return
- */
- static org.apache.abdera.model.Entry feedEntry(Entry<Object, Object> entry,
- DataType<?> itemClassType, DataType<?> itemXMLType, Mediator mediator,
- Factory factory) {
- Object key = entry.getKey();
- Object data = entry.getData();
- if (data instanceof Item) {
- Item item = (Item)data;
-
- org.apache.abdera.model.Entry feedEntry = factory.newEntry();
- if (key != null) {
- feedEntry.setId(key.toString());
- }
- feedEntry.setTitle(item.getTitle());
- feedEntry.setContentAsHtml(item.getContents());
-
- String href = item.getLink();
- if (href == null && key != null) {
- href = key.toString();
- }
-
- if (href != null) {
- feedEntry.addLink(href);
- }
- String related = item.getRelated();
- if (related != null) {
- feedEntry.addLink(related, "related");
- }
- String alternate = item.getAlternate();
- if (alternate != null) {
- feedEntry.addLink(alternate, "alternate");
- }
-
- Date date = item.getDate();
- if (date != null) {
- feedEntry.setUpdated(date);
- }
- return feedEntry;
-
- } else if (data != null) {
- org.apache.abdera.model.Entry feedEntry = factory.newEntry();
- feedEntry.setId(key.toString());
- feedEntry.setTitle("item");
-
-
- // Convert the item to XML
- String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
-
- Content content = factory.newContent();
- content.setContentType(Content.Type.XML);
- content.setValue(value);
-
- feedEntry.setContentElement(content);
-
- feedEntry.addLink(key.toString());
-
- return feedEntry;
- } else {
- return null;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java b/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java
deleted file mode 100644
index f2b1d1f72b..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.atom.provider;
-
-import java.net.URI;
-
-import javax.xml.namespace.QName;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpConnectionManager;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.tuscany.sca.binding.atom.AtomBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-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 Atom binding provider.
- *
- * @version $Rev$ $Date$
- */
-class AtomReferenceBindingProvider implements ReferenceBindingProvider {
-
- private RuntimeComponentReference reference;
- private AtomBinding binding;
- private String authorizationHeader;
- private HttpClient httpClient;
- private Mediator mediator;
- private DataType<?> itemClassType;
- private DataType<?> itemXMLType;
- private boolean supportsFeedEntries;
-
- /**
- * Constructs a new AtomReferenceBindingProvider
- * @param component
- * @param reference
- * @param binding
- * @param mediator
- */
- AtomReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- AtomBinding binding,
- Mediator mediator) {
- this.reference = reference;
- this.binding = binding;
- this.mediator = mediator;
-
- // Prepare authorization header
- String authorization = "admin" + ":" + "admin";
- authorizationHeader = "Basic " + new String(Base64.encodeBase64(authorization.getBytes()));
-
- // Create an HTTP client
- HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
- connectionManager.getParams().setDefaultMaxConnectionsPerHost(10);
- connectionManager.getParams().setConnectionTimeout(60000);
- httpClient = new HttpClient(connectionManager);
- }
-
- public Invoker createInvoker(Operation operation) {
-
- String operationName = operation.getName();
- if (operationName.equals("get")) {
-
- // Determine the collection item type
- itemXMLType = new DataTypeImpl<Class<?>>(String.class.getName(), String.class, String.class);
- Class<?> itemClass = operation.getOutputType().getPhysical();
- DataType<XMLType> outputType = operation.getOutputType();
- QName qname = outputType.getLogical().getElementName();
- qname = new QName(qname.getNamespaceURI(), itemClass.getSimpleName());
- itemClassType = new DataTypeImpl<XMLType>("java:complexType", itemClass, new XMLType(qname, null));
- if (itemClassType.getPhysical() == org.apache.abdera.model.Entry.class) {
- supportsFeedEntries = true;
- }
-
- return new AtomBindingInvoker.GetInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this);
-
- } else if (operationName.equals("post")) {
- return new AtomBindingInvoker.PostInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this);
- } else if (operationName.equals("put")) {
- return new AtomBindingInvoker.PutInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this);
- } else if (operationName.equals("delete")) {
- return new AtomBindingInvoker.DeleteInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this);
- } else if (operationName.equals("getFeed") || operationName.equals("getAll")) {
- return new AtomBindingInvoker.GetAllInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this);
- } else if (operationName.equals("postMedia")) {
- return new AtomBindingInvoker.PostMediaInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this);
- } else if (operationName.equals("putMedia")) {
- return new AtomBindingInvoker.PutMediaInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this);
- } else if (operationName.equals("query")) {
- return new AtomBindingInvoker.QueryInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this);
- }
-
- return new AtomBindingInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this);
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- public void start() {
-
- // Configure the HTTP client credentials
- Credentials credentials = new UsernamePasswordCredentials("admin", "admin");
- httpClient.getParams().setAuthenticationPreemptive(true);
- URI uri = URI.create(binding.getURI());
- httpClient.getState().setCredentials(new AuthScope(uri.getHost(), uri.getPort()), credentials);
-
- // Find the get operation on the reference interface
- if (true) {
- return;
- }
- }
-
- public void stop() {
-
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- /**
- * Returns the mediator.
- * @return
- */
- Mediator getMediator() {
- return mediator;
- }
-
- /**
- * Returns the item class type.
- * @return
- */
- DataType<?> getItemClassType() {
- return itemClassType;
- }
-
- /**
- * Returns the item XML type.
- * @return
- */
- DataType<?> getItemXMLType() {
- return itemXMLType;
- }
-
- /**
- * Returns true if the invoker should work with Atom
- * feed entries.
- * @return
- */
- boolean supportsFeedEntries() {
- return supportsFeedEntries;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java b/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java
deleted file mode 100644
index e1d470f5a3..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.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.atom.provider;
-
-import org.apache.tuscany.sca.binding.atom.AtomBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-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.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Implementation of the Atom binding provider.
- *
- * @version $Rev$ $Date$
- */
-class AtomServiceBindingProvider implements ServiceBindingProvider {
-
- private RuntimeComponentService service;
- private AtomBinding binding;
- private ServletHost servletHost;
- private MessageFactory messageFactory;
- private String servletMapping;
- private Mediator mediator;
-
- AtomServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- AtomBinding binding,
- ServletHost servletHost,
- MessageFactory messageFactory,
- Mediator mediator) {
- this.service = service;
- this.binding = binding;
- this.servletHost = servletHost;
- this.messageFactory = messageFactory;
- this.mediator = mediator;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- RuntimeComponentService componentService = (RuntimeComponentService)service;
- RuntimeWire wire = componentService.getRuntimeWire(binding);
-
- AtomBindingListenerServlet servlet =
- new AtomBindingListenerServlet(wire, messageFactory, mediator, binding.getTitle());
-
- servletMapping = binding.getURI();
- if (!servletMapping.endsWith("/")) {
- servletMapping += "/";
- }
- if (!servletMapping.endsWith("*")) {
- servletMapping += "*";
- }
- servletHost.addServletMapping(servletMapping, servlet);
- }
-
- public void stop() {
- servletHost.removeServletMapping(servletMapping);
- }
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-atom-abdera/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index 1b9052299c..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/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.atom.provider.AtomBindingProviderFactory;model=org.apache.tuscany.sca.binding.atom.AtomBinding
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java
deleted file mode 100644
index f9ac5f9c78..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.apache.tuscany.sca.binding.atom;
-
-import java.util.UUID;
-
-import junit.framework.Assert;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class AtomDeleteTestCase {
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
- protected static Abdera abdera;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println(">>>AtomDeleteTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
- abdera = new Abdera();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- // System.out.println(">>>AtomDeleteTestCase.destroy entry");
- scaConsumerDomain.close();
- scaProviderDomain.close();
- }
-
- @Test
- public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
- Assert.assertNotNull(testService);
- Assert.assertNotNull(abdera);
- }
-
- @Test
- public void testAtomDelete() throws Exception {
- Collection resourceCollection = testService.getCustomerCollection();
- Assert.assertNotNull(resourceCollection);
-
- Entry postEntry = postEntry("Sponge Bob");
- System.out.println(">>> post entry= " + postEntry.getTitle());
-
- Entry newEntry = resourceCollection.post(postEntry);
- System.out.println("<<< Entry posted for " + newEntry.getTitle());
-
- System.out.println(">>> get id=" + newEntry.getId());
-
- resourceCollection.delete(newEntry.getId().toString());
-
- }
-
- @Test
- public void testAtomDeleteException() throws Exception {
- Collection resourceCollection = testService.getCustomerCollection();
- Assert.assertNotNull(resourceCollection);
-
- try {
- // Generates custom ID
- String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
- resourceCollection.delete(id);
- } catch (Exception e) {
- // ID doesn't match with the existing IDs and NotFoundException is
- // thrown
- Assert.assertEquals("NotFoundException", e.getClass().getSimpleName());
- }
-
- }
-
- private Entry postEntry(String value) {
- Entry entry = abdera.newEntry();
- entry.setTitle("customer " + value);
-
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
- entry.setContentElement(content);
-
- return entry;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java
deleted file mode 100644
index 8d78d167c3..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package org.apache.tuscany.sca.binding.atom;
-
-import junit.framework.Assert;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class AtomGetTestCase {
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
- protected static Abdera abdera;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println(">>>AtomGetTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
- abdera = new Abdera();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- // System.out.println(">>>AtomGetTestCase.destroy entry");
- scaConsumerDomain.close();
- scaProviderDomain.close();
- }
-
- @Test
- public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
- Assert.assertNotNull(testService);
- Assert.assertNotNull(abdera);
- }
-
- @Test
- public void testAtomGet() throws Exception {
- Collection resourceCollection = testService.getCustomerCollection();
- Assert.assertNotNull(resourceCollection);
-
- Entry postEntry = postEntry("Sponge Bob");
- System.out.println(">>> post entry= " + postEntry.getTitle());
-
- Entry newEntry = resourceCollection.post(postEntry);
- System.out.println("<<< Entry posted for " + newEntry.getTitle());
-
- System.out.println(">>> get id=" + newEntry.getId());
-
- Entry getEntry = resourceCollection.get(newEntry.getId().toString());
-
- Assert.assertEquals(newEntry.getTitle(), getEntry.getTitle());
- System.out.println("<<< get id=" + getEntry.getId() + " entry=" + getEntry.getTitle());
- }
-
- @Test
- public void testAtomGetException() throws Exception {
- Collection resourceCollection = testService.getCustomerCollection();
- Assert.assertNotNull(resourceCollection);
-
- Entry postEntry = postEntry("Sponge Bob");
- System.out.println(">>> post entry= " + postEntry.getTitle());
-
- Entry newEntry = resourceCollection.post(postEntry);
- System.out.println("<<< Entry posted for " + newEntry.getTitle());
- System.out.println(newEntry.getId());
-
- // Delete the entry to force the Collection to throw NotFoundException
- resourceCollection.delete(newEntry.getId().toString());
-
- try {
- resourceCollection.get(newEntry.getId().toString());
- } catch (Exception e) {
- Assert.assertEquals("NotFoundException", e.getClass().getSimpleName());
- }
- }
-
- private Entry postEntry(String value) {
- Entry entry = abdera.newEntry();
- entry.setTitle("customer " + value);
-
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
- entry.setContentElement(content);
-
- return entry;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java
deleted file mode 100644
index ef5fe5a873..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.apache.tuscany.sca.binding.atom;
-
-import junit.framework.Assert;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class AtomPostTestCase {
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
- protected static Abdera abdera;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println(">>>AtomPostTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
- abdera = new Abdera();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println(">>>AtomPostTestCase.destroy entry");
- scaConsumerDomain.close();
- scaProviderDomain.close();
- }
-
- @Test
- public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
- Assert.assertNotNull(testService);
- Assert.assertNotNull(abdera);
- }
-
- @Test
- public void testAtomPost() throws Exception {
- Collection resourceCollection = testService.getCustomerCollection();
- Assert.assertNotNull(resourceCollection);
-
- Entry postEntry = postEntry("Sponge Bob");
- System.out.println(">>> post entry= " + postEntry.getTitle());
-
- Entry newEntry = resourceCollection.post(postEntry);
-
- Assert.assertEquals(postEntry.getTitle(), newEntry.getTitle());
-
- System.out.println("<<< new entry= " + newEntry.getTitle());
-
- }
-
- @Test
- public void testAtomPostException() throws Exception {
- Collection resourceCollection = testService.getCustomerCollection();
- Assert.assertNotNull(resourceCollection);
-
- Entry postEntry = postEntry("Exception_Test");
-
- try {
- resourceCollection.post(postEntry);
- } catch (Exception e) {
- Assert.assertEquals("HTTP status code: 500", e.getMessage());
- }
- }
-
- private Entry postEntry(String value) {
- Entry entry = abdera.newEntry();
- entry.setTitle("customer " + value);
-
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
- entry.setContentElement(content);
-
- return entry;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java
deleted file mode 100644
index a5c1226780..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.apache.tuscany.sca.binding.atom;
-
-import java.util.UUID;
-
-import junit.framework.Assert;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class AtomPutTestCase {
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
- protected static Abdera abdera;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println(">>>AtomPutTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
- abdera = new Abdera();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- // System.out.println(">>>AtomPutTestCase.destroy entry");
- scaConsumerDomain.close();
- scaProviderDomain.close();
- }
-
- @Test
- public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
- Assert.assertNotNull(testService);
- Assert.assertNotNull(abdera);
- }
-
- @Test
- public void testAtomPut() throws Exception {
- Collection resourceCollection = testService.getCustomerCollection();
- Assert.assertNotNull(resourceCollection);
-
- Entry postEntry = postEntry("Sponge Bob");
- System.out.println(">>> post entry= " + postEntry.getTitle());
-
- Entry newEntry = resourceCollection.post(postEntry);
- System.out.println("<<< Entry posted for " + newEntry.getTitle());
- System.out.println(newEntry.getId());
-
- System.out.println(">>> put id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
- resourceCollection.put(newEntry.getId().toString(), updateEntry(newEntry, "James Bond"));
- System.out.println("<<< put id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
- }
-
- @Test
- public void testAtomPutException() throws Exception {
- Collection resourceCollection = testService.getCustomerCollection();
- Assert.assertNotNull(resourceCollection);
-
- Entry postEntry = postEntry("Sponge Bob");
- System.out.println(">>> post entry= " + postEntry.getTitle());
-
- // Generate random ID to pass as parameter in PUT() --
- String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
- try {
- // ID doesn't match with the existing IDs and NotFoundException is thrown
- resourceCollection.put(id, updateEntry(postEntry, "James Bond"));
- } catch (Exception e) {
- Assert.assertEquals("NotFoundException", e.getClass().getSimpleName());
- }
- }
-
- private Entry postEntry(String value) {
- Entry entry = abdera.newEntry();
- entry.setTitle("customer " + value);
-
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
- entry.setContentElement(content);
-
- return entry;
- }
-
- private Entry updateEntry(Entry entry, String value) {
- entry.setTitle("customer " + value);
-
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
- entry.setContentElement(content);
-
- return entry;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomTestCaseUtils.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomTestCaseUtils.java
deleted file mode 100644
index 6beed6881f..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomTestCaseUtils.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.binding.atom;
-
-import java.io.IOException;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.model.Base;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.protocol.client.ClientResponse;
-import org.apache.abdera.protocol.client.RequestOptions;
-import org.apache.abdera.writer.Writer;
-import org.apache.abdera.writer.WriterFactory;
-
-/**
- * Utilities to help print and test various aspects of entity tag support.
- */
-public class AtomTestCaseUtils {
-
- public static void prettyPrint(Abdera abdera, Base doc) throws IOException {
- WriterFactory factory = abdera.getWriterFactory();
- Writer writer = factory.getWriter("prettyxml");
- writer.writeTo(doc, System.out);
- System.out.println();
- }
-
- public static void printRequestHeaders( String title, String indent, RequestOptions request ) {
- System.out.println( title );
- if ( request == null ) {
- System.out.println( indent + " request is null");
- return;
- }
- String [] headerNames = request.getHeaderNames();
- for ( String headerName: headerNames) {
- String header = request.getHeader(headerName);
- System.out.println( indent + " header name,value=" + headerName + "," + header );
- }
- }
-
- public static void printResponseHeaders( String title, String indent, ClientResponse response ) {
- System.out.println( title );
- if ( response == null ) {
- System.out.println( indent + " response is null");
- return;
- }
- String [] headerNames = response.getHeaderNames();
- for ( String headerName: headerNames) {
- String header = response.getHeader(headerName);
- System.out.println( indent + " header name,value=" + headerName + "," + header );
- }
-
- }
-
- public static Entry newEntry(String value) {
- Abdera abdera = new Abdera();
- Entry entry = abdera.newEntry();
- entry.setTitle("customer " + value);
-
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
- entry.setContentElement(content);
-
- return entry;
- }
-
- public static Entry updateEntry(Entry entry, String value) {
- Abdera abdera = new Abdera();
- entry.setTitle("customer " + value);
-
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
- entry.setContentElement(content);
-
- return entry;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/Consumer.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/Consumer.java
deleted file mode 100644
index 34d3ed1d1c..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/Consumer.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.atom;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class Consumer {
-
- public static void main(String[] args) throws Exception {
-
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
-
- CustomerClient testService = scaDomain.getService(CustomerClient.class, "CustomerClient");
- testService.testCustomerCollection();
-
- scaDomain.close();
- }
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java
deleted file mode 100644
index 9af85a970c..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.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.atom;
-
-import java.util.Date;
-
-import junit.framework.Assert;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.model.Feed;
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test case for the given package.
- */
-public class ConsumerProviderAtomTestCase {
-
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
- protected static Abdera abdera;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println(">>>AtomBindingIntegratedTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class,"CustomerClient");
- abdera = new Abdera();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println(">>>AtomBindingIntegratedTestCase.destroy entry");
- scaConsumerDomain.close();
- scaProviderDomain.close();
- }
-
- @Test
- public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
- Assert.assertNotNull(testService);
- Assert.assertNotNull(abdera);
- }
-
- @Test
- public void testEntry() throws Exception {
- // System.out.println( getClass().getName() + ".testEntry entry" );
- Entry entry = abdera.newEntry();
- Assert.assertNotNull(entry);
-
- String testTitle = "Sponge Bob";
- entry.setTitle(testTitle);
- Assert.assertEquals(testTitle, entry.getTitle());
-
- String testContent = "This is the content";
- entry.setContent(testContent);
- Assert.assertEquals(testContent, entry.getContent());
-
- Date now = new Date();
- entry.setEdited(now);
- Assert.assertEquals(now, entry.getEdited());
-
- Date later = new Date();
- entry.setPublished(later);
- Assert.assertEquals(later, entry.getPublished());
-
- String testSummary = "This is the summary";
- entry.setSummary(testSummary);
- Assert.assertEquals(testSummary, entry.getSummary());
- }
-
- @Test
- public void testCustomerCollection() throws Exception {
- System.out.println(getClass().getName() + ".testCustomerCollection entry");
- Collection resourceCollection = testService.getCustomerCollection();
- Assert.assertNotNull(resourceCollection);
-
- Entry newEntry = newEntry("Sponge Bob");
- System.out.println(">>> post entry=" + newEntry.getTitle());
- newEntry = resourceCollection.post(newEntry);
- System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
-
- newEntry = newEntry("Jane Bond");
- System.out.println(">>> post entry=" + newEntry.getTitle());
- newEntry = resourceCollection.post(newEntry);
- System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
-
- System.out.println(">>> get id=" + newEntry.getId());
- Entry entry = resourceCollection.get(newEntry.getId().toString());
- System.out.println("<<< get id=" + entry.getId() + " entry=" + entry.getTitle());
-
- System.out.println(">>> put id=" + newEntry.getId() + " entry=" + entry.getTitle());
- resourceCollection.put(entry.getId().toString(), updateEntry(entry, "James Bond"));
- System.out.println("<<< put id=" + entry.getId() + " entry=" + entry.getTitle());
-
- System.out.println(">>> delete id=" + entry.getId());
- resourceCollection.delete(entry.getId().toString());
- System.out.println("<<< delete id=" + entry.getId());
-
- System.out.println(">>> get collection");
- Feed feed = resourceCollection.getFeed();
- System.out.println("<<< get collection");
- for (Object o : feed.getEntries()) {
- Entry e = (Entry)o;
- System.out.println("id = " + e.getId() + " entry = " + e.getTitle());
- }
- }
-
- private Entry newEntry(String value) {
- Entry entry = abdera.newEntry();
- entry.setTitle("customer " + value);
-
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
- entry.setContentElement(content);
-
- return entry;
- }
-
- private Entry updateEntry(Entry entry, String value) {
- entry.setTitle("customer " + value);
-
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
- entry.setContentElement(content);
-
- return entry;
- }
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java
deleted file mode 100644
index 08f8e3db2a..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.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.binding.atom;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import junit.framework.Assert;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.factory.Factory;
-import org.apache.abdera.model.Base;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.model.Feed;
-import org.apache.abdera.model.Document;
-import org.apache.abdera.model.Service;
-import org.apache.abdera.protocol.Response.ResponseType;
-import org.apache.abdera.protocol.client.AbderaClient;
-import org.apache.abdera.protocol.client.ClientResponse;
-import org.apache.abdera.protocol.client.RequestOptions;
-import org.apache.abdera.protocol.client.util.BaseRequestEntity;
-import org.apache.abdera.util.EntityTag;
-import org.apache.abdera.parser.Parser;
-
-
-/**
- * Tests use of content negotiation for Atom binding in Tuscany.
- * Uses the SCA provided Provider composite to act as a server.
- * Uses the Abdera provided Client to act as a client.
- */
-public class ContentNegotiationTest {
- public final static String providerURI = "http://localhost:8084/customer";
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
- protected static Abdera abdera;
- protected static AbderaClient client;
- protected static Parser abderaParser;
- protected static String lastId;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println(">>>ContentNegotiationTest.init");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- abdera = new Abdera();
- client = new AbderaClient(abdera);
- abderaParser = Abdera.getNewParser();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println(">>>ContentNegotiationTest.destroy");
- scaProviderDomain.close();
- }
-
- @Test
- public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull( client );
- }
-
- @Test
- public void testPost() throws Exception {
- System.out.println(">>>ContentNegotiationTest.testPost");
- // Testing of entry creation
- Factory factory = abdera.getFactory();
- String customerName = "Fred Farkle";
- Entry entry = factory.newEntry();
- entry.setTitle("customer " + customerName);
- entry.setUpdated(new Date());
- entry.addAuthor("Apache Tuscany");
- // ID created by collection.
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(customerName);
- entry.setContentElement(content);
-
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml; type=entry";
- opts.setContentType(contentType);
- // AtomTestCaseUtils.printRequestHeaders( "Post request headers", " ", opts );
- IRI colUri = new IRI(providerURI).resolve("customer");
- // res = client.post(colUri.toString() + "?test=foo", entry, opts);
- ClientResponse res = client.post(colUri.toString(), entry, opts);
-
- // Assert response status code is 201-OK.
- // Assert response header Content-Type: application/atom+xml; charset=UTF-8
- Assert.assertEquals(201, res.getStatus());
- String returnedContentType = res.getContentType().toString().trim();
- Assert.assertEquals(contentType, returnedContentType );
-
- String eTag = res.getHeader( "ETag" );
- if ( eTag != null)
- lastId = eTag.substring( 1, eTag.length()-1);
-
- // AtomTestCaseUtils.printResponseHeaders( "Entry post response headers:", " ", res );
- // System.out.println("Entry post response content:");
- // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
- }
-
- @Test
- public void testXMLEntryGet() throws Exception {
- System.out.println(">>>ContentNegotiationTest.testXMLEntryGet");
- RequestOptions opts = new RequestOptions();
- opts.setHeader( "Accept", "application/atom+xml" );
-
- IRI colUri = new IRI(providerURI).resolve("customer");
- ClientResponse res = client.get(colUri.toString() + "/" + lastId, opts);
- Assert.assertEquals(200, res.getStatus());
- String returnedContentType = res.getContentType().toString().trim();
- // Assert.assertEquals(contentType, returnedContentType );
- res.release();
- }
-
- @Test
- public void testJSONEntryGet() throws Exception {
- System.out.println(">>>ContentNegotiationTest.testJSONEntryGet");
- RequestOptions opts = new RequestOptions();
- opts.setHeader( "Accept", "application/json" );
-
- IRI colUri = new IRI(providerURI).resolve("customer");
- ClientResponse res = client.get(colUri.toString() + "/" + lastId, opts);
- try {
- Assert.assertEquals(200, res.getStatus());
- // Abdera 0.4 throws exception on getContentType with application/json.
- // System.out.println( "ContentNegotiationTest.testJSONEntryGet contentType=" + res.getContentType());
- String contentType = res.getHeader( "Content-Type");
- Assert.assertTrue( -1 < contentType.indexOf( "application/json" ));
- // Following is a poor man's JSONObject test to avoid dependency on JSON libs.
- // JSONObject jsonResp = new JSONObject(res.);
- // Assert.assertEquals(12345, jsonResp.getInt("result"));
- String responseBody = readResponse( res.getReader() );
- Assert.assertTrue( responseBody.startsWith( "{") );
- Assert.assertTrue( responseBody.endsWith( "}") );
- Assert.assertTrue( -1 < responseBody.indexOf( "\"id\"" ));
- Assert.assertTrue( -1 < responseBody.indexOf( "\"title\"" ));
- Assert.assertTrue( -1 < responseBody.indexOf( "\"updated\"" ));
- // AtomTestCaseUtils.printResponseHeaders( "JSON Entry response headers:", " ", res );
- // System.out.println( "ContentNegotiationTest.testJSONEntryGet JSON entry body=" + responseBody );
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testXMLFeedGet() throws Exception {
- System.out.println(">>>ContentNegotiationTest.testXMLFeedGet");
- RequestOptions opts = new RequestOptions();
- opts.setHeader( "Accept", "application/atom+xml" );
-
- // Atom feed request
- ClientResponse res = client.get(providerURI, opts);
- Assert.assertNotNull(res);
- try {
- // Asser feed provided since no predicates
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(ResponseType.SUCCESS, res.getType());
- // AtomTestCaseUtils.printResponseHeaders( "Feed response headers:", " ", res );
- // System.out.println("Feed response content:");
- // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
-
- // Perform other tests on feed.
- Document<Feed> doc = res.getDocument();
- Assert.assertNotNull( doc );
- Feed feed = doc.getRoot();
- Assert.assertNotNull( feed );
- // RFC 4287 requires non-null id, title, updated elements
- Assert.assertNotNull( feed.getId() );
- Assert.assertNotNull( feed.getTitle() );
- Assert.assertNotNull( feed.getUpdated() );
- // AtomTestCaseUtils.printFeed( "Feed values", " ", feed );
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testJSONFeedGet() throws Exception {
- System.out.println(">>>ContentNegotiationTest.testJSONFeedGet");
- RequestOptions opts = new RequestOptions();
- opts.setHeader( "Accept", "application/json" );
-
- // JSON feed request
- ClientResponse res = client.get(providerURI, opts);
- Assert.assertNotNull(res);
- try {
- // Assert feed provided since no predicates
- Assert.assertEquals(200, res.getStatus());
- // Abdera 0.4 throws exception on getContentType with application/json.
- // System.out.println( "ContentNegotiationTest.testJSONEntryGet contentType=" + res.getContentType());
- String contentType = res.getHeader( "Content-Type");
- Assert.assertTrue( -1 < contentType.indexOf( "application/json" ));
- // Following is a poor man's JSONObject test to avoid dependency on JSON libs.
- // JSONObject jsonResp = new JSONObject(res.);
- // Assert.assertEquals(12345, jsonResp.getInt("result"));
- String responseBody = readResponse( res.getReader() );
- Assert.assertTrue( responseBody.startsWith( "{") );
- Assert.assertTrue( responseBody.endsWith( "}") );
- Assert.assertTrue( -1 < responseBody.indexOf( "\"id\"" ));
- Assert.assertTrue( -1 < responseBody.indexOf( "\"title\"" ));
- Assert.assertTrue( -1 < responseBody.indexOf( "\"updated\"" ));
- Assert.assertTrue( -1 < responseBody.indexOf( "\"entries\"" ));
- // AtomTestCaseUtils.printResponseHeaders( "JSON Entry response headers:", " ", res );
- // System.out.println( "ContentNegotiationTest.testJSONEntryGet JSON entry body=" + responseBody );
- } finally {
- res.release();
- }
- }
-
- protected String readResponse( Reader responseReader ) {
- if ( responseReader == null ) return "";
- StringBuffer sb = new StringBuffer(1024);
- try {
- int charValue = 0;
- while ((charValue = responseReader.read()) != -1) {
- //result = result + (char) charValue;
- sb.append((char)charValue);
- }
- } catch ( IOException e ) {
- }
- return sb.toString();
- }
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClient.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClient.java
deleted file mode 100644
index bc32b91367..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClient.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.atom;
-
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-
-public interface CustomerClient {
-
- void testCustomerCollection() throws Exception;
-
- Collection getCustomerCollection();
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java
deleted file mode 100644
index 3e5705b14c..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.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.atom;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.model.Feed;
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.osoa.sca.annotations.Reference;
-
-public class CustomerClientImpl implements CustomerClient {
-
- protected final Abdera abdera = new Abdera();
-
- @Reference
- public Collection customerCollection;
-
- public void testCustomerCollection() throws Exception {
-
- Entry newEntry = newEntry("Sponge Bob");
- System.out.println(">>> post entry=" + newEntry.getTitle());
- newEntry = customerCollection.post(newEntry);
- System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
-
- newEntry = newEntry("Jane Bond");
- System.out.println(">>> post entry=" + newEntry.getTitle());
- newEntry = customerCollection.post(newEntry);
- System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
-
- System.out.println(">>> get id=" + newEntry.getId());
- Entry entry = customerCollection.get(newEntry.getId().toString());
- System.out.println("<<< get id=" + entry.getId() + " entry=" + entry.getTitle());
-
- System.out.println(">>> put id=" + newEntry.getId() + " entry=" + entry.getTitle());
- customerCollection.put(entry.getId().toString(), updateEntry(entry, "James Bond"));
- System.out.println("<<< put id=" + entry.getId() + " entry=" + entry.getTitle());
-
- System.out.println(">>> delete id=" + entry.getId());
- customerCollection.delete(entry.getId().toString());
- System.out.println("<<< delete id=" + entry.getId());
-
- System.out.println(">>> get collection");
- Feed feed = customerCollection.getFeed();
- System.out.println("<<< get collection");
- for (Object o : feed.getEntries()) {
- Entry e = (Entry)o;
- System.out.println("id = " + e.getId() + " entry = " + e.getTitle());
- }
- }
-
- public Collection getCustomerCollection() {
- return customerCollection;
- }
-
- private Entry newEntry(String value) {
-
- Entry entry = this.abdera.newEntry();
- entry.setTitle("customer " + value);
-
- Content content = this.abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
-
- entry.setContentElement(content);
-
- return entry;
- }
-
- private Entry updateEntry(Entry entry, String value) {
-
- entry.setTitle("customer " + value);
-
- Content content = this.abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
-
- entry.setContentElement(content);
-
- return entry;
- }
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java
deleted file mode 100644
index db66b00a50..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.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.binding.atom;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.model.Feed;
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.binding.atom.collection.NotFoundException;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("COMPOSITE")
-public class CustomerCollectionImpl implements Collection {
- private final Abdera abdera = new Abdera();
- private Map<String, Entry> entries = new HashMap<String, Entry>();
- public Date lastModified = new Date();
-
- /**
- * Default constructor
- */
- public CustomerCollectionImpl() {
-
- }
-
- public Entry post(Entry entry) {
- System.out.println(">>> CustomerCollectionImpl.post entry=" + entry.getTitle());
-
- if(!("Exception_Test".equalsIgnoreCase(entry.getTitle())))
- {
- String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
- entry.setId(id);
-
- entry.addLink("" + id, "edit");
- entry.addLink("" + id, "alternate");
- Date now = new Date();
- entry.setUpdated(now);
- lastModified = now;
- entries.put(id, entry);
-
- System.out.println(">>> CustomerCollectionImpl.post return id=" + id);
-
- return entry;
-
- }
- else
- {
- throw new IllegalArgumentException("Exception in Post method");
- }
- }
-
- public Entry get(String id) {
- System.out.println(">>> CustomerCollectionImpl.get id=" + id);
- return entries.get(id);
- }
-
- public void put(String id, Entry entry) throws NotFoundException {
- System.out.println(">>> CustomerCollectionImpl.put id=" + id + " entry=" + entry.getTitle());
- if(entries.containsKey(id)){
- Date now = new Date();
- entry.setUpdated(now);
- lastModified = now;
- entries.put(id, entry);
- }
- else {
- throw new NotFoundException();
- }
- }
-
- public void delete(String id) throws NotFoundException {
- System.out.println(">>> CustomerCollectionImpl.delete id=" + id);
- if(entries.containsKey(id)){
- entries.remove(id);
- lastModified = new Date();
- }
- else {
- throw new NotFoundException();
- }
- }
-
- public Feed getFeed() {
- System.out.println(">>> CustomerCollectionImpl.getFeed");
-
- Feed feed = this.abdera.getFactory().newFeed();
- feed.setId("customers" + this.hashCode() ); // provide unique id for feed instance.
- feed.setTitle("customers");
- feed.setSubtitle("This is a sample feed");
- feed.setUpdated(lastModified);
- feed.addLink("");
- feed.addLink("", "self");
-
- for (Entry entry : entries.values()) {
- feed.addEntry(entry);
- }
-
- return feed;
- }
-
- public Feed query(String queryString) {
- System.out.println(">>> CustomerCollectionImpl.query collection " + queryString);
- return getFeed();
- }
-
- // This method used for testing.
- protected void testPut(String value) {
- String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
-
- Entry entry = abdera.getFactory().newEntry();
- entry.setId(id);
- entry.setTitle("customer " + value);
-
- Content content = this.abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
-
- entry.setContentElement(content);
-
- entry.addLink("" + id, "edit");
- entry.addLink("" + id, "alternate");
-
- entry.setUpdated(new Date());
-
- entries.put(id, entry);
- System.out.println(">>> id=" + id);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/Provider.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/Provider.java
deleted file mode 100644
index 3e1bf543e5..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/Provider.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.atom;
-
-import java.io.IOException;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class Provider {
-
- public static void main(String[] args) {
-
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- System.out.println("Provider.composite ready...");
-
- try {
- System.in.read();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- scaDomain.close();
- }
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTest.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTest.java
deleted file mode 100644
index fbdf9a05f7..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTest.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.atom;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import junit.framework.Assert;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.factory.Factory;
-import org.apache.abdera.model.Base;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.model.Feed;
-import org.apache.abdera.model.Document;
-import org.apache.abdera.model.Service;
-import org.apache.abdera.protocol.Response.ResponseType;
-import org.apache.abdera.protocol.client.AbderaClient;
-import org.apache.abdera.protocol.client.ClientResponse;
-import org.apache.abdera.protocol.client.RequestOptions;
-import org.apache.abdera.protocol.client.util.BaseRequestEntity;
-import org.apache.abdera.util.EntityTag;
-import org.apache.abdera.parser.Parser;
-
-/**
- * Tests use of server provided entry entity tags for Atom binding in Tuscany.
- * Tests conditional gets (e.g. get if-none-match) or conditional posts (post if-match)
- * using entity tags or last modified header entries.
- * Uses the SCA provided Provider composite to act as a server.
- * Uses the Abdera provided Client to act as a client.
- */
-public class ProviderEntryEntityTagsTest {
- public final static String providerURI = "http://localhost:8084/customer";
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
- protected static Abdera abdera;
- protected static AbderaClient client;
- protected static Parser abderaParser;
- protected static String eTag;
- protected static Date lastModified;
- protected static final SimpleDateFormat dateFormat = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss Z" ); // RFC 822 date time
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println(">>>ProviderEntryEntityTagsTest.init");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- abdera = new Abdera();
- client = new AbderaClient(abdera);
- abderaParser = Abdera.getNewParser();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println(">>>ProviderEntryEntityTagsTest.destroy");
- scaProviderDomain.close();
- }
-
- @Test
- public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull( client );
- }
-
- @Test
- public void testEmptyCachePost() throws Exception {
- // Pseudo-code
- // 1) Example HTTP POST request (new entry put, new etag response)
- // User client post request
- // POST /myblog/entries HTTP/1.1
- // Slug: First Post
- //
- // <?xml version="1.0" ?>
- // <entry xmlns="http://www.w3.org/2005/Atom">
- // <title>Atom-Powered Robots Run Amok</title>
- // <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- // <updated>2007-02-123T17:09:02Z</updated>
- // <author><name>Captain Lansing</name></author>
- // <content>It's something moving... solid metal</content>
- // </entry>
-
- // Expected Atom server response (note unique ETag)
- // HTTP/1.1 201 Created
- // Date: Fri, 23 Feb 2007 21:17:11 GMT
- // Content-Length: nnn
- // Content-Type: application/atom+xml;type=entry
- // Location: http://example.org/edit/first-post.atom
- // Content-Location: http://example.org/edit/first-post.atom
- // ETag: "e180ee84f0671b1"
- // Last-Modified: Fri, 25 Jul 2008 14:36:44 -0500
- //
- // <?xml version="1.0" ?>
- // <entry xmlns="http://www.w3.org/2005/Atom">
- // <title>Atom-Powered Robots Run Amok</title>
- // <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- // <updated>2007-02-123T17:09:02Z</updated>
- // <author><name>Captain Lansing</name></author>
- // <content>It's something moving... solid metal</content>
- // </entry>
-
- // Testing of entry creation
- Factory factory = abdera.getFactory();
- String customerName = "Fred Farkle";
- Entry entry = factory.newEntry();
- entry.setTitle("customer " + customerName);
- entry.setUpdated(new Date());
- entry.addAuthor("Apache Tuscany");
- // ID created by collection.
- // entry.setId(id); // auto-provided
- // entry.addLink("" + id, "edit"); // auto-provided
- // entry.addLink("" + id, "alternate"); // auto-provided
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(customerName);
- entry.setContentElement(content);
-
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml; type=entry";
- opts.setContentType(contentType);
- // AtomTestCaseUtils.printRequestHeaders( "Post request headers", " ", opts );
- IRI colUri = new IRI(providerURI).resolve("customer");
- // res = client.post(colUri.toString() + "?test=foo", entry, opts);
- ClientResponse res = client.post(colUri.toString(), entry, opts);
-
- // Assert response status code is 201-OK.
- // Assert response header Content-Type: application/atom+xml; charset=UTF-8
- // Assert response header Location: http://example.org/edit/first-post.atom
- // Assert response header Content-Location: http://example.org/edit/first-post.atom
- // Assert response header ETag: "e180ee84f0671b1"
- // Assert response header Last-Modified: Fri, 25 Jul 2008 14:36:44 -0500
- // Assert collection size is 1.
- Assert.assertEquals(201, res.getStatus());
- Assert.assertEquals(contentType, res.getContentType().toString().trim());
- // Assert.assertNotNull( res.getLocation().toString() );
- // Assert.assertEquals( "", res.getContentLocation().toString() );
- // Save eTag for subsequent tests;
- eTag = res.getHeader( "ETag" );
- Assert.assertNotNull( eTag );
- lastModified = res.getLastModified();
- Assert.assertNotNull(lastModified);
- }
-
- @Test
- public void testDirtyCachePut() throws Exception {
- // 2) Conditional PUT request (post with etag. entry provided is stale)
- // User client PUT request
- // PUT /edit/first-post.atom HTTP/1.1
- // > If-Match: "e180ee84f0671b1"
- //
- // <?xml version="1.0" ?>
- // <entry xmlns="http://www.w3.org/2005/Atom">
- // <title>Atom-Powered Robots Run Amok</title>
- // <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- // <updated>2007-02-24T16:34:06Z</updated>
- // <author><name>Captain Lansing</name></author>
- // <content>Update: it's a hoax!</content>
- // </entry>
- // Testing of entry creation
- Factory factory = abdera.getFactory();
- String customerName = "Molly Ringwald";
- Entry entry = factory.newEntry();
- entry.setTitle("customer " + customerName);
- entry.setUpdated( new Date());
- entry.addAuthor("Apache Tuscany");
- String id = eTag.substring( 1, eTag.length()-1);
- entry.setId(id); // auto-provided
- // entry.addLink("" + id, "edit"); // auto-provided
- // entry.addLink("" + id, "alternate"); // auto-provided
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(customerName);
- entry.setContentElement(content);
-
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml; type=entry";
- opts.setContentType(contentType);
- opts.setHeader( "If-None-Match", eTag);
-
- AtomTestCaseUtils.printRequestHeaders( "Put request headers", " ", opts );
- IRI colUri = new IRI(providerURI).resolve("customer");
- // res = client.post(colUri.toString() + "?test=foo", entry, opts);
- id = eTag.substring( 1, eTag.length()-1);
- // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
- // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
- ClientResponse res = client.put(colUri.toString() + "/" + id, new BaseRequestEntity( entry ), opts);
- // Expected Atom server response (item was edited by another user)
- // > HTTP/1.1 412 Precondition Failed
- // Date: Sat, 24 Feb 2007 16:34:11 GMT
-
- // If-Match Assert response status code is 412. Precondition failed.
- // If-None-Match Assert response status code is 200. OK
- Assert.assertEquals(200, res.getStatus());
- // Put provides null body and no etags.
- res.release();
- }
-
- @Test
- public void testETagMissGet() throws Exception {
- // 4) Conditional GET example (get with etag. etag not in cache)
- // User client GET request
- // GET /edit/first-post.atom HTTP/1.1
- // > If-None-Match: "e180ee84f0671b1"
-
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml; type=entry";
- opts.setContentType(contentType);
- opts.setHeader( "If-None-Match", "123456");
- opts.setHeader( "Pragma", "no-cache"); // turn off client caching
-
- IRI colUri = new IRI(providerURI).resolve("customer");
- // res = client.post(colUri.toString() + "?test=foo", entry, opts);
- String id = eTag.substring( 1, eTag.length()-1);
- // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
- // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
- ClientResponse res = client.get(colUri.toString() + "/" + id, opts);
- // Expected Atom server response (item was edited by another user)
- // > HTTP/1.1 412 Precondition Failed
- // Date: Sat, 24 Feb 2007 16:34:11 GMT
-
- // Atom server response (item was up to date)
- // > HTTP/1.1 200 OK
- // Date: Sat, 24 Feb 2007 13:17:11 GMT
- // > ETag: "bb4f5e86e92ddb8549604a0df0763581"
- // > Last-Modified: Mon, 28 Jul 2008 10:25:37 -0500
-
- // Assert response status code is 200 OK.
- // Assert header Content-Type: application/atom+xml;type=entry
- // Assert header Location: http://example.org/edit/first-post.atom
- // Assert header Content-Location: http://example.org/edit/first-post.atom
- // Assert header ETag: "555555" (etag response != etag request)
- // Assert header Last-Modified: Fri, 25 Jul 2008 14:36:44 -0500
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(contentType, res.getContentType().toString().trim());
- // Assert.assertNotNull( res.getLocation().toString() );
- // Assert.assertEquals( "", res.getContentLocation().toString() );
- Assert.assertNotNull( res.getHeader( "ETag" ) );
- lastModified = res.getLastModified();
- Assert.assertNotNull(lastModified);
- res.release();
- }
-
- @Test
- public void testETagHitGet() throws Exception {
- // 3) Conditional GET example (get with etag. etag match)
- // User client GET request
- // GET /edit/first-post.atom HTTP/1.1
- // > If-None-Match: "e180ee84f0671b1"
-
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml; type=entry";
- opts.setContentType(contentType);
- opts.setHeader( "If-None-Match", eTag);
- opts.setHeader( "Pragma", "no-cache"); // turn off client caching
-
- IRI colUri = new IRI(providerURI).resolve("customer");
- // res = client.post(colUri.toString() + "?test=foo", entry, opts);
- String id = eTag.substring( 1, eTag.length()-1);
- // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
- // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
- ClientResponse res = client.get(colUri.toString() + "/" + id, opts);
- // Atom server response (item was up to date)
- // > HTTP/1.1 304 Not Modified
- // Date: Sat, 24 Feb 2007 13:17:11 GMT
-
- // Assert response status code is 304 Not Modified.
- // Assert header ETag: "e180ee84f0671b1"
- // Assert header Last-Modified: Fri, 25 Jul 2008 14:36:44 -0500
- // Assert.assertEquals(304, res.getStatus());
- res.release();
- }
-
-
- @Test
- public void testUpToDateGet() throws Exception {
- // 3) Conditional GET example (get with If-Mod. entry is up to date)
- // User client GET request
- // GET /edit/first-post.atom HTTP/1.1
- // > If-Modified-Since: Sat, 29 Oct 2025 19:43:31 GMT
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml; type=entry";
- opts.setContentType(contentType);
- opts.setHeader( "If-Modified-Since", "Sat, 29 Oct 2025 19:43:31 GMT"); // "EEE, dd MMM yyyy HH:mm:ss Z // RFC 822 Date
- opts.setHeader( "Pragma", "no-cache"); // turn off client caching
-
- IRI colUri = new IRI(providerURI).resolve("customer");
- // res = client.post(colUri.toString() + "?test=foo", entry, opts);
- String id = eTag.substring( 1, eTag.length()-1);
- // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
- // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
- // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
- // ClientResponse res = client.get(colUri.toString() + "/" + id, opts);
- ClientResponse res = client.execute( "GET", colUri.toString(), (BaseRequestEntity)null, opts);
-
- // Atom server response (item was up to date)
- // > HTTP/1.1 304 Not Modified
- // Date: Sat, 24 Feb 2007 13:17:11 GMT
-
- // Assert response status code is 304 Not Modified.
- Assert.assertEquals(304, res.getStatus());
- res.release();
- }
-
- @Test
- public void testOutOfDateGet() throws Exception {
- // 4) Conditional GET example (get with If-Mod. entry is not to date)
- // User client GET request
- // GET /edit/first-post.atom HTTP/1.1
- // > If-Modified-Since: Sat, 29 Oct 1844 19:43:31 GMT
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml; type=entry";
- opts.setContentType(contentType);
- opts.setHeader( "If-Modified-Since", "Sat, 29 Oct 1844 19:43:31 GMT"); // "EEE, dd MMM yyyy HH:mm:ss Z // RFC 822 Date
- opts.setHeader( "Pragma", "no-cache"); // turn off client caching
-
- IRI colUri = new IRI(providerURI).resolve("customer");
- // res = client.post(colUri.toString() + "?test=foo", entry, opts);
- String id = eTag.substring( 1, eTag.length()-1);
- // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
- // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
- ClientResponse res = client.get(colUri.toString() + "/" + id, opts);
-
- // Atom server response (item was up to date)
- // > HTTP/1.1 200 OK
- // Date: Sat, 24 Feb 2007 13:17:11 GMT
- // > ETag: "bb4f5e86e92ddb8549604a0df0763581"
- // > Last-Modified: Mon, 28 Jul 2008 10:25:37 -0500
-
- // Assert response status code is 200 OK.
- // Assert header ETag: "e180ee84f0671b1"
- // Assert header Last-Modified: Greater than If-Mod
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(contentType, res.getContentType().toString().trim());
- // Assert.assertNotNull( res.getLocation().toString() );
- // Assert.assertEquals( "", res.getContentLocation().toString() );
- Assert.assertNotNull( res.getHeader( "ETag" ) );
- lastModified = res.getLastModified();
- Assert.assertNotNull(lastModified);
- res.release();
- }
-
- @Test
- public void testUpToDateUnModGet() throws Exception {
- // 3) Conditional GET example (get with If-Unmod. entry is up to date)
- // User client GET request
- // GET /edit/first-post.atom HTTP/1.1
- // > If-Unmodified-Since: Sat, 29 Oct 2025 19:43:31 GMT
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml; type=entry";
- opts.setContentType(contentType);
- opts.setHeader( "If-Unmodified-Since", "Sat, 29 Oct 2050 19:43:31 GMT" );
- opts.setHeader( "Pragma", "no-cache"); // turn off client caching
-
- IRI colUri = new IRI(providerURI).resolve("customer");
- // res = client.post(colUri.toString() + "?test=foo", entry, opts);
- String id = eTag.substring( 1, eTag.length()-1);
- // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
- // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
- ClientResponse res = client.get(colUri.toString() + "/" + id, opts);
-
- // Atom server response (item was up to date)
- // > HTTP/1.1 304 Not Modified
- // Date: Sat, 24 Feb 2007 13:17:11 GMT
-
- // Assert response status code is 304 Not Modified.
- // Assert.assertEquals(304, res.getStatus());
- // TODO Update when If-Unmodified-Since enabled.
- Assert.assertEquals(200, res.getStatus());
- res.release();
- }
-
- @Test
- public void testOutOfDateUnModGet() throws Exception {
- // 4) Conditional GET example (get with If-Unmod. entry is not to date)
- // User client GET request
- // GET /edit/first-post.atom HTTP/1.1
- // Host: example.org
- // > If-Unmodified-Since: Sat, 29 Oct 1844 19:43:31 GMT
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml; type=entry";
- opts.setContentType(contentType);
- opts.setHeader( "If-Unmodified-Since", "Sat, 29 Oct 1844 19:43:31 GMT" );
- opts.setHeader( "Pragma", "no-cache"); // turn off client caching
-
- IRI colUri = new IRI(providerURI).resolve("customer");
- // res = client.post(colUri.toString() + "?test=foo", entry, opts);
- String id = eTag.substring( 1, eTag.length()-1);
- // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
- // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
- ClientResponse res = client.get(colUri.toString() + "/" + id, opts);
-
- // Atom server response (item was up to date)
- // > HTTP/1.1 200 OK
- // Date: Sat, 24 Feb 2007 13:17:11 GMT
- // > ETag: "bb4f5e86e92ddb8549604a0df0763581"
- // > Last-Modified: Mon, 28 Jul 2008 10:25:37 -0500
-
- // Assert response status code is 200 OK.
- // Assert header Content-Type: application/atom+xml;type=entry
- // Assert header Location: http://example.org/edit/first-post.atom
- // Assert header Content-Location: http://example.org/edit/first-post.atom
- // Assert header ETag: "e180ee84f0671b1"
- // Assert header Last-Modified: Less than If-Unmod
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(contentType, res.getContentType().toString().trim());
- // Assert.assertNotNull( res.getLocation().toString() );
- // Assert.assertEquals( "", res.getContentLocation().toString() );
- Assert.assertNotNull( res.getHeader( "ETag" ) );
- lastModified = res.getLastModified();
- Assert.assertNotNull(lastModified);
- res.release();
- }
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTest.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTest.java
deleted file mode 100644
index faa7d414f5..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTest.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.atom;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import junit.framework.Assert;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.factory.Factory;
-import org.apache.abdera.model.Base;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.model.Feed;
-import org.apache.abdera.model.Document;
-import org.apache.abdera.model.Service;
-import org.apache.abdera.model.Collection;
-import org.apache.abdera.protocol.Response.ResponseType;
-import org.apache.abdera.protocol.client.AbderaClient;
-import org.apache.abdera.protocol.client.ClientResponse;
-import org.apache.abdera.protocol.client.RequestOptions;
-import org.apache.abdera.protocol.client.util.BaseRequestEntity;
-import org.apache.abdera.util.EntityTag;
-import org.apache.abdera.parser.Parser;
-
-/**
- * Tests use of server provided feed entity tags for Atom binding in Tuscany.
- * Tests conditional gets (e.g. get if-none-match) or conditional posts (post if-match)
- * using entity tags and last modified entries in headers.
- * Uses the SCA provided Provider composite to act as a server.
- * Uses the Abdera provided Client to act as a client.
- */
-public class ProviderFeedEntityTagsTest {
- public final static String providerURI = "http://localhost:8084/customer";
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
- protected static Abdera abdera;
- protected static AbderaClient client;
- protected static Parser abderaParser;
- protected static String eTag;
- protected static Date lastModified;
- protected static final SimpleDateFormat dateFormat = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss Z" ); // RFC 822 date time
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.init");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- abdera = new Abdera();
- client = new AbderaClient(abdera);
- abderaParser = Abdera.getNewParser();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.destroy");
- scaProviderDomain.close();
- }
-
- @Test
- public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull( client );
- }
-
- @Test
- public void testFeedBasics() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.testFeedBasics");
- // Normal feed request
- ClientResponse res = client.get(providerURI);
- Assert.assertNotNull(res);
- try {
- // Asser feed provided since no predicates
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(ResponseType.SUCCESS, res.getType());
- // AtomTestCaseUtils.printResponseHeaders( "Feed response headers:", " ", res );
- // System.out.println("Feed response content:");
- // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
-
- // Perform other tests on feed.
- Document<Feed> doc = res.getDocument();
- Assert.assertNotNull( doc );
- Feed feed = doc.getRoot();
- Assert.assertNotNull( feed );
- printFeed( "Feed values", " ", feed );
- // RFC 4287 requires non-null id, title, updated elements
- Assert.assertNotNull( feed.getId() );
- Assert.assertNotNull( feed.getTitle() );
- Assert.assertNotNull( feed.getUpdated() );
-
- eTag = res.getHeader("ETag");
- Assert.assertNotNull( eTag );
- lastModified = res.getLastModified();
- Assert.assertNotNull( lastModified );
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testUnmodifiedGetIfMatch() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.testFeedUnmodifiedGetIfMatch");
- // Feed request with predicates
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml";
- opts.setContentType(contentType);
- opts.setHeader( "If-Match", eTag);
-
- ClientResponse res = client.get(providerURI, opts);
- Assert.assertNotNull(res);
- try {
- String thisETag = res.getHeader("ETag");
- Assert.assertNotNull( thisETag );
- Date thisLastModified = res.getLastModified();
- Assert.assertNotNull( thisLastModified );
-
- // Should return 200 - Feed provided since it matches etag.
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(ResponseType.SUCCESS, res.getType());
- // AtomTestCaseUtils.printResponseHeaders( "Feed response headers:", " ", res );
- // System.out.println("Feed response content:");
- // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testUnmodifiedGetIfNoneMatch() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.testFeedUnmodifiedGetIfNoneMatch");
- // Feed request with predicates
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml";
- opts.setContentType(contentType);
- opts.setHeader( "If-None-Match", eTag);
-
- ClientResponse res = client.get(providerURI, opts);
- Assert.assertNotNull(res);
- try {
- // Should return 304 - Feed not provided since it matches ETag.
- Assert.assertEquals(304, res.getStatus());
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testUnmodifiedGetIfUnModified() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.testFeedUnmodifiedGetIfUnModified");
- // Feed request with predicates
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml";
- opts.setContentType(contentType);
- opts.setHeader( "If-Unmodified-Since", dateFormat.format( new Date() ));
-
- ClientResponse res = client.get(providerURI, opts);
- Assert.assertNotNull(res);
- try {
- // Should return 304 - Feed not provided since feed is modified since.
- Assert.assertEquals(304, res.getStatus());
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testUnmodifiedGetIfModified() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.testFeedUnmodifiedGetIfModified");
- // Feed request with predicates
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml";
- opts.setContentType(contentType);
- opts.setHeader( "If-Modified-Since", dateFormat.format( new Date( 0 ) ));
-
- ClientResponse res = client.get(providerURI, opts);
- Assert.assertNotNull(res);
- try {
- // Should return 200 - Feed provided since feed is changed.
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(ResponseType.SUCCESS, res.getType());
-
- String thisETag = res.getHeader("ETag");
- Assert.assertNotNull( thisETag );
- Date thisLastModified = res.getLastModified();
- Assert.assertNotNull( thisLastModified );
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testModifiedGetIfNoneMatch() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.testFeedModifiedGetIfNoneMatch");
- // Post some new content to the feed.
- Factory factory = abdera.getFactory();
- String customerName = "Fred Farkle";
- Entry entry = factory.newEntry();
- entry.setTitle("customer " + customerName);
- entry.setUpdated(new Date());
- entry.addAuthor("Apache Tuscany");
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(customerName);
- entry.setContentElement(content);
-
- RequestOptions opts = new RequestOptions();
- String contentType = "application/atom+xml; type=entry";
- opts.setContentType(contentType);
- IRI colUri = new IRI(providerURI).resolve("customer");
- ClientResponse res = client.post(colUri.toString(), entry, opts);
-
- // Feed request with predicates
- opts = new RequestOptions();
- contentType = "application/atom+xml";
- opts.setContentType(contentType);
- opts.setHeader( "If-None-Match", eTag);
-
- res = client.get(providerURI, opts);
- Assert.assertNotNull(res);
- try {
- String thisETag = res.getHeader("ETag");
- Assert.assertNotNull( thisETag );
- Date thisLastModified = res.getLastModified();
- Assert.assertNotNull( thisLastModified );
-
- // Should return 200 - value since feed is changed
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(ResponseType.SUCCESS, res.getType());
-
- // AtomTestCaseUtils.printResponseHeaders( "Feed modified if-none-match response headers:", " ", res );
- // System.out.println("Feed response content:");
- // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testModifiedGetIfMatch() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.testFeedModifiedGetIfMatch");
- // Feed request with predicates
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml";
- opts.setContentType(contentType);
- opts.setHeader( "If-Match", eTag);
-
- ClientResponse res = client.get(providerURI, opts);
- Assert.assertNotNull(res);
- try {
- // Should return 412 - Precondition failed since feed changed.
- Assert.assertEquals(412, res.getStatus());
- // AtomTestCaseUtils.printResponseHeaders( "Feed response headers:", " ", res );
- // System.out.println("Feed response content:");
- // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testModifiedGetIfUnModified() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.testFeedUnmodifiedGetIfUnModified");
- // Feed request with predicates
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml";
- opts.setContentType(contentType);
- opts.setHeader( "If-Unmodified-Since", dateFormat.format( new Date() ));
-
- ClientResponse res = client.get(providerURI, opts);
- Assert.assertNotNull(res);
- try {
- // Should return 304 - Feed not provided since feed is modified since.
- Assert.assertEquals(304, res.getStatus());
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testModifiedGetIfModified() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTest.testFeedUnmodifiedGetIfModified");
- // Feed request with predicates
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml";
- opts.setContentType(contentType);
- opts.setHeader( "If-Modified-Since", dateFormat.format( lastModified ));
-
- ClientResponse res = client.get(providerURI, opts);
- Assert.assertNotNull(res);
- try {
- // Should return 200 - Feed provided since feed is changed.
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(ResponseType.SUCCESS, res.getType());
-
- String thisETag = res.getHeader("ETag");
- Assert.assertNotNull( thisETag );
- Date thisLastModified = res.getLastModified();
- Assert.assertNotNull( thisLastModified );
- } finally {
- res.release();
- }
- }
-
-
- public static void printFeed( String title, String indent, Feed feed ) {
- if ( feed == null ) {
- System.out.println( title + " feed is null");
- return;
- }
-
- System.out.println( title );
- System.out.println( indent + "id=" + feed.getId() );
- System.out.println( indent + "title=" + feed.getTitle() );
- System.out.println( indent + "updated=" + feed.getUpdated() );
- System.out.println( indent + "author=" + feed.getAuthor() );
- Collection collection = feed.getCollection();
- if ( collection == null ) {
- System.out.println( indent + "collection=null" );
- } else {
- System.out.println( indent + "collection=" + collection );
- }
- // System.out.println( indent + "collection size=" + feed.getCollection() );
- // for (Collection collection : workspace.getCollections()) {
- // if (collection.getTitle().equals("customers")) {
- // String expected = uri + "customers";
- // String actual = collection.getResolvedHref().toString();
- // assertEquals(expected, actual);
- // }
- // }
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTest.java b/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTest.java
deleted file mode 100644
index 816be8b6e5..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTest.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.binding.atom;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-import junit.framework.Assert;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.factory.Factory;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.model.Feed;
-import org.apache.abdera.model.Document;
-import org.apache.abdera.model.Service;
-import org.apache.abdera.protocol.Response.ResponseType;
-import org.apache.abdera.protocol.client.AbderaClient;
-import org.apache.abdera.protocol.client.ClientResponse;
-import org.apache.abdera.protocol.client.RequestOptions;
-import org.apache.abdera.parser.Parser;
-
-/**
- * Tests use of service documents provided by atom binding based collections.
- * Uses the SCA provided Provider composite to act as a server.
- * Uses the Abdera provided Client to act as a client.
- */
-public class ProviderServiceDocumentTest {
- public final static String providerURI = "http://localhost:8084/customer";
- protected static SCADomain scaProviderDomain;
- protected static SCADomain scaConsumerDomain;
- protected static CustomerClient testService;
- protected static Abdera abdera;
- protected static AbderaClient client;
- protected static Parser abderaParser;
-
- @BeforeClass
- public static void init() throws Exception {
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
- abdera = new Abdera();
- client = new AbderaClient(abdera);
- abderaParser = Abdera.getNewParser();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- scaProviderDomain.close();
- }
-
- @Test
- public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull( client );
- }
-
- @Test
- public void testFeedBasics() throws Exception {
- // Normal feed request
- ClientResponse res = client.get(providerURI);
- Assert.assertNotNull(res);
- try {
- // Assert feed provided since no predicates
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(ResponseType.SUCCESS, res.getType());
- // AtomTestCaseUtils.printResponseHeaders( "Feed response headers:", " ", res );
- // System.out.println("Feed response content:");
- // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
-
- // Perform other tests on feed.
- Document<Feed> doc = res.getDocument();
- Assert.assertNotNull( doc );
- Feed feed = doc.getRoot();
- Assert.assertNotNull( feed );
- // printFeed( "Feed values", " ", feed );
- // RFC 4287 requires non-null id, title, updated elements
- Assert.assertNotNull( feed.getId() );
- Assert.assertNotNull( feed.getTitle() );
- Assert.assertNotNull( feed.getUpdated() );
- } finally {
- res.release();
- }
- }
-
- @Test
- public void testServiceDocumentGet() throws Exception {
- Collection resourceCollection = testService.getCustomerCollection();
- Assert.assertNotNull(resourceCollection);
-
- Entry postEntry = postEntry("Sponge Bob");
- Entry newEntry = resourceCollection.post(postEntry);
- postEntry = postEntry("Austin Powers");
- newEntry = resourceCollection.post(postEntry);
- postEntry = postEntry("Count Dracula");
- newEntry = resourceCollection.post(postEntry);
-
- // Service document
- ClientResponse res = client.get(providerURI + "/atomsvc");
- Assert.assertNotNull(res);
- try {
- // Asser feed provided since no predicates
- Assert.assertEquals(200, res.getStatus());
- Assert.assertEquals(ResponseType.SUCCESS, res.getType());
-
- // Perform other tests on feed.
- // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
- Document<Service> serviceDoc = res.getDocument();
- Service service = serviceDoc.getRoot();
- Assert.assertNotNull( service );
- org.apache.abdera.model.Collection collection = service.getCollection( "workspace", "customers" );
- String title = collection.getTitle();
- Assert.assertEquals("customers", title);
- String href = collection.getHref().toString();
- Assert.assertTrue( href.contains( "customer") );
- } finally {
- res.release();
- }
- }
-
- public static void printFeed( String title, String indent, Feed feed ) {
- if ( feed == null ) {
- System.out.println( title + " feed is null");
- return;
- }
-
- System.out.println( title );
- System.out.println( indent + "id=" + feed.getId() );
- System.out.println( indent + "title=" + feed.getTitle() );
- System.out.println( indent + "updated=" + feed.getUpdated() );
- System.out.println( indent + "author=" + feed.getAuthor() );
- // Collection collection = feed.getCollection();
- // if ( collection == null ) {
- // System.out.println( indent + "collection=null" );
- // } else {
- // System.out.println( indent + "collection=" + collection );
- // }
- // System.out.println( indent + "collection size=" + feed.getCollection() );
- // for (Collection collection : workspace.getCollections()) {
- // if (collection.getTitle().equals("customers")) {
- // String expected = uri + "customers";
- // String actual = collection.getResolvedHref().toString();
- // assertEquals(expected, actual);
- // }
- // }
-
- }
-
- private Entry postEntry(String value) {
- Entry entry = abdera.newEntry();
- entry.setTitle("customer " + value);
-
- Content content = abdera.getFactory().newContent();
- content.setContentType(Content.Type.TEXT);
- content.setValue(value);
- entry.setContentElement(content);
-
- return entry;
- }
-}
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite b/branches/sca-android/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite
deleted file mode 100644
index a2c50f872e..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://customer"
- name="Consumer">
-
- <component name="CustomerClient">
- <implementation.java class="org.apache.tuscany.sca.binding.atom.CustomerClientImpl"/>
- <reference name="customerCollection">
- <tuscany:binding.atom uri="http://localhost:8084/customer"/>
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Provider.composite b/branches/sca-android/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Provider.composite
deleted file mode 100644
index 60097ee0f7..0000000000
--- a/branches/sca-android/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Provider.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace = "http://customer"
- name="Provider">
-
- <service name="customer" promote="CustomerCollection">
- <tuscany:binding.atom uri = "http://localhost:8084/customer"/>
- </service>
-
- <component name="CustomerCollection">
- <implementation.java class="org.apache.tuscany.sca.binding.atom.CustomerCollectionImpl"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-atom/LICENSE b/branches/sca-android/modules/binding-atom/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/binding-atom/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-atom/META-INF/README b/branches/sca-android/modules/binding-atom/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-atom/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-atom/NOTICE b/branches/sca-android/modules/binding-atom/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/binding-atom/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/branches/sca-android/modules/binding-atom/pom.xml b/branches/sca-android/modules/binding-atom/pom.xml
deleted file mode 100644
index 388f203e1d..0000000000
--- a/branches/sca-android/modules/binding-atom/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-atom</artifactId>
- <name>Apache Tuscany SCA Atom Feed Binding Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.atom</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.atom*</Export-Package>
- <Import-Package>org.apache.tuscany.sca.assembly.xml;version="1.4", *</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/AtomBinding.java b/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/AtomBinding.java
deleted file mode 100644
index 807d6a8971..0000000000
--- a/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/AtomBinding.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.atom;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-/**
- * Atom binding model.
- *
- * @version $Rev$ $Date$
- */
-public interface AtomBinding extends Binding {
-
- /**
- * Returns the title of the Atom collection.
- * @return
- */
- String getTitle();
-
- /**
- * Sets the title of the Atom collection.
- * @param title
- */
- void setTitle(String title);
-
-}
diff --git a/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/AtomBindingFactory.java b/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/AtomBindingFactory.java
deleted file mode 100644
index 6e5623e1a2..0000000000
--- a/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/AtomBindingFactory.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.atom;
-
-/**
- * Factory for the Atom binding
- *
- * @version $Rev$ $Date$
- */
-public interface AtomBindingFactory {
-
- /**
- * Creates a new Atom binding.
- * @return the new Atom binding
- */
- AtomBinding createAtomBinding();
-
-}
diff --git a/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingFactoryImpl.java b/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingFactoryImpl.java
deleted file mode 100644
index ea06625d34..0000000000
--- a/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingFactoryImpl.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.atom.impl;
-
-import org.apache.tuscany.sca.binding.atom.AtomBinding;
-import org.apache.tuscany.sca.binding.atom.AtomBindingFactory;
-
-/**
- * Factory for the Atom binding model.
- *
- * @version $Rev$ $Date$
- */
-public class AtomBindingFactoryImpl implements AtomBindingFactory {
-
- public AtomBinding createAtomBinding() {
- return new AtomBindingImpl();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java b/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java
deleted file mode 100644
index 8b0b9451fb..0000000000
--- a/branches/sca-android/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.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.binding.atom.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.OptimizableBinding;
-import org.apache.tuscany.sca.binding.atom.AtomBinding;
-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;
-
-/**
- * Implementation of the Atom Feed binding model.
- *
- * @version $Rev$ $Date$
- */
-class AtomBindingImpl implements AtomBinding, PolicySetAttachPoint {
-
- private String name;
- private String uri;
- private String title;
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private IntentAttachPointType intentAttachPointType;
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- 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 String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public boolean isUnresolved() {
- // The binding is always resolved
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- // The binding is always resolved
- }
-
- 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 void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-}
diff --git a/branches/sca-android/modules/binding-atom/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.atom.AtomBindingFactory b/branches/sca-android/modules/binding-atom/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.atom.AtomBindingFactory
deleted file mode 100644
index a8117db8f3..0000000000
--- a/branches/sca-android/modules/binding-atom/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.atom.AtomBindingFactory
+++ /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.atom.impl.AtomBindingFactoryImpl \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-atom/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/binding-atom/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 52e0e916f5..0000000000
--- a/branches/sca-android/modules/binding-atom/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.atom,model=org.apache.tuscany.sca.binding.atom.AtomBinding,factory=org.apache.tuscany.sca.binding.atom.AtomBindingFactory \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.java b/branches/sca-android/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.java
deleted file mode 100644
index 63dffd5522..0000000000
--- a/branches/sca-android/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.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.atom;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.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.UtilityExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorFactoryImpl;
-
-/**
- * @version $Rev$ $Date$
- */
-public class AtomBindingProcessorTestCase extends TestCase {
-
- private static final String COMPOSITE =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://binding-atom\" name=\"binding-atom\">"
- + " <component name=\"HelloWorldComponent\">"
- + " <implementation.java class=\"services.HelloWorld\"/>"
- + " <service name=\"HelloWorldService\">"
- + " <tuscany:binding.atom uri=\"http://localhost:8080/feed\" title=\"Feed Title\"/>"
- + " </service>"
- + " </component>"
- + "</composite>";
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private Monitor monitor;
-
- @Override
- protected void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();
- if (monitorFactory != null) {
- monitor = monitorFactory.createMonitor();
- utilities.addUtility(monitorFactory);
- }
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, monitor);
- }
-
- /**
- * Test parsing valid composite definition. Valid composite populated with correct values expected.
- * @throws Exception
- */
- public void testLoadValidComposite() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE));
-
- Composite composite = (Composite)staxProcessor.read(reader);
- AtomBinding binding = (AtomBinding) composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
-
- assertNotNull(binding);
- assertEquals("Feed Title", binding.getTitle());
- assertEquals("http://localhost:8080/feed", binding.getURI());
- }
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/LICENSE b/branches/sca-android/modules/binding-corba-runtime/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/binding-corba-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/branches/sca-android/modules/binding-corba-runtime/META-INF/README b/branches/sca-android/modules/binding-corba-runtime/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-corba-runtime/NOTICE b/branches/sca-android/modules/binding-corba-runtime/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/binding-corba-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/branches/sca-android/modules/binding-corba-runtime/pom.xml b/branches/sca-android/modules/binding-corba-runtime/pom.xml
deleted file mode 100644
index 69321c9345..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/pom.xml
+++ /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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-corba-runtime</artifactId>
- <name>Apache Tuscany SCA CORBA Binding Runtime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-corba</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba-jse</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- <version>2.1_3</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <!-- Unfortunately the idlj maven plugin only works with SUN JDK -->
- <!--
- <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/idl-source</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>idlj-maven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <debug>true</debug>
- <compiler>idlj</compiler>
- <sources>
- <source>
- <includes>
- <include>tester.idl</include>
- </includes>
- <emitStubs>true</emitStubs>
- <emitSkeletons>true</emitSkeletons>
- </source>
- </sources>
- <sourceDirectory>${basedir}/src/test/resources</sourceDirectory>
- <outputDirectory>${project.build.directory}/idl-source</outputDirectory>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>com.sun</groupId>
- <artifactId>tools</artifactId>
- <version>1.5.0</version>
- <scope>system</scope>
- <systemPath>${java.home}/../lib/tools.jar</systemPath>
- </dependency>
- </dependencies>
- </plugin>
- -->
-
- <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.corba</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.corba*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProviderFactory.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProviderFactory.java
deleted file mode 100644
index 99c9d7736e..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProviderFactory.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.corba.impl;
-
-import org.apache.tuscany.sca.binding.corba.CorbaBinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.corba.CorbaHostExtensionPoint;
-import org.apache.tuscany.sca.host.corba.ExtensibleCorbaHost;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CorbaBindingProviderFactory implements BindingProviderFactory<CorbaBinding> {
-
- private CorbaHostExtensionPoint chep;
- private ExtensibleCorbaHost host;
-
- public CorbaBindingProviderFactory(ExtensionPointRegistry registry) {
- chep = registry.getExtensionPoint(CorbaHostExtensionPoint.class);
- host = new ExtensibleCorbaHost(chep);
- }
- /**
- * @see org.apache.tuscany.sca.provider.BindingProviderFactory#createReferenceBindingProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentReference, org.apache.tuscany.sca.assembly.Binding)
- */
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- CorbaBinding binding) {
- return new CorbaReferenceBindingProvider(binding, host, reference);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.BindingProviderFactory#createServiceBindingProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentService, org.apache.tuscany.sca.assembly.Binding)
- */
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- CorbaBinding binding) {
- return new CorbaServiceBindingProvider(binding, host, service);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class<CorbaBinding> getModelType() {
- return CorbaBinding.class;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaInvoker.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaInvoker.java
deleted file mode 100644
index 1577184b48..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaInvoker.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.corba.impl;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
-import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaRequest;
-import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaResponse;
-import org.apache.tuscany.sca.binding.corba.impl.util.OperationMapper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.omg.CORBA.Object;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CorbaInvoker implements Invoker {
-
- private Object remoteObject;
- private Class<?> referenceClass;
- private Map<Method, String> operationsMap;
- private Map<Operation, Method> operationMethodMapping;
-
- public CorbaInvoker(RuntimeComponentReference reference, Object remoteObject, Class<?> referenceClass, Map<Method, String> operationsMap) {
- this.remoteObject = remoteObject;
- this.referenceClass = referenceClass;
- this.operationsMap = operationsMap;
- this.operationMethodMapping = OperationMapper.mapOperationToMethod(reference.getInterfaceContract().getInterface().getOperations(), referenceClass);
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Invoker#invoke(org.apache.tuscany.sca.invocation.Message)
- */
- public Message invoke(Message msg) {
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(remoteObject, msg.getOperation().getName());
- request.setReferenceClass(referenceClass);
- request.setOperationsMap(operationsMap);
- if (msg.getOperation().getOutputType() != null) {
- Annotation[] notes = operationMethodMapping.get(msg.getOperation()).getAnnotations();
- request.setOutputType(msg.getOperation().getOutputType().getPhysical(), notes);
- }
- java.lang.Object[] args = msg.getBody();
- if (args != null) {
- Annotation[][] notes = operationMethodMapping.get(msg.getOperation()).getParameterAnnotations();
- for (int i = 0; i < args.length; i++) {
- request.addArgument(args[i], notes[i]);
- }
- }
- if (msg.getOperation().getFaultTypes() != null) {
- for (DataType<?> type : msg.getOperation().getFaultTypes()) {
- request.addExceptionType(type.getPhysical());
- }
- }
- DynaCorbaResponse response = request.invoke();
- msg.setBody(response.getContent());
- } catch (RequestConfigurationException e) {
- throw new ServiceRuntimeException(e);
- } catch (Exception e) {
- msg.setFaultBody(e);
- }
- return msg;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaReferenceBindingProvider.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaReferenceBindingProvider.java
deleted file mode 100644
index 43bf984440..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaReferenceBindingProvider.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.impl;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.binding.corba.CorbaBinding;
-import org.apache.tuscany.sca.binding.corba.impl.util.OperationMapper;
-import org.apache.tuscany.sca.host.corba.CorbaHost;
-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.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.omg.CORBA.Object;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CorbaReferenceBindingProvider implements ReferenceBindingProvider {
-
- private static final Logger logger = Logger.getLogger(CorbaReferenceBindingProvider.class.getName());
- private CorbaBinding binding;
- private CorbaHost host;
- private RuntimeComponentReference reference;
- private Object remoteObject;
- private Class<?> referenceClass;
- private Map<Method, String> operationsMap = null;
-
- public CorbaReferenceBindingProvider(CorbaBinding binding, CorbaHost host, RuntimeComponentReference reference) {
- this.binding = binding;
- this.host = host;
- this.reference = reference;
- this.referenceClass = ((JavaInterface)reference.getInterfaceContract().getInterface()).getJavaClass();
- operationsMap = OperationMapper.mapMethodToOperationName(referenceClass);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ReferenceBindingProvider#createInvoker(org.apache.tuscany.sca.interfacedef.Operation)
- */
- public Invoker createInvoker(Operation operation) {
- try {
- if (remoteObject == null) {
- remoteObject = host.lookup(binding.getCorbaname());
- }
- return new CorbaInvoker(reference, remoteObject, referenceClass, operationsMap);
- } catch (Exception e) {
- logger.log(Level.WARNING, "Exception during creating CORBA invoker", e);
- }
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ReferenceBindingProvider#getBindingInterfaceContract()
- */
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ReferenceBindingProvider#start()
- */
- public void start() {
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ReferenceBindingProvider#stop()
- */
- public void stop() {
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ReferenceBindingProvider#supportsOneWayInvocation()
- */
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java
deleted file mode 100644
index 0465dbe7e9..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.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.binding.corba.impl;
-
-import org.apache.tuscany.sca.binding.corba.CorbaBinding;
-import org.apache.tuscany.sca.binding.corba.impl.service.ComponentInvocationProxy;
-import org.apache.tuscany.sca.binding.corba.impl.service.DynaCorbaServant;
-import org.apache.tuscany.sca.binding.corba.impl.service.InvocationProxy;
-import org.apache.tuscany.sca.binding.corba.impl.types.util.Utils;
-import org.apache.tuscany.sca.host.corba.CorbaHost;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CorbaServiceBindingProvider implements ServiceBindingProvider {
-
- private CorbaBinding binding;
- private CorbaHost host;
- private RuntimeComponentService service;
- private DynaCorbaServant servant;
-
- public CorbaServiceBindingProvider(CorbaBinding binding, CorbaHost host, RuntimeComponentService service) {
- this.binding = binding;
- this.host = host;
- this.service = service;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ServiceBindingProvider#getBindingInterfaceContract()
- */
- public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ServiceBindingProvider#start()
- */
- public void start() {
- try {
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(binding), javaClass);
- servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- servant.setIds(new String[] {binding.getId()});
- host.registerServant(binding.getCorbaname(), servant);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
-
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ServiceBindingProvider#stop()
- */
- public void stop() {
- try {
- host.unregisterServant(binding.getCorbaname());
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
-
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ServiceBindingProvider#supportsOneWayInvocation()
- */
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/exceptions/CorbaException.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/exceptions/CorbaException.java
deleted file mode 100644
index 6e54556a2c..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/exceptions/CorbaException.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.corba.impl.exceptions;
-
-/**
- * @version $Rev$ $Date$
- * Represents CORBA SystemException
- */
-public class CorbaException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- public CorbaException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/exceptions/RequestConfigurationException.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/exceptions/RequestConfigurationException.java
deleted file mode 100644
index 9a11d205f2..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/exceptions/RequestConfigurationException.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.corba.impl.exceptions;
-
-/**
- * @version $Rev$ $Date$
- */
-public class RequestConfigurationException extends Exception {
-
- private static final long serialVersionUID = 1L;
- private String objectId;
-
- public RequestConfigurationException(String message, String objectId) {
- super(message + ", object id was: " + objectId);
- this.objectId = objectId;
- }
-
- public RequestConfigurationException(String message) {
- super(message);
- }
-
- public String getType() {
- return objectId;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/DynaCorbaRequest.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/DynaCorbaRequest.java
deleted file mode 100644
index 3936bed9f6..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/DynaCorbaRequest.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.binding.corba.impl.reference;
-
-import java.lang.annotation.Annotation;
-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.binding.corba.impl.exceptions.CorbaException;
-import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTree;
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeCreator;
-import org.apache.tuscany.sca.binding.corba.impl.types.util.TypeHelpersProxy;
-import org.apache.tuscany.sca.binding.corba.impl.types.util.Utils;
-import org.apache.tuscany.sca.binding.corba.impl.util.MethodFinder;
-import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.BAD_PARAM;
-import org.omg.CORBA.Object;
-import org.omg.CORBA.SystemException;
-import org.omg.CORBA.portable.ApplicationException;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.ObjectImpl;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$ Represents single CORBA request
- */
-public class DynaCorbaRequest {
-
- private TypeTree returnTree;
- private Map<String, TypeTree> exceptions = new HashMap<String, TypeTree>();
- private InputStream inputStream;
- private ObjectImpl remoteObject;
- private String operation;
- private List<java.lang.Object> arguments = new ArrayList<java.lang.Object>();
- private List<TypeTree> argumentsTypes = new ArrayList<TypeTree>();
- private Class<?> referenceClass;
- private Map<Method, String> operationsMap;
-
- /**
- * Creates request.
- *
- * @param ObjectremoteObject remote object reference
- * @param operation operation to invoke
- * @param scaBindingRules apply SCA default binding mapping rules
- */
- public DynaCorbaRequest(Object remoteObject, String operation) {
- this.remoteObject = (ObjectImpl)remoteObject;
- this.operation = operation;
- }
-
- /**
- * Sets class which will be backed by this reference request
- * @param referenceClass
- */
- public void setReferenceClass(Class<?> referenceClass) {
- this.referenceClass = referenceClass;
- }
-
- /**
- * Sets method to operation names mapping
- * @param operationsMap
- */
- public void setOperationsMap(Map<Method, String> operationsMap) {
- this.operationsMap = operationsMap;
- }
-
- /**
- * Adds operation argument - stores arguments and caches its TypeTree. Annotations will be set to null by default.
- *
- * @param argument
- */
- public void addArgument(java.lang.Object argument) throws RequestConfigurationException {
- addArgument(argument, null);
- }
-
- /**
- * Adds operation argument - stores arguments and caches its TypeTree
- *
- * @param argument
- */
- public void addArgument(java.lang.Object argument, Annotation[] notes) throws RequestConfigurationException {
- TypeTree tree = TypeTreeCreator.createTypeTree(argument.getClass(), notes);
- argumentsTypes.add(tree);
- arguments.add(argument);
- }
-
- /**
- * Passing stored arguments to CORBA communication output stream
- *
- * @param outputStream
- * @throws RequestConfigurationException
- */
- private void passArguments(OutputStream outputStream) throws RequestConfigurationException {
- for (int i = 0; i < arguments.size(); i++) {
- TypeTree tree = argumentsTypes.get(i);
- TypeHelpersProxy.write(tree.getRootNode(), outputStream, arguments.get(i));
- }
- }
-
- /**
- * Sets return type for operation. Annotations will be set to null by default.
- *
- * @param forClass
- */
- public void setOutputType(Class<?> forClass) throws RequestConfigurationException {
- setOutputType(forClass, null);
- }
-
- /**
- * Sets return type for operation
- *
- * @param forClass
- */
- public void setOutputType(Class<?> forClass, Annotation[] notes) throws RequestConfigurationException {
- returnTree = TypeTreeCreator.createTypeTree(forClass, notes);
- }
-
- /**
- * Configures possible exceptions
- *
- * @param forClass
- */
- public void addExceptionType(Class<?> forClass) throws RequestConfigurationException {
- TypeTree tree = TypeTreeCreator.createTypeTree(forClass, null);
- String exceptionId = Utils.getTypeId(forClass);
- exceptions.put(exceptionId, tree);
- }
-
- /**
- * Handles application excpeition.
- *
- * @param ae occured exception
- * @throws Exception
- */
- private void handleApplicationException(ApplicationException ae) throws Exception {
- try {
- if (exceptions.size() == 0) {
- RequestConfigurationException exception =
- new RequestConfigurationException(
- "ApplicationException occured, but no exception type was specified.",
- ae.getId());
- throw exception;
- }
- InputStream is = ae.getInputStream();
- String exceptionId = is.read_string();
- TypeTree tree = exceptions.get(exceptionId);
- if (tree == null) {
- RequestConfigurationException exception =
- new RequestConfigurationException(
- "ApplicationException occured, but no such exception was defined",
- ae.getId());
- throw exception;
- } else {
- Exception ex = (Exception)TypeHelpersProxy.read(tree.getRootNode(), is);
- throw ex;
- }
- } catch (Exception e) {
- throw e;
- }
- }
-
- /**
- * Handles exceptions generated by CORBA API
- *
- * @param se
- */
- private void handleSystemException(SystemException se) throws Exception {
- if (se instanceof BAD_OPERATION) {
- throw new CorbaException("Bad operation name: " + operation, se);
- } else if (se instanceof BAD_PARAM) {
- throw new CorbaException("Bad parameter", se);
- } else {
- // TODO: handle more system exception types
- throw new CorbaException(se.getMessage(), se);
- }
- }
-
- /**
- * Gets operation name which is includes mapping rules
- * @return
- */
- private String getFinalOperationName() {
- String result = operation;
- if (referenceClass != null) {
- Class<?>[] argumentTypes = new Class<?>[arguments.size()];
- for (int i = 0; i < arguments.size(); i++) {
- argumentTypes[i] = arguments.get(i).getClass();
- }
- Method method = MethodFinder.findMethod(referenceClass, operation, argumentTypes);
- String newOperation = (String)operationsMap.get(method);
- if (newOperation != null) {
- result = newOperation;
- }
- }
- return result;
- }
-
- /**
- * Invokes previously configured request
- *
- * @return
- */
- public DynaCorbaResponse invoke() throws Exception {
- DynaCorbaResponse response = new DynaCorbaResponse();
- String finalOperationName = getFinalOperationName();
- OutputStream outputStream = ((ObjectImpl)remoteObject)._request(finalOperationName, true);
- passArguments(outputStream);
- try {
- inputStream = remoteObject._invoke(outputStream);
- if (inputStream != null && returnTree != null) {
- response.setContent(TypeHelpersProxy.read(returnTree.getRootNode(), inputStream));
- }
- } catch (ApplicationException ae) {
- handleApplicationException(ae);
- } catch (SystemException se) {
- handleSystemException(se);
- } catch (Exception e) {
- throw e;
- } finally {
- release();
- }
- return response;
- }
-
- /**
- * Releases request resources
- */
- private void release() {
- remoteObject._releaseReply(inputStream);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/DynaCorbaResponse.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/DynaCorbaResponse.java
deleted file mode 100644
index 25463a7a8a..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/DynaCorbaResponse.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.binding.corba.impl.reference;
-
-/**
- * @version $Rev$ $Date$
- * Holder for content returned from DynaCorbaRequest
- *
- */
-public class DynaCorbaResponse {
-
- private Object content;
-
- public Object getContent() {
- return content;
- }
-
- public void setContent(Object content) {
- this.content = content;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/InterfaceInstanceCreator.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/InterfaceInstanceCreator.java
deleted file mode 100644
index 514d7055a8..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/InterfaceInstanceCreator.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.corba.impl.reference;
-
-import java.lang.reflect.Method;
-
-import net.sf.cglib.proxy.Callback;
-import net.sf.cglib.proxy.CallbackFilter;
-import net.sf.cglib.proxy.Enhancer;
-import net.sf.cglib.proxy.MethodInterceptor;
-import net.sf.cglib.proxy.NoOp;
-
-import org.omg.CORBA.Object;
-
-/**
- * @version $Rev$ $Date$
- */
-public class InterfaceInstanceCreator {
-
- private static final CallbackFilter FILTER = new CallbackFilter() {
- public int accept(Method method) {
- return 1;
- }
- };
-
- /**
- * Dynamically creates instance of user defined interface. Instance is
- * enhanced by RemoteMethodInterceptor
- *
- * @param reference
- * CORBA reference
- * @param forClass
- * user defined interface
- * @return dynamic implementation instance
- */
- public static java.lang.Object createInstance(Object reference, Class<?> forClass) {
- java.lang.Object result = null;
- try {
- Enhancer enhancer = new Enhancer();
- enhancer.setInterfaces(new Class[] {forClass});
- enhancer.setCallbackFilter(FILTER);
- enhancer.setCallbackTypes(new Class[] {NoOp.class, MethodInterceptor.class});
- Class<?> newClass = enhancer.createClass();
- Enhancer.registerStaticCallbacks(newClass, new Callback[] {NoOp.INSTANCE,
- new InterfaceMethodInterceptor(reference, forClass)});
- result = newClass.newInstance();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return result;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/InterfaceMethodInterceptor.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/InterfaceMethodInterceptor.java
deleted file mode 100644
index 7fba091b41..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/reference/InterfaceMethodInterceptor.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.corba.impl.reference;
-
-import java.lang.reflect.Method;
-
-import net.sf.cglib.proxy.MethodInterceptor;
-import net.sf.cglib.proxy.MethodProxy;
-
-import org.omg.CORBA.Object;
-
-/**
- * @version $Rev$ $Date$
- * Interceptor for CORBA reference methods
- */
-public class InterfaceMethodInterceptor implements MethodInterceptor {
-
- private Object reference;
- private Class<?> javaClass;
-
- public InterfaceMethodInterceptor(Object reference, Class<?> javaClass) {
- this.reference = reference;
- this.javaClass = javaClass;
- }
-
- /**
- * Create and execute DynaCorbaRequest instance, basing on intercepted
- * method arguments, return types, exceptions
- */
- public java.lang.Object intercept(java.lang.Object object,
- Method method,
- java.lang.Object[] arguments,
- MethodProxy arg3) throws Throwable {
- DynaCorbaRequest request = new DynaCorbaRequest(reference, method.getName());
- request.setReferenceClass(javaClass);
- for (int i = 0; i < arguments.length; i++) {
- request.addArgument(arguments[i]);
- }
- request.setOutputType(method.getReturnType());
- Class<?>[] exceptions = method.getExceptionTypes();
- for (int i = 0; i < exceptions.length; i++) {
- request.addExceptionType(exceptions[i]);
- }
- DynaCorbaResponse response = request.invoke();
- return response.getContent();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/ComponentInvocationProxy.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/ComponentInvocationProxy.java
deleted file mode 100644
index ff4732cfdb..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/ComponentInvocationProxy.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.binding.corba.impl.service;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationTargetException;
-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.binding.corba.impl.exceptions.RequestConfigurationException;
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTree;
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeCreator;
-import org.apache.tuscany.sca.binding.corba.impl.util.OperationMapper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * @version $Rev$ $Date$
- * Invocation proxy for SCA components
- */
-public class ComponentInvocationProxy implements InvocationProxy {
-
- private RuntimeWire wire;
- private Map<Method, Operation> methodOperationMapping;
- private Map<Operation, Method> operationMethodMapping;
- private Map<String, Method> operationsMap;
- private Map<Operation, OperationTypes> operationsCache = new HashMap<Operation, OperationTypes>();
-
- public ComponentInvocationProxy(RuntimeComponentService service, RuntimeWire wire, Class<?> javaClass)
- throws RequestConfigurationException {
- this.wire = wire;
- operationsMap = OperationMapper.mapOperationNameToMethod(javaClass);
- operationMethodMapping = OperationMapper.mapOperationToMethod(service.getInterfaceContract().getInterface().getOperations(), javaClass);
- methodOperationMapping = OperationMapper.mapMethodToOperation(service.getInterfaceContract().getInterface().getOperations(), javaClass);
- cacheOperationTypes(service.getInterfaceContract().getInterface().getOperations());
- }
-
- /**
- * Caches TypeTree for every operation in backed component
- *
- * @param operations
- * @throws RequestConfigurationException
- */
- private void cacheOperationTypes(List<Operation> operations) throws RequestConfigurationException {
- for (Operation operation : operations) {
- try {
- OperationTypes operationTypes = new OperationTypes();
- List<TypeTree> inputInstances = new ArrayList<TypeTree>();
- // cache output type tree
- if (operation.getOutputType() != null && operation.getOutputType().getPhysical() != null
- && !operation.getOutputType().getPhysical().equals(void.class)) {
- Annotation[] notes = operationMethodMapping.get(operation).getAnnotations();
- TypeTree outputType =
- TypeTreeCreator.createTypeTree(operation.getOutputType().getPhysical(), notes);
- operationTypes.setOutputType(outputType);
- }
- // cache input types trees
- if (operation.getInputType() != null) {
- Method method = operationMethodMapping.get(operation);
- Annotation[][] notes = method.getParameterAnnotations();
- int i = 0;
- for (DataType<List<DataType<?>>> type : operation.getInputType().getLogical()) {
- Class<?> forClass = type.getPhysical();
- TypeTree inputType = TypeTreeCreator.createTypeTree(forClass, notes[i]);
- inputInstances.add(inputType);
- i++;
- }
-
- }
- operationTypes.setInputType(inputInstances);
- operationsCache.put(operation, operationTypes);
- } catch (RequestConfigurationException e) {
- throw e;
- }
- }
- }
-
- private Operation getOperation4Name(String operationName) {
- Method method = operationsMap.get(operationName);
- return methodOperationMapping.get(method);
- }
-
- public OperationTypes getOperationTypes(String operationName) {
- return operationsCache.get(getOperation4Name(operationName));
- }
-
- public Object invoke(String operationName, List<Object> arguments) throws InvocationException {
- Object result = null;
- try {
- result = wire.invoke(getOperation4Name(operationName), arguments.toArray());
- } catch (InvocationTargetException e) {
- InvocationException exception = new InvocationException(e.getCause());
- throw exception;
- }
- return result;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java
deleted file mode 100644
index 2a032f5d25..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.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.binding.corba.impl.service;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTree;
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeCreator;
-import org.apache.tuscany.sca.binding.corba.impl.types.util.TypeHelpersProxy;
-import org.apache.tuscany.sca.binding.corba.impl.types.util.Utils;
-import org.omg.CORBA.MARSHAL;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.InvokeHandler;
-import org.omg.CORBA.portable.ObjectImpl;
-import org.omg.CORBA.portable.OutputStream;
-import org.omg.CORBA.portable.ResponseHandler;
-
-/**
- * @version $Rev$ $Date$
- * General servant which provides target component implementation via CORBA
- */
-public class DynaCorbaServant extends ObjectImpl implements InvokeHandler {
-
- private static final Logger logger = Logger.getLogger(DynaCorbaServant.class.getName());
-
- private String[] ids;
- private InvocationProxy invocationProxy;
- private String typeId;
-
- /**
- * Creates servant object
- * @param invocationProxy
- * @param typeId
- * @throws RequestConfigurationException
- */
- public DynaCorbaServant(InvocationProxy invocationProxy, String typeId) throws RequestConfigurationException {
- this.invocationProxy = invocationProxy;
- this.typeId = typeId;
- setDefaultIds();
- }
-
- /**
- * Sets CORBA object ID
- * @param ids
- */
- public void setIds(String[] ids) {
- for (int i = 0; i < ids.length; i++) {
- if (ids[i] == null || ids[i].length() == 0) {
- // if invalid id was passed then set to default
- setDefaultIds();
- return;
- }
- }
- this.ids = ids;
- }
-
- public OutputStream _invoke(String operationName, InputStream in, ResponseHandler rh) {
- OperationTypes types = invocationProxy.getOperationTypes(operationName);
- if (types == null) {
- // operation wasn't found
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- } else {
- List<Object> inputInstances = new ArrayList<Object>();
- try {
- // retrieving in arguments
- for (TypeTree tree : types.getInputType()) {
- Object o = TypeHelpersProxy.read(tree.getRootNode(), in);
- inputInstances.add(o);
- }
- } catch (MARSHAL e) {
- // parameter passed by user was not compatible with Java to
- // Corba mapping
- throw new org.omg.CORBA.BAD_PARAM(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
- try {
- // invocation and sending result
- Object result = invocationProxy.invoke(operationName, inputInstances);
- OutputStream out = rh.createReply();
- if (types.getOutputType() != null) {
- TypeTree tree = types.getOutputType();
- TypeHelpersProxy.write(tree.getRootNode(), out, result);
- }
- return out;
- } catch (InvocationException ie) {
- // handling user exception
- try {
- OutputStream out = rh.createExceptionReply();
- Class<?> exceptionClass = ie.getTargetException().getClass();
- TypeTree tree = TypeTreeCreator.createTypeTree(exceptionClass, null);
- String exceptionId = Utils.getTypeId(exceptionClass);
- out.write_string(exceptionId);
- TypeHelpersProxy.write(tree.getRootNode(), out, ie.getTargetException());
- return out;
- } catch (Exception e) {
- logger.log(Level.WARNING, "Exception during handling invocation exception", e);
- }
- } catch (Exception e) {
- logger.log(Level.WARNING, "Unexpected exception during sending CORBA result to client", e);
- }
- }
- return null;
- }
-
- @Override
- public String[] _ids() {
- return ids;
- }
-
- /**
- * Sets servant ID to default, based on Java class name
- */
- private void setDefaultIds() {
- this.ids = new String[] {typeId};
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationException.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationException.java
deleted file mode 100644
index a82e43e42e..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationException.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.corba.impl.service;
-
-/**
- * @version $Rev$ $Date$
- * Wrapper for exception thrown during target invocation
- */
-public class InvocationException extends Exception {
-
- private static final long serialVersionUID = 1L;
- private Throwable targetException;
-
- public InvocationException(Throwable targetException) {
- this.targetException = targetException;
- }
-
- public Throwable getTargetException() {
- return targetException;
- }
-
- public void setTargetException(Throwable target) {
- this.targetException = target;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.java
deleted file mode 100644
index 5ad9068b8d..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.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.corba.impl.service;
-
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- * Target proxy interface for service bindings
- */
-public interface InvocationProxy {
-
- /**
- * Gets operations types for target
- * @param operationName
- * @return
- */
- public OperationTypes getOperationTypes(String operationName);
-
- /**
- * Invokes target operation
- * @param operationName
- * @param arguments
- * @return
- * @throws InvocationException
- */
- public Object invoke(String operationName, List<Object> arguments) throws InvocationException;
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/OperationTypes.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/OperationTypes.java
deleted file mode 100644
index d93036d6d9..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/OperationTypes.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.corba.impl.service;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTree;
-
-/**
- * @version $Rev$ $Date$
- * Holder for Java type trees for one method
- */
-public class OperationTypes {
-
- private TypeTree outputType;
- private List<TypeTree> inputType;
-
- public TypeTree getOutputType() {
- return outputType;
- }
-
- public void setOutputType(TypeTree outputType) {
- this.outputType = outputType;
- }
-
- public List<TypeTree> getInputType() {
- return inputType;
- }
-
- public void setInputType(List<TypeTree> inputType) {
- this.inputType = inputType;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/AnnotationAttributes.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/AnnotationAttributes.java
deleted file mode 100644
index d2b48d22c7..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/AnnotationAttributes.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.corba.impl.types;
-
-/**
- * Holds information retrieved from objects annotations
- */
-public class AnnotationAttributes {
-
- private boolean corbaArray;
- private int[] corbaArrayLength;
-
- public boolean isCorbaArray() {
- return corbaArray;
- }
-
- public void setCorbaArray(boolean isCorbaArray) {
- this.corbaArray = isCorbaArray;
- }
-
- public int[] getCorbaArrayLength() {
- return corbaArrayLength;
- }
-
- public void setCorbaArrayLength(int[] corbaArrayLength) {
- this.corbaArrayLength = corbaArrayLength;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/NodeType.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/NodeType.java
deleted file mode 100644
index 4080a836bc..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/NodeType.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.corba.impl.types;
-
-/**
- * @version $Rev$ $Date$
- * Types of CORBA objects.
- */
-public enum NodeType {
- primitive, struct, union, array, sequence, reference, idl_enum, exception
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTree.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTree.java
deleted file mode 100644
index b8c4f88324..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTree.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.corba.impl.types;
-
-/**
- * @version $Rev$ $Date$
- * Helper tree for Java object hierarchy. It's closer to CORBA types
- * structure than plain Java hierarchy - it helps reading and writing
- * complex structures.
- */
-public class TypeTree {
-
- private TypeTreeNode rootNode;
-
- /**
- * Returns root node.
- *
- * @return root of type tree
- */
- public TypeTreeNode getRootNode() {
- return rootNode;
- }
-
- /**
- * Sets root of the type tree.
- *
- * @param rootNode root node.
- */
- public void setRootNode(TypeTreeNode rootNode) {
- this.rootNode = rootNode;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeCreator.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeCreator.java
deleted file mode 100644
index e8441ed177..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeCreator.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.impl.types;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
-import org.apache.tuscany.sca.binding.corba.meta.CorbaArray;
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement;
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElementType;
-
-/**
- * @version $Rev$ $Date$
- * Creator of types tree.
- */
-public class TypeTreeCreator {
-
- /**
- * Helps to determine if type is a primitive.
- */
- private static List<Class<?>> primitives = new ArrayList<Class<?>>();
-
- static {
- primitives.add(boolean.class);
- primitives.add(byte.class);
- primitives.add(short.class);
- primitives.add(int.class);
- primitives.add(long.class);
- primitives.add(double.class);
- primitives.add(float.class);
- primitives.add(char.class);
- primitives.add(String.class);
- primitives.add(Boolean.class);
- primitives.add(Byte.class);
- primitives.add(Short.class);
- primitives.add(Integer.class);
- primitives.add(Long.class);
- primitives.add(Double.class);
- primitives.add(Float.class);
- primitives.add(Character.class);
- }
-
- /**
- * Creates class for given string argument.
- *
- * @param name name of type
- * @return type
- */
- private static Class<?> createClassFromString(String name) {
- Class<?> result = null;
- try {
- if (name.length() == 1) {
- // primitives
- switch (name.charAt(0)) {
- case 'Z':
- result = boolean.class;
- break;
- case 'C':
- result = char.class;
- break;
- case 'B':
- result = byte.class;
- break;
- case 'S':
- result = short.class;
- break;
- case 'I':
- result = int.class;
- break;
- case 'J':
- result = long.class;
- break;
- case 'F':
- result = float.class;
- break;
- case 'D':
- result = double.class;
- break;
- }
- } else {
- // class
- name = name.substring(1, name.length() - 1);
- result = Class.forName(name);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return result;
- }
-
- /**
- * Reduces dimension of array.
- *
- * @param forClass array class
- * @return reduced array
- */
- private static Class<?> reduceArrayDimension(Class<?> forClass) {
- String name = forClass.getName();
- try {
- String reduced = name.substring(1, name.length());
- if (reduced.startsWith("[")) {
- // reduced class is still an array
- return Class.forName(reduced);
- } else {
- // reduced class may be primitive or class
- return createClassFromString(reduced);
- }
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- /**
- * Return given array without first element
- *
- * @param array
- * @return
- */
- private static int[] removeFirstElement(int[] array) {
- int[] result = new int[array.length - 1];
- System.arraycopy(array, 1, result, 0, result.length);
- return result;
- }
-
- /**
- * Converts objects annotations to structure which will be used by this
- * class
- *
- * @param notes
- * @return
- */
- private static AnnotationAttributes createAnnotationAttributes(Annotation[] notes) {
- AnnotationAttributes attrs = new AnnotationAttributes();
- for (int i = 0; notes != null && i < notes.length; i++) {
- if (notes[i].annotationType().equals(CorbaArray.class)) {
- attrs.setCorbaArray(true);
- attrs.setCorbaArrayLength(((CorbaArray)notes[i]).value());
- }
- }
- return attrs;
- }
-
- /**
- * Creates tree for given type.
- *
- * @param forClass
- * @return type tree
- */
- public static TypeTree createTypeTree(Class<?> forClass, Annotation[] notes) throws RequestConfigurationException {
- TypeTree tree = new TypeTree();
- TypeTreeNode rootNode = null;
- AnnotationAttributes attrs = createAnnotationAttributes(notes);
- rootNode = inspectClassHierarchy(forClass, attrs, tree);
- tree.setRootNode(rootNode);
- return tree;
-
- }
-
- /**
- * Recurrent method which builds type tree.
- *
- * @param forClass
- * @param tree
- * @return
- */
- private static TypeTreeNode inspectClassHierarchy(Class<?> forClass, AnnotationAttributes attributes, TypeTree tree)
- throws RequestConfigurationException {
-
- TypeTreeNode node = null;
- node = createTypeNode(forClass, attributes);
-
- NodeType nodeType = node.getNodeType();
- TypeTreeNode[] children = null;
-
- if (nodeType.equals(NodeType.primitive)) {
- // stop condition for recurrent method
- } else if (nodeType.equals(NodeType.array)) {
- Class<?> reduced = reduceArrayDimension(node.getJavaClass());
- children = new TypeTreeNode[1];
- int[] newLengths = removeFirstElement(attributes.getCorbaArrayLength());
- attributes.setCorbaArrayLength(newLengths);
- children[0] = inspectClassHierarchy(reduced, attributes, tree);
- } else if (nodeType.equals(NodeType.sequence)) {
- // reducing sequence dimension
- Class<?> reduced = reduceArrayDimension(node.getJavaClass());
- children = new TypeTreeNode[1];
- children[0] = inspectClassHierarchy(reduced, attributes, tree);
- // System.arraycopy(src, srcPos, dest, destPos, length)
- } else if (nodeType.equals(NodeType.struct) || nodeType.equals(NodeType.exception)) {
- // inspect types for every structure member
- Field[] fields = node.getJavaClass().getFields();
- children = new TypeTreeNode[fields.length];
- for (int i = 0; i < fields.length; i++) {
- Class<?> field = fields[i].getType();
- AnnotationAttributes fAttrs = createAnnotationAttributes(fields[i].getAnnotations());
- TypeTreeNode child = inspectClassHierarchy(field, fAttrs, tree);
- child.setName(fields[i].getName());
- children[i] = child;
- }
- } else if (nodeType.equals(NodeType.idl_enum)) {
-
- } else if (nodeType.equals(NodeType.union)) {
- // inspect types for every structure member
- Field[] fields = node.getJavaClass().getDeclaredFields();
- children = new TypeTreeNode[fields.length];
- for (int i = 0; i < fields.length; i++) {
- Class<?> field = fields[i].getType();
- AnnotationAttributes fAttrs = createAnnotationAttributes(fields[i].getAnnotations());
- TypeTreeNode child = inspectClassHierarchy(field, fAttrs, tree);
- child.setName(fields[i].getName());
- children[i] = child;
- }
- } else if (nodeType.equals(NodeType.reference)) {
- // TODO: CORBA references
- }
-
- node.setChildren(children);
- return node;
- }
-
- /**
- * Creating and configuring TypeTreeNode for given class.
- *
- * @param forClass class
- * @return node
- * @throws RequestConfigurationException
- */
- private static TypeTreeNode createTypeNode(Class<?> forClass, AnnotationAttributes attributes)
- throws RequestConfigurationException {
- TypeTreeNode node = new TypeTreeNode();
- if (forClass.isArray() && !attributes.isCorbaArray()) {
- node.setNodeType(NodeType.sequence);
- node.setJavaClass(forClass);
- } else if (forClass.isArray() && attributes.isCorbaArray()) {
- node.setNodeType(NodeType.array);
- node.setJavaClass(forClass);
- try {
- // set the actual array size for further use by ArrayTypeHelper
- node.setAttributes(attributes.getCorbaArrayLength()[0]);
- } catch (ArrayIndexOutOfBoundsException e) {
- RequestConfigurationException exc =
- new RequestConfigurationException("Annotated array size doesn't match declared arrays size");
- throw exc;
- }
- } else if (primitives.contains(forClass)) {
- node.setNodeType(NodeType.primitive);
- node.setJavaClass(forClass);
- node.setChildren(null);
- } else if (forClass.isInterface()) {
- node.setNodeType(NodeType.reference);
- node.setJavaClass(forClass);
- node.setChildren(null);
- } else if (isStructType(forClass)) {
- node.setNodeType(NodeType.struct);
- node.setJavaClass(forClass);
- } else if (isEnumType(forClass)) {
- node.setNodeType(NodeType.idl_enum);
- node.setJavaClass(forClass);
- } else if (isUserException(forClass)) {
- node.setNodeType(NodeType.exception);
- node.setJavaClass(forClass);
- } else if (isUnionType(forClass)) {
- node.setNodeType(NodeType.union);
- node.setJavaClass(forClass);
- node.setAttributes(getUnionAttributes(forClass));
- } else {
- RequestConfigurationException e =
- new RequestConfigurationException("User defined type which cannot be handled: " + forClass
- .getCanonicalName());
- throw e;
- }
- return node;
- }
-
- /**
- * Tells whether given class is structure
- *
- * @param forClass
- * @return
- */
- private static boolean isStructType(Class<?> forClass) {
- int classMods = forClass.getModifiers();
- if (!Modifier.isFinal(classMods)) {
- return false;
- }
- boolean areCtorsValid = false;
- Class<?>[] fieldsTypes = null;
- Constructor<?>[] ctors = forClass.getConstructors();
- /*
- * Do we have 2 ctors and one of them is null ctor?
- */
- if (ctors.length != 2) {
- return false;
- }
- for (int i = 0; i < ctors.length; i++) {
- Class<?>[] params = ctors[i].getParameterTypes();
- if (params.length == 0) {
- areCtorsValid = true;
- } else {
- fieldsTypes = params;
- }
- }
- if (!areCtorsValid) {
- return false;
- }
- /*
- * Are constructor args declared as class fields?
- */
- Field[] fields = forClass.getFields();
- Set<Class<?>> fieldsSet = new HashSet<Class<?>>(Arrays.asList(fieldsTypes));
- for (int i = 0; i < fields.length && !fieldsSet.isEmpty(); i++) {
- int mods = fields[i].getModifiers();
- if (Modifier.isPublic(mods) && !Modifier.isStatic(mods) && !Modifier.isFinal(mods)) {
- fieldsSet.remove(fields[i].getType());
- }
-
- }
- return fieldsSet.isEmpty();
- }
-
- /**
- * Tells whether given class is enum
- *
- * @param forClass
- * @return
- */
- private static boolean isEnumType(Class<?> forClass) {
- boolean isValueMethod = false;
- boolean isFromIntMethod = false;
- /*
- * enum type should have value and from_int methods
- */
- try {
- Method valueMet = forClass.getMethod("value", new Class[] {});
- int modValueMet = valueMet.getModifiers();
- if (valueMet.getReturnType().equals(int.class) && Modifier.isPublic(modValueMet)) {
- isValueMethod = true;
- }
- Method fromIntMet = forClass.getMethod("from_int", new Class[] {int.class});
- int modFromIntMet = fromIntMet.getModifiers();
- if ((fromIntMet.getReturnType().equals(forClass) && Modifier.isPublic(modFromIntMet) && Modifier
- .isStatic(modFromIntMet))) {
- isFromIntMethod = true;
- }
- } catch (NoSuchMethodException e) {
- }
- if (!isFromIntMethod || !isValueMethod) {
- return false;
- }
- /*
- * enum type should also contain minimum one pair of fields: EnumType
- * field and int _field
- */
- int enumCount = 0;
- Field[] fields = forClass.getFields();
- for (int i = 0; i < fields.length; i++) {
- if (fields[i].getType().equals(forClass)) {
- int modifiers = fields[i].getModifiers();
- if (Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers) && Modifier.isFinal(modifiers)) {
- try {
- Field field = forClass.getField("_" + fields[i].getName());
- if (field.getType().equals(int.class)) {
- enumCount++;
- }
- } catch (NoSuchFieldException e) {
- }
-
- }
- }
- }
- return enumCount > 0;
- }
-
- /**
- * Tells whether given class is CORBA user exception
- *
- * @param forClass
- * @return
- */
- private static boolean isUserException(Class<?> forClass) {
- do {
- if (forClass.equals(Exception.class)) {
- return true;
- } else {
- forClass = forClass.getSuperclass();
- }
- } while (forClass != null && !forClass.equals(Object.class));
- return false;
- }
-
- /**
- * Tells whether given class is CORBA union. This method validates usage of
- * unions annotations.
- *
- * @param forClass
- * @return
- * @throws RequestConfigurationException
- */
- private static boolean isUnionType(Class<?> forClass) throws RequestConfigurationException {
- int classMods = forClass.getModifiers();
- if (!Modifier.isFinal(classMods)) {
- return false;
- }
- boolean atLeastOneOption = false;
- boolean discriminatorPresent = false;
- for (int i = 0; i < forClass.getDeclaredFields().length; i++) {
- CorbaUnionElement note = forClass.getDeclaredFields()[i].getAnnotation(CorbaUnionElement.class);
- if (note != null) {
- int fieldMod = forClass.getDeclaredFields()[i].getModifiers();
- if (Modifier.isPrivate(fieldMod) && !Modifier.isFinal(fieldMod) && !Modifier.isStatic(fieldMod)) {
- if (note.type().equals(CorbaUnionElementType.discriminator)) {
- if (discriminatorPresent) {
- throw new RequestConfigurationException(
- "More than one discriminators declared on: " + forClass);
- }
- discriminatorPresent = true;
- } else {
- atLeastOneOption = true;
- }
- } else {
- throw new RequestConfigurationException(
- "Annotated union field should be private, not final and no static on class: " + forClass);
- }
- }
- }
- if (atLeastOneOption && !discriminatorPresent) {
- throw new RequestConfigurationException("No discriminator annotation found on: " + forClass);
- } else if (!atLeastOneOption && discriminatorPresent) {
- throw new RequestConfigurationException("No union option found on: " + forClass);
- } else if (discriminatorPresent && atLeastOneOption) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Gets union attributes - discriminator field name, option fields etc. This
- * method relies that previously scanned class is valid (method isUnionType)
- *
- * @param forClass
- * @return
- * @throws RequestConfigurationException
- */
- private static UnionAttributes getUnionAttributes(Class<?> forClass) throws RequestConfigurationException {
- UnionAttributes attributes = new UnionAttributes();
- for (int i = 0; i < forClass.getDeclaredFields().length; i++) {
- CorbaUnionElement note = forClass.getDeclaredFields()[i].getAnnotation(CorbaUnionElement.class);
- if (note != null) {
- if (note.type().equals(CorbaUnionElementType.discriminator)) {
- attributes.setDiscriminatorName(forClass.getDeclaredFields()[i].getName());
- } else if (note.type().equals(CorbaUnionElementType.defaultOption)) {
- attributes.setDefaultOptionName(forClass.getDeclaredFields()[i].getName());
- } else if (note.type().equals(CorbaUnionElementType.option)) {
- if (attributes.getOptionsMapping().containsKey(note.optionNumber())) {
- throw new RequestConfigurationException("In " + forClass
- + ": field \""
- + forClass.getDeclaredFields()[i].getName()
- + "\" uses already used option id: "
- + note.optionNumber());
- } else {
- attributes.getOptionsMapping().put(note.optionNumber(),
- forClass.getDeclaredFields()[i].getName());
- }
- }
- }
- }
- return attributes;
- }
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeNode.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeNode.java
deleted file mode 100644
index 7d2183fb01..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeNode.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.corba.impl.types;
-
-/**
- * @version $Rev$ $Date$
- * Represents single tree node.
- *
- */
-public class TypeTreeNode {
-
- private NodeType nodeType;
- private TypeTreeNode[] children;
- private Class<?> javaClass;
- private String name;
- private Object attributes;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public NodeType getNodeType() {
- return nodeType;
- }
-
- public void setNodeType(NodeType nodeType) {
- this.nodeType = nodeType;
- }
-
- public TypeTreeNode[] getChildren() {
- return children;
- }
-
- public void setChildren(TypeTreeNode[] children) {
- this.children = children;
- }
-
- public Class<?> getJavaClass() {
- return javaClass;
- }
-
- public void setJavaClass(Class<?> javaClass) {
- this.javaClass = javaClass;
- }
-
- public Object getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Object attributes) {
- this.attributes = attributes;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/UnionAttributes.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/UnionAttributes.java
deleted file mode 100644
index df6358d118..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/UnionAttributes.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.corba.impl.types;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @version $Rev$ $Date$
- * Stores attributes for previously scanned CORBA union type
- */
-public class UnionAttributes {
-
- public String discriminatorName;
- public String defaultOptionName;
- public Map<Integer, String> optionsMapping = new HashMap<Integer, String>();
-
- public String getDiscriminatorName() {
- return discriminatorName;
- }
-
- public void setDiscriminatorName(String discriminatorName) {
- this.discriminatorName = discriminatorName;
- }
-
- public String getDefaultOptionName() {
- return defaultOptionName;
- }
-
- public void setDefaultOptionName(String defaultOptionName) {
- this.defaultOptionName = defaultOptionName;
- }
-
- public Map<Integer, String> getOptionsMapping() {
- return optionsMapping;
- }
-
- public void setOptionsMapping(Map<Integer, String> optionsMapping) {
- this.optionsMapping = optionsMapping;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ArrayTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ArrayTypeHelper.java
deleted file mode 100644
index 6dbeda3b7c..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ArrayTypeHelper.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.corba.impl.types.util;
-
-import java.lang.reflect.Array;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ArrayTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- Object array = null;
- try {
- int size = (Integer)node.getAttributes();
- array = Array.newInstance(node.getChildren()[0].getJavaClass(), size);
- for (int i = 0; i < size; i++) {
- Array.set(array, i, TypeHelpersProxy.read(node.getChildren()[0], is));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return array;
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- for (int i = 0; i < (Integer)node.getAttributes(); i++) {
- TypeHelpersProxy.write(node.getChildren()[0], os, Array.get(data, i));
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/BooleanTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/BooleanTypeHelper.java
deleted file mode 100644
index 87d3e93d22..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/BooleanTypeHelper.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.binding.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BooleanTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- return is.read_boolean();
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- os.write_boolean((Boolean)data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ByteTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ByteTypeHelper.java
deleted file mode 100644
index eb02f1cbcb..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ByteTypeHelper.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.binding.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ByteTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- return is.read_octet();
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- os.write_octet((Byte)data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/CharTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/CharTypeHelper.java
deleted file mode 100644
index 71f8fbfc47..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/CharTypeHelper.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.binding.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CharTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- return is.read_char();
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- os.write_char((Character)data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/DoubleTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/DoubleTypeHelper.java
deleted file mode 100644
index c5019c5c0b..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/DoubleTypeHelper.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.binding.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DoubleTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- return is.read_double();
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- os.write_double((Double)data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/EnumTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/EnumTypeHelper.java
deleted file mode 100644
index 30c3ac3a8a..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/EnumTypeHelper.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.impl.types.util;
-
-import java.lang.reflect.Method;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class EnumTypeHelper implements TypeHelper {
-
- private static final Logger logger = Logger.getLogger(EnumTypeHelper.class.getName());
-
- public Object read(TypeTreeNode node, InputStream is) {
- int value = is.read_long();
- Object result = null;
- try {
- Method method = node.getJavaClass().getMethod("from_int", new Class[] {int.class});
- result = method.invoke(null, new Object[] {value});
- } catch (Exception e) {
- logger.log(Level.WARNING, "Exception during reading CORBA enum data", e);
- e.printStackTrace();
- }
- return result;
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- int value = 0;
- try {
- Method method = data.getClass().getMethod("value", new Class[] {});
- value = (Integer)method.invoke(data, new Object[] {});
- } catch (Exception e) {
- logger.log(Level.WARNING, "Exception during writing CORBA enum data", e);
- }
- os.write_long(value);
- }
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/FloatTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/FloatTypeHelper.java
deleted file mode 100644
index 3214f8b30d..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/FloatTypeHelper.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.binding.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class FloatTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- return is.read_float();
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- os.write_float((Float)data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/IntTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/IntTypeHelper.java
deleted file mode 100644
index b11175064c..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/IntTypeHelper.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.binding.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class IntTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- return is.read_long();
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- os.write_long((Integer)data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/LongTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/LongTypeHelper.java
deleted file mode 100644
index 7b4300a1da..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/LongTypeHelper.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.binding.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class LongTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- return is.read_longlong();
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- os.write_longlong((Long)data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ReferenceTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ReferenceTypeHelper.java
deleted file mode 100644
index 4e0c2893d2..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ReferenceTypeHelper.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.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.reference.InterfaceInstanceCreator;
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.Object;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ReferenceTypeHelper implements TypeHelper {
-
- public java.lang.Object read(TypeTreeNode node, InputStream is) {
- Object reference = is.read_Object();
- return (java.lang.Object)InterfaceInstanceCreator.createInstance(reference, node.getJavaClass());
- }
-
- public void write(TypeTreeNode node, OutputStream os, java.lang.Object data) {
- os.write_Object((Object)data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/SequenceTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/SequenceTypeHelper.java
deleted file mode 100644
index 5862838cd5..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/SequenceTypeHelper.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.corba.impl.types.util;
-
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SequenceTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- Object sequence = null;
- try {
- int size = is.read_long();
- sequence = Array.newInstance(node.getChildren()[0].getJavaClass(), size);
- for (int i = 0; i < size; i++) {
- Array.set(sequence, i, TypeHelpersProxy.read(node.getChildren()[0], is));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return sequence;
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- int sum = 0;
- // determine length of array
- List<Object> array = new ArrayList<Object>();
- while (true) {
- try {
- array.add(Array.get(data, sum));
- sum++;
- } catch (ArrayIndexOutOfBoundsException e) {
- break;
- }
- }
- os.write_long(sum);
- Iterator<Object> iter = array.iterator();
- while (iter.hasNext()) {
- Object elem = iter.next();
- TypeHelpersProxy.write(node.getChildren()[0], os, elem);
- }
-
- }
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ShortTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ShortTypeHelper.java
deleted file mode 100644
index 9130db65e4..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/ShortTypeHelper.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.binding.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ShortTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- return is.read_short();
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- os.write_short((Short)data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/StringTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/StringTypeHelper.java
deleted file mode 100644
index 4d782efcc5..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/StringTypeHelper.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.binding.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class StringTypeHelper implements TypeHelper {
-
- public Object read(TypeTreeNode node, InputStream is) {
- return is.read_string();
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- os.write_string((String)data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/StructTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/StructTypeHelper.java
deleted file mode 100644
index 365d62fb73..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/StructTypeHelper.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.corba.impl.types.util;
-
-import java.lang.reflect.Field;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class StructTypeHelper implements TypeHelper {
-
- private static final Logger logger = Logger.getLogger(StructTypeHelper.class.getName());
-
- public Object read(TypeTreeNode node, InputStream is) {
- TypeTreeNode[] children = node.getChildren();
- Object result = null;
- if (children != null) {
- try {
- result = node.getJavaClass().newInstance();
- for (int i = 0; i < children.length; i++) {
- Object childResult = TypeHelpersProxy.read(children[i], is);
- Field childField = result.getClass().getField(children[i].getName());
- childField.set(result, childResult);
- }
- } catch (Exception e) {
- logger.log(Level.WARNING, "Exception during reading CORBA struct data", e);
- }
- }
- return result;
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- TypeTreeNode[] children = node.getChildren();
- if (children != null) {
- try {
- for (int i = 0; i < children.length; i++) {
- Field childField = node.getJavaClass().getField(children[i].getName());
- TypeHelpersProxy.write(children[i], os, childField.get(data));
- }
- } catch (Exception e) {
- logger.log(Level.WARNING, "Exception during writing CORBA struct data", e);
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/TypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/TypeHelper.java
deleted file mode 100644
index c9d0dd263f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/TypeHelper.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.corba.impl.types.util;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface TypeHelper {
-
- /**
- * Reads CORBA object
- * @param node
- * @param is
- * @return
- */
- Object read(TypeTreeNode node, InputStream is);
-
- /**
- * Writes CORBA object
- * @param node
- * @param os
- * @param data
- */
- void write(TypeTreeNode node, OutputStream os, Object data);
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/TypeHelpersProxy.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/TypeHelpersProxy.java
deleted file mode 100644
index 72e4ccc6fb..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/TypeHelpersProxy.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.binding.corba.impl.types.util;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.NodeType;
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- * Proxies getType(), write(), read() methods to appropriate TypeHelper implementation.
- */
-public class TypeHelpersProxy {
-
- /**
- * Maps primitive types to its TypeHelper implementations
- */
- private static Map<Class<?>, TypeHelper> primitiveTypes = null;
-
- /**
- * Maps other types to its TypeHelper implementations
- */
- private static Map<NodeType, TypeHelper> complexTypes = null;
-
- static {
- // initiate type helpers
- primitiveTypes = new HashMap<Class<?>, TypeHelper>();
- complexTypes = new HashMap<NodeType, TypeHelper>();
-
- primitiveTypes.put(boolean.class, new BooleanTypeHelper());
- primitiveTypes.put(char.class, new CharTypeHelper());
- primitiveTypes.put(byte.class, new ByteTypeHelper());
- primitiveTypes.put(short.class, new ShortTypeHelper());
- primitiveTypes.put(int.class, new IntTypeHelper());
- primitiveTypes.put(long.class, new LongTypeHelper());
- primitiveTypes.put(float.class, new FloatTypeHelper());
- primitiveTypes.put(double.class, new DoubleTypeHelper());
- primitiveTypes.put(String.class, new StringTypeHelper());
- primitiveTypes.put(Boolean.class, primitiveTypes.get(boolean.class));
- primitiveTypes.put(Character.class, primitiveTypes.get(char.class));
- primitiveTypes.put(Byte.class, primitiveTypes.get(byte.class));
- primitiveTypes.put(Short.class, primitiveTypes.get(short.class));
- primitiveTypes.put(Integer.class, primitiveTypes.get(int.class));
- primitiveTypes.put(Long.class, primitiveTypes.get(long.class));
- primitiveTypes.put(Float.class, primitiveTypes.get(float.class));
- primitiveTypes.put(Double.class, primitiveTypes.get(double.class));
- primitiveTypes.put(String.class, primitiveTypes.get(String.class));
- complexTypes.put(NodeType.array, new ArrayTypeHelper());
- complexTypes.put(NodeType.struct, new StructTypeHelper());
- complexTypes.put(NodeType.reference, new ReferenceTypeHelper());
- complexTypes.put(NodeType.sequence, new SequenceTypeHelper());
- complexTypes.put(NodeType.idl_enum, new EnumTypeHelper());
- complexTypes.put(NodeType.exception, new StructTypeHelper());
- complexTypes.put(NodeType.union, new UnionTypeHelper());
- }
-
- /**
- * Gets type helper basing on given type
- *
- * @param node
- * @return
- */
- private static TypeHelper getTypeHelper(TypeTreeNode node) {
- TypeHelper typeHelper = null;
- NodeType type = node.getNodeType();
- if (type.equals(NodeType.primitive)) {
- typeHelper = primitiveTypes.get(node.getJavaClass());
- } else {
- typeHelper = complexTypes.get(type);
- }
- return typeHelper;
- }
-
- /**
- * Proxies read method invocation to appropriate TypeHelper implementation.
- *
- * @param node
- * @param is
- * @return
- */
- public static final Object read(TypeTreeNode node, InputStream is) {
- TypeHelper helper = getTypeHelper(node);
- return helper.read(node, is);
- }
-
- /**
- * Proxies write method invocation to appropriate TypeHelper implementation.
- *
- * @param node
- * @param os
- * @param data
- */
- public static final void write(TypeTreeNode node, OutputStream os, Object data) {
- TypeHelper helper = getTypeHelper(node);
- helper.write(node, os, data);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/UnionTypeHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/UnionTypeHelper.java
deleted file mode 100644
index 66c928acec..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/UnionTypeHelper.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.binding.corba.impl.types.util;
-
-import java.lang.reflect.Field;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeNode;
-import org.apache.tuscany.sca.binding.corba.impl.types.UnionAttributes;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.OutputStream;
-
-/**
- * @version $Rev$ $Date$
- */
-public class UnionTypeHelper implements TypeHelper {
-
- private static final Logger logger = Logger.getLogger(UnionTypeHelper.class.getName());
-
- public Object read(TypeTreeNode node, InputStream is) {
- Object result = null;
- try {
- int discriminator = is.read_long();
- UnionAttributes attrs = (UnionAttributes)node.getAttributes();
- String childName = attrs.getOptionsMapping().get(discriminator);
- if (childName == null) {
- // get default if option numbers field not found
- childName = attrs.getDefaultOptionName();
- }
- result = node.getJavaClass().newInstance();
- Field discField = result.getClass().getDeclaredField(attrs.getDiscriminatorName());
- discField.setAccessible(true);
- discField.set(result, discriminator);
- for (int i = 0; i < node.getChildren().length; i++) {
- if (node.getChildren()[i].getName().equals(childName)) {
- Object unionValue = TypeHelpersProxy.read(node.getChildren()[i], is);
- Field childField = result.getClass().getDeclaredField(childName);
- childField.setAccessible(true);
- childField.set(result, unionValue);
- break;
- }
- }
- } catch (Exception e) {
- logger.log(Level.WARNING, "Exception during reading CORBA union data", e);
- }
- return result;
- }
-
- public void write(TypeTreeNode node, OutputStream os, Object data) {
- try {
- UnionAttributes attrs = (UnionAttributes)node.getAttributes();
- Field discriminatorField = data.getClass().getDeclaredField(attrs.getDiscriminatorName());
- discriminatorField.setAccessible(true);
- int discriminator = discriminatorField.getInt(data);
- os.write_long(discriminator);
- String childName = attrs.getOptionsMapping().get(discriminator);
- if (childName == null) {
- // get default if option numbers field not found
- childName = attrs.getDefaultOptionName();
- }
- for (int i = 0; i < node.getChildren().length; i++) {
- if (node.getChildren()[i].getName().equals(childName)) {
- Field childField = data.getClass().getDeclaredField(childName);
- childField.setAccessible(true);
- TypeHelpersProxy.write(node.getChildren()[i], os, childField.get(data));
- break;
- }
- }
- } catch (Exception e) {
- logger.log(Level.WARNING, "Exception during writing CORBA union data", e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/Utils.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/Utils.java
deleted file mode 100644
index 68f71b7169..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/Utils.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.corba.impl.types.util;
-
-/**
- * @version $Rev$ $Date$
- * Class for type utilities
- */
-public class Utils {
-
- /**
- * Creates CORBA id for Java class
- * @param forClass
- * @return
- */
- public static String getTypeId(Class<?> forClass) {
- String result = forClass.getName().replace('.', '/');
- result = result.replaceAll("Package", "");
- result = "IDL:" + result + ":1.0";
- return result;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/util/MethodFinder.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/util/MethodFinder.java
deleted file mode 100644
index 912d355641..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/util/MethodFinder.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.binding.corba.impl.util;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @version $Rev$ $Date$
- * Utility for finding method in given class.
- */
-public class MethodFinder {
-
- private static Map<Class<?>, Class<?>> boxingMapping;
-
- static {
- boxingMapping = new HashMap<Class<?>, Class<?>>();
- boxingMapping.put(boolean.class, Boolean.class);
- boxingMapping.put(byte.class, Byte.class);
- boxingMapping.put(short.class, Short.class);
- boxingMapping.put(char.class, Character.class);
- boxingMapping.put(int.class, Integer.class);
- boxingMapping.put(long.class, Long.class);
- boxingMapping.put(float.class, Float.class);
- boxingMapping.put(double.class, Double.class);
- }
-
- /**
- * Converts primitive class to its object equivalent.
- *
- * @param parameter class to convert
- * @return object equivalent for primitive type. If parameter wasn't
- * primitive then returns parameter.
- */
- private static Class<?> normalizePrimitive(Class<?> parameter) {
- Class<?> result = boxingMapping.get(parameter);
- if (result != null) {
- return result;
- } else {
- // not a primitive - no need to normalize
- return parameter;
- }
- }
-
- /**
- * Finds appropriate method. This method ignores difference between
- * primitive types and theirs object equivalents. Ie. if we want to find
- * method "get" in java.util.List with only one parameter, which type is
- * Integer then we'll obtain method get(int).
- *
- * @param forClass class which possibly contains desired method
- * @param methodName desired methods name
- * @param parameterTypes desired methods parameter types
- * @return desired method, if no method was found then null will be returned
- */
- public static Method findMethod(Class<?> forClass, String methodName, Class<?>[] parameterTypes) {
- Method[] methods = forClass.getMethods();
- for (int i = 0; i < methods.length; i++) {
- if (methods[i].getName().equals(methodName)) {
- Class<?>[] methodPTypes = methods[i].getParameterTypes();
- if (methodPTypes.length == parameterTypes.length) {
- boolean parameterMatch = true;
- for (int j = 0; j < methodPTypes.length; j++) {
- Class<?> nMethodPType = normalizePrimitive(methodPTypes[j]);
- Class<?> nParameterType = normalizePrimitive(parameterTypes[j]);
- if (!nMethodPType.equals(nParameterType)) {
- parameterMatch = false;
- break;
- }
- }
- if (parameterMatch) {
- return methods[i];
- }
- }
- }
- }
- return null;
- }
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/util/OperationMapper.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/util/OperationMapper.java
deleted file mode 100644
index a9fabcb82a..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/util/OperationMapper.java
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.corba.impl.util;
-
-import java.lang.reflect.Method;
-import java.rmi.RemoteException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.omg.CORBA.portable.IDLEntity;
-
-/**
- * @version $Rev$ $Date$
- */
-public final class OperationMapper {
-
- private static Set<Class<?>> getAllInterfaces(Class<?> intfClass) {
- Set<Class<?>> allInterfaces = new LinkedHashSet<Class<?>>();
-
- LinkedList<Class<?>> stack = new LinkedList<Class<?>>();
- stack.addFirst(intfClass);
-
- while (!stack.isEmpty()) {
- Class<?> intf = stack.removeFirst();
- allInterfaces.add(intf);
- for (Class<?> i : intf.getInterfaces()) {
- stack.add(0, i);
- }
- }
-
- return allInterfaces;
- }
-
- /**
- * Maps Java methods to operation names
- * @param intfClass
- * @return
- */
- @SuppressWarnings("unchecked")
- public static Map<Method, String> mapMethodToOperationName(Class<?> intfClass) {
- return iiopMap(intfClass, false);
- }
-
- /**
- * Maps operation names to Java methods
- * @param intfClass
- * @return
- */
- @SuppressWarnings("unchecked")
- public static Map<String, Method> mapOperationNameToMethod(Class<?> intfClass) {
- return iiopMap(intfClass, true);
- }
-
- @SuppressWarnings("unchecked")
- private static Map iiopMap(Class<?> intfClass, boolean operationToMethod) {
- Method[] methods = getAllMethods(intfClass);
-
- // find every valid getter
- Map<Method, String> getterByMethod = new HashMap<Method, String>(methods.length);
- Map<String, Method> getterByName = new HashMap<String, Method>(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
- String methodName = method.getName();
-
- // no arguments allowed
- if (method.getParameterTypes().length != 0) {
- continue;
- }
-
- // must start with get or is
- String verb;
- if (methodName.startsWith("get") && methodName.length() > 3 && method.getReturnType() != void.class) {
- verb = "get";
- } else if (methodName.startsWith("is") && methodName.length() > 2 && method.getReturnType() == boolean.class) {
- verb = "is";
- } else {
- continue;
- }
-
- // must only throw Remote or Runtime Exceptions
- boolean exceptionsValid = true;
- Class[] exceptionTypes = method.getExceptionTypes();
- for (int j = 0; j < exceptionTypes.length; j++) {
- Class<?> exceptionType = exceptionTypes[j];
- if (!RemoteException.class.isAssignableFrom(exceptionType) &&
- !RuntimeException.class.isAssignableFrom(exceptionType) &&
- !Error.class.isAssignableFrom(exceptionType)) {
- exceptionsValid = false;
- break;
- }
- }
- if (!exceptionsValid) {
- continue;
- }
-
- String propertyName;
- if (methodName.length() > verb.length() + 1 && Character.isUpperCase(methodName.charAt(verb.length() + 1))) {
- propertyName = methodName.substring(verb.length());
- } else {
- propertyName = Character.toLowerCase(methodName.charAt(verb.length())) + methodName.substring(verb.length() + 1);
- }
- getterByMethod.put(method, propertyName);
- getterByName.put(propertyName, method);
- }
-
- Map<Method, String> setterByMethod = new HashMap<Method, String>(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
- String methodName = method.getName();
-
- // must have exactally one arg
- if (method.getParameterTypes().length != 1) {
- continue;
- }
-
- // must return non void
- if (method.getReturnType() != void.class) {
- continue;
- }
-
- // must start with set
- if (!methodName.startsWith("set") || methodName.length() <= 3) {
- continue;
- }
-
- // must only throw Remote or Runtime Exceptions
- boolean exceptionsValid = true;
- Class<?>[] exceptionTypes = method.getExceptionTypes();
- for (int j = 0; j < exceptionTypes.length; j++) {
- Class<?> exceptionType = exceptionTypes[j];
- if (!RemoteException.class.isAssignableFrom(exceptionType) &&
- !RuntimeException.class.isAssignableFrom(exceptionType) &&
- !Error.class.isAssignableFrom(exceptionType)) {
- exceptionsValid = false;
- break;
- }
- }
- if (!exceptionsValid) {
- continue;
- }
-
- String propertyName;
- if (methodName.length() > 4 && Character.isUpperCase(methodName.charAt(4))) {
- propertyName = methodName.substring(3);
- } else {
- propertyName = Character.toLowerCase(methodName.charAt(3)) + methodName.substring(4);
- }
-
- // must have a matching getter
- Method getter = (Method) getterByName.get(propertyName);
- if (getter == null) {
- continue;
- }
-
- // setter property must match getter return value
- if (!method.getParameterTypes()[0].equals(getter.getReturnType())) {
- continue;
- }
- setterByMethod.put(method, propertyName);
- }
-
- // index the methods by name... used to determine which methods are overloaded
- HashMap<String, List<Method>> overloadedMethods = new HashMap<String, List<Method>>(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
- if (getterByMethod.containsKey(method) || setterByMethod.containsKey(method)) {
- continue;
- }
- String methodName = method.getName();
- List<Method> methodList = overloadedMethods.get(methodName);
- if (methodList == null) {
- methodList = new LinkedList<Method>();
- overloadedMethods.put(methodName, methodList);
- }
- methodList.add(method);
- }
-
- // index the methods by lower case name... used to determine which methods differ only by case
- Map<String, Set<String>> caseCollisionMethods = new HashMap<String, Set<String>>(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
- if (getterByMethod.containsKey(method) || setterByMethod.containsKey(method)) {
- continue;
- }
- String lowerCaseMethodName = method.getName().toLowerCase();
- Set<String> methodSet = caseCollisionMethods.get(lowerCaseMethodName);
- if (methodSet == null) {
- methodSet = new HashSet<String>();
- caseCollisionMethods.put(lowerCaseMethodName, methodSet);
- }
- methodSet.add(method.getName());
- }
-
- String className = getClassName(intfClass);
- Map iiopMap = new HashMap(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
-
- String iiopName = (String) getterByMethod.get(method);
- if (iiopName != null) {
- // if we have a leading underscore prepend with J
- if (iiopName.charAt(0) == '_') {
- iiopName = "J_get_" + iiopName.substring(1);
- } else {
- iiopName = "_get_" + iiopName;
- }
- } else {
- iiopName = (String) setterByMethod.get(method);
- if (iiopName != null) {
- // if we have a leading underscore prepend with J
- if (iiopName.charAt(0) == '_') {
- iiopName = "J_set_" + iiopName.substring(1);
- } else {
- iiopName = "_set_" + iiopName;
- }
- } else {
- iiopName = method.getName();
-
- // if we have a leading underscore prepend with J
- if (iiopName.charAt(0) == '_') {
- iiopName = "J" + iiopName;
- }
- }
- }
-
- // if this name only differs by case add the case index to the end
- Set<String> caseCollisions = caseCollisionMethods.get(method.getName().toLowerCase());
- if (caseCollisions != null && caseCollisions.size() > 1) {
- iiopName += upperCaseIndexString(iiopName);
- }
-
- // if this is an overloaded method append the parameter string
- List<Method> overloads = overloadedMethods.get(method.getName());
- if (overloads != null && overloads.size() > 1) {
- iiopName += buildOverloadParameterString(method.getParameterTypes());
- }
-
- // if we have a leading underscore prepend with J
- iiopName = replace(iiopName, '$', "U0024");
-
- // if we have matched a keyword prepend with an underscore
- if (keywords.contains(iiopName.toLowerCase())) {
- iiopName = "_" + iiopName;
- }
-
- // if the name is the same as the class name, append an underscore
- if (iiopName.equalsIgnoreCase(className)) {
- iiopName += "_";
- }
-
- if (operationToMethod) {
- iiopMap.put(iiopName, method);
- } else {
- iiopMap.put(method, iiopName);
- }
- }
-
- return iiopMap;
- }
-
- private static Method[] getAllMethods(Class<?> intfClass) {
- List<Method> methods = new LinkedList<Method>();
- for (Iterator<Class<?>> iterator = getAllInterfaces(intfClass).iterator(); iterator.hasNext();) {
- Class<?> intf = iterator.next();
- methods.addAll(Arrays.asList(intf.getDeclaredMethods()));
- }
-
- return (Method[]) methods.toArray(new Method[methods.size()]);
- }
-
- /**
- * Return the a string containing an underscore '_' index of each uppercase
- * character in the IIOP name. This is used for distinction of names that
- * only differ by case, since CORBA does not support case sensitive names.
- */
- private static String upperCaseIndexString(String iiopName) {
- StringBuffer stringBuffer = new StringBuffer();
- for (int i = 0; i < iiopName.length(); i++) {
- char c = iiopName.charAt(i);
- if (Character.isUpperCase(c)) {
- stringBuffer.append('_').append(i);
- }
- }
- return stringBuffer.toString();
- }
-
- /**
- * Replaces any occurances of the specified "oldChar" with the new string.
- * This is used to replace occurances if '$' in CORBA names since '$' is a
- * special character
- */
- private static String replace(String source, char oldChar, String newString) {
- StringBuffer stringBuffer = new StringBuffer(source.length());
- for (int i = 0; i < source.length(); i++) {
- char c = source.charAt(i);
- if (c == oldChar) {
- stringBuffer.append(newString);
- } else {
- stringBuffer.append(c);
- }
- }
- return stringBuffer.toString();
- }
-
- /**
- * Return the a string containing a double underscore '__' list of parameter
- * types encoded using the Java to IDL rules. This is used for distinction
- * of methods that only differ by parameter lists.
- */
- private static String buildOverloadParameterString(Class<?>[] parameterTypes) {
- String name = "";
- if (parameterTypes.length == 0) {
- name += "__";
- } else {
- for (int i = 0; i < parameterTypes.length; i++) {
- Class<?> parameterType = parameterTypes[i];
- name += buildOverloadParameterString(parameterType);
- }
- }
- return name.replace('.', '_');
- }
-
- /**
- * Returns a single parameter type encoded using the Java to IDL rules.
- */
- private static String buildOverloadParameterString(Class<?> parameterType) {
- String name = "_";
-
- int arrayDimensions = 0;
- while (parameterType.isArray()) {
- arrayDimensions++;
- parameterType = parameterType.getComponentType();
- }
-
- // arrays start with org_omg_boxedRMI_
- if (arrayDimensions > 0) {
- name += "_org_omg_boxedRMI";
- }
-
- // IDLEntity types must be prefixed with org_omg_boxedIDL_
- if (IDLEntity.class.isAssignableFrom(parameterType)) {
- name += "_org_omg_boxedIDL";
- }
-
- // add package... some types have special mappings in corba
- String packageName = (String)specialTypePackages.get(parameterType.getName());
- if (packageName == null) {
- packageName = getPackageName(parameterType.getName());
- }
- if (packageName.length() > 0) {
- name += "_" + packageName;
- }
-
- // arrays now contain a dimension indicator
- if (arrayDimensions > 0) {
- name += "_" + "seq" + arrayDimensions;
- }
-
- // add the class name
- String className = (String)specialTypeNames.get(parameterType.getName());
- if (className == null) {
- className = buildClassName(parameterType);
- }
- name += "_" + className;
-
- return name;
- }
-
- /**
- * Returns a string containing an encoded class name.
- */
- private static String buildClassName(Class<?> type) {
- if (type.isArray()) {
- throw new IllegalArgumentException("type is an array: " + type);
- }
-
- // get the classname
- String typeName = type.getName();
- int endIndex = typeName.lastIndexOf('.');
- if (endIndex < 0) {
- return typeName;
- }
- StringBuffer className = new StringBuffer(typeName.substring(endIndex + 1));
-
- // for innerclasses replace the $ separator with two underscores
- // we can't just blindly replace all $ characters since class names can
- // contain the $ character
- if (type.getDeclaringClass() != null) {
- String declaringClassName = getClassName(type.getDeclaringClass());
- assert className.toString().startsWith(declaringClassName + "$");
- className.replace(declaringClassName.length(), declaringClassName.length() + 1, "__");
- }
-
- // if we have a leading underscore prepend with J
- if (className.charAt(0) == '_') {
- className.insert(0, "J");
- }
- return className.toString();
- }
-
- private static String getClassName(Class<?> type) {
- if (type.isArray()) {
- throw new IllegalArgumentException("type is an array: " + type);
- }
-
- // get the classname
- String typeName = type.getName();
- int endIndex = typeName.lastIndexOf('.');
- if (endIndex < 0) {
- return typeName;
- }
- return typeName.substring(endIndex + 1);
- }
-
- private static String getPackageName(String interfaceName) {
- int endIndex = interfaceName.lastIndexOf('.');
- if (endIndex < 0) {
- return "";
- }
- return interfaceName.substring(0, endIndex);
- }
-
- private static final Map<String, String> specialTypeNames;
- private static final Map<String, String> specialTypePackages;
- private static final Set<String> keywords;
-
- static {
- specialTypeNames = new HashMap<String, String>();
- specialTypeNames.put("boolean", "boolean");
- specialTypeNames.put("char", "wchar");
- specialTypeNames.put("byte", "octet");
- specialTypeNames.put("short", "short");
- specialTypeNames.put("int", "long");
- specialTypeNames.put("long", "long_long");
- specialTypeNames.put("float", "float");
- specialTypeNames.put("double", "double");
- specialTypeNames.put("java.lang.Class", "ClassDesc");
- specialTypeNames.put("java.lang.String", "WStringValue");
- specialTypeNames.put("org.omg.CORBA.Object", "Object");
-
- specialTypePackages = new HashMap<String, String>();
- specialTypePackages.put("boolean", "");
- specialTypePackages.put("char", "");
- specialTypePackages.put("byte", "");
- specialTypePackages.put("short", "");
- specialTypePackages.put("int", "");
- specialTypePackages.put("long", "");
- specialTypePackages.put("float", "");
- specialTypePackages.put("double", "");
- specialTypePackages.put("java.lang.Class", "javax.rmi.CORBA");
- specialTypePackages.put("java.lang.String", "CORBA");
- specialTypePackages.put("org.omg.CORBA.Object", "");
-
- keywords = new HashSet<String>();
- keywords.add("abstract");
- keywords.add("any");
- keywords.add("attribute");
- keywords.add("boolean");
- keywords.add("case");
- keywords.add("char");
- keywords.add("const");
- keywords.add("context");
- keywords.add("custom");
- keywords.add("default");
- keywords.add("double");
- keywords.add("enum");
- keywords.add("exception");
- keywords.add("factory");
- keywords.add("false");
- keywords.add("fixed");
- keywords.add("float");
- keywords.add("in");
- keywords.add("inout");
- keywords.add("interface");
- keywords.add("long");
- keywords.add("module");
- keywords.add("native");
- keywords.add("object");
- keywords.add("octet");
- keywords.add("oneway");
- keywords.add("out");
- keywords.add("private");
- keywords.add("public");
- keywords.add("raises");
- keywords.add("readonly");
- keywords.add("sequence");
- keywords.add("short");
- keywords.add("string");
- keywords.add("struct");
- keywords.add("supports");
- keywords.add("switch");
- keywords.add("true");
- keywords.add("truncatable");
- keywords.add("typedef");
- keywords.add("union");
- keywords.add("unsigned");
- keywords.add("valuebase");
- keywords.add("valuetype");
- keywords.add("void");
- keywords.add("wchar");
- keywords.add("wstring");
- }
-
- @SuppressWarnings("unchecked")
- public static Map<Operation, Method> mapOperationToMethod(List<Operation> operations, Class<?> forClass) {
- return (Map<Operation, Method>)createMethod2OperationMapping(operations, forClass, false);
- }
-
- @SuppressWarnings("unchecked")
- public static Map<Method, Operation> mapMethodToOperation(List<Operation> operations, Class<?> forClass) {
- return (Map<Method, Operation>)createMethod2OperationMapping(operations, forClass, true);
- }
-
- /**
- * Maps Java methods to Tuscany operations
- */
- @SuppressWarnings("unchecked")
- private static Map createMethod2OperationMapping(List<Operation> operations, Class<?> forClass, boolean method2operation) {
- // for every operation find all methods with the same name, then
- // compare operations and methods parameters
- Map mapping = new HashMap();
- for (Operation operation : operations) {
- List<DataType> inputTypes = operation.getInputType().getLogical();
- Method[] methods = forClass.getMethods();
- for (int i = 0; i < methods.length; i++) {
- if (methods[i].getName().equals(operation.getName()) && inputTypes.size() == methods[i]
- .getParameterTypes().length) {
- Class<?>[] parameterTypes = methods[i].getParameterTypes();
- int j = 0;
- boolean parameterMatch = true;
- for (DataType dataType : inputTypes) {
- if (!dataType.getPhysical().equals(parameterTypes[j])) {
- parameterMatch = false;
- break;
- }
- j++;
- }
- if (parameterMatch) {
- // match found
- if (method2operation) {
- mapping.put(methods[i], operation);
- } else {
- mapping.put(operation, methods[i]);
- }
- break;
- }
- }
- }
- }
- return mapping;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaArray.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaArray.java
deleted file mode 100644
index 24661323be..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaArray.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.corba.meta;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * @version $Rev$ $Date$
- * Declares CORBA arrays lengths
- */
-@Retention(RetentionPolicy.RUNTIME)
-public @interface CorbaArray {
-
- int[] value();
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaUnionElement.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaUnionElement.java
deleted file mode 100644
index 101bda1ba2..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaUnionElement.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.corba.meta;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * @version $Rev$ $Date$ Declares CORBA union object
- */
-@Retention(RetentionPolicy.RUNTIME)
-public @interface CorbaUnionElement {
-
- // number of option in switch clause
- int optionNumber() default -1;
-
- // type of element
- CorbaUnionElementType type();
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaUnionElementType.java b/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaUnionElementType.java
deleted file mode 100644
index 3a46fc2b5f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/meta/CorbaUnionElementType.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.corba.meta;
-
-/**
- * @version $Rev$ $Date$
- * Types for union element
- */
-public enum CorbaUnionElementType {
- discriminator, defaultOption, option;
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-corba-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index 394e7bbd05..0000000000
--- a/branches/sca-android/modules/binding-corba-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.corba.impl.CorbaBindingProviderFactory;model=org.apache.tuscany.sca.binding.corba.CorbaBinding
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaServantTestCase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaServantTestCase.java
deleted file mode 100644
index 93256d7381..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaServantTestCase.java
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing;
-
-import static junit.framework.Assert.fail;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.lang.reflect.Array;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.binding.corba.impl.exceptions.CorbaException;
-import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
-import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaRequest;
-import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaResponse;
-import org.apache.tuscany.sca.binding.corba.impl.service.ComponentInvocationProxy;
-import org.apache.tuscany.sca.binding.corba.impl.service.DynaCorbaServant;
-import org.apache.tuscany.sca.binding.corba.impl.service.InvocationProxy;
-import org.apache.tuscany.sca.binding.corba.impl.types.util.Utils;
-import org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests;
-import org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTestsHelper;
-import org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct;
-import org.apache.tuscany.sca.binding.corba.testing.enums.Color;
-import org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager;
-import org.apache.tuscany.sca.binding.corba.testing.enums.EnumManagerHelper;
-import org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc;
-import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcHelper;
-import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero;
-import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported;
-import org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter;
-import org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetterHelper;
-import org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter;
-import org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetterHelper;
-import org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct;
-import org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct;
-import org.apache.tuscany.sca.binding.corba.testing.generated.TestObject;
-import org.apache.tuscany.sca.binding.corba.testing.generated.TestObjectHelper;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.NonCorbaException;
-import org.apache.tuscany.sca.binding.corba.testing.servants.ArraysSetterServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.ArraysUnionsTuscanyServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.CalcServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.EnumManagerServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.InvalidTestObjectServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.InvalidTypesServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.NonCorbaServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.PrimitivesSetterServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.TestObjectServant;
-import org.apache.tuscany.sca.binding.corba.testing.service.mocks.TestRuntimeComponentService;
-import org.apache.tuscany.sca.host.corba.naming.TransientNameServer;
-import org.apache.tuscany.sca.host.corba.naming.TransientNameService;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.Object;
-import org.omg.CosNaming.NameComponent;
-import org.omg.CosNaming.NamingContext;
-import org.omg.CosNaming.NamingContextHelper;
-
-/**
- * @version $Rev$ $Date$
- * Tests API for dynamic CORBA servants
- */
-public class CorbaServantTestCase {
-
- private static ORB orb;
- private static TransientNameServer server;
-
- @BeforeClass
- public static void start() {
- try {
- server =
- new TransientNameServer(TestConstants.TEST2_HOST, TestConstants.TEST2_PORT,
- TransientNameService.DEFAULT_SERVICE_NAME);
- Thread t = server.start();
- if (t == null) {
- Assert.fail("The naming server cannot be started");
- }
- orb = server.getORB();
- } catch (Throwable e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
- }
-
- @AfterClass
- public static void stop() {
- server.stop();
- }
-
- /**
- * Binds servant implementation to name
- */
- private void bindServant(DynaCorbaServant servant, String name) {
- try {
- Object nameService = orb.resolve_initial_references("NameService");
- NamingContext namingContext = NamingContextHelper.narrow(nameService);
-
- NameComponent nc = new NameComponent(name, "");
- NameComponent[] path = new NameComponent[] {nc};
- namingContext.rebind(path, servant);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Returns object reference which is binded to given name
- *
- * @param name
- * @return
- */
- private org.omg.CORBA.Object bindReference(String name) {
- try {
- org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
- NamingContext ncRef = NamingContextHelper.narrow(objRef);
- NameComponent nc = new NameComponent(name, "");
- NameComponent path[] = {nc};
- return ncRef.resolve(path);
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- /**
- * Tests primitives (arguments, return types)
- */
- @Test
- public void test_primitivesSetter() {
- try {
- PrimitivesSetter primitivesSetter = new PrimitivesSetterServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(primitivesSetter);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- String[] ids =
- new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter:1.0"};
- servant.setIds(ids);
- bindServant(servant, "PrimitivesSetter");
- PrimitivesSetter psClient = PrimitivesSetterHelper.narrow(bindReference("PrimitivesSetter"));
- assertTrue(psClient.setBoolean(true) == true);
- assertTrue(psClient.setChar('A') == 'A');
- assertTrue(psClient.setString("SomeTest").equals("SomeTest"));
- assertTrue(psClient.setDouble(2d) == 2d);
- assertTrue(psClient.setFloat(3f) == 3f);
- assertTrue(psClient.setLong(1) == 1);
- assertTrue(psClient.setLongLong(0L) == 0L);
- assertTrue(psClient.setOctet((byte)8) == (byte)8);
- assertTrue(psClient.setShort((short)6) == (short)6);
- assertTrue(psClient.setUnsignedLong(9) == 9);
- assertTrue(psClient.setUnsignedLongLong(11L) == 11L);
- assertTrue(psClient.setUnsignedShort((short)15) == (short)15);
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests if array values are equal
- */
- private boolean areArraysEqual(java.lang.Object arr1, java.lang.Object arr2, int arrLen) {
- try {
- for (int i = 0; i < arrLen; i++) {
- if (!Array.get(arr1, i).equals(Array.get(arr2, i))) {
- return false;
- }
- }
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return false;
- }
-
- /**
- * Tests arrays (arguments, return types)
- */
- @Test
- public void test_arraysSetter() {
- try {
- ArraysSetter arraysSetter = new ArraysSetterServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(arraysSetter);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter:1.0"};
- servant.setIds(ids);
- java.lang.Object result = null;
- bindServant(servant, "ArraysSetter");
- ArraysSetter asClient = ArraysSetterHelper.narrow(bindReference("ArraysSetter"));
-
- boolean[] bArr = new boolean[] {true, false};
- result = (java.lang.Object)asClient.setBoolean(bArr);
- assertTrue(areArraysEqual(bArr, result, bArr.length));
-
- byte[] byArr = new byte[] {1, 2};
- result = (java.lang.Object)asClient.setOctet(byArr);
- assertTrue(areArraysEqual(byArr, result, byArr.length));
-
- short[] shArr = new short[] {1, 2};
- result = (java.lang.Object)asClient.setShort(shArr);
- assertTrue(areArraysEqual(shArr, result, shArr.length));
-
- int[] iArr = new int[] {1, 2};
- result = (java.lang.Object)asClient.setLong(iArr);
- assertTrue(areArraysEqual(iArr, result, iArr.length));
-
- long[] lArr = new long[] {1, 2};
- result = (java.lang.Object)asClient.setLongLong(lArr);
- assertTrue(areArraysEqual(lArr, result, lArr.length));
-
- String[] strArr = new String[] {"Some", "Test"};
- result = (java.lang.Object)asClient.setString(strArr);
- assertTrue(areArraysEqual(strArr, result, strArr.length));
-
- char[] chArr = new char[] {'A', 'B'};
- result = (java.lang.Object)asClient.setChar(chArr);
- assertTrue(areArraysEqual(chArr, result, chArr.length));
-
- float[] flArr = new float[] {1, 2};
- result = (java.lang.Object)asClient.setFloat(flArr);
- assertTrue(areArraysEqual(flArr, result, flArr.length));
-
- double[] dbArr = new double[] {1, 2};
- result = (java.lang.Object)asClient.setDouble(dbArr);
- assertTrue(areArraysEqual(dbArr, result, dbArr.length));
-
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests structures (arguments, return types)
- */
- @Test
- public void test_TestObject_setStruct() {
- try {
- TestObject to = new TestObjectServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(to);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
- servant.setIds(ids);
- bindServant(servant, "TestObject");
- TestObject testObject = TestObjectHelper.narrow(bindReference("TestObject"));
- SomeStruct ss = new SomeStruct();
- SimpleStruct inner = new SimpleStruct();
- inner.field1 = TestConstants.STR_1;
- inner.field2 = TestConstants.INT_1;
- ss.innerStruct = inner;
- ss.str = TestConstants.STR_2;
- ss.str_list = TestConstants.STR_ARR_1;
- ss.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
- ss.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
- SomeStruct result = testObject.setStruct(ss);
- assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
- assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
- assertTrue(result.str.equals(ss.str));
- assertTrue(result.innerStruct.field1.equals(ss.innerStruct.field1));
- assertTrue(result.innerStruct.field2 == ss.innerStruct.field2);
- assertTrue(areArraysEqual(result.str_list, ss.str_list, ss.str_list.length));
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests handling BAD_OPERATION system exception
- */
- @Test
- public void test_systemException_BAD_OPERATION() {
- try {
- TestObjectServant tos = new TestObjectServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(tos);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
- servant.setIds(ids);
- bindServant(servant, "TestObject");
- DynaCorbaRequest request =
- new DynaCorbaRequest(bindReference("TestObject"), "methodThatSurelyDoesNotExist");
- request.invoke();
- fail();
- } catch (Exception e) {
- if (e instanceof CorbaException) {
- assertTrue(true);
- } else {
- e.printStackTrace();
- }
- }
-
- try {
- InvalidTestObjectServant tos = new InvalidTestObjectServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(tos);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
- servant.setIds(ids);
- bindServant(servant, "InvalidTestObject");
- TestObject to = TestObjectHelper.narrow(bindReference("InvalidTestObject"));
- SomeStruct str = new SomeStruct();
- str.innerStruct = new SimpleStruct();
- str.innerStruct.field1 = "Whatever";
- str.str = "Whatever";
- str.str_list = new String[] {};
- str.threeDimSeq = new int[][][] {};
- str.twoDimSeq = new int[][] {};
- to.setStruct(str);
- } catch (Exception e) {
- if (e instanceof BAD_OPERATION) {
- assertTrue(true);
- } else {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Tests handling user exceptions
- */
- @Test
- public void test_userExceptions() {
- try {
- CalcServant calc = new CalcServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(calc);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- String[] ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0"};
- servant.setIds(ids);
- bindServant(servant, "Calc");
- Calc calcClient = CalcHelper.narrow(bindReference("Calc"));
- calcClient.div(1, 0);
- fail();
- } catch (Exception e) {
- if (e instanceof DivByZero) {
- assertTrue(true);
- } else {
- e.printStackTrace();
- fail();
- }
- }
-
- try {
- CalcServant calc = new CalcServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(calc);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- String[] ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0"};
- servant.setIds(ids);
- bindServant(servant, "Calc");
- Calc calcClient = CalcHelper.narrow(bindReference("Calc"));
- calcClient.divForSmallArgs(255, 255);
- fail();
- } catch (Exception e) {
- if (e instanceof NotSupported) {
- assertTrue(true);
- } else {
- e.printStackTrace();
- fail();
- }
- }
- }
-
- /**
- * Tests enums (arguments, return types)
- */
- @Test
- public void test_enums() {
- try {
- EnumManagerServant ems = new EnumManagerServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(ems);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- String[] ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager:1.0"};
- servant.setIds(ids);
- bindServant(servant, "Enum");
- EnumManager em = EnumManagerHelper.narrow(bindReference("Enum"));
- Color color = Color.red;
- assertTrue(em.getColor(color).value() == color.value());
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- @Test
- public void test_nonCorbaServants() {
- try {
- NonCorbaServant ncs = new NonCorbaServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(ncs);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- bindServant(servant, "NonCorbaServant");
- // it's non corba servant so we don't have stubs to test them
- DynaCorbaRequest request = new DynaCorbaRequest(bindReference("NonCorbaServant"), "setString");
- request.addArgument(TestConstants.STR_1);
- request.setOutputType(String.class);
- DynaCorbaResponse response = request.invoke();
- assertTrue(response.getContent().equals(TestConstants.STR_1));
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
-
- try {
- NonCorbaServant ncs = new NonCorbaServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(ncs);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- bindServant(servant, "NonCorbaServant");
- // it's non corba servant so we don't have stubs to test them
- DynaCorbaRequest request = new DynaCorbaRequest(bindReference("NonCorbaServant"), "throwException");
- request.addExceptionType(NonCorbaException.class);
- request.invoke();
- fail();
- } catch (Exception e) {
- if (e instanceof NonCorbaException) {
- assertTrue(true);
- } else {
- e.printStackTrace();
- fail();
- }
- }
- }
-
- /**
- * Tests handling BAD_PARAM system exception
- */
- @Test
- public void test_systemException_BAD_PARAM() {
- try {
- CalcServant calc = new CalcServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(calc);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
- servant.setIds(ids);
- bindServant(servant, "Calc");
- DynaCorbaRequest request = new DynaCorbaRequest(bindReference("Calc"), "div");
- request.addArgument(2d);
- request.setOutputType(double.class);
- request.invoke();
- fail();
- } catch (Exception e) {
- if (e instanceof CorbaException) {
- assertTrue(true);
- } else {
- e.printStackTrace();
- fail();
- }
- }
- }
-
- /**
- * Tests handling BAD_PARAM system exception
- */
- @Test
- public void test_invalidServantConfiguraion() {
- try {
- InvalidTypesServant its = new InvalidTypesServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(its);
- //expecting exception...
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- fail();
- } catch (Exception e) {
- if (e instanceof RequestConfigurationException) {
- assertTrue(true);
- } else {
- e.printStackTrace();
- fail();
- }
- }
- }
-
- /**
- * Tests serving CORBA arrays by Tuscany CORBA servants
- */
- @Test
- public void test_arraysPassing() {
- try {
- ArraysUnionsTuscanyServant arraysUnions = new ArraysUnionsTuscanyServant();
- TestRuntimeComponentService service = new TestRuntimeComponentService(arraysUnions);
- Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
- InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
- DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
- String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests:1.0"};
- servant.setIds(ids);
- bindServant(servant, "ArraysUnions");
- Object reference = bindReference("ArraysUnions");
- ArraysUnionsTests objRef = ArraysUnionsTestsHelper.narrow(reference);
- String[][] stringArray = {{"Hello", "World"}, {"Hi", "Again"}};
- String[][] result = objRef.passStringArray(stringArray);
- for (int i = 0; i < stringArray.length; i++) {
- for (int j = 0; j < stringArray[i].length; j++) {
- assertEquals(stringArray[i][j], result[i][j]);
- }
- }
- TestStruct struct = new TestStruct();
- String[] field1 = {"Hello", "World"};
- int[][] field2 = { {4, 2, 2, 5}, {6, 12, 5, 8}};
- float[][][] field3 = { { {2, 6}, {2, 7}, {9, 3}, {4, 6}}, { {3, 7}, {6, 6}, {3, 5}, {6, 2}}};
- struct.oneDimArray = field1;
- struct.twoDimArray = field2;
- struct.threeDimArray = field3;
-
- TestStruct structResult = objRef.passTestStruct(struct);
- for (int i = 0; i < struct.oneDimArray.length; i++) {
- assertEquals(struct.oneDimArray[i], structResult.oneDimArray[i]);
- }
- for (int i = 0; i < struct.twoDimArray.length; i++) {
- for (int j = 0; j < struct.twoDimArray[i].length; j++) {
- assertEquals(struct.twoDimArray[i][j], structResult.twoDimArray[i][j]);
- }
- }
- for (int i = 0; i < struct.threeDimArray.length; i++) {
- for (int j = 0; j < struct.threeDimArray[i].length; j++) {
- for (int k = 0; k < struct.threeDimArray[i][j].length; k++) {
- assertEquals(struct.threeDimArray[i][j][k], structResult.threeDimArray[i][j][k]);
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaTypesTestCase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaTypesTestCase.java
deleted file mode 100644
index 927f43652b..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaTypesTestCase.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.corba.testing;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Array;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.binding.corba.impl.exceptions.CorbaException;
-import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
-import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaRequest;
-import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaResponse;
-import org.apache.tuscany.sca.binding.corba.testing.enums.Color;
-import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero;
-import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported;
-import org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct;
-import org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.ArraysTestStruct;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.DummyObject;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InnerUnion;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidCorbaArray;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidEnum1;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidEnum2;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidEnum3;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidStruct1;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidStruct2;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidStruct3;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidUnion1;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidUnion2;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidUnion3;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidUnion4;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidUnion5;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.RichUnion;
-import org.apache.tuscany.sca.binding.corba.testing.servants.ArraysSetterServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.ArraysUnionsServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.ArraysUnionsTuscanyServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.CalcServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.EnumManagerServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.ObjectManagerServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.PrimitivesSetterServant;
-import org.apache.tuscany.sca.binding.corba.testing.servants.TestObjectServant;
-import org.apache.tuscany.sca.host.corba.naming.TransientNameServer;
-import org.apache.tuscany.sca.host.corba.naming.TransientNameService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.Object;
-import org.omg.CosNaming.NameComponent;
-import org.omg.CosNaming.NamingContext;
-import org.omg.CosNaming.NamingContextExt;
-import org.omg.CosNaming.NamingContextExtHelper;
-import org.omg.CosNaming.NamingContextHelper;
-
-/**
- * @version $Rev$ $Date$
- * Tests API for dynamic CORBA requests. Tests handling various Java
- * types.
- */
-public class CorbaTypesTestCase {
- private static TransientNameServer server;
- private static ORB orb;
-
- private static Object refPrimitivesSetter;
- private static Object refArraysSetter;
- private static Object refTestObject;
- private static Object refCalcObject;
- private static Object refObjectManager;
- private static Object refEnumManager;
- private static Object refArraysUnions;
-
- /**
- * Spawns tnameserv process (must be in PATH). Initializes test servants and
- * stores it's references so tests can use it.
- */
- @BeforeClass
- public static void setUp() {
- try {
- try {
- server =
- new TransientNameServer(TestConstants.TEST1_HOST, TestConstants.TEST1_PORT,
- TransientNameService.DEFAULT_SERVICE_NAME);
- Thread t = server.start();
- if (t == null) {
- Assert.fail("The naming server cannot be started");
- }
- orb = server.getORB();
- } catch (Throwable e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
-
- Object nameService = orb.resolve_initial_references("NameService");
- NamingContext namingContext = NamingContextHelper.narrow(nameService);
-
- PrimitivesSetterServant singleSetter = new PrimitivesSetterServant();
- ArraysSetterServant arraysSetter = new ArraysSetterServant();
- TestObjectServant complexObject = new TestObjectServant();
- CalcServant calcObject = new CalcServant();
- ObjectManagerServant objectManager = new ObjectManagerServant();
- EnumManagerServant enumManager = new EnumManagerServant();
- ArraysUnionsServant arraysUnions = new ArraysUnionsServant();
-
- orb.connect(singleSetter);
- orb.connect(arraysSetter);
-
- NameComponent nc;
- NameComponent[] path;
-
- nc = new NameComponent("PrimitivesSetter", "");
- path = new NameComponent[] {nc};
- namingContext.rebind(path, singleSetter);
-
- nc = new NameComponent("ArraysSetter", "");
- path = new NameComponent[] {nc};
- namingContext.rebind(path, arraysSetter);
-
- nc = new NameComponent("TestObject", "");
- path = new NameComponent[] {nc};
- namingContext.rebind(path, complexObject);
-
- nc = new NameComponent("CalcObject", "");
- path = new NameComponent[] {nc};
- namingContext.rebind(path, calcObject);
-
- nc = new NameComponent("ObjectManager", "");
- path = new NameComponent[] {nc};
- namingContext.rebind(path, objectManager);
-
- nc = new NameComponent("EnumManager", "");
- path = new NameComponent[] {nc};
- namingContext.rebind(path, enumManager);
-
- nc = new NameComponent("ArraysUnions", "");
- path = new NameComponent[] {nc};
- namingContext.rebind(path, arraysUnions);
-
- NamingContextExt nce = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
-
- refArraysSetter = nce.resolve(nce.to_name("ArraysSetter"));
- refPrimitivesSetter = nce.resolve(nce.to_name("PrimitivesSetter"));
- refTestObject = nce.resolve(nce.to_name("TestObject"));
- refCalcObject = nce.resolve(nce.to_name("CalcObject"));
- refObjectManager = nce.resolve(nce.to_name("ObjectManager"));
- refEnumManager = nce.resolve(nce.to_name("EnumManager"));
- refArraysUnions = nce.resolve(nce.to_name("ArraysUnions"));
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void stop() {
- server.stop();
- }
-
- /**
- * Tests remote operation, basing on given reference, operation name,
- * arguments, expected return type and content
- *
- * @param ref remote object
- * @param operationName operation to invoke
- * @param clazz expected return type
- * @param arguments array of operation arguments
- * @param equalTo expected return content
- */
- private void dynaTestInvoker(Object ref,
- String operationName,
- Class<?> clazz,
- java.lang.Object[] arguments,
- java.lang.Object equalTo) {
-
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(ref, operationName);
- request.setOutputType(clazz);
- for (int i = 0; arguments != null && i < arguments.length; i++) {
- request.addArgument(arguments[i]);
- }
-
- DynaCorbaResponse response = request.invoke();
- java.lang.Object content = (java.lang.Object)response.getContent();
- assertTrue(content.getClass().equals(clazz));
- if (equalTo != null && equalTo.getClass().isArray()) {
- for (int i = 0; i < Array.getLength(equalTo); i++) {
- assertTrue(Array.get(content, i).equals(Array.get(equalTo, i)));
- }
- } else {
- assertTrue(content.equals(equalTo));
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail("Error while invoking " + operationName);
- }
- }
-
- /**
- * Tests passing (and getting as result) varied primitives
- */
- @Test
- public void test_setPrimitives() {
-
- dynaTestInvoker(refPrimitivesSetter, "setBoolean", Boolean.class, new Boolean[] {true}, true);
- dynaTestInvoker(refPrimitivesSetter, "setOctet", Byte.class, new Byte[] {1}, (byte)1);
- dynaTestInvoker(refPrimitivesSetter, "setChar", Character.class, new Character[] {'A'}, 'A');
- dynaTestInvoker(refPrimitivesSetter, "setShort", Short.class, new Short[] {1}, (short)1);
- dynaTestInvoker(refPrimitivesSetter, "setLong", Integer.class, new Integer[] {1}, (int)1);
- dynaTestInvoker(refPrimitivesSetter, "setLongLong", Long.class, new Long[] {(long)1}, (long)1);
- dynaTestInvoker(refPrimitivesSetter, "setFloat", Float.class, new Float[] {(float)1}, (float)1);
- dynaTestInvoker(refPrimitivesSetter, "setDouble", Double.class, new Double[] {(double)1}, (double)1);
- dynaTestInvoker(refPrimitivesSetter, "setString", String.class, new String[] {"1"}, "1");
-
- }
-
- /**
- * Tests passing (and getting as result) varied types sequences
- */
- @Test
- public void test_setArrays() {
-
- dynaTestInvoker(refArraysSetter,
- "setBoolean",
- Boolean[].class,
- new Boolean[][] {new Boolean[] {false, true}},
- new Boolean[] {false, true});
-
- dynaTestInvoker(refArraysSetter,
- "setChar",
- Character[].class,
- new Character[][] {new Character[] {'A', 'B'}},
- new Character[] {'A', 'B'});
-
- dynaTestInvoker(refArraysSetter, "setOctet", Byte[].class, new Byte[][] {new Byte[] {1, 2}}, new Byte[] {1, 2});
-
- dynaTestInvoker(refArraysSetter, "setShort", Short[].class, new Short[][] {new Short[] {1, 2}}, new Short[] {1,
- 2});
-
- dynaTestInvoker(refArraysSetter,
- "setLong",
- Integer[].class,
- new Integer[][] {new Integer[] {1, 2}},
- new Integer[] {1, 2});
-
- dynaTestInvoker(refArraysSetter,
- "setLongLong",
- Long[].class,
- new Long[][] {new Long[] {new Long(1), new Long(2)}},
- new Long[] {new Long(1), new Long(2)});
-
- dynaTestInvoker(refArraysSetter,
- "setFloat",
- Float[].class,
- new Float[][] {new Float[] {new Float(1.0), new Float(2.0)}},
- new Float[] {new Float(1.0), new Float(2.0)});
-
- dynaTestInvoker(refArraysSetter,
- "setDouble",
- Double[].class,
- new Double[][] {new Double[] {new Double(1.0), new Double(2.0)}},
- new Double[] {new Double(1.0), new Double(2.0)});
-
- dynaTestInvoker(refArraysSetter,
- "setString",
- String[].class,
- new String[][] {new String[] {"A", "B"}},
- new String[] {"A", "B"});
-
- }
-
- /**
- * Tests passing (and getting as result) complex structure
- */
- @Test
- public void test_TestObject_setStruct() {
- DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "setStruct");
-
- SomeStruct struct = new SomeStruct();
- SimpleStruct inner = new SimpleStruct();
- inner.field1 = TestConstants.STR_1;
- inner.field2 = TestConstants.INT_1;
- struct.innerStruct = inner;
- struct.str_list = TestConstants.STR_ARR_2;
- struct.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
- struct.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
- struct.str = TestConstants.STR_1;
-
- try {
- request.addArgument(struct);
- request.setOutputType(SomeStruct.class);
- DynaCorbaResponse response = request.invoke();
- SomeStruct result = (SomeStruct)response.getContent();
- assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
- assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
- assertEquals(TestConstants.STR_1, result.str);
- assertEquals(TestConstants.STR_ARR_2[0], result.str_list[0]);
- assertEquals(TestConstants.STR_ARR_2[1], result.str_list[1]);
- assertEquals(TestConstants.STR_1, result.innerStruct.field1);
- assertEquals(TestConstants.INT_1, result.innerStruct.field2);
- } catch (Exception e) {
- e.printStackTrace();
- fail("Exception occured during tests: " + e);
- }
- }
-
- /**
- * Test passing (and getting as result) simple two-field structure
- */
- @Test
- public void test_TestObject_setSimpleStruct() {
- SimpleStruct struct = new SimpleStruct();
- struct.field1 = TestConstants.STR_1;
- struct.field2 = TestConstants.INT_1;
- DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "setSimpleStruct");
- try {
- request.setOutputType(SimpleStruct.class);
- request.addArgument(struct);
- DynaCorbaResponse response = request.invoke();
- SimpleStruct retStruct = (SimpleStruct)response.getContent();
- assertTrue(retStruct.field1.equals(struct.field1) && retStruct.field2 == struct.field2);
- } catch (Exception e) {
- e.printStackTrace();
- fail("Exception occured during tests: " + e);
- }
- }
-
- /**
- * Tests passing (and getting as result) two dim. sequence of long.
- */
- @Test
- public void test_TestObject_setLongSeq2() {
- int[][] arr1 = new int[2][2];
- for (int i = 0; i < 2; i++) {
- for (int j = 0; j < 2; j++) {
- arr1[i][j] = (int)(Math.random() * 1000);
- }
- }
- DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "setLongSeq2");
- try {
- request.setOutputType(arr1.getClass());
- request.addArgument(arr1);
- DynaCorbaResponse response = request.invoke();
- int[][] arr2 = (int[][])response.getContent();
- for (int i = 0; i < 2; i++) {
- for (int j = 0; j < 2; j++) {
- assertEquals(arr1[i][j], arr2[i][j]);
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail("Exception occured during tests: " + e);
- }
- }
-
- /**
- * Tests passing multiple complex attributes.
- */
- @Test
- public void test_TestObject_pickStructFromArgs() {
- SomeStruct arg1 = new SomeStruct();
- SomeStruct arg2 = new SomeStruct();
- SomeStruct arg3 = new SomeStruct();
-
- SimpleStruct inner = new SimpleStruct();
- inner.field1 = TestConstants.STR_1;
- inner.field2 = TestConstants.INT_1;
-
- arg1.innerStruct = inner;
- arg2.innerStruct = inner;
- arg3.innerStruct = inner;
-
- arg1.str = TestConstants.STR_1;
- arg2.str = TestConstants.STR_2;
- arg3.str = TestConstants.STR_3;
-
- arg1.str_list = TestConstants.STR_ARR_1;
- arg2.str_list = TestConstants.STR_ARR_2;
- arg3.str_list = TestConstants.STR_ARR_2;
-
- arg1.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
- arg2.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
- arg3.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
-
- arg1.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
- arg2.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
- arg3.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
-
- DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "pickStructFromArgs");
- try {
-
- request.setOutputType(SomeStruct.class);
- request.addArgument(arg1);
- request.addArgument(arg2);
- request.addArgument(arg3);
- request.addArgument(1);
- DynaCorbaResponse response = request.invoke();
- SomeStruct result = (SomeStruct)response.getContent();
-
- // just make sure that servant returned right structure
- assertTrue(result.str.equals(TestConstants.STR_1));
- } catch (Exception e) {
- fail("Exception occured during tests " + e);
- e.printStackTrace();
- }
-
- }
-
- /**
- * Tests handling user defined remote exception (single declared)
- */
- @Test
- public void test_singleException() {
- DynaCorbaRequest request1 = new DynaCorbaRequest(refCalcObject, "div");
- try {
- request1.addArgument(2d);
- request1.addArgument(2d);
- request1.setOutputType(Double.class);
- request1.addExceptionType(DivByZero.class);
- request1.invoke();
- } catch (Exception e) {
- fail();
- }
-
- DynaCorbaRequest request2 = new DynaCorbaRequest(refCalcObject, "div");
- try {
- request2.addArgument(2d);
- request2.addArgument(0d);
- request2.setOutputType(Double.class);
- request2.addExceptionType(DivByZero.class);
- request2.invoke();
- } catch (DivByZero e) {
- assertTrue(e.info != null && e.arguments != null && e.arguments.arg1 == 2 && e.arguments.arg2 == 0);
- } catch (Exception exc) {
- exc.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests handling user defined multiple exceptions
- */
- @Test
- public void test_multipleExceptions() {
- DynaCorbaRequest request = new DynaCorbaRequest(refCalcObject, "divForSmallArgs");
- try {
- request.addArgument(101d);
- request.addArgument(101d);
- request.setOutputType(Double.class);
- request.addExceptionType(DivByZero.class);
- request.addExceptionType(NotSupported.class);
- request.invoke();
- } catch (Exception e) {
- assertTrue(e instanceof NotSupported);
- }
- }
-
- /**
- * Tests handling exceptions while user defined no exceptions
- */
- @Test
- public void test_noExceptionsDeclared() {
- DynaCorbaRequest request = new DynaCorbaRequest(refCalcObject, "div");
- try {
- request.addArgument(1d);
- request.addArgument(0d);
- request.setOutputType(Double.class);
- request.invoke();
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof RequestConfigurationException);
- }
- }
-
- /**
- * Tests handling exceptions while user defined no such exception
- */
- @Test
- public void test_noSuchExceptionDeclared() {
- DynaCorbaRequest request = new DynaCorbaRequest(refCalcObject, "div");
- try {
- request.addArgument(1d);
- request.addArgument(0d);
- request.addExceptionType(NotSupported.class);
- request.setOutputType(Double.class);
- request.invoke();
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof RequestConfigurationException);
- }
- }
-
- /**
- * Tests handling non existing operation situation
- */
- @Test
- public void test_systemException_BAD_OPERATION() {
- DynaCorbaRequest request = new DynaCorbaRequest(refCalcObject, "thisOperationSurelyDoesNotExist");
- try {
- request.invoke();
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof CorbaException);
- }
- }
-
- /**
- * Tests obtaining references to other objects and using them with specified
- * user interface
- */
- @Test
- @Ignore("Cause of tnameservice hang on stop")
- public void test_enchancedReferences() {
- DynaCorbaRequest request = null;
- try {
- request = new DynaCorbaRequest(refObjectManager, "getDummyObject");
- request.setOutputType(DummyObject.class);
- DynaCorbaResponse response = request.invoke();
- DummyObject dummy = (DummyObject)response.getContent();
- DummyObject dummy2 = dummy.cloneObject();
- dummy2.cloneObject();
- assertNotSame(dummy.getLong(), dummy2.getLong());
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Test passing enums as arguments and retrieving them as a result
- */
- @Test
- public void test_enums() {
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refEnumManager, "getColor");
- Color color = Color.green;
- request.addArgument(color);
- request.setOutputType(Color.class);
- DynaCorbaResponse response = request.invoke();
- Color result = (Color)response.getContent();
- assertEquals(color.value(), result.value());
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests recognizing structures
- */
- @Test
- public void test_structValidation() {
- DynaCorbaRequest request = null;
- try {
- request = new DynaCorbaRequest(refArraysSetter, "whatever");
- request.setOutputType(InvalidStruct1.class);
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof RequestConfigurationException);
- }
-
- try {
- request = new DynaCorbaRequest(refArraysSetter, "whatever");
- request.setOutputType(InvalidStruct2.class);
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof RequestConfigurationException);
- }
-
- try {
- request = new DynaCorbaRequest(refArraysSetter, "whatever");
- request.setOutputType(InvalidStruct3.class);
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof RequestConfigurationException);
- }
-
- try {
- request = new DynaCorbaRequest(refArraysSetter, "whatever");
- request.setOutputType(SomeStruct.class);
- } catch (Exception e) {
- fail();
- }
- }
-
- /**
- * Tests recognizing enums
- */
- @Test
- public void test_enumValidation() {
- DynaCorbaRequest request = null;
- try {
- request = new DynaCorbaRequest(refArraysSetter, "whatever");
- request.setOutputType(InvalidEnum1.class);
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof RequestConfigurationException);
- }
-
- try {
- request = new DynaCorbaRequest(refArraysSetter, "whatever");
- request.setOutputType(InvalidEnum2.class);
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof RequestConfigurationException);
- }
-
- try {
- request = new DynaCorbaRequest(refArraysSetter, "whatever");
- request.setOutputType(InvalidEnum3.class);
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof RequestConfigurationException);
- }
-
- try {
- request = new DynaCorbaRequest(refArraysSetter, "whatever");
- request.setOutputType(Color.class);
- } catch (Exception e) {
- fail();
- }
- }
-
- /**
- * Tests handling passing wrong params
- */
- @Test
- public void test_systemException_BAD_PARAM() {
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refCalcObject, "div");
- request.setOutputType(Double.class);
- request.addArgument(3d);
- request.invoke();
- fail();
- } catch (Exception e) {
- if (e instanceof CorbaException) {
- assertTrue(true);
- } else {
- e.printStackTrace();
- fail();
- }
- }
- }
-
- /**
- * Tests passing CORBA arrays
- */
- @Test
- public void test_arraysPassing() {
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "passStringArray");
- Annotation[] notes =
- ArraysUnionsTuscanyServant.class.getMethod("passStringArray", new Class<?>[] {String[][].class})
- .getAnnotations();
- request.setOutputType(String[][].class, notes);
- String[][] argument = { {"Hello", "World"}, {"Hi", "again"}};
- request.addArgument(argument, notes);
- DynaCorbaResponse response = request.invoke();
- String[][] result = (String[][])response.getContent();
- for (int i = 0; i < argument.length; i++) {
- for (int j = 0; j < argument[i].length; j++) {
- assertEquals(argument[i][j], result[i][j]);
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
-
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "passTestStruct");
- ArraysTestStruct arg = new ArraysTestStruct();
- String[] field1 = {"Hello", "World"};
- arg.field1 = field1;
- int[][] field2 = { {4, 2, 2, 5}, {6, 12, 5, 8}};
- arg.field2 = field2;
- float[][][] field3 = { { {2, 6}, {2, 7}, {9, 3}, {4, 6}}, { {3, 7}, {6, 6}, {3, 5}, {6, 2}}};
- arg.field3 = field3;
- request.addArgument(arg);
- request.setOutputType(ArraysTestStruct.class);
- DynaCorbaResponse response = request.invoke();
- ArraysTestStruct result = (ArraysTestStruct)response.getContent();
- for (int i = 0; i < arg.field1.length; i++) {
- assertEquals(arg.field1[i], result.field1[i]);
- }
- for (int i = 0; i < arg.field2.length; i++) {
- for (int j = 0; j < arg.field2[i].length; j++) {
- assertEquals(arg.field2[i][j], result.field2[i][j]);
- }
- }
- for (int i = 0; i < arg.field2.length; i++) {
- for (int j = 0; j < arg.field2[i].length; j++) {
- for (int k = 0; k < arg.field3[i][j].length; k++) {
- assertEquals(arg.field3[i][j][k], result.field3[i][j][k]);
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests situation when CORBA array dimension size doesn't match
- * CORBA array annotation arguments (which sets dimension lengths)
- */
- @Test
- public void test_invalidArrayAnnotationSize() {
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "passStringArray");
- Annotation[] notes =
- ArraysUnionsTuscanyServant.class.getMethod("passStringArray", new Class<?>[] {String[][].class})
- .getAnnotations();
- request.setOutputType(String[][][].class, notes);
- fail();
- } catch (RequestConfigurationException e) {
- // expected
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "passStringArray");
- Annotation[] notes =
- ArraysUnionsTuscanyServant.class.getMethod("passStringArray", new Class<?>[] {String[][].class})
- .getAnnotations();
- request.addArgument(new String[0][0][0], notes);
- fail();
- } catch (RequestConfigurationException e) {
- // expected
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "passStringArray");
- request.addArgument(new InvalidCorbaArray(), null);
- fail();
- } catch (RequestConfigurationException e) {
- // expected
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests passing CORBA unions
- */
- @Test
- public void test_passingUnions() {
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "passRichUnion");
- request.setOutputType(RichUnion.class);
- RichUnion arg = new RichUnion();
- InnerUnion argIu = new InnerUnion();
- argIu.setX(10);
- arg.setIu(argIu);
- request.addArgument(arg);
- DynaCorbaResponse response = request.invoke();
- RichUnion result = (RichUnion)response.getContent();
- assertEquals(arg.getIu().getX(), result.getIu().getX());
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "passRichUnion");
- request.setOutputType(RichUnion.class);
- RichUnion arg = new RichUnion();
- arg.setDef(true);
- request.addArgument(arg);
- DynaCorbaResponse response = request.invoke();
- RichUnion result = (RichUnion)response.getContent();
- assertEquals(arg.isDef(), result.isDef());
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests handling invalid union declarations
- */
- @Test
- public void test_testInvalidUnionClasses() {
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "whatever");
- request.setOutputType(InvalidUnion1.class);
- } catch (Exception e) {
- assertEquals(RequestConfigurationException.class, e.getClass());
- }
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "whatever");
- request.setOutputType(InvalidUnion2.class);
- } catch (Exception e) {
- assertEquals(RequestConfigurationException.class, e.getClass());
- }
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "whatever");
- request.setOutputType(InvalidUnion3.class);
- } catch (Exception e) {
- assertEquals(RequestConfigurationException.class, e.getClass());
- }
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "whatever");
- request.setOutputType(InvalidUnion4.class);
- } catch (Exception e) {
- assertEquals(RequestConfigurationException.class, e.getClass());
- }
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "whatever");
- request.setOutputType(InvalidUnion5.class);
- } catch (Exception e) {
- assertEquals(RequestConfigurationException.class, e.getClass());
- }
- }
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/MappingTestInterface.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/MappingTestInterface.java
deleted file mode 100644
index f0dccd9e7e..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/MappingTestInterface.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.corba.testing;
-
-/**
- * @version $Rev$ $Date$
- * Interface that can be tested for operations mapping
- */
-public interface MappingTestInterface {
-
- int getIntField();
-
- void setIntField(int intField);
-
- boolean isBoolField();
-
- void setBoolField(boolean boolField);
-
- void overloadedName();
-
- void overloadedName(String arg1);
-
- void overloadedName(String arg1, int arg2);
-
- void caseCollision();
-
- void CaseCollision();
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/MethodFinderTestCase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/MethodFinderTestCase.java
deleted file mode 100644
index 725ce0ec41..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/MethodFinderTestCase.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.corba.testing;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.binding.corba.impl.util.MethodFinder;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- * Various tests for MethodFinder
- */
-public class MethodFinderTestCase {
-
- /**
- * Tests finding existing methods
- */
- @Test
- public void test_findExistingMethod() {
- try {
- String methodName = "rotateLeft";
- Method sample = Integer.class.getMethod(methodName, new Class<?>[] {int.class, int.class});
- Method m1 = MethodFinder.findMethod(Integer.class, methodName, new Class<?>[] {int.class, int.class});
- Method m2 =
- MethodFinder.findMethod(Integer.class, methodName, new Class<?>[] {Integer.class, Integer.class});
- assertEquals(sample, m1);
- assertEquals(sample, m2);
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests null result value for not existing method
- */
- @Test
- public void test_findNotExistingMethod() {
- try {
- String methodName = "rotateLeft";
- Method method = MethodFinder.findMethod(Integer.class, methodName, new Class<?>[] {});
- assertEquals(null, method);
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/OperationMappingTestCase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/OperationMappingTestCase.java
deleted file mode 100644
index 0dd34c26e8..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/OperationMappingTestCase.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.corba.testing;
-
-import static org.junit.Assert.assertEquals;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import org.apache.tuscany.sca.binding.corba.impl.util.OperationMapper;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- * Various tests for OperationsMapping
- */
-public class OperationMappingTestCase {
-
- /**
- * Tests if Java2IDLUtil maps methods to operations correctly
- */
- @Test
- public void test_mappingRules() {
- Map<Method, String> met2op = OperationMapper.mapMethodToOperationName(MappingTestInterface.class);
- for (Method method : met2op.keySet()) {
- String name = method.getName();
- String translatedName = met2op.get(method);
- if (name.equals("getIntField")) {
- assertEquals("_get_intField", translatedName);
- } else if (name.equals("setIntField")) {
- assertEquals("_set_intField", translatedName);
- } else if (name.equals("isBoolField")) {
- assertEquals("_get_boolField", translatedName);
- } else if (name.equals("setBoolField")) {
- assertEquals("_set_boolField", translatedName);
- } else if (name.equals("overloadedName") && method.getParameterTypes().length == 0) {
- assertEquals("overloadedName__", translatedName);
- } else if (name.equals("overloadedName") && method.getParameterTypes().length == 1) {
- assertEquals("overloadedName__CORBA_WStringValue", translatedName);
- } else if (name.equals("overloadedName") && method.getParameterTypes().length == 2) {
- assertEquals("overloadedName__CORBA_WStringValue__long", translatedName);
- } else if (name.equals("caseCollision")) {
- assertEquals("caseCollision_4", translatedName);
- } else if (name.equals("CaseCollision")) {
- assertEquals("CaseCollision_0_4", translatedName);
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/TestConstants.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/TestConstants.java
deleted file mode 100644
index 962a00d002..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/TestConstants.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.corba.testing;
-
-/**
- * Some constants and utilities for module tests
- * @version $Rev$ $Date$
- */
-public class TestConstants {
-
- public static final String STR_1 = "Hello world!";
- public static final String STR_2 = "2nd string";
- public static final String STR_3 = "Other string";
- public static final String[] STR_ARR_1 = {"Hello", "World"};
- public static final String[] STR_ARR_2 = {"Another", "string", "array"};
- public static final int INT_1 = 0;
-
- public static final int TEST1_PORT = 11100;
- public static final String TEST1_HOST = "localhost";
-
- public static final int TEST2_PORT = 11101;
- public static final String TEST2_HOST = "localhost";
-
- public static final int[][] INT_ARRAY_2_DIM = { {1, 2}, {3, 4}};
- public static final int[][][] INT_ARRAY_3_DIM = { { {1, 2}, {3, 4}}, { {5, 6}, {7, 8}}};
-
- public static final long TNAMESERV_SPAWN_WAIT = 300;
-
- /**
- * Tests if given 2D arrays values are equal
- * @param arr1
- * @param arr2
- * @return
- */
- public static boolean are2DimArraysEqual(int[][] arr1, int[][] arr2) {
- int sum = 0;
- int expSum = 0;
- for (int i = 0; i < arr1.length; i++) {
- for (int j = 0; j < arr1[i].length; j++) {
- expSum++;
- if (arr1[i][j] == arr2[i][j]) {
- sum++;
- }
- }
- }
- return sum == expSum;
- }
-
- /**
- * Tests if given 3D arrays values are equal
- * @param arr1
- * @param arr2
- * @return
- */
- public static boolean are3DimArraysEqual(int[][][] arr1, int[][][] arr2) {
- int sum = 0;
- int expSum = 0;
- for (int i = 0; i < arr1.length; i++) {
- for (int j = 0; j < arr1[i].length; j++) {
- for (int k = 0; k < arr1[i][j].length; k++) {
- expSum++;
- if (arr1[i][j][k] == arr2[i][j][k]) {
- sum++;
- }
- }
- }
- }
- return sum == expSum;
- }
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests.java
deleted file mode 100644
index f4ca1577f5..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public interface ArraysUnionsTests extends ArraysUnionsTestsOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity
-{
-} // interface ArraysUnionsTests
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsHelper.java
deleted file mode 100644
index d10bc498b7..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsHelper.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-abstract public class ArraysUnionsTestsHelper
-{
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests:1.0";
-
- public static void insert (org.omg.CORBA.Any a, org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests that)
- {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
- a.type (type ());
- write (out, that);
- a.read_value (out.create_input_stream (), type ());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests extract (org.omg.CORBA.Any a)
- {
- return read (a.create_input_stream ());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
- synchronized public static org.omg.CORBA.TypeCode type ()
- {
- if (__typeCode == null)
- {
- __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTestsHelper.id (), "ArraysUnionsTests");
- }
- return __typeCode;
- }
-
- public static String id ()
- {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests read (org.omg.CORBA.portable.InputStream istream)
- {
- return narrow (istream.read_Object (_ArraysUnionsTestsStub.class));
- }
-
- public static void write (org.omg.CORBA.portable.OutputStream ostream, org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests value)
- {
- ostream.write_Object ((org.omg.CORBA.Object) value);
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests narrow (org.omg.CORBA.Object obj)
- {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests)
- return (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests)obj;
- else if (!obj._is_a (id ()))
- throw new org.omg.CORBA.BAD_PARAM ();
- else
- {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions._ArraysUnionsTestsStub stub = new org.apache.tuscany.sca.binding.corba.testing.arrays_unions._ArraysUnionsTestsStub ();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests unchecked_narrow (org.omg.CORBA.Object obj)
- {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests)
- return (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests)obj;
- else
- {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions._ArraysUnionsTestsStub stub = new org.apache.tuscany.sca.binding.corba.testing.arrays_unions._ArraysUnionsTestsStub ();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsHolder.java
deleted file mode 100644
index 98987c1252..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsHolder.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public final class ArraysUnionsTestsHolder implements org.omg.CORBA.portable.Streamable
-{
- public org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests value = null;
-
- public ArraysUnionsTestsHolder ()
- {
- }
-
- public ArraysUnionsTestsHolder (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests initialValue)
- {
- value = initialValue;
- }
-
- public void _read (org.omg.CORBA.portable.InputStream i)
- {
- value = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTestsHelper.read (i);
- }
-
- public void _write (org.omg.CORBA.portable.OutputStream o)
- {
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTestsHelper.write (o, value);
- }
-
- public org.omg.CORBA.TypeCode _type ()
- {
- return org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTestsHelper.type ();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsOperations.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsOperations.java
deleted file mode 100644
index d80adb476a..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsOperations.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTestsOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public interface ArraysUnionsTestsOperations
-{
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct passTestStruct (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct arg);
- String[][] passStringArray (String[][] arg);
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion passRichUnion (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion arg);
-} // interface ArraysUnionsTestsOperations
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnion.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnion.java
deleted file mode 100644
index 9f520f3c5d..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnion.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnion.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public final class InnerUnion implements org.omg.CORBA.portable.IDLEntity
-{
- private int ___x;
- private float ___y;
- private int __discriminator;
- private boolean __uninitialized = true;
-
- public InnerUnion ()
- {
- }
-
- public int discriminator ()
- {
- if (__uninitialized)
- throw new org.omg.CORBA.BAD_OPERATION ();
- return __discriminator;
- }
-
- public int x ()
- {
- if (__uninitialized)
- throw new org.omg.CORBA.BAD_OPERATION ();
- verifyx (__discriminator);
- return ___x;
- }
-
- public void x (int value)
- {
- __discriminator = 1;
- ___x = value;
- __uninitialized = false;
- }
-
- public void x (int discriminator, int value)
- {
- verifyx (discriminator);
- __discriminator = discriminator;
- ___x = value;
- __uninitialized = false;
- }
-
- private void verifyx (int discriminator)
- {
- if (discriminator != 1)
- throw new org.omg.CORBA.BAD_OPERATION ();
- }
-
- public float y ()
- {
- if (__uninitialized)
- throw new org.omg.CORBA.BAD_OPERATION ();
- verifyy (__discriminator);
- return ___y;
- }
-
- public void y (float value)
- {
- __discriminator = 2;
- ___y = value;
- __uninitialized = false;
- }
-
- public void y (int discriminator, float value)
- {
- verifyy (discriminator);
- __discriminator = discriminator;
- ___y = value;
- __uninitialized = false;
- }
-
- private void verifyy (int discriminator)
- {
- if (discriminator != 2)
- throw new org.omg.CORBA.BAD_OPERATION ();
- }
-
- public void _default ()
- {
- __discriminator = -2147483648;
- __uninitialized = false;
- }
-
- public void _default (int discriminator)
- {
- verifyDefault( discriminator ) ;
- __discriminator = discriminator ;
- __uninitialized = false;
- }
-
- private void verifyDefault( int value )
- {
- switch (value) {
- case 1:
- case 2:
- throw new org.omg.CORBA.BAD_OPERATION() ;
-
- default:
- return;
- }
- }
-
-} // class InnerUnion
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnionHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnionHelper.java
deleted file mode 100644
index 11c22f1d72..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnionHelper.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnionHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-abstract public class InnerUnionHelper
-{
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnion/InnerUnion:1.0";
-
- public static void insert (org.omg.CORBA.Any a, org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion that)
- {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
- a.type (type ());
- write (out, that);
- a.read_value (out.create_input_stream (), type ());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion extract (org.omg.CORBA.Any a)
- {
- return read (a.create_input_stream ());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
- synchronized public static org.omg.CORBA.TypeCode type ()
- {
- if (__typeCode == null)
- {
- org.omg.CORBA.TypeCode _disTypeCode0;
- _disTypeCode0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_long);
- org.omg.CORBA.UnionMember[] _members0 = new org.omg.CORBA.UnionMember [2];
- org.omg.CORBA.TypeCode _tcOf_members0;
- org.omg.CORBA.Any _anyOf_members0;
-
- // Branch for x (case label 1)
- _anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
- _anyOf_members0.insert_long ((int)1);
- _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_long);
- _members0[0] = new org.omg.CORBA.UnionMember (
- "x",
- _anyOf_members0,
- _tcOf_members0,
- null);
-
- // Branch for y (case label 2)
- _anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
- _anyOf_members0.insert_long ((int)2);
- _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_float);
- _members0[1] = new org.omg.CORBA.UnionMember (
- "y",
- _anyOf_members0,
- _tcOf_members0,
- null);
- __typeCode = org.omg.CORBA.ORB.init ().create_union_tc (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnionHelper.id (), "InnerUnion", _disTypeCode0, _members0);
- }
- return __typeCode;
- }
-
- public static String id ()
- {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion read (org.omg.CORBA.portable.InputStream istream)
- {
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion value = new org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion ();
- int _dis0 = (int)0;
- _dis0 = istream.read_long ();
- switch (_dis0)
- {
- case 1:
- int _x = (int)0;
- _x = istream.read_long ();
- value.x (_x);
- break;
- case 2:
- float _y = (float)0;
- _y = istream.read_float ();
- value.y (_y);
- break;
- default:
- value._default( _dis0 ) ;
- break;
- }
- return value;
- }
-
- public static void write (org.omg.CORBA.portable.OutputStream ostream, org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion value)
- {
- ostream.write_long (value.discriminator ());
- switch (value.discriminator ())
- {
- case 1:
- ostream.write_long (value.x ());
- break;
- case 2:
- ostream.write_float (value.y ());
- break;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnionHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnionHolder.java
deleted file mode 100644
index ca9233c77f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnionHolder.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/InnerUnionHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public final class InnerUnionHolder implements org.omg.CORBA.portable.Streamable
-{
- public org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion value = null;
-
- public InnerUnionHolder ()
- {
- }
-
- public InnerUnionHolder (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion initialValue)
- {
- value = initialValue;
- }
-
- public void _read (org.omg.CORBA.portable.InputStream i)
- {
- value = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnionHelper.read (i);
- }
-
- public void _write (org.omg.CORBA.portable.OutputStream o)
- {
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnionHelper.write (o, value);
- }
-
- public org.omg.CORBA.TypeCode _type ()
- {
- return org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnionHelper.type ();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnion.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnion.java
deleted file mode 100644
index 1a1a36fd16..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnion.java
+++ /dev/null
@@ -1,177 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnion.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public final class RichUnion implements org.omg.CORBA.portable.IDLEntity
-{
- private int ___x;
- private float ___y;
- private String ___z;
- private org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion ___iu;
- private boolean ___a;
- private int __discriminator;
- private boolean __uninitialized = true;
-
- public RichUnion ()
- {
- }
-
- public int discriminator ()
- {
- if (__uninitialized)
- throw new org.omg.CORBA.BAD_OPERATION ();
- return __discriminator;
- }
-
- public int x ()
- {
- if (__uninitialized)
- throw new org.omg.CORBA.BAD_OPERATION ();
- verifyx (__discriminator);
- return ___x;
- }
-
- public void x (int value)
- {
- __discriminator = 1;
- ___x = value;
- __uninitialized = false;
- }
-
- public void x (int discriminator, int value)
- {
- verifyx (discriminator);
- __discriminator = discriminator;
- ___x = value;
- __uninitialized = false;
- }
-
- private void verifyx (int discriminator)
- {
- if (discriminator != 1)
- throw new org.omg.CORBA.BAD_OPERATION ();
- }
-
- public float y ()
- {
- if (__uninitialized)
- throw new org.omg.CORBA.BAD_OPERATION ();
- verifyy (__discriminator);
- return ___y;
- }
-
- public void y (float value)
- {
- __discriminator = 2;
- ___y = value;
- __uninitialized = false;
- }
-
- public void y (int discriminator, float value)
- {
- verifyy (discriminator);
- __discriminator = discriminator;
- ___y = value;
- __uninitialized = false;
- }
-
- private void verifyy (int discriminator)
- {
- if (discriminator != 2)
- throw new org.omg.CORBA.BAD_OPERATION ();
- }
-
- public String z ()
- {
- if (__uninitialized)
- throw new org.omg.CORBA.BAD_OPERATION ();
- verifyz (__discriminator);
- return ___z;
- }
-
- public void z (String value)
- {
- __discriminator = 3;
- ___z = value;
- __uninitialized = false;
- }
-
- public void z (int discriminator, String value)
- {
- verifyz (discriminator);
- __discriminator = discriminator;
- ___z = value;
- __uninitialized = false;
- }
-
- private void verifyz (int discriminator)
- {
- if (discriminator != 3)
- throw new org.omg.CORBA.BAD_OPERATION ();
- }
-
- public org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion iu ()
- {
- if (__uninitialized)
- throw new org.omg.CORBA.BAD_OPERATION ();
- verifyiu (__discriminator);
- return ___iu;
- }
-
- public void iu (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion value)
- {
- __discriminator = 4;
- ___iu = value;
- __uninitialized = false;
- }
-
- public void iu (int discriminator, org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion value)
- {
- verifyiu (discriminator);
- __discriminator = discriminator;
- ___iu = value;
- __uninitialized = false;
- }
-
- private void verifyiu (int discriminator)
- {
- if (discriminator != 4)
- throw new org.omg.CORBA.BAD_OPERATION ();
- }
-
- public boolean a ()
- {
- if (__uninitialized)
- throw new org.omg.CORBA.BAD_OPERATION ();
- verifya (__discriminator);
- return ___a;
- }
-
- public void a (boolean value)
- {
- __discriminator = -2147483648;
- ___a = value;
- __uninitialized = false;
- }
-
- public void a (int discriminator, boolean value)
- {
- verifya (discriminator);
- __discriminator = discriminator;
- ___a = value;
- __uninitialized = false;
- }
-
- private void verifya (int discriminator)
- {
- if (discriminator == 1 || discriminator == 2 || discriminator == 3 || discriminator == 4)
- throw new org.omg.CORBA.BAD_OPERATION ();
- }
-
-} // class RichUnion
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnionHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnionHelper.java
deleted file mode 100644
index 7cef0ea189..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnionHelper.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnionHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-abstract public class RichUnionHelper
-{
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnion/RichUnion:1.0";
-
- public static void insert (org.omg.CORBA.Any a, org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion that)
- {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
- a.type (type ());
- write (out, that);
- a.read_value (out.create_input_stream (), type ());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion extract (org.omg.CORBA.Any a)
- {
- return read (a.create_input_stream ());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
- synchronized public static org.omg.CORBA.TypeCode type ()
- {
- if (__typeCode == null)
- {
- org.omg.CORBA.TypeCode _disTypeCode0;
- _disTypeCode0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_long);
- org.omg.CORBA.UnionMember[] _members0 = new org.omg.CORBA.UnionMember [5];
- org.omg.CORBA.TypeCode _tcOf_members0;
- org.omg.CORBA.Any _anyOf_members0;
-
- // Branch for x (case label 1)
- _anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
- _anyOf_members0.insert_long ((int)1);
- _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_long);
- _members0[0] = new org.omg.CORBA.UnionMember (
- "x",
- _anyOf_members0,
- _tcOf_members0,
- null);
-
- // Branch for y (case label 2)
- _anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
- _anyOf_members0.insert_long ((int)2);
- _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_float);
- _members0[1] = new org.omg.CORBA.UnionMember (
- "y",
- _anyOf_members0,
- _tcOf_members0,
- null);
-
- // Branch for z (case label 3)
- _anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
- _anyOf_members0.insert_long ((int)3);
- _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0);
- _members0[2] = new org.omg.CORBA.UnionMember (
- "z",
- _anyOf_members0,
- _tcOf_members0,
- null);
-
- // Branch for iu (case label 4)
- _anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
- _anyOf_members0.insert_long ((int)4);
- _tcOf_members0 = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnionHelper.type ();
- _members0[3] = new org.omg.CORBA.UnionMember (
- "iu",
- _anyOf_members0,
- _tcOf_members0,
- null);
-
- // Branch for a (Default case)
- _anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
- _anyOf_members0.insert_octet ((byte)0); // default member label
- _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_boolean);
- _members0[4] = new org.omg.CORBA.UnionMember (
- "a",
- _anyOf_members0,
- _tcOf_members0,
- null);
- __typeCode = org.omg.CORBA.ORB.init ().create_union_tc (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnionHelper.id (), "RichUnion", _disTypeCode0, _members0);
- }
- return __typeCode;
- }
-
- public static String id ()
- {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion read (org.omg.CORBA.portable.InputStream istream)
- {
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion value = new org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion ();
- int _dis0 = (int)0;
- _dis0 = istream.read_long ();
- switch (_dis0)
- {
- case 1:
- int _x = (int)0;
- _x = istream.read_long ();
- value.x (_x);
- break;
- case 2:
- float _y = (float)0;
- _y = istream.read_float ();
- value.y (_y);
- break;
- case 3:
- String _z = null;
- _z = istream.read_string ();
- value.z (_z);
- break;
- case 4:
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnion _iu = null;
- _iu = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnionHelper.read (istream);
- value.iu (_iu);
- break;
- default:
- boolean _a = false;
- _a = istream.read_boolean ();
- value.a (_dis0, _a);
- break;
- }
- return value;
- }
-
- public static void write (org.omg.CORBA.portable.OutputStream ostream, org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion value)
- {
- ostream.write_long (value.discriminator ());
- switch (value.discriminator ())
- {
- case 1:
- ostream.write_long (value.x ());
- break;
- case 2:
- ostream.write_float (value.y ());
- break;
- case 3:
- ostream.write_string (value.z ());
- break;
- case 4:
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.InnerUnionHelper.write (ostream, value.iu ());
- break;
- default:
- ostream.write_boolean (value.a ());
- break;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnionHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnionHolder.java
deleted file mode 100644
index 5498104905..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnionHolder.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/RichUnionHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public final class RichUnionHolder implements org.omg.CORBA.portable.Streamable
-{
- public org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion value = null;
-
- public RichUnionHolder ()
- {
- }
-
- public RichUnionHolder (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion initialValue)
- {
- value = initialValue;
- }
-
- public void _read (org.omg.CORBA.portable.InputStream i)
- {
- value = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnionHelper.read (i);
- }
-
- public void _write (org.omg.CORBA.portable.OutputStream o)
- {
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnionHelper.write (o, value);
- }
-
- public org.omg.CORBA.TypeCode _type ()
- {
- return org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnionHelper.type ();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArrayHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArrayHelper.java
deleted file mode 100644
index 72beff0537..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArrayHelper.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArrayHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-abstract public class StringArrayHelper
-{
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArray:1.0";
-
- public static void insert (org.omg.CORBA.Any a, String[][] that)
- {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
- a.type (type ());
- write (out, that);
- a.read_value (out.create_input_stream (), type ());
- }
-
- public static String[][] extract (org.omg.CORBA.Any a)
- {
- return read (a.create_input_stream ());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
- synchronized public static org.omg.CORBA.TypeCode type ()
- {
- if (__typeCode == null)
- {
- __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0);
- __typeCode = org.omg.CORBA.ORB.init ().create_array_tc (2, __typeCode );
- __typeCode = org.omg.CORBA.ORB.init ().create_array_tc (2, __typeCode );
- __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.StringArrayHelper.id (), "StringArray", __typeCode);
- }
- return __typeCode;
- }
-
- public static String id ()
- {
- return _id;
- }
-
- public static String[][] read (org.omg.CORBA.portable.InputStream istream)
- {
- String value[][] = null;
- value = new String[2][];
- for (int _o0 = 0;_o0 < (2); ++_o0)
- {
- value[_o0] = new String[2];
- for (int _o1 = 0;_o1 < (2); ++_o1)
- {
- value[_o0][_o1] = istream.read_string ();
- }
- }
- return value;
- }
-
- public static void write (org.omg.CORBA.portable.OutputStream ostream, String[][] value)
- {
- if (value.length != (2))
- throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- for (int _i0 = 0;_i0 < (2); ++_i0)
- {
- if (value[_i0].length != (2))
- throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- for (int _i1 = 0;_i1 < (2); ++_i1)
- {
- ostream.write_string (value[_i0][_i1]);
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArrayHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArrayHolder.java
deleted file mode 100644
index 747337597c..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArrayHolder.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/StringArrayHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public final class StringArrayHolder implements org.omg.CORBA.portable.Streamable
-{
- public String value[][] = null;
-
- public StringArrayHolder ()
- {
- }
-
- public StringArrayHolder (String[][] initialValue)
- {
- value = initialValue;
- }
-
- public void _read (org.omg.CORBA.portable.InputStream i)
- {
- value = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.StringArrayHelper.read (i);
- }
-
- public void _write (org.omg.CORBA.portable.OutputStream o)
- {
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.StringArrayHelper.write (o, value);
- }
-
- public org.omg.CORBA.TypeCode _type ()
- {
- return org.apache.tuscany.sca.binding.corba.testing.arrays_unions.StringArrayHelper.type ();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStruct.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStruct.java
deleted file mode 100644
index 2b239deadc..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStruct.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStruct.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public final class TestStruct implements org.omg.CORBA.portable.IDLEntity
-{
- public String oneDimArray[] = null;
- public int twoDimArray[][] = null;
- public float threeDimArray[][][] = null;
-
- public TestStruct ()
- {
- } // ctor
-
- public TestStruct (String[] _oneDimArray, int[][] _twoDimArray, float[][][] _threeDimArray)
- {
- oneDimArray = _oneDimArray;
- twoDimArray = _twoDimArray;
- threeDimArray = _threeDimArray;
- } // ctor
-
-} // class TestStruct
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStructHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStructHelper.java
deleted file mode 100644
index 6427d9d200..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStructHelper.java
+++ /dev/null
@@ -1,149 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStructHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-abstract public class TestStructHelper
-{
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStruct/TestStruct:1.0";
-
- public static void insert (org.omg.CORBA.Any a, org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct that)
- {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
- a.type (type ());
- write (out, that);
- a.read_value (out.create_input_stream (), type ());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct extract (org.omg.CORBA.Any a)
- {
- return read (a.create_input_stream ());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
- private static boolean __active = false;
- synchronized public static org.omg.CORBA.TypeCode type ()
- {
- if (__typeCode == null)
- {
- synchronized (org.omg.CORBA.TypeCode.class)
- {
- if (__typeCode == null)
- {
- if (__active)
- {
- return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
- }
- __active = true;
- org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [3];
- org.omg.CORBA.TypeCode _tcOf_members0 = null;
- _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0);
- _tcOf_members0 = org.omg.CORBA.ORB.init ().create_array_tc (2, _tcOf_members0 );
- _members0[0] = new org.omg.CORBA.StructMember (
- "oneDimArray",
- _tcOf_members0,
- null);
- _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_long);
- _tcOf_members0 = org.omg.CORBA.ORB.init ().create_array_tc (2, _tcOf_members0 );
- _tcOf_members0 = org.omg.CORBA.ORB.init ().create_array_tc (4, _tcOf_members0 );
- _members0[1] = new org.omg.CORBA.StructMember (
- "twoDimArray",
- _tcOf_members0,
- null);
- _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_float);
- _tcOf_members0 = org.omg.CORBA.ORB.init ().create_array_tc (2, _tcOf_members0 );
- _tcOf_members0 = org.omg.CORBA.ORB.init ().create_array_tc (4, _tcOf_members0 );
- _tcOf_members0 = org.omg.CORBA.ORB.init ().create_array_tc (2, _tcOf_members0 );
- _members0[2] = new org.omg.CORBA.StructMember (
- "threeDimArray",
- _tcOf_members0,
- null);
- __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStructHelper.id (), "TestStruct", _members0);
- __active = false;
- }
- }
- }
- return __typeCode;
- }
-
- public static String id ()
- {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct read (org.omg.CORBA.portable.InputStream istream)
- {
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct value = new org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct ();
- value.oneDimArray = new String[2];
- for (int _o0 = 0;_o0 < (2); ++_o0)
- {
- value.oneDimArray[_o0] = istream.read_string ();
- }
- value.twoDimArray = new int[2][];
- for (int _o1 = 0;_o1 < (2); ++_o1)
- {
- value.twoDimArray[_o1] = new int[4];
- for (int _o2 = 0;_o2 < (4); ++_o2)
- {
- value.twoDimArray[_o1][_o2] = istream.read_long ();
- }
- }
- value.threeDimArray = new float[2][][];
- for (int _o3 = 0;_o3 < (2); ++_o3)
- {
- value.threeDimArray[_o3] = new float[4][];
- for (int _o4 = 0;_o4 < (4); ++_o4)
- {
- value.threeDimArray[_o3][_o4] = new float[2];
- for (int _o5 = 0;_o5 < (2); ++_o5)
- {
- value.threeDimArray[_o3][_o4][_o5] = istream.read_float ();
- }
- }
- }
- return value;
- }
-
- public static void write (org.omg.CORBA.portable.OutputStream ostream, org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct value)
- {
- if (value.oneDimArray.length != (2))
- throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- for (int _i0 = 0;_i0 < (2); ++_i0)
- {
- ostream.write_string (value.oneDimArray[_i0]);
- }
- if (value.twoDimArray.length != (2))
- throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- for (int _i1 = 0;_i1 < (2); ++_i1)
- {
- if (value.twoDimArray[_i1].length != (4))
- throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- for (int _i2 = 0;_i2 < (4); ++_i2)
- {
- ostream.write_long (value.twoDimArray[_i1][_i2]);
- }
- }
- if (value.threeDimArray.length != (2))
- throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- for (int _i3 = 0;_i3 < (2); ++_i3)
- {
- if (value.threeDimArray[_i3].length != (4))
- throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- for (int _i4 = 0;_i4 < (4); ++_i4)
- {
- if (value.threeDimArray[_i3][_i4].length != (2))
- throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- for (int _i5 = 0;_i5 < (2); ++_i5)
- {
- ostream.write_float (value.threeDimArray[_i3][_i4][_i5]);
- }
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStructHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStructHolder.java
deleted file mode 100644
index 94683e0327..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStructHolder.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/TestStructHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public final class TestStructHolder implements org.omg.CORBA.portable.Streamable
-{
- public org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct value = null;
-
- public TestStructHolder ()
- {
- }
-
- public TestStructHolder (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct initialValue)
- {
- value = initialValue;
- }
-
- public void _read (org.omg.CORBA.portable.InputStream i)
- {
- value = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStructHelper.read (i);
- }
-
- public void _write (org.omg.CORBA.portable.OutputStream o)
- {
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStructHelper.write (o, value);
- }
-
- public org.omg.CORBA.TypeCode _type ()
- {
- return org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStructHelper.type ();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/_ArraysUnionsTestsImplBase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/_ArraysUnionsTestsImplBase.java
deleted file mode 100644
index e4cac28e4f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/_ArraysUnionsTestsImplBase.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/_ArraysUnionsTestsImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public abstract class _ArraysUnionsTestsImplBase extends org.omg.CORBA.portable.ObjectImpl
- implements org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests, org.omg.CORBA.portable.InvokeHandler
-{
-
- // Constructors
- public _ArraysUnionsTestsImplBase ()
- {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable ();
- static
- {
- _methods.put ("passTestStruct", new java.lang.Integer (0));
- _methods.put ("passStringArray", new java.lang.Integer (1));
- _methods.put ("passRichUnion", new java.lang.Integer (2));
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke (String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh)
- {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- switch (__method.intValue ())
- {
- case 0: // org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests/passTestStruct
- {
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct arg = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStructHelper.read (in);
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct $result = null;
- $result = this.passTestStruct (arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStructHelper.write (out, $result);
- break;
- }
-
- case 1: // org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests/passStringArray
- {
- String arg[][] = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.StringArrayHelper.read (in);
- String $result[][] = null;
- $result = this.passStringArray (arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.StringArrayHelper.write (out, $result);
- break;
- }
-
- case 2: // org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests/passRichUnion
- {
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion arg = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnionHelper.read (in);
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion $result = null;
- $result = this.passRichUnion (arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnionHelper.write (out, $result);
- break;
- }
-
- default:
- throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {
- "IDL:org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests:1.0"};
-
- public String[] _ids ()
- {
- return (String[])__ids.clone ();
- }
-
-
-} // class _ArraysUnionsTestsImplBase
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/_ArraysUnionsTestsStub.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/_ArraysUnionsTestsStub.java
deleted file mode 100644
index 38e29c0d63..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/arrays_unions/_ArraysUnionsTestsStub.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.apache.tuscany.sca.binding.corba.testing.arrays_unions;
-
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/arrays_unions/_ArraysUnionsTestsStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from arrays_unions.idl
-* niedziela, 17 sierpieñ 2008 15:45:39 CEST
-*/
-
-public class _ArraysUnionsTestsStub extends org.omg.CORBA.portable.ObjectImpl implements org.apache.tuscany.sca.binding.corba.testing.arrays_unions.ArraysUnionsTests
-{
-
- public org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct passTestStruct (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct arg)
- {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request ("passTestStruct", true);
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStructHelper.write ($out, arg);
- $in = _invoke ($out);
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct $result = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStructHelper.read ($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream ();
- String _id = $ex.getId ();
- throw new org.omg.CORBA.MARSHAL (_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return passTestStruct (arg );
- } finally {
- _releaseReply ($in);
- }
- } // passTestStruct
-
- public String[][] passStringArray (String[][] arg)
- {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request ("passStringArray", true);
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.StringArrayHelper.write ($out, arg);
- $in = _invoke ($out);
- String $result[][] = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.StringArrayHelper.read ($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream ();
- String _id = $ex.getId ();
- throw new org.omg.CORBA.MARSHAL (_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return passStringArray (arg );
- } finally {
- _releaseReply ($in);
- }
- } // passStringArray
-
- public org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion passRichUnion (org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion arg)
- {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request ("passRichUnion", true);
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnionHelper.write ($out, arg);
- $in = _invoke ($out);
- org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion $result = org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnionHelper.read ($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream ();
- String _id = $ex.getId ();
- throw new org.omg.CORBA.MARSHAL (_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return passRichUnion (arg );
- } finally {
- _releaseReply ($in);
- }
- } // passRichUnion
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {
- "IDL:org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests:1.0"};
-
- public String[] _ids ()
- {
- return (String[])__ids.clone ();
- }
-
- private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
- {
- String str = s.readUTF ();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
- _set_delegate (delegate);
- }
-
- private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
- {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
- s.writeUTF (str);
- }
-} // class _ArraysUnionsTestsStub
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/Color.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/Color.java
deleted file mode 100644
index e3c28f8b91..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/Color.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.enums;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/enums/Color.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from enums.idl
-* czwartek, 19 czerwiec 2008 15:46:10 CEST
-*/
-
-public class Color implements org.omg.CORBA.portable.IDLEntity {
- private int __value;
- private static int __size = 3;
- private static org.apache.tuscany.sca.binding.corba.testing.enums.Color[] __array =
- new org.apache.tuscany.sca.binding.corba.testing.enums.Color[__size];
-
- public static final int _red = 0;
- public static final org.apache.tuscany.sca.binding.corba.testing.enums.Color red =
- new org.apache.tuscany.sca.binding.corba.testing.enums.Color(_red);
- public static final int _yellow = 1;
- public static final org.apache.tuscany.sca.binding.corba.testing.enums.Color yellow =
- new org.apache.tuscany.sca.binding.corba.testing.enums.Color(_yellow);
- public static final int _green = 2;
- public static final org.apache.tuscany.sca.binding.corba.testing.enums.Color green =
- new org.apache.tuscany.sca.binding.corba.testing.enums.Color(_green);
-
- public int value() {
- return __value;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.enums.Color from_int(int value) {
- if (value >= 0 && value < __size)
- return __array[value];
- else
- throw new org.omg.CORBA.BAD_PARAM();
- }
-
- protected Color(int value) {
- __value = value;
- __array[__value] = this;
- }
-} // class Color
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHelper.java
deleted file mode 100644
index 775cac8e16..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHelper.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.corba.testing.enums;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/enums/ColorHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from enums.idl
-* czwartek, 19 czerwiec 2008 15:46:10 CEST
-*/
-
-abstract public class ColorHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/enums/Color:1.0";
-
- public static void insert(org.omg.CORBA.Any a, org.apache.tuscany.sca.binding.corba.testing.enums.Color that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.enums.Color extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB.init().create_enum_tc(org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper
- .id(),
- "Color",
- new String[] {"red", "yellow", "green"});
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.enums.Color read(org.omg.CORBA.portable.InputStream istream) {
- return org.apache.tuscany.sca.binding.corba.testing.enums.Color.from_int(istream.read_long());
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.enums.Color value) {
- ostream.write_long(value.value());
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHolder.java
deleted file mode 100644
index 32cd9c8df6..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHolder.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.corba.testing.enums;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/enums/ColorHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from enums.idl
-* czwartek, 19 czerwiec 2008 15:46:10 CEST
-*/
-
-public final class ColorHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.enums.Color value = null;
-
- public ColorHolder() {
- }
-
- public ColorHolder(org.apache.tuscany.sca.binding.corba.testing.enums.Color initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager.java
deleted file mode 100644
index 3f73557952..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager.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.corba.testing.enums;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from enums.idl
-* czwartek, 19 czerwiec 2008 15:46:10 CEST
-*/
-
-public interface EnumManager extends EnumManagerOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity {
-} // interface EnumManager
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHelper.java
deleted file mode 100644
index a6160a7643..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHelper.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.binding.corba.testing.enums;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from enums.idl
-* czwartek, 19 czerwiec 2008 15:46:10 CEST
-*/
-
-abstract public class EnumManagerHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager:1.0";
-
- public static void insert(org.omg.CORBA.Any a, org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_interface_tc(org.apache.tuscany.sca.binding.corba.testing.enums.EnumManagerHelper.id(),
- "EnumManager");
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager read(org.omg.CORBA.portable.InputStream istream) {
- return narrow(istream.read_Object(_EnumManagerStub.class));
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager value) {
- ostream.write_Object((org.omg.CORBA.Object)value);
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager)
- return (org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager)obj;
- else if (!obj._is_a(id()))
- throw new org.omg.CORBA.BAD_PARAM();
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.enums._EnumManagerStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.enums._EnumManagerStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager unchecked_narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager)
- return (org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager)obj;
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.enums._EnumManagerStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.enums._EnumManagerStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHolder.java
deleted file mode 100644
index 6afa6bc806..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHolder.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.corba.testing.enums;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from enums.idl
-* czwartek, 19 czerwiec 2008 15:46:10 CEST
-*/
-
-public final class EnumManagerHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager value = null;
-
- public EnumManagerHolder() {
- }
-
- public EnumManagerHolder(org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.enums.EnumManagerHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.enums.EnumManagerHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.enums.EnumManagerHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerOperations.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerOperations.java
deleted file mode 100644
index bab0c27f77..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerOperations.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.corba.testing.enums;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from enums.idl
-* czwartek, 19 czerwiec 2008 15:46:10 CEST
-*/
-
-public interface EnumManagerOperations {
-
- org.apache.tuscany.sca.binding.corba.testing.enums.Color getColor(org.apache.tuscany.sca.binding.corba.testing.enums.Color color);
-} // interface EnumManagerOperations
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerImplBase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerImplBase.java
deleted file mode 100644
index 514627ff4b..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerImplBase.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.binding.corba.testing.enums;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from enums.idl
-* czwartek, 19 czerwiec 2008 15:46:10 CEST
-*/
-
-public abstract class _EnumManagerImplBase extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager, org.omg.CORBA.portable.InvokeHandler {
-
- // Constructors
- public _EnumManagerImplBase() {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable();
- static {
- _methods.put("getColor", new java.lang.Integer(0));
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke(String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh) {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- switch (__method.intValue()) {
- case 0: // org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager/getColor
- {
- org.apache.tuscany.sca.binding.corba.testing.enums.Color color =
- org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.read(in);
- org.apache.tuscany.sca.binding.corba.testing.enums.Color $result = null;
- $result = this.getColor(color);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.write(out, $result);
- break;
- }
-
- default:
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
-} // class _EnumManagerImplBase
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerStub.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerStub.java
deleted file mode 100644
index 4629ca9cff..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerStub.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.corba.testing.enums;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from enums.idl
-* czwartek, 19 czerwiec 2008 15:46:10 CEST
-*/
-
-public class _EnumManagerStub extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager {
-
- public org.apache.tuscany.sca.binding.corba.testing.enums.Color getColor(org.apache.tuscany.sca.binding.corba.testing.enums.Color color) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("getColor", true);
- org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.write($out, color);
- $in = _invoke($out);
- org.apache.tuscany.sca.binding.corba.testing.enums.Color $result =
- org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return getColor(color);
- } finally {
- _releaseReply($in);
- }
- } // getColor
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
- private void readObject(java.io.ObjectInputStream s) throws java.io.IOException {
- String str = s.readUTF();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props).string_to_object(str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- _set_delegate(delegate);
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init(args, props).object_to_string(this);
- s.writeUTF(str);
- }
-} // class _EnumManagerStub
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc.java
deleted file mode 100644
index aa480f93ac..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc.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.corba.testing.exceptions;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public interface Calc extends CalcOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity {
-} // interface Calc
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcHelper.java
deleted file mode 100644
index 5ed36ca19b..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcHelper.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.binding.corba.testing.exceptions;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-abstract public class CalcHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0";
-
- public static void insert(org.omg.CORBA.Any a, org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_interface_tc(org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcHelper.id(),
- "Calc");
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc read(org.omg.CORBA.portable.InputStream istream) {
- return narrow(istream.read_Object(_CalcStub.class));
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc value) {
- ostream.write_Object((org.omg.CORBA.Object)value);
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc)
- return (org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc)obj;
- else if (!obj._is_a(id()))
- throw new org.omg.CORBA.BAD_PARAM();
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.exceptions._CalcStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.exceptions._CalcStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc unchecked_narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc)
- return (org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc)obj;
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.exceptions._CalcStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.exceptions._CalcStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcHolder.java
deleted file mode 100644
index ec1cfadd1e..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcHolder.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.corba.testing.exceptions;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public final class CalcHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc value = null;
-
- public CalcHolder() {
- }
-
- public CalcHolder(org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcOperations.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcOperations.java
deleted file mode 100644
index 29865ace06..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcOperations.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.corba.testing.exceptions;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public interface CalcOperations {
- double div(double arg1, double arg2)
- throws org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero;
-
- double divForSmallArgs(double arg1, double arg2)
- throws org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero,
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported;
-} // interface CalcOperations
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/Arguments.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/Arguments.java
deleted file mode 100644
index d7839ec4db..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/Arguments.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.corba.testing.exceptions.CalcPackage;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/Arguments.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public final class Arguments implements org.omg.CORBA.portable.IDLEntity {
- public double arg1 = (double)0;
- public double arg2 = (double)0;
-
- public Arguments() {
- } // ctor
-
- public Arguments(double _arg1, double _arg2) {
- arg1 = _arg1;
- arg2 = _arg2;
- } // ctor
-
-} // class Arguments
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/ArgumentsHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/ArgumentsHelper.java
deleted file mode 100644
index c47d63208f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/ArgumentsHelper.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.binding.corba.testing.exceptions.CalcPackage;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/ArgumentsHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-abstract public class ArgumentsHelper {
- private static String _id =
- "IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc/Arguments/Arguments:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
- private static boolean __active = false;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- synchronized (org.omg.CORBA.TypeCode.class) {
- if (__typeCode == null) {
- if (__active) {
- return org.omg.CORBA.ORB.init().create_recursive_tc(_id);
- }
- __active = true;
- org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember[2];
- org.omg.CORBA.TypeCode _tcOf_members0 = null;
- _tcOf_members0 = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_double);
- _members0[0] = new org.omg.CORBA.StructMember("arg1", _tcOf_members0, null);
- _tcOf_members0 = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_double);
- _members0[1] = new org.omg.CORBA.StructMember("arg2", _tcOf_members0, null);
- __typeCode =
- org.omg.CORBA.ORB
- .init()
- .create_struct_tc(org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.ArgumentsHelper
- .id(),
- "Arguments",
- _members0);
- __active = false;
- }
- }
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments read(org.omg.CORBA.portable.InputStream istream) {
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments value =
- new org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments();
- value.arg1 = istream.read_double();
- value.arg2 = istream.read_double();
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments value) {
- ostream.write_double(value.arg1);
- ostream.write_double(value.arg2);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/ArgumentsHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/ArgumentsHolder.java
deleted file mode 100644
index f767e8c11a..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/ArgumentsHolder.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.corba.testing.exceptions.CalcPackage;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/ArgumentsHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public final class ArgumentsHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments value = null;
-
- public ArgumentsHolder() {
- }
-
- public ArgumentsHolder(org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.ArgumentsHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.ArgumentsHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.ArgumentsHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZero.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZero.java
deleted file mode 100644
index e7cbb4b8ca..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZero.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.corba.testing.exceptions.CalcPackage;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZero.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public final class DivByZero extends org.omg.CORBA.UserException {
- public org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments arguments = null;
- public String info = null;
-
- public DivByZero() {
- super(DivByZeroHelper.id());
- } // ctor
-
- public DivByZero(org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments _arguments,
- String _info) {
- super(DivByZeroHelper.id());
- arguments = _arguments;
- info = _info;
- } // ctor
-
- public DivByZero(String $reason,
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments _arguments,
- String _info) {
- super(DivByZeroHelper.id() + " " + $reason);
- arguments = _arguments;
- info = _info;
- } // ctor
-
-} // class DivByZero
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZeroHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZeroHelper.java
deleted file mode 100644
index 5d27f9969c..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZeroHelper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZeroHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-abstract public class DivByZeroHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc/DivByZero:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
- private static boolean __active = false;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- synchronized (org.omg.CORBA.TypeCode.class) {
- if (__typeCode == null) {
- if (__active) {
- return org.omg.CORBA.ORB.init().create_recursive_tc(_id);
- }
- __active = true;
- org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember[2];
- org.omg.CORBA.TypeCode _tcOf_members0 = null;
- _tcOf_members0 =
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.ArgumentsHelper.type();
- _members0[0] = new org.omg.CORBA.StructMember("arguments", _tcOf_members0, null);
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_string_tc(0);
- _members0[1] = new org.omg.CORBA.StructMember("info", _tcOf_members0, null);
- __typeCode =
- org.omg.CORBA.ORB
- .init()
- .create_exception_tc(org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZeroHelper
- .id(),
- "DivByZero",
- _members0);
- __active = false;
- }
- }
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero read(org.omg.CORBA.portable.InputStream istream) {
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero value =
- new org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero();
- // read and discard the repository ID
- istream.read_string();
- value.arguments =
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.ArgumentsHelper.read(istream);
- value.info = istream.read_string();
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero value) {
- // write the repository ID
- ostream.write_string(id());
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.ArgumentsHelper.write(ostream,
- value.arguments);
- ostream.write_string(value.info);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZeroHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZeroHolder.java
deleted file mode 100644
index ab01c66675..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZeroHolder.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.corba.testing.exceptions.CalcPackage;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/DivByZeroHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public final class DivByZeroHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero value = null;
-
- public DivByZeroHolder() {
- }
-
- public DivByZeroHolder(org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZeroHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZeroHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZeroHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupported.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupported.java
deleted file mode 100644
index f4ea58e55e..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupported.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.corba.testing.exceptions.CalcPackage;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupported.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public final class NotSupported extends org.omg.CORBA.UserException {
- public String info = null;
-
- public NotSupported() {
- super(NotSupportedHelper.id());
- } // ctor
-
- public NotSupported(String _info) {
- super(NotSupportedHelper.id());
- info = _info;
- } // ctor
-
- public NotSupported(String $reason, String _info) {
- super(NotSupportedHelper.id() + " " + $reason);
- info = _info;
- } // ctor
-
-} // class NotSupported
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupportedHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupportedHelper.java
deleted file mode 100644
index 82609a36c1..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupportedHelper.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.corba.testing.exceptions.CalcPackage;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupportedHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-abstract public class NotSupportedHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc/NotSupported:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
- private static boolean __active = false;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- synchronized (org.omg.CORBA.TypeCode.class) {
- if (__typeCode == null) {
- if (__active) {
- return org.omg.CORBA.ORB.init().create_recursive_tc(_id);
- }
- __active = true;
- org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember[1];
- org.omg.CORBA.TypeCode _tcOf_members0 = null;
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_string_tc(0);
- _members0[0] = new org.omg.CORBA.StructMember("info", _tcOf_members0, null);
- __typeCode =
- org.omg.CORBA.ORB
- .init()
- .create_exception_tc(org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupportedHelper
- .id(),
- "NotSupported",
- _members0);
- __active = false;
- }
- }
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported read(org.omg.CORBA.portable.InputStream istream) {
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported value =
- new org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported();
- // read and discard the repository ID
- istream.read_string();
- value.info = istream.read_string();
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported value) {
- // write the repository ID
- ostream.write_string(id());
- ostream.write_string(value.info);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupportedHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupportedHolder.java
deleted file mode 100644
index 1389bd33d9..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupportedHolder.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.corba.testing.exceptions.CalcPackage;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/CalcPackage/NotSupportedHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public final class NotSupportedHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported value = null;
-
- public NotSupportedHolder() {
- }
-
- public NotSupportedHolder(org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupportedHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupportedHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupportedHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/_CalcImplBase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/_CalcImplBase.java
deleted file mode 100644
index a73e252129..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/_CalcImplBase.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.corba.testing.exceptions;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/_CalcImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public abstract class _CalcImplBase extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc, org.omg.CORBA.portable.InvokeHandler {
-
- // Constructors
- public _CalcImplBase() {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable();
- static {
- _methods.put("div", new java.lang.Integer(0));
- _methods.put("divForSmallArgs", new java.lang.Integer(1));
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke(String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh) {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- switch (__method.intValue()) {
- case 0: // org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc/div
- {
- try {
- double arg1 = in.read_double();
- double arg2 = in.read_double();
- double $result = (double)0;
- $result = this.div(arg1, arg2);
- out = $rh.createReply();
- out.write_double($result);
- } catch (org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero $ex) {
- out = $rh.createExceptionReply();
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZeroHelper.write(out, $ex);
- }
- break;
- }
-
- case 1: // org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc/divForSmallArgs
- {
- try {
- double arg1 = in.read_double();
- double arg2 = in.read_double();
- double $result = (double)0;
- $result = this.divForSmallArgs(arg1, arg2);
- out = $rh.createReply();
- out.write_double($result);
- } catch (org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero $ex) {
- out = $rh.createExceptionReply();
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZeroHelper.write(out, $ex);
- } catch (org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported $ex) {
- out = $rh.createExceptionReply();
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupportedHelper.write(out,
- $ex);
- }
- break;
- }
-
- default:
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
-} // class _CalcImplBase
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/_CalcStub.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/_CalcStub.java
deleted file mode 100644
index 65ce051129..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/exceptions/_CalcStub.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.corba.testing.exceptions;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/exceptions/_CalcStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from exceptions.idl
-* sobota, 7 czerwiec 2008 16:12:31 CEST
-*/
-
-public class _CalcStub extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc {
-
- public double div(double arg1, double arg2)
- throws org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("div", true);
- $out.write_double(arg1);
- $out.write_double(arg2);
- $in = _invoke($out);
- double $result = $in.read_double();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- if (_id.equals("IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc/DivByZero:1.0"))
- throw org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZeroHelper.read($in);
- else
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return div(arg1, arg2);
- } finally {
- _releaseReply($in);
- }
- } // div
-
- public double divForSmallArgs(double arg1, double arg2)
- throws org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero,
- org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("divForSmallArgs", true);
- $out.write_double(arg1);
- $out.write_double(arg2);
- $in = _invoke($out);
- double $result = $in.read_double();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- if (_id.equals("IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc/DivByZero:1.0"))
- throw org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZeroHelper.read($in);
- else if (_id.equals("IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc/NotSupported:1.0"))
- throw org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupportedHelper.read($in);
- else
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return divForSmallArgs(arg1, arg2);
- } finally {
- _releaseReply($in);
- }
- } // divForSmallArgs
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
- private void readObject(java.io.ObjectInputStream s) throws java.io.IOException {
- String str = s.readUTF();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props).string_to_object(str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- _set_delegate(delegate);
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init(args, props).object_to_string(this);
- s.writeUTF(str);
- }
-} // class _CalcStub
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter.java
deleted file mode 100644
index fde204edf8..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public interface ArraysSetter extends ArraysSetterOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity {
-} // interface ArraysSetter
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterHelper.java
deleted file mode 100644
index 71b4fbbdb6..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterHelper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-abstract public class ArraysSetterHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB
- .init()
- .create_interface_tc(org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetterHelper.id(),
- "ArraysSetter");
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter read(org.omg.CORBA.portable.InputStream istream) {
- return narrow(istream.read_Object(_ArraysSetterStub.class));
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter value) {
- ostream.write_Object((org.omg.CORBA.Object)value);
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter)
- return (org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter)obj;
- else if (!obj._is_a(id()))
- throw new org.omg.CORBA.BAD_PARAM();
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.generated._ArraysSetterStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.generated._ArraysSetterStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter unchecked_narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter)
- return (org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter)obj;
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.generated._ArraysSetterStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.generated._ArraysSetterStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterHolder.java
deleted file mode 100644
index d758a560a9..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public final class ArraysSetterHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter value = null;
-
- public ArraysSetterHolder() {
- }
-
- public ArraysSetterHolder(org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetterHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetterHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetterHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterOperations.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterOperations.java
deleted file mode 100644
index 464c2ccbc3..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterOperations.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetterOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public interface ArraysSetterOperations {
- boolean[] setBoolean(boolean[] arg);
-
- char[] setChar(char[] arg);
-
- char[] setWchar(char[] arg);
-
- byte[] setOctet(byte[] arg);
-
- short[] setShort(short[] arg);
-
- short[] setUnsignedShort(short[] arg);
-
- int[] setLong(int[] arg);
-
- int[] setUnsignedLong(int[] arg);
-
- long[] setLongLong(long[] arg);
-
- long[] setUnsignedLongLong(long[] arg);
-
- float[] setFloat(float[] arg);
-
- double[] setDouble(double[] arg);
-
- String[] setString(String[] arg);
-
- String[] setWstring(String[] arg);
-
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject[] setRemoteObject(org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject[] obj);
-} // interface ArraysSetterOperations
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter.java
deleted file mode 100644
index c053f12a02..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public interface PrimitivesSetter extends PrimitivesSetterOperations, org.omg.CORBA.Object,
- org.omg.CORBA.portable.IDLEntity {
-} // interface PrimitivesSetter
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterHelper.java
deleted file mode 100644
index 566689960e..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterHelper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class PrimitivesSetterHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_interface_tc(org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetterHelper
- .id(),
- "PrimitivesSetter");
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter read(org.omg.CORBA.portable.InputStream istream) {
- return narrow(istream.read_Object(_PrimitivesSetterStub.class));
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter value) {
- ostream.write_Object((org.omg.CORBA.Object)value);
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter)
- return (org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter)obj;
- else if (!obj._is_a(id()))
- throw new org.omg.CORBA.BAD_PARAM();
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.generated._PrimitivesSetterStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.generated._PrimitivesSetterStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter unchecked_narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter)
- return (org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter)obj;
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.generated._PrimitivesSetterStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.generated._PrimitivesSetterStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterHolder.java
deleted file mode 100644
index 6564957081..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class PrimitivesSetterHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter value = null;
-
- public PrimitivesSetterHolder() {
- }
-
- public PrimitivesSetterHolder(org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetterHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetterHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetterHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterOperations.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterOperations.java
deleted file mode 100644
index 26669de95a..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterOperations.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetterOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public interface PrimitivesSetterOperations {
- boolean setBoolean(boolean arg);
-
- char setChar(char arg);
-
- char setWchar(char arg);
-
- byte setOctet(byte arg);
-
- short setShort(short arg);
-
- short setUnsignedShort(short arg);
-
- int setLong(int arg);
-
- int setUnsignedLong(int arg);
-
- long setLongLong(long arg);
-
- long setUnsignedLongLong(long arg);
-
- float setFloat(float arg);
-
- double setDouble(double arg);
-
- String setString(String arg);
-
- String setWstring(String arg);
-
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject setRemoteObject(org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject obj);
-} // interface PrimitivesSetterOperations
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObject.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObject.java
deleted file mode 100644
index 5a140f5ecc..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObject.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObject.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public interface RemoteObject extends RemoteObjectOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity {
-} // interface RemoteObject
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectHelper.java
deleted file mode 100644
index 2a8fe73417..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectHelper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class RemoteObjectHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObject:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB
- .init()
- .create_interface_tc(org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.id(),
- "RemoteObject");
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject read(org.omg.CORBA.portable.InputStream istream) {
- return narrow(istream.read_Object(_RemoteObjectStub.class));
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject value) {
- ostream.write_Object((org.omg.CORBA.Object)value);
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject)
- return (org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject)obj;
- else if (!obj._is_a(id()))
- throw new org.omg.CORBA.BAD_PARAM();
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.generated._RemoteObjectStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.generated._RemoteObjectStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject unchecked_narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject)
- return (org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject)obj;
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.generated._RemoteObjectStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.generated._RemoteObjectStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectHolder.java
deleted file mode 100644
index 63e3926dd2..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class RemoteObjectHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject value = null;
-
- public RemoteObjectHolder() {
- }
-
- public RemoteObjectHolder(org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectOperations.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectOperations.java
deleted file mode 100644
index a8231236eb..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectOperations.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObjectOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public interface RemoteObjectOperations {
-} // interface RemoteObjectOperations
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStruct.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStruct.java
deleted file mode 100644
index ca86420240..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStruct.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStruct.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class SimpleStruct implements org.omg.CORBA.portable.IDLEntity {
- public String field1 = null;
- public int field2 = (int)0;
-
- public SimpleStruct() {
- } // ctor
-
- public SimpleStruct(String _field1, int _field2) {
- field1 = _field1;
- field2 = _field2;
- } // ctor
-
-} // class SimpleStruct
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStructHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStructHelper.java
deleted file mode 100644
index 2a8898d38f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStructHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStructHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class SimpleStructHelper {
- private static String _id =
- "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStruct/SimpleStruct:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
- private static boolean __active = false;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- synchronized (org.omg.CORBA.TypeCode.class) {
- if (__typeCode == null) {
- if (__active) {
- return org.omg.CORBA.ORB.init().create_recursive_tc(_id);
- }
- __active = true;
- org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember[2];
- org.omg.CORBA.TypeCode _tcOf_members0 = null;
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_string_tc(0);
- _members0[0] = new org.omg.CORBA.StructMember("field1", _tcOf_members0, null);
- _tcOf_members0 = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_long);
- _members0[1] = new org.omg.CORBA.StructMember("field2", _tcOf_members0, null);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_struct_tc(org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper
- .id(),
- "SimpleStruct",
- _members0);
- __active = false;
- }
- }
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct read(org.omg.CORBA.portable.InputStream istream) {
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct value =
- new org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct();
- value.field1 = istream.read_string();
- value.field2 = istream.read_long();
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct value) {
- ostream.write_string(value.field1);
- ostream.write_long(value.field2);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStructHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStructHolder.java
deleted file mode 100644
index bed30e00ca..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStructHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/SimpleStructHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class SimpleStructHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct value = null;
-
- public SimpleStructHolder() {
- }
-
- public SimpleStructHolder(org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStruct.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStruct.java
deleted file mode 100644
index 73dbd6c198..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStruct.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/SomeStruct.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class SomeStruct implements org.omg.CORBA.portable.IDLEntity {
- public org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct innerStruct = null;
- public String str = null;
- public String str_list[] = null;
- public int twoDimSeq[][] = null;
- public int threeDimSeq[][][] = null;
-
- public SomeStruct() {
- } // ctor
-
- public SomeStruct(org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct _innerStruct,
- String _str,
- String[] _str_list,
- int[][] _twoDimSeq,
- int[][][] _threeDimSeq) {
- innerStruct = _innerStruct;
- str = _str;
- str_list = _str_list;
- twoDimSeq = _twoDimSeq;
- threeDimSeq = _threeDimSeq;
- } // ctor
-
-} // class SomeStruct
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStructHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStructHelper.java
deleted file mode 100644
index 8f524ffeb1..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStructHelper.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/SomeStructHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class SomeStructHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/SomeStruct/SomeStruct:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
- private static boolean __active = false;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- synchronized (org.omg.CORBA.TypeCode.class) {
- if (__typeCode == null) {
- if (__active) {
- return org.omg.CORBA.ORB.init().create_recursive_tc(_id);
- }
- __active = true;
- org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember[5];
- org.omg.CORBA.TypeCode _tcOf_members0 = null;
- _tcOf_members0 = org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.type();
- _members0[0] = new org.omg.CORBA.StructMember("innerStruct", _tcOf_members0, null);
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_string_tc(0);
- _members0[1] = new org.omg.CORBA.StructMember("str", _tcOf_members0, null);
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_string_tc(0);
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_sequence_tc(0, _tcOf_members0);
- _tcOf_members0 =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper
- .id(),
- "string_list",
- _tcOf_members0);
- _members0[2] = new org.omg.CORBA.StructMember("str_list", _tcOf_members0, null);
- _tcOf_members0 = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_long);
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_sequence_tc(0, _tcOf_members0);
- _tcOf_members0 =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper
- .id(),
- "long_seq1",
- _tcOf_members0);
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_sequence_tc(0, _tcOf_members0);
- _tcOf_members0 =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper
- .id(),
- "long_seq2",
- _tcOf_members0);
- _members0[3] = new org.omg.CORBA.StructMember("twoDimSeq", _tcOf_members0, null);
- _tcOf_members0 = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_long);
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_sequence_tc(0, _tcOf_members0);
- _tcOf_members0 =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper
- .id(),
- "long_seq1",
- _tcOf_members0);
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_sequence_tc(0, _tcOf_members0);
- _tcOf_members0 =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper
- .id(),
- "long_seq2",
- _tcOf_members0);
- _tcOf_members0 = org.omg.CORBA.ORB.init().create_sequence_tc(0, _tcOf_members0);
- _tcOf_members0 =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper
- .id(),
- "long_seq3",
- _tcOf_members0);
- _members0[4] = new org.omg.CORBA.StructMember("threeDimSeq", _tcOf_members0, null);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_struct_tc(org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper
- .id(),
- "SomeStruct",
- _members0);
- __active = false;
- }
- }
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct read(org.omg.CORBA.portable.InputStream istream) {
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct value =
- new org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct();
- value.innerStruct = org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.read(istream);
- value.str = istream.read_string();
- value.str_list = org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper.read(istream);
- value.twoDimSeq = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.read(istream);
- value.threeDimSeq = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.read(istream);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct value) {
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.write(ostream, value.innerStruct);
- ostream.write_string(value.str);
- org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper.write(ostream, value.str_list);
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.write(ostream, value.twoDimSeq);
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.write(ostream, value.threeDimSeq);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStructHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStructHolder.java
deleted file mode 100644
index 3231a136dc..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/SomeStructHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/SomeStructHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class SomeStructHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct value = null;
-
- public SomeStructHolder() {
- }
-
- public SomeStructHolder(org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObject.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObject.java
deleted file mode 100644
index 28d3ecdc91..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObject.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/TestObject.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public interface TestObject extends TestObjectOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity {
-} // interface TestObject
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectHelper.java
deleted file mode 100644
index 29ff2edfd2..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class TestObjectHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.generated.TestObject that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.TestObject extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_interface_tc(org.apache.tuscany.sca.binding.corba.testing.generated.TestObjectHelper.id(),
- "TestObject");
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.TestObject read(org.omg.CORBA.portable.InputStream istream) {
- return narrow(istream.read_Object(_TestObjectStub.class));
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.generated.TestObject value) {
- ostream.write_Object((org.omg.CORBA.Object)value);
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.TestObject narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.generated.TestObject)
- return (org.apache.tuscany.sca.binding.corba.testing.generated.TestObject)obj;
- else if (!obj._is_a(id()))
- throw new org.omg.CORBA.BAD_PARAM();
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.generated._TestObjectStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.generated._TestObjectStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.TestObject unchecked_narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.generated.TestObject)
- return (org.apache.tuscany.sca.binding.corba.testing.generated.TestObject)obj;
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.generated._TestObjectStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.generated._TestObjectStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectHolder.java
deleted file mode 100644
index b8aea13c8d..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class TestObjectHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.generated.TestObject value = null;
-
- public TestObjectHolder() {
- }
-
- public TestObjectHolder(org.apache.tuscany.sca.binding.corba.testing.generated.TestObject initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.TestObjectHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.TestObjectHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.TestObjectHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectOperations.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectOperations.java
deleted file mode 100644
index 0bacb6746a..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectOperations.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/TestObjectOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public interface TestObjectOperations {
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct pickStructFromArgs(org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg1,
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg2,
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg3,
- int structNumber);
-
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct setStruct(org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg);
-
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct setSimpleStruct(org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHolder arg);
-
- int[] setLongSeq1(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Holder arg);
-
- int[][] setLongSeq2(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Holder arg);
-
- int[][][] setLongSeq3(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Holder arg);
-} // interface TestObjectOperations
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_ArraysSetterImplBase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_ArraysSetterImplBase.java
deleted file mode 100644
index c6e8c2a4e0..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_ArraysSetterImplBase.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/_ArraysSetterImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public abstract class _ArraysSetterImplBase extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter, org.omg.CORBA.portable.InvokeHandler {
-
- // Constructors
- public _ArraysSetterImplBase() {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable();
- static {
- _methods.put("setBoolean", new java.lang.Integer(0));
- _methods.put("setChar", new java.lang.Integer(1));
- _methods.put("setWchar", new java.lang.Integer(2));
- _methods.put("setOctet", new java.lang.Integer(3));
- _methods.put("setShort", new java.lang.Integer(4));
- _methods.put("setUnsignedShort", new java.lang.Integer(5));
- _methods.put("setLong", new java.lang.Integer(6));
- _methods.put("setUnsignedLong", new java.lang.Integer(7));
- _methods.put("setLongLong", new java.lang.Integer(8));
- _methods.put("setUnsignedLongLong", new java.lang.Integer(9));
- _methods.put("setFloat", new java.lang.Integer(10));
- _methods.put("setDouble", new java.lang.Integer(11));
- _methods.put("setString", new java.lang.Integer(12));
- _methods.put("setWstring", new java.lang.Integer(13));
- _methods.put("setRemoteObject", new java.lang.Integer(14));
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke(String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh) {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- switch (__method.intValue()) {
- case 0: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setBoolean
- {
- boolean arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.boolean_listHelper.read(in);
- boolean $result[] = null;
- $result = this.setBoolean(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.boolean_listHelper.write(out, $result);
- break;
- }
-
- case 1: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setChar
- {
- char arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.char_listHelper.read(in);
- char $result[] = null;
- $result = this.setChar(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.char_listHelper.write(out, $result);
- break;
- }
-
- case 2: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setWchar
- {
- char arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.wchar_listHelper.read(in);
- char $result[] = null;
- $result = this.setWchar(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.wchar_listHelper.write(out, $result);
- break;
- }
-
- case 3: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setOctet
- {
- byte arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.octet_listHelper.read(in);
- byte $result[] = null;
- $result = this.setOctet(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.octet_listHelper.write(out, $result);
- break;
- }
-
- case 4: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setShort
- {
- short arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.short_listHelper.read(in);
- short $result[] = null;
- $result = this.setShort(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.short_listHelper.write(out, $result);
- break;
- }
-
- case 5: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setUnsignedShort
- {
- short arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_short_listHelper.read(in);
- short $result[] = null;
- $result = this.setUnsignedShort(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_short_listHelper.write(out, $result);
- break;
- }
-
- case 6: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setLong
- {
- int arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.long_listHelper.read(in);
- int $result[] = null;
- $result = this.setLong(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.long_listHelper.write(out, $result);
- break;
- }
-
- case 7: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setUnsignedLong
- {
- int arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_listHelper.read(in);
- int $result[] = null;
- $result = this.setUnsignedLong(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_listHelper.write(out, $result);
- break;
- }
-
- case 8: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setLongLong
- {
- long arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.long_long_listHelper.read(in);
- long $result[] = null;
- $result = this.setLongLong(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.long_long_listHelper.write(out, $result);
- break;
- }
-
- case 9: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setUnsignedLongLong
- {
- long arg[] =
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_long_listHelper.read(in);
- long $result[] = null;
- $result = this.setUnsignedLongLong(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_long_listHelper
- .write(out, $result);
- break;
- }
-
- case 10: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setFloat
- {
- float arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.float_listHelper.read(in);
- float $result[] = null;
- $result = this.setFloat(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.float_listHelper.write(out, $result);
- break;
- }
-
- case 11: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setDouble
- {
- double arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.double_listHelper.read(in);
- double $result[] = null;
- $result = this.setDouble(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.double_listHelper.write(out, $result);
- break;
- }
-
- case 12: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setString
- {
- String arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper.read(in);
- String $result[] = null;
- $result = this.setString(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper.write(out, $result);
- break;
- }
-
- case 13: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setWstring
- {
- String arg[] = org.apache.tuscany.sca.binding.corba.testing.generated.wstring_listHelper.read(in);
- String $result[] = null;
- $result = this.setWstring(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.wstring_listHelper.write(out, $result);
- break;
- }
-
- case 14: // org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter/setRemoteObject
- {
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject obj[] =
- org.apache.tuscany.sca.binding.corba.testing.generated.remote_object_listHelper.read(in);
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject $result[] = null;
- $result = this.setRemoteObject(obj);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.remote_object_listHelper.write(out, $result);
- break;
- }
-
- default:
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
-} // class _ArraysSetterImplBase
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_ArraysSetterStub.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_ArraysSetterStub.java
deleted file mode 100644
index 079cc6e899..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_ArraysSetterStub.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/_ArraysSetterStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public class _ArraysSetterStub extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.generated.ArraysSetter {
-
- public boolean[] setBoolean(boolean[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setBoolean", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.boolean_listHelper.write($out, arg);
- $in = _invoke($out);
- boolean $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.boolean_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setBoolean(arg);
- } finally {
- _releaseReply($in);
- }
- } // setBoolean
-
- public char[] setChar(char[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setChar", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.char_listHelper.write($out, arg);
- $in = _invoke($out);
- char $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.char_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setChar(arg);
- } finally {
- _releaseReply($in);
- }
- } // setChar
-
- public char[] setWchar(char[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setWchar", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.wchar_listHelper.write($out, arg);
- $in = _invoke($out);
- char $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.wchar_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setWchar(arg);
- } finally {
- _releaseReply($in);
- }
- } // setWchar
-
- public byte[] setOctet(byte[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setOctet", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.octet_listHelper.write($out, arg);
- $in = _invoke($out);
- byte $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.octet_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setOctet(arg);
- } finally {
- _releaseReply($in);
- }
- } // setOctet
-
- public short[] setShort(short[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setShort", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.short_listHelper.write($out, arg);
- $in = _invoke($out);
- short $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.short_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setShort(arg);
- } finally {
- _releaseReply($in);
- }
- } // setShort
-
- public short[] setUnsignedShort(short[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setUnsignedShort", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_short_listHelper.write($out, arg);
- $in = _invoke($out);
- short $result[] =
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_short_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setUnsignedShort(arg);
- } finally {
- _releaseReply($in);
- }
- } // setUnsignedShort
-
- public int[] setLong(int[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setLong", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.long_listHelper.write($out, arg);
- $in = _invoke($out);
- int $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.long_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setLong(arg);
- } finally {
- _releaseReply($in);
- }
- } // setLong
-
- public int[] setUnsignedLong(int[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setUnsignedLong", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_listHelper.write($out, arg);
- $in = _invoke($out);
- int $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setUnsignedLong(arg);
- } finally {
- _releaseReply($in);
- }
- } // setUnsignedLong
-
- public long[] setLongLong(long[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setLongLong", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.long_long_listHelper.write($out, arg);
- $in = _invoke($out);
- long $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.long_long_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setLongLong(arg);
- } finally {
- _releaseReply($in);
- }
- } // setLongLong
-
- public long[] setUnsignedLongLong(long[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setUnsignedLongLong", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_long_listHelper.write($out, arg);
- $in = _invoke($out);
- long $result[] =
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_long_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setUnsignedLongLong(arg);
- } finally {
- _releaseReply($in);
- }
- } // setUnsignedLongLong
-
- public float[] setFloat(float[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setFloat", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.float_listHelper.write($out, arg);
- $in = _invoke($out);
- float $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.float_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setFloat(arg);
- } finally {
- _releaseReply($in);
- }
- } // setFloat
-
- public double[] setDouble(double[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setDouble", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.double_listHelper.write($out, arg);
- $in = _invoke($out);
- double $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.double_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setDouble(arg);
- } finally {
- _releaseReply($in);
- }
- } // setDouble
-
- public String[] setString(String[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setString", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper.write($out, arg);
- $in = _invoke($out);
- String $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setString(arg);
- } finally {
- _releaseReply($in);
- }
- } // setString
-
- public String[] setWstring(String[] arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setWstring", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.wstring_listHelper.write($out, arg);
- $in = _invoke($out);
- String $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.wstring_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setWstring(arg);
- } finally {
- _releaseReply($in);
- }
- } // setWstring
-
- public org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject[] setRemoteObject(org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject[] obj) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setRemoteObject", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.remote_object_listHelper.write($out, obj);
- $in = _invoke($out);
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject $result[] =
- org.apache.tuscany.sca.binding.corba.testing.generated.remote_object_listHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setRemoteObject(obj);
- } finally {
- _releaseReply($in);
- }
- } // setRemoteObject
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
- private void readObject(java.io.ObjectInputStream s) throws java.io.IOException {
- String str = s.readUTF();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props).string_to_object(str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- _set_delegate(delegate);
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init(args, props).object_to_string(this);
- s.writeUTF(str);
- }
-} // class _ArraysSetterStub
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_PrimitivesSetterImplBase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_PrimitivesSetterImplBase.java
deleted file mode 100644
index b444ce68d8..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_PrimitivesSetterImplBase.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/_PrimitivesSetterImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public abstract class _PrimitivesSetterImplBase extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter, org.omg.CORBA.portable.InvokeHandler {
-
- // Constructors
- public _PrimitivesSetterImplBase() {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable();
- static {
- _methods.put("setBoolean", new java.lang.Integer(0));
- _methods.put("setChar", new java.lang.Integer(1));
- _methods.put("setWchar", new java.lang.Integer(2));
- _methods.put("setOctet", new java.lang.Integer(3));
- _methods.put("setShort", new java.lang.Integer(4));
- _methods.put("setUnsignedShort", new java.lang.Integer(5));
- _methods.put("setLong", new java.lang.Integer(6));
- _methods.put("setUnsignedLong", new java.lang.Integer(7));
- _methods.put("setLongLong", new java.lang.Integer(8));
- _methods.put("setUnsignedLongLong", new java.lang.Integer(9));
- _methods.put("setFloat", new java.lang.Integer(10));
- _methods.put("setDouble", new java.lang.Integer(11));
- _methods.put("setString", new java.lang.Integer(12));
- _methods.put("setWstring", new java.lang.Integer(13));
- _methods.put("setRemoteObject", new java.lang.Integer(14));
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke(String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh) {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- switch (__method.intValue()) {
- case 0: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setBoolean
- {
- boolean arg = in.read_boolean();
- boolean $result = false;
- $result = this.setBoolean(arg);
- out = $rh.createReply();
- out.write_boolean($result);
- break;
- }
-
- case 1: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setChar
- {
- char arg = in.read_char();
- char $result = (char)0;
- $result = this.setChar(arg);
- out = $rh.createReply();
- out.write_char($result);
- break;
- }
-
- case 2: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setWchar
- {
- char arg = in.read_wchar();
- char $result = (char)0;
- $result = this.setWchar(arg);
- out = $rh.createReply();
- out.write_wchar($result);
- break;
- }
-
- case 3: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setOctet
- {
- byte arg = in.read_octet();
- byte $result = (byte)0;
- $result = this.setOctet(arg);
- out = $rh.createReply();
- out.write_octet($result);
- break;
- }
-
- case 4: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setShort
- {
- short arg = in.read_short();
- short $result = (short)0;
- $result = this.setShort(arg);
- out = $rh.createReply();
- out.write_short($result);
- break;
- }
-
- case 5: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setUnsignedShort
- {
- short arg = in.read_ushort();
- short $result = (short)0;
- $result = this.setUnsignedShort(arg);
- out = $rh.createReply();
- out.write_ushort($result);
- break;
- }
-
- case 6: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setLong
- {
- int arg = in.read_long();
- int $result = (int)0;
- $result = this.setLong(arg);
- out = $rh.createReply();
- out.write_long($result);
- break;
- }
-
- case 7: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setUnsignedLong
- {
- int arg = in.read_ulong();
- int $result = (int)0;
- $result = this.setUnsignedLong(arg);
- out = $rh.createReply();
- out.write_ulong($result);
- break;
- }
-
- case 8: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setLongLong
- {
- long arg = in.read_longlong();
- long $result = (long)0;
- $result = this.setLongLong(arg);
- out = $rh.createReply();
- out.write_longlong($result);
- break;
- }
-
- case 9: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setUnsignedLongLong
- {
- long arg = in.read_ulonglong();
- long $result = (long)0;
- $result = this.setUnsignedLongLong(arg);
- out = $rh.createReply();
- out.write_ulonglong($result);
- break;
- }
-
- case 10: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setFloat
- {
- float arg = in.read_float();
- float $result = (float)0;
- $result = this.setFloat(arg);
- out = $rh.createReply();
- out.write_float($result);
- break;
- }
-
- case 11: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setDouble
- {
- double arg = in.read_double();
- double $result = (double)0;
- $result = this.setDouble(arg);
- out = $rh.createReply();
- out.write_double($result);
- break;
- }
-
- case 12: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setString
- {
- String arg = in.read_string();
- String $result = null;
- $result = this.setString(arg);
- out = $rh.createReply();
- out.write_string($result);
- break;
- }
-
- case 13: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setWstring
- {
- String arg = in.read_wstring();
- String $result = null;
- $result = this.setWstring(arg);
- out = $rh.createReply();
- out.write_wstring($result);
- break;
- }
-
- case 14: // org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter/setRemoteObject
- {
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject obj =
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.read(in);
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject $result = null;
- $result = this.setRemoteObject(obj);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.write(out, $result);
- break;
- }
-
- default:
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
-} // class _PrimitivesSetterImplBase
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_PrimitivesSetterStub.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_PrimitivesSetterStub.java
deleted file mode 100644
index 0b08e1fb67..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_PrimitivesSetterStub.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/_PrimitivesSetterStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public class _PrimitivesSetterStub extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.generated.PrimitivesSetter {
-
- public boolean setBoolean(boolean arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setBoolean", true);
- $out.write_boolean(arg);
- $in = _invoke($out);
- boolean $result = $in.read_boolean();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setBoolean(arg);
- } finally {
- _releaseReply($in);
- }
- } // setBoolean
-
- public char setChar(char arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setChar", true);
- $out.write_char(arg);
- $in = _invoke($out);
- char $result = $in.read_char();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setChar(arg);
- } finally {
- _releaseReply($in);
- }
- } // setChar
-
- public char setWchar(char arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setWchar", true);
- $out.write_wchar(arg);
- $in = _invoke($out);
- char $result = $in.read_wchar();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setWchar(arg);
- } finally {
- _releaseReply($in);
- }
- } // setWchar
-
- public byte setOctet(byte arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setOctet", true);
- $out.write_octet(arg);
- $in = _invoke($out);
- byte $result = $in.read_octet();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setOctet(arg);
- } finally {
- _releaseReply($in);
- }
- } // setOctet
-
- public short setShort(short arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setShort", true);
- $out.write_short(arg);
- $in = _invoke($out);
- short $result = $in.read_short();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setShort(arg);
- } finally {
- _releaseReply($in);
- }
- } // setShort
-
- public short setUnsignedShort(short arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setUnsignedShort", true);
- $out.write_ushort(arg);
- $in = _invoke($out);
- short $result = $in.read_ushort();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setUnsignedShort(arg);
- } finally {
- _releaseReply($in);
- }
- } // setUnsignedShort
-
- public int setLong(int arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setLong", true);
- $out.write_long(arg);
- $in = _invoke($out);
- int $result = $in.read_long();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setLong(arg);
- } finally {
- _releaseReply($in);
- }
- } // setLong
-
- public int setUnsignedLong(int arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setUnsignedLong", true);
- $out.write_ulong(arg);
- $in = _invoke($out);
- int $result = $in.read_ulong();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setUnsignedLong(arg);
- } finally {
- _releaseReply($in);
- }
- } // setUnsignedLong
-
- public long setLongLong(long arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setLongLong", true);
- $out.write_longlong(arg);
- $in = _invoke($out);
- long $result = $in.read_longlong();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setLongLong(arg);
- } finally {
- _releaseReply($in);
- }
- } // setLongLong
-
- public long setUnsignedLongLong(long arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setUnsignedLongLong", true);
- $out.write_ulonglong(arg);
- $in = _invoke($out);
- long $result = $in.read_ulonglong();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setUnsignedLongLong(arg);
- } finally {
- _releaseReply($in);
- }
- } // setUnsignedLongLong
-
- public float setFloat(float arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setFloat", true);
- $out.write_float(arg);
- $in = _invoke($out);
- float $result = $in.read_float();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setFloat(arg);
- } finally {
- _releaseReply($in);
- }
- } // setFloat
-
- public double setDouble(double arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setDouble", true);
- $out.write_double(arg);
- $in = _invoke($out);
- double $result = $in.read_double();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setDouble(arg);
- } finally {
- _releaseReply($in);
- }
- } // setDouble
-
- public String setString(String arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setString", true);
- $out.write_string(arg);
- $in = _invoke($out);
- String $result = $in.read_string();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setString(arg);
- } finally {
- _releaseReply($in);
- }
- } // setString
-
- public String setWstring(String arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setWstring", true);
- $out.write_wstring(arg);
- $in = _invoke($out);
- String $result = $in.read_wstring();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setWstring(arg);
- } finally {
- _releaseReply($in);
- }
- } // setWstring
-
- public org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject setRemoteObject(org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject obj) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setRemoteObject", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.write($out, obj);
- $in = _invoke($out);
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject $result =
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setRemoteObject(obj);
- } finally {
- _releaseReply($in);
- }
- } // setRemoteObject
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
- private void readObject(java.io.ObjectInputStream s) throws java.io.IOException {
- String str = s.readUTF();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props).string_to_object(str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- _set_delegate(delegate);
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init(args, props).object_to_string(this);
- s.writeUTF(str);
- }
-} // class _PrimitivesSetterStub
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_RemoteObjectImplBase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_RemoteObjectImplBase.java
deleted file mode 100644
index a87534f88b..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_RemoteObjectImplBase.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/_RemoteObjectImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public abstract class _RemoteObjectImplBase extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject, org.omg.CORBA.portable.InvokeHandler {
-
- // Constructors
- public _RemoteObjectImplBase() {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable();
- static {
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke(String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh) {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObject:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
-} // class _RemoteObjectImplBase
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_RemoteObjectStub.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_RemoteObjectStub.java
deleted file mode 100644
index e219dfa338..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_RemoteObjectStub.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/_RemoteObjectStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public class _RemoteObjectStub extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject {
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/RemoteObject:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
- private void readObject(java.io.ObjectInputStream s) throws java.io.IOException {
- String str = s.readUTF();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props).string_to_object(str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- _set_delegate(delegate);
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init(args, props).object_to_string(this);
- s.writeUTF(str);
- }
-} // class _RemoteObjectStub
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_TestObjectImplBase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_TestObjectImplBase.java
deleted file mode 100644
index c0bc0d6ebd..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_TestObjectImplBase.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/_TestObjectImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public abstract class _TestObjectImplBase extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.generated.TestObject, org.omg.CORBA.portable.InvokeHandler {
-
- // Constructors
- public _TestObjectImplBase() {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable();
- static {
- _methods.put("pickStructFromArgs", new java.lang.Integer(0));
- _methods.put("setStruct", new java.lang.Integer(1));
- _methods.put("setSimpleStruct", new java.lang.Integer(2));
- _methods.put("setLongSeq1", new java.lang.Integer(3));
- _methods.put("setLongSeq2", new java.lang.Integer(4));
- _methods.put("setLongSeq3", new java.lang.Integer(5));
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke(String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh) {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- switch (__method.intValue()) {
- case 0: // org/apache/tuscany/sca/binding/corba/testing/generated/TestObject/pickStructFromArgs
- {
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg1 =
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.read(in);
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg2 =
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.read(in);
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg3 =
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.read(in);
- int structNumber = in.read_long();
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct $result = null;
- $result = this.pickStructFromArgs(arg1, arg2, arg3, structNumber);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.write(out, $result);
- break;
- }
-
- case 1: // org/apache/tuscany/sca/binding/corba/testing/generated/TestObject/setStruct
- {
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg =
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.read(in);
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct $result = null;
- $result = this.setStruct(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.write(out, $result);
- break;
- }
-
- case 2: // org/apache/tuscany/sca/binding/corba/testing/generated/TestObject/setSimpleStruct
- {
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHolder arg =
- new org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHolder();
- arg.value = org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.read(in);
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct $result = null;
- $result = this.setSimpleStruct(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.write(out, $result);
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.write(out, arg.value);
- break;
- }
-
- case 3: // org/apache/tuscany/sca/binding/corba/testing/generated/TestObject/setLongSeq1
- {
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Holder arg =
- new org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Holder();
- arg.value = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.read(in);
- int $result[] = null;
- $result = this.setLongSeq1(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.write(out, $result);
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.write(out, arg.value);
- break;
- }
-
- case 4: // org/apache/tuscany/sca/binding/corba/testing/generated/TestObject/setLongSeq2
- {
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Holder arg =
- new org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Holder();
- arg.value = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.read(in);
- int $result[][] = null;
- $result = this.setLongSeq2(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.write(out, $result);
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.write(out, arg.value);
- break;
- }
-
- case 5: // org/apache/tuscany/sca/binding/corba/testing/generated/TestObject/setLongSeq3
- {
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Holder arg =
- new org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Holder();
- arg.value = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.read(in);
- int $result[][][] = null;
- $result = this.setLongSeq3(arg);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.write(out, $result);
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.write(out, arg.value);
- break;
- }
-
- default:
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
-} // class _TestObjectImplBase
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_TestObjectStub.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_TestObjectStub.java
deleted file mode 100644
index ad47595ddf..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/_TestObjectStub.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/_TestObjectStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public class _TestObjectStub extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.generated.TestObject {
-
- public org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct pickStructFromArgs(org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg1,
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg2,
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg3,
- int structNumber) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("pickStructFromArgs", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.write($out, arg1);
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.write($out, arg2);
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.write($out, arg3);
- $out.write_long(structNumber);
- $in = _invoke($out);
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct $result =
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return pickStructFromArgs(arg1, arg2, arg3, structNumber);
- } finally {
- _releaseReply($in);
- }
- } // pickStructFromArgs
-
- public org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct setStruct(org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setStruct", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.write($out, arg);
- $in = _invoke($out);
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct $result =
- org.apache.tuscany.sca.binding.corba.testing.generated.SomeStructHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setStruct(arg);
- } finally {
- _releaseReply($in);
- }
- } // setStruct
-
- public org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct setSimpleStruct(org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHolder arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setSimpleStruct", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.write($out, arg.value);
- $in = _invoke($out);
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct $result =
- org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.read($in);
- arg.value = org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setSimpleStruct(arg);
- } finally {
- _releaseReply($in);
- }
- } // setSimpleStruct
-
- public int[] setLongSeq1(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Holder arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setLongSeq1", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.write($out, arg.value);
- $in = _invoke($out);
- int $result[] = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.read($in);
- arg.value = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setLongSeq1(arg);
- } finally {
- _releaseReply($in);
- }
- } // setLongSeq1
-
- public int[][] setLongSeq2(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Holder arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setLongSeq2", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.write($out, arg.value);
- $in = _invoke($out);
- int $result[][] = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.read($in);
- arg.value = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setLongSeq2(arg);
- } finally {
- _releaseReply($in);
- }
- } // setLongSeq2
-
- public int[][][] setLongSeq3(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Holder arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("setLongSeq3", true);
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.write($out, arg.value);
- $in = _invoke($out);
- int $result[][][] = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.read($in);
- arg.value = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return setLongSeq3(arg);
- } finally {
- _releaseReply($in);
- }
- } // setLongSeq3
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
- private void readObject(java.io.ObjectInputStream s) throws java.io.IOException {
- String str = s.readUTF();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props).string_to_object(str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- _set_delegate(delegate);
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init(args, props).object_to_string(this);
- s.writeUTF(str);
- }
-} // class _TestObjectStub
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/boolean_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/boolean_listHelper.java
deleted file mode 100644
index f3d96e8fd7..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/boolean_listHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/boolean_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-abstract public class boolean_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/boolean_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, boolean[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static boolean[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_boolean);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.boolean_listHelper.id(),
- "boolean_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static boolean[] read(org.omg.CORBA.portable.InputStream istream) {
- boolean value[] = null;
- int _len0 = istream.read_long();
- value = new boolean[_len0];
- istream.read_boolean_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, boolean[] value) {
- ostream.write_long(value.length);
- ostream.write_boolean_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/boolean_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/boolean_listHolder.java
deleted file mode 100644
index cb0ab8bcfd..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/boolean_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/boolean_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public final class boolean_listHolder implements org.omg.CORBA.portable.Streamable {
- public boolean value[] = null;
-
- public boolean_listHolder() {
- }
-
- public boolean_listHolder(boolean[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.boolean_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.boolean_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.boolean_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/char_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/char_listHelper.java
deleted file mode 100644
index 0bde1e701c..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/char_listHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/char_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-abstract public class char_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/char_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, char[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static char[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_char);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.char_listHelper.id(),
- "char_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static char[] read(org.omg.CORBA.portable.InputStream istream) {
- char value[] = null;
- int _len0 = istream.read_long();
- value = new char[_len0];
- istream.read_char_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, char[] value) {
- ostream.write_long(value.length);
- ostream.write_char_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/char_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/char_listHolder.java
deleted file mode 100644
index 19b2942cfe..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/char_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/char_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public final class char_listHolder implements org.omg.CORBA.portable.Streamable {
- public char value[] = null;
-
- public char_listHolder() {
- }
-
- public char_listHolder(char[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.char_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.char_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.char_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/double_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/double_listHelper.java
deleted file mode 100644
index 8bb5a9c69d..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/double_listHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/double_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-abstract public class double_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/double_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, double[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static double[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_double);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.double_listHelper.id(),
- "double_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static double[] read(org.omg.CORBA.portable.InputStream istream) {
- double value[] = null;
- int _len0 = istream.read_long();
- value = new double[_len0];
- istream.read_double_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, double[] value) {
- ostream.write_long(value.length);
- ostream.write_double_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/double_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/double_listHolder.java
deleted file mode 100644
index dc89e71092..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/double_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/double_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public final class double_listHolder implements org.omg.CORBA.portable.Streamable {
- public double value[] = null;
-
- public double_listHolder() {
- }
-
- public double_listHolder(double[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.double_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.double_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.double_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/float_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/float_listHelper.java
deleted file mode 100644
index 7b71aa0a9f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/float_listHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/float_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-abstract public class float_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/float_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, float[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static float[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_float);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.float_listHelper.id(),
- "float_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static float[] read(org.omg.CORBA.portable.InputStream istream) {
- float value[] = null;
- int _len0 = istream.read_long();
- value = new float[_len0];
- istream.read_float_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, float[] value) {
- ostream.write_long(value.length);
- ostream.write_float_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/float_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/float_listHolder.java
deleted file mode 100644
index 513bab37cc..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/float_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/float_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public final class float_listHolder implements org.omg.CORBA.portable.Streamable {
- public float value[] = null;
-
- public float_listHolder() {
- }
-
- public float_listHolder(float[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.float_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.float_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.float_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_listHelper.java
deleted file mode 100644
index c1d06e2ba9..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_listHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/long_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-abstract public class long_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/long_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, int[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static int[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_long);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_listHelper.id(),
- "long_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static int[] read(org.omg.CORBA.portable.InputStream istream) {
- int value[] = null;
- int _len0 = istream.read_long();
- value = new int[_len0];
- istream.read_long_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, int[] value) {
- ostream.write_long(value.length);
- ostream.write_long_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_listHolder.java
deleted file mode 100644
index f9ad7b77ac..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/long_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public final class long_listHolder implements org.omg.CORBA.portable.Streamable {
- public int value[] = null;
-
- public long_listHolder() {
- }
-
- public long_listHolder(int[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.long_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.long_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.long_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_long_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_long_listHelper.java
deleted file mode 100644
index cfb292fc01..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_long_listHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/long_long_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-abstract public class long_long_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/long_long_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, long[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static long[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_longlong);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_long_listHelper.id(),
- "long_long_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static long[] read(org.omg.CORBA.portable.InputStream istream) {
- long value[] = null;
- int _len0 = istream.read_long();
- value = new long[_len0];
- istream.read_longlong_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, long[] value) {
- ostream.write_long(value.length);
- ostream.write_longlong_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_long_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_long_listHolder.java
deleted file mode 100644
index 02f46a7d85..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_long_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/long_long_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 14:12:28 CEST
-*/
-
-public final class long_long_listHolder implements org.omg.CORBA.portable.Streamable {
- public long value[] = null;
-
- public long_long_listHolder() {
- }
-
- public long_long_listHolder(long[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.long_long_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.long_long_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.long_long_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1Helper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1Helper.java
deleted file mode 100644
index 505aa3f026..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1Helper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1Helper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class long_seq1Helper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1:1.0";
-
- public static void insert(org.omg.CORBA.Any a, int[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static int[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_long);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.id(),
- "long_seq1",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static int[] read(org.omg.CORBA.portable.InputStream istream) {
- int value[] = null;
- int _len0 = istream.read_long();
- value = new int[_len0];
- istream.read_long_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, int[] value) {
- ostream.write_long(value.length);
- ostream.write_long_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1Holder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1Holder.java
deleted file mode 100644
index 5cbaa109ee..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1Holder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/long_seq1Holder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class long_seq1Holder implements org.omg.CORBA.portable.Streamable {
- public int value[] = null;
-
- public long_seq1Holder() {
- }
-
- public long_seq1Holder(int[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2Helper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2Helper.java
deleted file mode 100644
index 2f792888fb..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2Helper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2Helper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class long_seq2Helper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2:1.0";
-
- public static void insert(org.omg.CORBA.Any a, int[][] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static int[][] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_long);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.id(),
- "long_seq1",
- __typeCode);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.id(),
- "long_seq2",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static int[][] read(org.omg.CORBA.portable.InputStream istream) {
- int value[][] = null;
- int _len0 = istream.read_long();
- value = new int[_len0][];
- for (int _o1 = 0; _o1 < value.length; ++_o1)
- value[_o1] = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.read(istream);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, int[][] value) {
- ostream.write_long(value.length);
- for (int _i0 = 0; _i0 < value.length; ++_i0)
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.write(ostream, value[_i0]);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2Holder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2Holder.java
deleted file mode 100644
index 8b2ccc1f73..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2Holder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/long_seq2Holder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class long_seq2Holder implements org.omg.CORBA.portable.Streamable {
- public int value[][] = null;
-
- public long_seq2Holder() {
- }
-
- public long_seq2Holder(int[][] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3Helper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3Helper.java
deleted file mode 100644
index 67e224f0be..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3Helper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3Helper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class long_seq3Helper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3:1.0";
-
- public static void insert(org.omg.CORBA.Any a, int[][][] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static int[][][] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_long);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Helper.id(),
- "long_seq1",
- __typeCode);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.id(),
- "long_seq2",
- __typeCode);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.id(),
- "long_seq3",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static int[][][] read(org.omg.CORBA.portable.InputStream istream) {
- int value[][][] = null;
- int _len0 = istream.read_long();
- value = new int[_len0][][];
- for (int _o1 = 0; _o1 < value.length; ++_o1)
- value[_o1] = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.read(istream);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, int[][][] value) {
- ostream.write_long(value.length);
- for (int _i0 = 0; _i0 < value.length; ++_i0)
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Helper.write(ostream, value[_i0]);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3Holder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3Holder.java
deleted file mode 100644
index 5d4adfba2d..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3Holder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/long_seq3Holder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class long_seq3Holder implements org.omg.CORBA.portable.Streamable {
- public int value[][][] = null;
-
- public long_seq3Holder() {
- }
-
- public long_seq3Holder(int[][][] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Helper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/octet_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/octet_listHelper.java
deleted file mode 100644
index c7d86d9179..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/octet_listHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/octet_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class octet_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/octet_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, byte[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static byte[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_octet);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.octet_listHelper.id(),
- "octet_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static byte[] read(org.omg.CORBA.portable.InputStream istream) {
- byte value[] = null;
- int _len0 = istream.read_long();
- value = new byte[_len0];
- istream.read_octet_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, byte[] value) {
- ostream.write_long(value.length);
- ostream.write_octet_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/octet_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/octet_listHolder.java
deleted file mode 100644
index 09b2b85c6a..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/octet_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/octet_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class octet_listHolder implements org.omg.CORBA.portable.Streamable {
- public byte value[] = null;
-
- public octet_listHolder() {
- }
-
- public octet_listHolder(byte[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.octet_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.octet_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.octet_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_listHelper.java
deleted file mode 100644
index e88b1e06c4..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_listHelper.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class remote_object_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.type();
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.remote_object_listHelper
- .id(),
- "remote_object_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject[] read(org.omg.CORBA.portable.InputStream istream) {
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject value[] = null;
- int _len0 = istream.read_long();
- value = new org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject[_len0];
- for (int _o1 = 0; _o1 < value.length; ++_o1)
- value[_o1] = org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.read(istream);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject[] value) {
- ostream.write_long(value.length);
- for (int _i0 = 0; _i0 < value.length; ++_i0)
- org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObjectHelper.write(ostream, value[_i0]);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_listHolder.java
deleted file mode 100644
index d3f996c5b4..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/remote_object_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class remote_object_listHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject value[] = null;
-
- public remote_object_listHolder() {
- }
-
- public remote_object_listHolder(org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.remote_object_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.remote_object_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.remote_object_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/short_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/short_listHelper.java
deleted file mode 100644
index 7c58d47f7c..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/short_listHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/short_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class short_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/short_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, short[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static short[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_short);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.short_listHelper.id(),
- "short_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static short[] read(org.omg.CORBA.portable.InputStream istream) {
- short value[] = null;
- int _len0 = istream.read_long();
- value = new short[_len0];
- istream.read_short_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, short[] value) {
- ostream.write_long(value.length);
- ostream.write_short_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/short_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/short_listHolder.java
deleted file mode 100644
index 5be5a65c43..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/short_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/short_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class short_listHolder implements org.omg.CORBA.portable.Streamable {
- public short value[] = null;
-
- public short_listHolder() {
- }
-
- public short_listHolder(short[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.short_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.short_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.short_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/string_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/string_listHelper.java
deleted file mode 100644
index a40d5fa8de..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/string_listHelper.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/string_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class string_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/string_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, String[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static String[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().create_string_tc(0);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper.id(),
- "string_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static String[] read(org.omg.CORBA.portable.InputStream istream) {
- String value[] = null;
- int _len0 = istream.read_long();
- value = new String[_len0];
- for (int _o1 = 0; _o1 < value.length; ++_o1)
- value[_o1] = istream.read_string();
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, String[] value) {
- ostream.write_long(value.length);
- for (int _i0 = 0; _i0 < value.length; ++_i0)
- ostream.write_string(value[_i0]);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/string_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/string_listHolder.java
deleted file mode 100644
index 76f99408f2..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/string_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/string_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class string_listHolder implements org.omg.CORBA.portable.Streamable {
- public String value[] = null;
-
- public string_listHolder() {
- }
-
- public string_listHolder(String[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.string_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_listHelper.java
deleted file mode 100644
index d7594b0815..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_listHelper.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class unsigned_long_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, int[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static int[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_listHelper
- .id(),
- "unsigned_long_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static int[] read(org.omg.CORBA.portable.InputStream istream) {
- int value[] = null;
- int _len0 = istream.read_long();
- value = new int[_len0];
- istream.read_ulong_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, int[] value) {
- ostream.write_long(value.length);
- ostream.write_ulong_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_listHolder.java
deleted file mode 100644
index e9fbcccc36..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class unsigned_long_listHolder implements org.omg.CORBA.portable.Streamable {
- public int value[] = null;
-
- public unsigned_long_listHolder() {
- }
-
- public unsigned_long_listHolder(int[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_listHelper.java
deleted file mode 100644
index 6ef187c4e5..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_listHelper.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class unsigned_long_long_listHelper {
- private static String _id =
- "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, long[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static long[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulonglong);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB
- .init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_long_listHelper
- .id(),
- "unsigned_long_long_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static long[] read(org.omg.CORBA.portable.InputStream istream) {
- long value[] = null;
- int _len0 = istream.read_long();
- value = new long[_len0];
- istream.read_ulonglong_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, long[] value) {
- ostream.write_long(value.length);
- ostream.write_ulonglong_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_listHolder.java
deleted file mode 100644
index 59bc015c38..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_long_long_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class unsigned_long_long_listHolder implements org.omg.CORBA.portable.Streamable {
- public long value[] = null;
-
- public unsigned_long_long_listHolder() {
- }
-
- public unsigned_long_long_listHolder(long[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_long_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_long_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_long_long_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_listHelper.java
deleted file mode 100644
index ec4526cebf..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_listHelper.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class unsigned_short_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, short[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static short[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ushort);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_short_listHelper
- .id(),
- "unsigned_short_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static short[] read(org.omg.CORBA.portable.InputStream istream) {
- short value[] = null;
- int _len0 = istream.read_long();
- value = new short[_len0];
- istream.read_ushort_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, short[] value) {
- ostream.write_long(value.length);
- ostream.write_ushort_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_listHolder.java
deleted file mode 100644
index 56ab28f0be..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/unsigned_short_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class unsigned_short_listHolder implements org.omg.CORBA.portable.Streamable {
- public short value[] = null;
-
- public unsigned_short_listHolder() {
- }
-
- public unsigned_short_listHolder(short[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_short_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_short_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.unsigned_short_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wchar_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wchar_listHelper.java
deleted file mode 100644
index 73a10d3b7f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wchar_listHelper.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/wchar_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class wchar_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/wchar_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, char[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static char[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_wchar);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.wchar_listHelper.id(),
- "wchar_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static char[] read(org.omg.CORBA.portable.InputStream istream) {
- char value[] = null;
- int _len0 = istream.read_long();
- value = new char[_len0];
- istream.read_wchar_array(value, 0, _len0);
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, char[] value) {
- ostream.write_long(value.length);
- ostream.write_wchar_array(value, 0, value.length);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wchar_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wchar_listHolder.java
deleted file mode 100644
index c5c1e87756..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wchar_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/wchar_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class wchar_listHolder implements org.omg.CORBA.portable.Streamable {
- public char value[] = null;
-
- public wchar_listHolder() {
- }
-
- public wchar_listHolder(char[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.wchar_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.wchar_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.wchar_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wstring_listHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wstring_listHelper.java
deleted file mode 100644
index 3e45568f01..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wstring_listHelper.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.binding.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/wstring_listHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-abstract public class wstring_listHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/generated/wstring_list:1.0";
-
- public static void insert(org.omg.CORBA.Any a, String[] that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static String[] extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode = org.omg.CORBA.ORB.init().create_wstring_tc(0);
- __typeCode = org.omg.CORBA.ORB.init().create_sequence_tc(0, __typeCode);
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_alias_tc(org.apache.tuscany.sca.binding.corba.testing.generated.wstring_listHelper.id(),
- "wstring_list",
- __typeCode);
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static String[] read(org.omg.CORBA.portable.InputStream istream) {
- String value[] = null;
- int _len0 = istream.read_long();
- value = new String[_len0];
- for (int _o1 = 0; _o1 < value.length; ++_o1)
- value[_o1] = istream.read_wstring();
- return value;
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream, String[] value) {
- ostream.write_long(value.length);
- for (int _i0 = 0; _i0 < value.length; ++_i0)
- ostream.write_wstring(value[_i0]);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wstring_listHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wstring_listHolder.java
deleted file mode 100644
index bdbf9d995b..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/generated/wstring_listHolder.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.corba.testing.generated;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/generated/wstring_listHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* monday, 23 june 2008 2008 14:12:28 CEST
-*/
-
-public final class wstring_listHolder implements org.omg.CORBA.portable.Streamable {
- public String value[] = null;
-
- public wstring_listHolder() {
- }
-
- public wstring_listHolder(String[] initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.generated.wstring_listHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.generated.wstring_listHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.generated.wstring_listHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/ArraysTestStruct.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/ArraysTestStruct.java
deleted file mode 100644
index 7f90520d67..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/ArraysTestStruct.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.corba.testing.hierarchy;
-
-import org.apache.tuscany.sca.binding.corba.meta.CorbaArray;
-
-public final class ArraysTestStruct {
-
- public ArraysTestStruct() {
-
- }
-
- public ArraysTestStruct(String[] field1, int[][] field2, float[][][] field3) {
- this.field1 = field1;
- this.field2 = field2;
- this.field3 = field3;
- }
-
- @CorbaArray( {2})
- public String[] field1;
-
- @CorbaArray( {2, 4})
- public int[][] field2;
-
- @CorbaArray( {2, 4, 2})
- public float[][][] field3;
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/Calc.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/Calc.java
deleted file mode 100644
index 7c33b1d449..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/Calc.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.corba.testing.hierarchy;
-
-import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero;
-
-public interface Calc {
-
- public double div(double arg1, double arg2) throws DivByZero;
-
- public double divForSmallArgs(double arg1, double arg2);
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/DummyObject.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/DummyObject.java
deleted file mode 100644
index d0ebff5fec..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/DummyObject.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.corba.testing.hierarchy;
-
-public interface DummyObject {
-
- int getLong();
-
- DummyObject cloneObject();
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InnerUnion.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InnerUnion.java
deleted file mode 100644
index baf5043bc2..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InnerUnion.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.binding.corba.testing.hierarchy;
-
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement;
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElementType;
-
-public final class InnerUnion {
-
- @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 1)
- private int x;
-
- @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 2)
- private float y;
-
- @CorbaUnionElement(type = CorbaUnionElementType.discriminator)
- @SuppressWarnings("unused")
- private int discriminator;
-
- public int getX() {
- return x;
- }
-
- public void setX(int x) {
- discriminator = 1;
- this.x = x;
- }
-
- public float getY() {
- return y;
- }
-
- public void setY(float y) {
- discriminator = 2;
- this.y = y;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidCorbaArray.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidCorbaArray.java
deleted file mode 100644
index 9ad637fc55..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidCorbaArray.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.binding.corba.testing.hierarchy;
-
-import org.apache.tuscany.sca.binding.corba.meta.CorbaArray;
-
-public final class InvalidCorbaArray {
-
- // annotation argument array is not equal to declared arrays dimension
- @CorbaArray( {1})
- public String[][] array;
-
- public InvalidCorbaArray() {
-
- }
-
- public InvalidCorbaArray(String[][] arg) {
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum1.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum1.java
deleted file mode 100644
index 0c9de5bb31..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum1.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.corba.testing.hierarchy;
-
-public class InvalidEnum1 {
-
- public static final InvalidEnum1 red = new InvalidEnum1(0);
-
- public int value() {
- return 0;
- }
-
- public static InvalidEnum1 from_int(int value) {
- return null;
- }
-
- protected InvalidEnum1(int value) {
- }
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum2.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum2.java
deleted file mode 100644
index 8746eb7f9b..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum2.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.corba.testing.hierarchy;
-
-public class InvalidEnum2 {
-
- public static final int _red = 0;
- public static final InvalidEnum2 red = new InvalidEnum2(_red);
-
- public static InvalidEnum2 from_int(int value) {
- return null;
- }
-
- protected InvalidEnum2(int value) {
- }
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum3.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum3.java
deleted file mode 100644
index 6d124b0485..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum3.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.corba.testing.hierarchy;
-
-public class InvalidEnum3 {
-
- public static final int _red = 0;
- public static final InvalidEnum2 red = new InvalidEnum2(_red);
-
- public int value() {
- return 0;
- }
-
- protected InvalidEnum3(int value) {
- }
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct1.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct1.java
deleted file mode 100644
index 8cf66e2fac..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct1.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.corba.testing.hierarchy;
-
-public final class InvalidStruct1 {
-
- public InvalidStruct1() {
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct2.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct2.java
deleted file mode 100644
index 5f361512f0..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct2.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.corba.testing.hierarchy;
-
-public final class InvalidStruct2 {
-
- public int f1;
- public String f2;
-
- public InvalidStruct2(int f1, String f2) {
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct3.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct3.java
deleted file mode 100644
index adc81ea5a2..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct3.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.corba.testing.hierarchy;
-
-public final class InvalidStruct3 {
-
- public int f1;
- public String f2;
- public static byte f3;
-
- public InvalidStruct3() {
-
- }
-
- public InvalidStruct3(int f1, String f2, byte f3) {
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion1.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion1.java
deleted file mode 100644
index c3fd45d5f4..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion1.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.corba.testing.hierarchy;
-
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement;
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElementType;
-
-/**
- * More than one discriminators
- */
-public final class InvalidUnion1 {
-
- @CorbaUnionElement(type = CorbaUnionElementType.discriminator)
- @SuppressWarnings("unused")
- private int a;
- @CorbaUnionElement(type = CorbaUnionElementType.discriminator)
- @SuppressWarnings("unused")
- private int b;
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion2.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion2.java
deleted file mode 100644
index f6d5421a56..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion2.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.corba.testing.hierarchy;
-
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement;
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElementType;
-
-/**
- * Discriminator is missing
- */
-public final class InvalidUnion2 {
-
- @CorbaUnionElement(type=CorbaUnionElementType.defaultOption)
- @SuppressWarnings("unused")
- private int a;
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion3.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion3.java
deleted file mode 100644
index 0d1bdd0a13..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion3.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.corba.testing.hierarchy;
-
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement;
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElementType;
-
-/**
- * No option, only discriminator
- */
-public final class InvalidUnion3{
-
- @CorbaUnionElement(type = CorbaUnionElementType.discriminator)
- @SuppressWarnings("unused")
- private int a;
-
-}
-
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion4.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion4.java
deleted file mode 100644
index 3afe702f87..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion4.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.binding.corba.testing.hierarchy;
-
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement;
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElementType;
-
-/**
- * Invalid field modifiers
- */
-public final class InvalidUnion4{
-
- @CorbaUnionElement(type = CorbaUnionElementType.discriminator)
- @SuppressWarnings("unused")
- private static int a;
-
- @CorbaUnionElement(type = CorbaUnionElementType.defaultOption)
- @SuppressWarnings("unused")
- private static int b;
-
-}
-
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion5.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion5.java
deleted file mode 100644
index 9d30e5ced1..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion5.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.corba.testing.hierarchy;
-
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement;
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElementType;
-
-/**
- * Reused option id
- */
-public final class InvalidUnion5 {
-
- @CorbaUnionElement(type = CorbaUnionElementType.discriminator)
- @SuppressWarnings("unused")
- private int a;
-
- @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 1)
- @SuppressWarnings("unused")
- private int b;
-
- @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 1)
- @SuppressWarnings("unused")
- private int c;
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/NonCorbaException.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/NonCorbaException.java
deleted file mode 100644
index a514b5e222..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/NonCorbaException.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.corba.testing.hierarchy;
-
-public class NonCorbaException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- public String someField;
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/RichUnion.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/RichUnion.java
deleted file mode 100644
index 2ea40e345f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/RichUnion.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.binding.corba.testing.hierarchy;
-
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement;
-import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElementType;
-
-public final class RichUnion {
-
- @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 1)
- private int x;
-
- @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 2)
- private float y;
-
- @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 3)
- private String z;
-
- @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 4)
- private InnerUnion iu;
-
- @CorbaUnionElement(type = CorbaUnionElementType.defaultOption)
- private boolean def;
-
- @CorbaUnionElement(type = CorbaUnionElementType.discriminator)
- @SuppressWarnings("unused")
- private int discriminator = -1;
-
- public int getX() {
- return x;
- }
-
- public void setX(int x) {
- this.discriminator = 1;
- this.x = x;
- }
-
- public float getY() {
- return y;
- }
-
- public void setY(float y) {
- this.discriminator = 2;
- this.y = y;
- }
-
- public String getZ() {
- return z;
- }
-
- public void setZ(String z) {
- this.discriminator = 3;
- this.z = z;
- }
-
- public boolean isDef() {
- return def;
- }
-
- public void setDef(boolean def) {
- this.discriminator = -1;
- this.def = def;
- }
-
- public InnerUnion getIu() {
- return iu;
- }
-
- public void setIu(InnerUnion iu) {
- this.discriminator = 4;
- this.iu = iu;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/SimpleStruct.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/SimpleStruct.java
deleted file mode 100644
index 85ca3798f4..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/SimpleStruct.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.corba.testing.hierarchy;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SimpleStruct {
-
- public String field1;
- public int field2;
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/SomeStruct.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/SomeStruct.java
deleted file mode 100644
index d8cdf1835a..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/SomeStruct.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.corba.testing.hierarchy;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SomeStruct {
-
- public SimpleStruct innerStruct;
- public String str;
- public String[] str_list;
- public int[][] twoDimSeq;
- public int[][][] threeDimSeq;
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObject.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObject.java
deleted file mode 100644
index bb72fdbbf3..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObject.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.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/DummyObject.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-public interface DummyObject extends DummyObjectOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity {
-} // interface DummyObject
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectHelper.java
deleted file mode 100644
index 606d333bb3..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectHelper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-abstract public class DummyObjectHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/references/DummyObject:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.references.DummyObject extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB
- .init()
- .create_interface_tc(org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.id(),
- "DummyObject");
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.references.DummyObject read(org.omg.CORBA.portable.InputStream istream) {
- return narrow(istream.read_Object(_DummyObjectStub.class));
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject value) {
- ostream.write_Object((org.omg.CORBA.Object)value);
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.references.DummyObject narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.references.DummyObject)
- return (org.apache.tuscany.sca.binding.corba.testing.references.DummyObject)obj;
- else if (!obj._is_a(id()))
- throw new org.omg.CORBA.BAD_PARAM();
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.references._DummyObjectStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.references._DummyObjectStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.references.DummyObject unchecked_narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.references.DummyObject)
- return (org.apache.tuscany.sca.binding.corba.testing.references.DummyObject)obj;
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.references._DummyObjectStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.references._DummyObjectStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectHolder.java
deleted file mode 100644
index 0ff9540502..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectHolder.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.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-public final class DummyObjectHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.references.DummyObject value = null;
-
- public DummyObjectHolder() {
- }
-
- public DummyObjectHolder(org.apache.tuscany.sca.binding.corba.testing.references.DummyObject initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectOperations.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectOperations.java
deleted file mode 100644
index 912bd16f9b..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectOperations.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.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/DummyObjectOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-public interface DummyObjectOperations {
- int getLong();
-
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject cloneObject();
-} // interface DummyObjectOperations
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManager.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManager.java
deleted file mode 100644
index 79f7959c72..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManager.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.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/ObjectManager.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-public interface ObjectManager extends ObjectManagerOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity {
-} // interface ObjectManager
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerHelper.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerHelper.java
deleted file mode 100644
index 495a614d84..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerHelper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-abstract public class ObjectManagerHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/references/ObjectManager:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_interface_tc(org.apache.tuscany.sca.binding.corba.testing.references.ObjectManagerHelper
- .id(),
- "ObjectManager");
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager read(org.omg.CORBA.portable.InputStream istream) {
- return narrow(istream.read_Object(_ObjectManagerStub.class));
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager value) {
- ostream.write_Object((org.omg.CORBA.Object)value);
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager)
- return (org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager)obj;
- else if (!obj._is_a(id()))
- throw new org.omg.CORBA.BAD_PARAM();
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.references._ObjectManagerStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.references._ObjectManagerStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager unchecked_narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager)
- return (org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager)obj;
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.binding.corba.testing.references._ObjectManagerStub stub =
- new org.apache.tuscany.sca.binding.corba.testing.references._ObjectManagerStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerHolder.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerHolder.java
deleted file mode 100644
index 11cfc82ac2..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerHolder.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.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-public final class ObjectManagerHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager value = null;
-
- public ObjectManagerHolder() {
- }
-
- public ObjectManagerHolder(org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.binding.corba.testing.references.ObjectManagerHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.binding.corba.testing.references.ObjectManagerHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.binding.corba.testing.references.ObjectManagerHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerOperations.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerOperations.java
deleted file mode 100644
index e0e56d1017..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerOperations.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.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/ObjectManagerOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-public interface ObjectManagerOperations {
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject getDummyObject();
-
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject getObjectByArgument(org.apache.tuscany.sca.binding.corba.testing.references.DummyObject dummy);
-} // interface ObjectManagerOperations
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_DummyObjectImplBase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_DummyObjectImplBase.java
deleted file mode 100644
index c706661eaa..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_DummyObjectImplBase.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.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/_DummyObjectImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-public abstract class _DummyObjectImplBase extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject, org.omg.CORBA.portable.InvokeHandler {
-
- // Constructors
- public _DummyObjectImplBase() {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable();
- static {
- _methods.put("getLong", new java.lang.Integer(0));
- _methods.put("cloneObject", new java.lang.Integer(1));
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke(String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh) {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- switch (__method.intValue()) {
- case 0: // org/apache/tuscany/sca/binding/corba/testing/references/DummyObject/getLong
- {
- int $result = (int)0;
- $result = this.getLong();
- out = $rh.createReply();
- out.write_long($result);
- break;
- }
-
- case 1: // org/apache/tuscany/sca/binding/corba/testing/references/DummyObject/cloneObject
- {
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject $result = null;
- $result = this.cloneObject();
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.write(out, $result);
- break;
- }
-
- default:
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/references/DummyObject:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
-} // class _DummyObjectImplBase
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_DummyObjectStub.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_DummyObjectStub.java
deleted file mode 100644
index c9a31deb27..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_DummyObjectStub.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.binding.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/_DummyObjectStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-public class _DummyObjectStub extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject {
-
- public int getLong() {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("getLong", true);
- $in = _invoke($out);
- int $result = $in.read_long();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return getLong();
- } finally {
- _releaseReply($in);
- }
- } // getLong
-
- public org.apache.tuscany.sca.binding.corba.testing.references.DummyObject cloneObject() {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("cloneObject", true);
- $in = _invoke($out);
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject $result =
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return cloneObject();
- } finally {
- _releaseReply($in);
- }
- } // cloneObject
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/references/DummyObject:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
- private void readObject(java.io.ObjectInputStream s) throws java.io.IOException {
- String str = s.readUTF();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props).string_to_object(str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- _set_delegate(delegate);
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init(args, props).object_to_string(this);
- s.writeUTF(str);
- }
-} // class _DummyObjectStub
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_ObjectManagerImplBase.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_ObjectManagerImplBase.java
deleted file mode 100644
index a6b55b8bae..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_ObjectManagerImplBase.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.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/_ObjectManagerImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-public abstract class _ObjectManagerImplBase extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager, org.omg.CORBA.portable.InvokeHandler {
-
- // Constructors
- public _ObjectManagerImplBase() {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable();
- static {
- _methods.put("getDummyObject", new java.lang.Integer(0));
- _methods.put("getObjectByArgument", new java.lang.Integer(1));
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke(String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh) {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- switch (__method.intValue()) {
- case 0: // org/apache/tuscany/sca/binding/corba/testing/references/ObjectManager/getDummyObject
- {
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject $result = null;
- $result = this.getDummyObject();
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.write(out, $result);
- break;
- }
-
- case 1: // org/apache/tuscany/sca/binding/corba/testing/references/ObjectManager/getObjectByArgument
- {
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject dummy =
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.read(in);
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject $result = null;
- $result = this.getObjectByArgument(dummy);
- out = $rh.createReply();
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.write(out, $result);
- break;
- }
-
- default:
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/references/ObjectManager:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
-} // class _ObjectManagerImplBase
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_ObjectManagerStub.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_ObjectManagerStub.java
deleted file mode 100644
index e06a078a93..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/references/_ObjectManagerStub.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.binding.corba.testing.references;
-
-/**
-* org/apache/tuscany/sca/binding/corba/testing/references/_ObjectManagerStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from remote_objects.idl
-* niedziela, 8 czerwiec 2008 16:43:12 CEST
-*/
-
-public class _ObjectManagerStub extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.binding.corba.testing.references.ObjectManager {
-
- public org.apache.tuscany.sca.binding.corba.testing.references.DummyObject getDummyObject() {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("getDummyObject", true);
- $in = _invoke($out);
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject $result =
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return getDummyObject();
- } finally {
- _releaseReply($in);
- }
- } // getDummyObject
-
- public org.apache.tuscany.sca.binding.corba.testing.references.DummyObject getObjectByArgument(org.apache.tuscany.sca.binding.corba.testing.references.DummyObject dummy) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("getObjectByArgument", true);
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.write($out, dummy);
- $in = _invoke($out);
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObject $result =
- org.apache.tuscany.sca.binding.corba.testing.references.DummyObjectHelper.read($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return getObjectByArgument(dummy);
- } finally {
- _releaseReply($in);
- }
- } // getObjectByArgument
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/references/ObjectManager:1.0"};
-
- @Override
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
- private void readObject(java.io.ObjectInputStream s) throws java.io.IOException {
- String str = s.readUTF();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props).string_to_object(str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- _set_delegate(delegate);
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init(args, props).object_to_string(this);
- s.writeUTF(str);
- }
-} // class _ObjectManagerStub
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysSetterServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysSetterServant.java
deleted file mode 100644
index 0aec4d278d..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysSetterServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject;
-import org.apache.tuscany.sca.binding.corba.testing.generated._ArraysSetterImplBase;
-
-public class ArraysSetterServant extends _ArraysSetterImplBase {
-
- private static final long serialVersionUID = 1L;
-
- public boolean[] setBoolean(boolean[] arg) {
- return arg;
- }
-
- public char[] setChar(char[] arg) {
- return arg;
- }
-
- public double[] setDouble(double[] arg) {
- return arg;
- }
-
- public float[] setFloat(float[] arg) {
- return arg;
- }
-
- public int[] setLong(int[] arg) {
- return arg;
- }
-
- public long[] setLongLong(long[] arg) {
- return arg;
- }
-
- public byte[] setOctet(byte[] arg) {
- return arg;
- }
-
- public RemoteObject[] setRemoteObject(RemoteObject[] obj) {
- return obj;
- }
-
- public short[] setShort(short[] arg) {
- return arg;
- }
-
- public String[] setString(String[] arg) {
- return arg;
- }
-
- public int[] setUnsignedLong(int[] arg) {
- return arg;
- }
-
- public long[] setUnsignedLongLong(long[] arg) {
- return arg;
- }
-
- public short[] setUnsignedShort(short[] arg) {
- return arg;
- }
-
- public char[] setWchar(char[] arg) {
- return arg;
- }
-
- public String[] setWstring(String[] arg) {
- return arg;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsServant.java
deleted file mode 100644
index d9bde48a5a..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion;
-import org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct;
-import org.apache.tuscany.sca.binding.corba.testing.arrays_unions._ArraysUnionsTestsImplBase;
-
-public class ArraysUnionsServant extends _ArraysUnionsTestsImplBase {
-
- private static final long serialVersionUID = 1L;
-
- public TestStruct passTestStruct(TestStruct arg) {
- return arg;
- }
-
- public String[][] passStringArray(String[][] arg) {
- return arg;
- }
-
- public RichUnion passRichUnion(RichUnion arg) {
- return arg;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsTuscanyServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsTuscanyServant.java
deleted file mode 100644
index cd78588363..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsTuscanyServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.meta.CorbaArray;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.ArraysTestStruct;
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.RichUnion;
-
-public class ArraysUnionsTuscanyServant {
-
- private static final long serialVersionUID = 1L;
-
- public ArraysTestStruct passTestStruct(ArraysTestStruct arg) {
- return arg;
- }
-
- @CorbaArray( {2, 2})
- public String[][] passStringArray(@CorbaArray( {2, 2})String[][] arg) {
- return arg;
- }
-
- public RichUnion passRichUnion(RichUnion arg) {
- return arg;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/CalcServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/CalcServant.java
deleted file mode 100644
index fd789e19cb..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/CalcServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.testing.exceptions._CalcImplBase;
-import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments;
-import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero;
-import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported;
-
-public class CalcServant extends _CalcImplBase {
-
- private static final long serialVersionUID = 1L;
-
- public double div(double arg1, double arg2) throws DivByZero {
- if (arg2 == 0) {
- DivByZero exception = new DivByZero();
- exception.arguments = new Arguments(arg1, arg2);
- exception.info = "Error occured during div: div by zero";
- throw exception;
- } else {
- return arg1 / arg2;
- }
- }
-
- public double divForSmallArgs(double arg1, double arg2) throws DivByZero, NotSupported {
- if (arg1 > 100 || arg2 > 100) {
- NotSupported exception = new NotSupported();
- exception.info = "arg1: " + arg1 + ", arg2: " + arg2;
- throw exception;
- } else {
- return div(arg1, arg2);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/DummyObjectServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/DummyObjectServant.java
deleted file mode 100644
index 2e205f1d0f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/DummyObjectServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.testing.references.DummyObject;
-import org.apache.tuscany.sca.binding.corba.testing.references._DummyObjectImplBase;
-
-public class DummyObjectServant extends _DummyObjectImplBase {
-
- private static final long serialVersionUID = 1L;
- private int retVal;
-
- public DummyObjectServant() {
- retVal = (int)System.currentTimeMillis();
- }
-
- public int getLong() {
- return retVal;
- }
-
- public DummyObject cloneObject() {
- return new DummyObjectServant();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/EnumManagerServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/EnumManagerServant.java
deleted file mode 100644
index 52386aeef7..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/EnumManagerServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.testing.enums.Color;
-import org.apache.tuscany.sca.binding.corba.testing.enums._EnumManagerImplBase;
-
-public class EnumManagerServant extends _EnumManagerImplBase {
-
- private static final long serialVersionUID = 1L;
-
- public Color getColor(Color color) {
- return color;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/InvalidTestObjectServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/InvalidTestObjectServant.java
deleted file mode 100644
index b7fbb69627..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/InvalidTestObjectServant.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.corba.testing.servants;
-
-public class InvalidTestObjectServant {
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/InvalidTypesServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/InvalidTypesServant.java
deleted file mode 100644
index dda8203f79..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/InvalidTypesServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidStruct1;
-
-public class InvalidTypesServant {
-
- public InvalidStruct1 firstMethodWithInvalidArg() {
- return null;
- }
-
- public void secondMethodWithInvalidArg(InvalidStruct1 arg) {
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/NonCorbaServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/NonCorbaServant.java
deleted file mode 100644
index 20700a0392..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/NonCorbaServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.testing.hierarchy.NonCorbaException;
-
-public class NonCorbaServant {
-
- public String setString(String arg) {
- return arg;
- }
-
- public void throwException() throws NonCorbaException {
- NonCorbaException e = new NonCorbaException();
- e.someField = "test";
- throw e;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ObjectManagerServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ObjectManagerServant.java
deleted file mode 100644
index 213c7fbd7c..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ObjectManagerServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.testing.references.DummyObject;
-import org.apache.tuscany.sca.binding.corba.testing.references._ObjectManagerImplBase;
-
-public class ObjectManagerServant extends _ObjectManagerImplBase {
-
- private static final long serialVersionUID = 1L;
-
- public DummyObject getObjectByArgument(DummyObject arg) {
- return arg;
- }
-
- public DummyObject getDummyObject() {
- return new DummyObjectServant();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/PrimitivesSetterServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/PrimitivesSetterServant.java
deleted file mode 100644
index 92e18741ae..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/PrimitivesSetterServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.testing.generated.RemoteObject;
-import org.apache.tuscany.sca.binding.corba.testing.generated._PrimitivesSetterImplBase;
-
-public class PrimitivesSetterServant extends _PrimitivesSetterImplBase {
-
- private static final long serialVersionUID = 1L;
-
- public boolean setBoolean(boolean arg) {
- return arg;
- }
-
- public char setChar(char arg) {
- return arg;
- }
-
- public double setDouble(double arg) {
- return arg;
- }
-
- public float setFloat(float arg) {
- return arg;
- }
-
- public int setLong(int arg) {
- return arg;
- }
-
- public long setLongLong(long arg) {
- return arg;
- }
-
- public byte setOctet(byte arg) {
- return arg;
- }
-
- public RemoteObject setRemoteObject(RemoteObject obj) {
- return obj;
- }
-
- public short setShort(short arg) {
- return arg;
- }
-
- public String setString(String arg) {
- return arg;
- }
-
- public int setUnsignedLong(int arg) {
- return arg;
- }
-
- public long setUnsignedLongLong(long arg) {
- return arg;
- }
-
- public short setUnsignedShort(short arg) {
- return arg;
- }
-
- public char setWchar(char arg) {
- return arg;
- }
-
- public String setWstring(String arg) {
- return arg;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/TestObjectServant.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/TestObjectServant.java
deleted file mode 100644
index 153268983f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/TestObjectServant.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.corba.testing.servants;
-
-import org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct;
-import org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStructHolder;
-import org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct;
-import org.apache.tuscany.sca.binding.corba.testing.generated._TestObjectImplBase;
-import org.apache.tuscany.sca.binding.corba.testing.generated.long_seq1Holder;
-import org.apache.tuscany.sca.binding.corba.testing.generated.long_seq2Holder;
-import org.apache.tuscany.sca.binding.corba.testing.generated.long_seq3Holder;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TestObjectServant extends _TestObjectImplBase {
-
- private static final long serialVersionUID = 1L;
-
- public int[] setLongSeq1(long_seq1Holder arg) {
- return arg.value;
- }
-
- public int[][] setLongSeq2(long_seq2Holder arg) {
-
- return arg.value;
- }
-
- public int[][][] setLongSeq3(long_seq3Holder arg) {
- return arg.value;
- }
-
- public SimpleStruct setSimpleStruct(SimpleStructHolder arg) {
- return arg.value;
- }
-
- public SomeStruct setStruct(SomeStruct arg) {
- return arg;
- }
-
- public SomeStruct pickStructFromArgs(SomeStruct arg1, SomeStruct arg2, SomeStruct arg3, int structNumber) {
- switch (structNumber) {
- case 1:
- return arg1;
- case 2:
- return arg2;
- case 3:
- return arg3;
- default:
- return arg1;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestDataType.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestDataType.java
deleted file mode 100644
index 7ebc3fce85..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestDataType.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.binding.corba.testing.service.mocks;
-
-import java.lang.reflect.Type;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-
-/**
- * Mock DataType implementation. Only few methods needs to be implemented.
- */
-public class TestDataType<L> implements DataType<L> {
-
- public Class<?> typeClass;
- public L logical;
-
- public TestDataType(Class<?> typeClass) {
- this.typeClass = typeClass;
- }
-
- public TestDataType(Class<?> typeClass, L logical) {
- this.typeClass = typeClass;
- this.logical = logical;
- }
-
- public String getDataBinding() {
- return null;
- }
-
- public Type getGenericType() {
- return null;
- }
-
- public L getLogical() {
- return logical;
- }
-
- public <T> T getMetaData(Class<T> arg0) {
- return null;
- }
-
- public Class<?> getPhysical() {
- return typeClass;
- }
-
- public void setDataBinding(String arg0) {
-
- }
-
- public void setGenericType(Type arg0) {
-
- }
-
- public void setLogical(L arg0) {
-
- }
-
- public <T> void setMetaData(Class<T> arg0, T arg1) {
-
- }
-
- public void setPhysical(Class<?> arg0) {
-
- }
-
- @Override
- public Object clone() {
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java
deleted file mode 100644
index 2c5a0d8159..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.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.binding.corba.testing.service.mocks;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Mock TestInterface implementation. Only few methods needs to be implemented.
- */
-public class TestInterface implements JavaInterface {
-
- private List<Operation> operations;
- private Class<?> javaClass;
-
- public TestInterface(List<Operation> opearations, Class<?> javaClass) {
- this.operations = opearations;
- this.javaClass = javaClass;
- }
-
- public List<Operation> getOperations() {
- return operations;
- }
-
- public boolean isConversational() {
- return false;
- }
-
- public boolean isDynamic() {
- return false;
- }
-
- public boolean isRemotable() {
- return false;
- }
-
- public void resetDataBinding(String dataBinding) {
-
- }
-
- public void setConversational(boolean conversational) {
-
- }
-
- public void setDefaultDataBinding(String dataBinding) {
-
- }
-
- public void setRemotable(boolean remotable) {
-
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return null;
- }
-
- public List<PolicySet> getPolicySets() {
- return null;
- }
-
- public List<Intent> getRequiredIntents() {
- return null;
- }
-
- public IntentAttachPointType getType() {
- return null;
- }
-
- public void setType(IntentAttachPointType type) {
-
- }
-
- @Override
- public Object clone() {
- return null;
- }
-
- public Class<?> getCallbackClass() {
- return null;
- }
-
- public Class<?> getJavaClass() {
- return javaClass;
- }
-
- public String getName() {
- return null;
- }
-
- public QName getQName() {
- return null;
- }
-
- public void setCallbackClass(Class<?> arg0) {
- }
-
- public void setJavaClass(Class<?> javaClass) {
- this.javaClass = javaClass;
- }
-
- public void setName(String arg0) {
- }
-
- public void setQName(QName arg0) {
-
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean arg0) {
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterfaceContract.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterfaceContract.java
deleted file mode 100644
index d691705955..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterfaceContract.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.corba.testing.service.mocks;
-
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-
-/**
- * Mock InterfaceContract implementation. Only few methods needs to be
- * implemented.
- */
-public class TestInterfaceContract implements InterfaceContract {
-
- private Interface iface;
-
- public Interface getCallbackInterface() {
- return null;
- }
-
- public Interface getInterface() {
- return iface;
- }
-
- public InterfaceContract makeUnidirectional(boolean isCallback) {
- return null;
- }
-
- public void setCallbackInterface(Interface callbackInterface) {
-
- }
-
- public void setInterface(Interface callInterface) {
- this.iface = callInterface;
- }
-
- @Override
- public Object clone() {
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
deleted file mode 100644
index 90551ec25d..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.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.binding.corba.testing.service.mocks;
-
-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;
-
-/**
- * Mock Operation implementation. Only few methods needs to be implemented.
- */
-public class TestOperation implements Operation {
-
- private DataType<List<DataType>> inputType;
- private DataType outputType;
- private String name;
-
- public ConversationSequence getConversationSequence() {
- return null;
- }
-
- public String getDataBinding() {
- return null;
- }
-
- public Map<QName, List<DataType<XMLType>>> getFaultBeans() {
- return null;
- }
-
- public List<DataType> getFaultTypes() {
- return null;
- }
-
- public DataType<List<DataType>> getInputType() {
- return inputType;
- }
-
- public Interface getInterface() {
- return null;
- }
-
- public String getName() {
- return name;
- }
-
- public DataType getOutputType() {
- return outputType;
- }
-
- public WrapperInfo getWrapper() {
- return null;
- }
-
- public boolean isDynamic() {
- return false;
- }
-
- public boolean isNonBlocking() {
- return false;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public boolean isWrapperStyle() {
- return false;
- }
-
- public void setConversationSequence(ConversationSequence sequence) {
-
- }
-
- public void setDataBinding(String dataBinding) {
-
- }
-
- public void setDynamic(boolean b) {
-
- }
-
- public void setFaultBeans(Map<QName, List<DataType<XMLType>>> faultBeans) {
-
- }
-
- public void setFaultTypes(List<DataType> faultTypes) {
-
- }
-
- public void setInputType(DataType<List<DataType>> inputType) {
- this.inputType = inputType;
- }
-
- public void setInterface(Interface interfaze) {
-
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setNonBlocking(boolean nonBlocking) {
-
- }
-
- public void setOutputType(DataType outputType) {
- this.outputType = outputType;
- }
-
- public void setUnresolved(boolean unresolved) {
-
- }
-
- public void setWrapper(WrapperInfo wrapperInfo) {
-
- }
-
- public void setWrapperStyle(boolean wrapperStyle) {
-
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return null;
- }
-
- public List<PolicySet> getPolicySets() {
- return null;
- }
-
- @Override
- public Object clone() {
- return null;
- }
-
- public List<Intent> getRequiredIntents() {
- return null;
- }
-
- public IntentAttachPointType getType() {
- return null;
- }
-
- public void setType(IntentAttachPointType type) {
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
deleted file mode 100644
index 6fc5f9398e..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.service.mocks;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-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.ComponentReference;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-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.provider.PolicyProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Mock RuntimeComponentService implementation. Only few methods needs to be
- * implemented.
- */
-public class TestRuntimeComponentService implements RuntimeComponentService {
-
- private InterfaceContract interfaceContract;
- private RuntimeWire runtimeWire;
-
- public TestRuntimeComponentService(Object invocationTarget) {
- runtimeWire = new TestRuntimeWire(invocationTarget);
- List<Operation> operations = new ArrayList<Operation>();
- Method[] methods = invocationTarget.getClass().getMethods();
- for (int i = 0; i < methods.length; i++) {
- int mod = methods[i].getModifiers();
- if (methods[i].getDeclaringClass().equals(invocationTarget.getClass()) && Modifier.isPublic(mod)
- && !methods[i].getName().startsWith("_")) {
- Operation operation = new TestOperation();
- DataType returnType = new TestDataType(methods[i].getReturnType());
- operation.setOutputType(returnType);
- Class<?>[] argTypes = methods[i].getParameterTypes();
- List<DataType> argDataTypes = new ArrayList<DataType>();
- for (int j = 0; j < argTypes.length; j++) {
- argDataTypes.add(new TestDataType(argTypes[j]));
- }
- TestDataType<List<DataType>> inputDataType = new TestDataType<List<DataType>>(null, argDataTypes);
- operation.setInputType(inputDataType);
- operations.add(operation);
- operation.setName(methods[i].getName());
- }
- }
- TestInterface iface = new TestInterface(operations, invocationTarget.getClass());
- interfaceContract = new TestInterfaceContract();
- interfaceContract.setInterface(iface);
- }
-
- public void addPolicyProvider(Binding binding, PolicyProvider policyProvider) {
-
- }
-
- public ServiceBindingProvider getBindingProvider(Binding binding) {
- return null;
- }
-
- public List<RuntimeWire> getCallbackWires() {
- return null;
- }
-
- public InvocationChain getInvocationChain(Binding binding, Operation operation) {
- return null;
- }
-
- public InvocationChain getInvocationChain(Binding binding, InterfaceContract interfaceContract, Operation operation) {
- return null;
- }
-
- public Invoker getInvoker(Binding binding, Operation operation) {
- return null;
- }
-
- public Invoker getInvoker(Binding binding, InterfaceContract interfaceContract, Operation operation) {
- return null;
- }
-
- public List<PolicyProvider> getPolicyProviders(Binding binding) {
- return null;
- }
-
- public RuntimeWire getRuntimeWire(Binding binding) {
- return runtimeWire;
- }
-
- public RuntimeWire getRuntimeWire(Binding binding, InterfaceContract interfaceContract) {
- return null;
- }
-
- public List<RuntimeWire> getRuntimeWires() {
- return null;
- }
-
- public void setBindingProvider(Binding binding, ServiceBindingProvider bindingProvider) {
-
- }
-
- public ComponentReference getCallbackReference() {
- return null;
- }
-
- public Service getService() {
- return null;
- }
-
- public void setCallbackReference(ComponentReference callbackReference) {
-
- }
-
- public void setService(Service service) {
-
- }
-
- public InterfaceContract getInterfaceContract() {
- return interfaceContract;
- }
-
- public InterfaceContract getInterfaceContract(Binding binding) {
- return getInterfaceContract();
- }
-
- public String getName() {
- return null;
- }
-
- public boolean isCallback() {
- return false;
- }
-
- public void setInterfaceContract(InterfaceContract interfaceContract) {
- this.interfaceContract = interfaceContract;
- }
-
- public void setIsCallback(boolean isCallback) {
-
- }
-
- public void setName(String name) {
-
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
-
- }
-
- public List<Object> getExtensions() {
- return null;
- }
-
- public List<Intent> getRequiredIntents() {
- return null;
- }
-
- public IntentAttachPointType getType() {
- return null;
- }
-
- public void setType(IntentAttachPointType type) {
-
- }
-
- public List<ConfiguredOperation> getConfiguredOperations() {
- return null;
- }
-
- public <B> B getBinding(Class<B> bindingClass) {
- return null;
- }
-
- public List<Binding> getBindings() {
- return null;
- }
-
- public Callback getCallback() {
- return null;
- }
-
- public <B> B getCallbackBinding(Class<B> bindingClass) {
- return null;
- }
-
- public void setCallback(Callback callback) {
-
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return null;
- }
-
- public List<PolicySet> getPolicySets() {
- return null;
- }
-
- @Override
- public Object clone() {
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java b/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
deleted file mode 100644
index 696705aa74..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.corba.testing.service.mocks;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-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;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Mock RuntimeWire implementation. Only few methods needs to be implemented.
- */
-public class TestRuntimeWire implements RuntimeWire {
-
- private Object invocationTarget;
-
- public TestRuntimeWire(Object invocationTarget) {
- this.invocationTarget = invocationTarget;
- }
-
- public InvocationChain getInvocationChain(Operation arg0) {
- return null;
- }
-
- public List<InvocationChain> getInvocationChains() {
- return null;
- }
-
- public EndpointReference getSource() {
- return null;
- }
-
- public EndpointReference getTarget() {
- return null;
- }
-
- public Object invoke(Operation operation, Object[] args) throws InvocationTargetException {
- Class<?>[] types = new Class<?>[args.length];
- for (int i = 0; i < args.length; i++) {
- types[i] = args[i].getClass();
- }
- Object result = null;
- try {
- Method[] methods = invocationTarget.getClass().getMethods();
- for (int i = 0; i < methods.length; i++) {
- if (methods[i].getName().equals(operation.getName())) {
- result = methods[i].invoke(invocationTarget, args);
- break;
- }
- }
- } catch (InvocationTargetException e) {
- throw e;
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
-
- return result;
- }
-
- public Object invoke(Operation operation, Message arg1) throws InvocationTargetException {
-
- return null;
- }
-
- public void rebuild() {
-
- }
-
- public void setTarget(EndpointReference arg0) {
-
- }
-
- @Override
- public Object clone() {
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/resources/arrays_unions.idl b/branches/sca-android/modules/binding-corba-runtime/src/test/resources/arrays_unions.idl
deleted file mode 100644
index 0f4ed03b4e..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/resources/arrays_unions.idl
+++ /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.
- */
-
-/*
- * compile by
- * idlj -fall -oldImplBase arrays_unions.idl
- */
-
-module org {
- module apache {
- module tuscany {
- module sca {
- module binding {
- module corba {
- module testing {
- module arrays_unions {
-
- struct TestStruct {
- string oneDimArray[2];
- long twoDimArray[2][4];
- float threeDimArray[2][4][2];
- };
-
- typedef string StringArray[2][2];
-
- union InnerUnion switch (long) {
- case 1: long x;
- case 2: float y;
- };
-
- union RichUnion switch (long) {
- case 1: long x;
- case 2: float y;
- case 3: string z;
- case 4: InnerUnion iu;
- default: boolean a;
- };
-
- interface ArraysUnionsTests {
- TestStruct passTestStruct(in TestStruct arg);
- StringArray passStringArray(in StringArray arg);
- RichUnion passRichUnion(in RichUnion arg);
- };
-
- };
- };
- };
- };
- };
- };
- };
-};
-
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/resources/enums.idl b/branches/sca-android/modules/binding-corba-runtime/src/test/resources/enums.idl
deleted file mode 100644
index 2e4e829b0f..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/resources/enums.idl
+++ /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.
- */
-
-/*
- * compile by
- * idlj -fall -oldImplBase enums.idl
- */
-
-module org {
- module apache {
- module tuscany {
- module sca {
- module binding {
- module corba {
- module testing {
- module enums {
- enum Color {red, yellow, green};
- interface EnumManager {
- Color getColor(in Color color);
- };
- };
- };
- };
- };
- };
- };
- };
-};
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/resources/exceptions.idl b/branches/sca-android/modules/binding-corba-runtime/src/test/resources/exceptions.idl
deleted file mode 100644
index b34ec46458..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/resources/exceptions.idl
+++ /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.
- */
-
-/*
- * compile by
- * idlj -fall -oldImplBase exceptions.idl
- */
-
-module org {
- module apache {
- module tuscany {
- module sca {
- module binding {
- module corba {
- module testing {
- module exceptions {
- interface Calc {
- struct Arguments {
- double arg1;
- double arg2;
- };
-
- exception DivByZero{
- Arguments arguments;
- string info;
- };
-
- exception NotSupported {
- string info;
- };
-
- double div(in double arg1, in double arg2) raises(DivByZero);
- double divForSmallArgs(in double arg1, in double arg2) raises(DivByZero, NotSupported);
- };
- };
- };
- };
- };
- };
- };
- };
-};
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/resources/general_tests.idl b/branches/sca-android/modules/binding-corba-runtime/src/test/resources/general_tests.idl
deleted file mode 100644
index db253338c3..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/resources/general_tests.idl
+++ /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.
- */
-
-/*
- * compile by
- * idlj -fall -oldImplBase general_tests.idl
- */
-
-module org {
- module apache {
- module tuscany {
- module sca {
- module binding {
- module corba {
- module testing {
- module generated {
-
- interface RemoteObject {
-
- };
-
- typedef sequence<RemoteObject> remote_object_list;
- typedef sequence<boolean> boolean_list;
- typedef sequence<char> char_list;
- typedef sequence<wchar> wchar_list;
- typedef sequence<octet> octet_list;
- typedef sequence<short> short_list;
- typedef sequence<unsigned short> unsigned_short_list;
- typedef sequence<long> long_list;
- typedef sequence<unsigned long> unsigned_long_list;
- typedef sequence<long long> long_long_list;
- typedef sequence<unsigned long long> unsigned_long_long_list;
- typedef sequence<float> float_list;
- typedef sequence<double> double_list;
- typedef sequence<string> string_list;
- typedef sequence<wstring> wstring_list;
-
- interface PrimitivesSetter {
- boolean setBoolean(in boolean arg);
- char setChar(in char arg);
- wchar setWchar(in wchar arg);
- octet setOctet(in octet arg);
- short setShort(in short arg);
- unsigned short setUnsignedShort(in unsigned short arg);
- long setLong(in long arg);
- unsigned long setUnsignedLong(in unsigned long arg);
- long long setLongLong(in long long arg);
- unsigned long long setUnsignedLongLong(in unsigned long long arg);
- float setFloat(in float arg);
- double setDouble(in double arg);
- string setString(in string arg);
- wstring setWstring(in wstring arg);
- RemoteObject setRemoteObject(in RemoteObject obj);
- };
-
- interface ArraysSetter {
- boolean_list setBoolean(in boolean_list arg);
- char_list setChar(in char_list arg);
- wchar_list setWchar(in wchar_list arg);
- octet_list setOctet(in octet_list arg);
- short_list setShort(in short_list arg);
- unsigned_short_list setUnsignedShort(in unsigned_short_list arg);
- long_list setLong(in long_list arg);
- unsigned_long_list setUnsignedLong(in unsigned_long_list arg);
- long_long_list setLongLong(in long_long_list arg);
- unsigned_long_long_list setUnsignedLongLong(in unsigned_long_long_list arg);
- float_list setFloat(in float_list arg);
- double_list setDouble(in double_list arg);
- string_list setString(in string_list arg);
- wstring_list setWstring(in wstring_list arg);
- remote_object_list setRemoteObject(in remote_object_list obj);
- };
-
- typedef sequence<long> long_seq1;
- typedef sequence<long_seq1> long_seq2;
- typedef sequence<long_seq2> long_seq3;
-
- struct SimpleStruct {
- string field1;
- long field2;
- };
-
-
- struct SomeStruct {
- SimpleStruct innerStruct;
- string str;
- string_list str_list;
- long_seq2 twoDimSeq;
- long_seq3 threeDimSeq;
- };
-
- interface TestObject {
- SomeStruct pickStructFromArgs(in SomeStruct arg1, in SomeStruct arg2, in SomeStruct arg3, in long structNumber);
- SomeStruct setStruct(in SomeStruct arg);
- SimpleStruct setSimpleStruct(inout SimpleStruct arg);
- long_seq1 setLongSeq1(inout long_seq1 arg);
- long_seq2 setLongSeq2(inout long_seq2 arg);
- long_seq3 setLongSeq3(inout long_seq3 arg);
- };
-
- };
- };
- };
- };
- };
- };
- };
-};
diff --git a/branches/sca-android/modules/binding-corba-runtime/src/test/resources/references.idl b/branches/sca-android/modules/binding-corba-runtime/src/test/resources/references.idl
deleted file mode 100644
index 72b58806e6..0000000000
--- a/branches/sca-android/modules/binding-corba-runtime/src/test/resources/references.idl
+++ /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.
- */
-
-/*
- * compile by
- * idlj -fall -oldImplBase remote_objects.idl
- */
-
-module org {
- module apache {
- module tuscany {
- module sca {
- module binding {
- module corba {
- module testing {
- module references {
-
- interface DummyObject {
- long getLong();
- DummyObject cloneObject();
- };
-
- interface ObjectManager {
- DummyObject getDummyObject();
- DummyObject getObjectByArgument(in DummyObject dummy);
- };
- };
- };
- };
- };
- };
- };
- };
-};
diff --git a/branches/sca-android/modules/binding-corba/LICENSE b/branches/sca-android/modules/binding-corba/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/binding-corba/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-corba/META-INF/README b/branches/sca-android/modules/binding-corba/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-corba/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-corba/NOTICE b/branches/sca-android/modules/binding-corba/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/binding-corba/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/branches/sca-android/modules/binding-corba/pom.xml b/branches/sca-android/modules/binding-corba/pom.xml
deleted file mode 100644
index 2eda625e4a..0000000000
--- a/branches/sca-android/modules/binding-corba/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-corba</artifactId>
- <name>Apache Tuscany SCA CORBA Binding Extension</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.corba</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.corba*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/CorbaBinding.java b/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/CorbaBinding.java
deleted file mode 100644
index 0b79065cc3..0000000000
--- a/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/CorbaBinding.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.corba;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface CorbaBinding extends Binding {
- QName BINDING_CORBA_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "binding.corba");
-
- String getHost();
-
- void setHost(String host);
-
- int getPort();
-
- void setPort(int port);
-
- String getId();
-
- void setId(String id);
-
- String getCorbaname();
-}
diff --git a/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/CorbaBindingFactory.java b/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/CorbaBindingFactory.java
deleted file mode 100644
index 67e3bdcf74..0000000000
--- a/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/CorbaBindingFactory.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.corba;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface CorbaBindingFactory {
- /**
- * Create a CorbaBinding model
- * @return The CorbaBinding model
- */
- CorbaBinding createCorbaBinding();
-}
diff --git a/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingFactoryImpl.java b/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingFactoryImpl.java
deleted file mode 100644
index cecb4fb567..0000000000
--- a/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingFactoryImpl.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.corba.impl;
-
-import org.apache.tuscany.sca.binding.corba.CorbaBinding;
-import org.apache.tuscany.sca.binding.corba.CorbaBindingFactory;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CorbaBindingFactoryImpl implements CorbaBindingFactory {
-
- /**
- * @see org.apache.tuscany.sca.binding.corba.CorbaBindingFactory#createCorbaBinding()
- */
- public CorbaBinding createCorbaBinding() {
- return new CorbaBindingImpl();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingImpl.java b/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingImpl.java
deleted file mode 100644
index 54e98d4117..0000000000
--- a/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingImpl.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.binding.corba.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.corba.CorbaBinding;
-import org.apache.tuscany.sca.host.corba.CorbaHostUtils;
-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;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CorbaBindingImpl implements CorbaBinding, PolicySetAttachPoint {
- private String name;
- private String uri;
- private String host;
- private int port;
- private String id;
-
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private IntentAttachPointType intentAttachPointType;
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- public String getHost() {
- return host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-
- public int getPort() {
- return port;
- }
-
- public void setPort(int port) {
- this.port = port;
- }
-
- 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 false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-
- 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 void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getCorbaname() {
- return CorbaHostUtils.isValidCorbanameURI(getURI()) ? getURI(): CorbaHostUtils.createCorbanameURI(getHost(), getPort(), getName());
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProcessor.java b/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProcessor.java
deleted file mode 100644
index 0bb38d3682..0000000000
--- a/branches/sca-android/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProcessor.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.binding.corba.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.assembly.xml.Constants;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-import org.apache.tuscany.sca.binding.corba.CorbaBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CorbaBindingProcessor implements StAXArtifactProcessor<CorbaBinding> {
- private PolicyFactory policyFactory;
- private PolicyAttachPointProcessor policyProcessor;
-
- public CorbaBindingProcessor(ModelFactoryExtensionPoint modelFactories) {
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- }
-
- /**
- * @see org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor#getArtifactType()
- */
- public QName getArtifactType() {
- return CorbaBinding.BINDING_CORBA_QNAME;
- }
-
- /**
- * @see org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor#read(javax.xml.stream.XMLStreamReader)
- */
- public CorbaBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- CorbaBinding binding = new CorbaBindingImpl();
-
- // Read the policies
- policyProcessor.readPolicies(binding, reader);
-
- binding.setHost(reader.getAttributeValue(null, "host"));
- String port = reader.getAttributeValue(null, "port");
- if (port != null) {
- binding.setPort(Integer.parseInt(port));
- }
-
- // Read the name
- String name = reader.getAttributeValue(null, "name");
- if (name != null) {
- binding.setName(name);
- }
-
- // Read binding URI
- String uri = reader.getAttributeValue(null, "uri");
- if (uri != null) {
- binding.setURI(uri);
- }
-
- // Read CORBA id
- String id = reader.getAttributeValue(null, "id");
- if (id != null) {
- binding.setId(id);
- }
- return binding;
- }
-
- /**
- * @see org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor#write(java.lang.Object, javax.xml.stream.XMLStreamWriter)
- */
- public void write(CorbaBinding model, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- // Write a <binding.corba>
- writer.writeStartElement(Constants.SCA10_TUSCANY_NS, "binding.corba");
-
- if (model.getName() != null) {
- writer.writeAttribute("name", model.getName());
- }
-
- if (model.getURI() != null) {
- writer.writeAttribute("uri", model.getURI());
- }
-
- if (model.getHost() != null) {
- writer.writeAttribute("host", model.getHost());
- }
-
- if (model.getPort() != -1) {
- writer.writeAttribute("port", String.valueOf(model.getPort()));
- }
-
- if (model.getId() != null) {
- writer.writeAttribute("id", model.getId());
- }
- writer.writeEndElement();
- }
-
- /**
- * @see org.apache.tuscany.sca.contribution.processor.ArtifactProcessor#getModelType()
- */
- public Class<CorbaBinding> getModelType() {
- return CorbaBinding.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.contribution.processor.ArtifactProcessor#resolve(java.lang.Object, org.apache.tuscany.sca.contribution.resolver.ModelResolver)
- */
- public void resolve(CorbaBinding model, ModelResolver resolver) throws ContributionResolveException {
- }
-
-}
diff --git a/branches/sca-android/modules/binding-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.corba.CorbaBindingFactory b/branches/sca-android/modules/binding-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.corba.CorbaBindingFactory
deleted file mode 100644
index 57959840d4..0000000000
--- a/branches/sca-android/modules/binding-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.corba.CorbaBindingFactory
+++ /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.corba.impl.CorbaBindingFactoryImpl \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/binding-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 71d14bc077..0000000000
--- a/branches/sca-android/modules/binding-corba/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.corba.impl.CorbaBindingProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#binding.corba,model=org.apache.tuscany.sca.binding.corba.CorbaBinding,factory=org.apache.tuscany.sca.binding.corba.CorbaBindingFactory
diff --git a/branches/sca-android/modules/binding-ejb-runtime/LICENSE b/branches/sca-android/modules/binding-ejb-runtime/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-ejb-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/branches/sca-android/modules/binding-ejb-runtime/META-INF/README b/branches/sca-android/modules/binding-ejb-runtime/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-ejb-runtime/NOTICE b/branches/sca-android/modules/binding-ejb-runtime/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-ejb-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/branches/sca-android/modules/binding-ejb-runtime/pom.xml b/branches/sca-android/modules/binding-ejb-runtime/pom.xml
deleted file mode 100644
index 38a6d9b19d..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/pom.xml
+++ /dev/null
@@ -1,189 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-ejb-runtime</artifactId>
- <name>Apache Tuscany SCA EJB Binding Runtime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ejb</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- <version>2.1_3</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-ejb_3.0_spec</artifactId>
- <version>1.0</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-openejb</artifactId>
- <version>2.0.2</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-connector</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-persistence-jpa10</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-ejbd</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-server</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-loader</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-jee</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-ejbd</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-javaagent</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- </exclusion>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm-commons</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm-all</artifactId>
- <version>3.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <repositories>
- <repository>
- <id>geronimo-repository</id>
- <name>Geronimo Repository</name>
- <url>http://svn.apache.org/repos/asf/geronimo/server/tags/2.0.2/repository</url>
- <layout>default</layout>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- </repository>
- </repositories>
-
- <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.ejb.runtime</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.ejb*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-
-</project>
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/ClassLoadingUtil.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/ClassLoadingUtil.java
deleted file mode 100644
index c65868c23b..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/ClassLoadingUtil.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ejb.corba;
-
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Utility class for loading classes by a variety of name variations.
- * <p/>
- * Supported names types are:
- * <p/>
- * 1) Fully qualified class name (e.g., "java.lang.String", "org.apache.geronimo.kernel.ClassLoading"
- * 2) Method signature encoding ("Ljava.lang.String;", "J", "I", etc.)
- * 3) Primitive type names ("int", "boolean", etc.)
- * 4) Method array signature strings ("[I", "[Ljava.lang.String")
- * 5) Arrays using Java code format ("int[]", "java.lang.String[][]")
- * <p/>
- * The classes are loaded using the provided class loader. For the basic types, the primitive
- * reflection types are returned.
- *
- * @version $Rev$ $Date$
- */
-public class ClassLoadingUtil {
-
- /**
- * Table for mapping primitive class names/signatures to the implementing
- * class object
- */
- private static final HashMap PRIMITIVE_CLASS_MAP = new HashMap();
-
- /**
- * Table for mapping primitive classes back to their name signature type, which
- * allows a reverse mapping to be performed from a class object into a resolvable
- * signature.
- */
- private static final HashMap CLASS_TO_SIGNATURE_MAP = new HashMap();
-
-
- /**
- * Setup the primitives map. We make any entry for each primitive class using both the
- * human readable name and the method signature shorthand type.
- */
- static {
- PRIMITIVE_CLASS_MAP.put("boolean", boolean.class);
- PRIMITIVE_CLASS_MAP.put("Z", boolean.class);
- PRIMITIVE_CLASS_MAP.put("byte", byte.class);
- PRIMITIVE_CLASS_MAP.put("B", byte.class);
- PRIMITIVE_CLASS_MAP.put("char", char.class);
- PRIMITIVE_CLASS_MAP.put("C", char.class);
- PRIMITIVE_CLASS_MAP.put("short", short.class);
- PRIMITIVE_CLASS_MAP.put("S", short.class);
- PRIMITIVE_CLASS_MAP.put("int", int.class);
- PRIMITIVE_CLASS_MAP.put("I", int.class);
- PRIMITIVE_CLASS_MAP.put("long", long.class);
- PRIMITIVE_CLASS_MAP.put("J", long.class);
- PRIMITIVE_CLASS_MAP.put("float", float.class);
- PRIMITIVE_CLASS_MAP.put("F", float.class);
- PRIMITIVE_CLASS_MAP.put("double", double.class);
- PRIMITIVE_CLASS_MAP.put("D", double.class);
- PRIMITIVE_CLASS_MAP.put("void", void.class);
- PRIMITIVE_CLASS_MAP.put("V", void.class);
-
- // Now build a reverse mapping table. The table above has a many-to-one mapping for
- // class names. To do the reverse, we need to pick just one. As long as the
- // returned name supports "round tripping" of the requests, this will work fine.
-
- CLASS_TO_SIGNATURE_MAP.put(boolean.class, "Z");
- CLASS_TO_SIGNATURE_MAP.put(byte.class, "B");
- CLASS_TO_SIGNATURE_MAP.put(char.class, "C");
- CLASS_TO_SIGNATURE_MAP.put(short.class, "S");
- CLASS_TO_SIGNATURE_MAP.put(int.class, "I");
- CLASS_TO_SIGNATURE_MAP.put(long.class, "J");
- CLASS_TO_SIGNATURE_MAP.put(float.class, "F");
- CLASS_TO_SIGNATURE_MAP.put(double.class, "D");
- CLASS_TO_SIGNATURE_MAP.put(void.class, "V");
- }
-
-
- /**
- * Load a class that matches the requested name, using the provided class loader context.
- * <p/>
- * The class name may be a standard class name, the name of a primitive type Java
- * reflection class (e.g., "boolean" or "int"), or a type in method type signature
- * encoding. Array classes in either encoding form are also processed.
- *
- * @param className The name of the required class.
- * @param classLoader The class loader used to resolve the class object.
- * @return The Class object resolved from "className".
- * @throws ClassNotFoundException When unable to resolve the class object.
- * @throws IllegalArgumentException If either argument is null.
- */
- public static Class loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
-
- // the tests require IllegalArgumentExceptions for null values on either of these.
- if (className == null) {
- throw new IllegalArgumentException("className is null");
- }
-
- if (classLoader == null) {
- throw new IllegalArgumentException("classLoader is null");
- }
- // The easiest case is a proper class name. We just have the class loader resolve this.
- // If the class loader throws a ClassNotFoundException, then we need to check each of the
- // special name encodings we support.
- try {
- return classLoader.loadClass(className);
- } catch (ClassNotFoundException ignore) {
- // if not found, continue on to the other name forms.
- }
-
-
- // The second easiest version to resolve is a direct map to a primitive type name
- // or method signature. Check our name-to-class map for one of those.
- Class resolvedClass = (Class) PRIMITIVE_CLASS_MAP.get(className);
- if (resolvedClass != null) {
- return resolvedClass;
- }
-
- // Class names in method signature have the format "Lfully.resolved.name;",
- // so if it ends in a semicolon and begins with an "L", this must be in
- // this format. Have the class loader try to load this. There are no other
- // options if this fails, so just allow the class loader to throw the
- // ClassNotFoundException.
- if (className.endsWith(";") && className.startsWith("L")) {
- // pick out the name portion
- String typeName = className.substring(1, className.length() - 1);
- // and delegate the loading to the class loader.
- return classLoader.loadClass(typeName);
- }
-
- // All we have left now are the array types. Method signature array types
- // have a series of leading "[" characters to specify the number of dimensions.
- // The other array type we handle uses trailing "[]" for the dimensions, just
- // like the Java language syntax.
-
- // first check for the signature form ([[[[type).
- if (className.charAt(0) == '[') {
- // we have at least one array marker, now count how many leading '['s we have
- // to get the dimension count.
- int count = 0;
- int nameLen = className.length();
-
- while (count < nameLen && className.charAt(count) == '[') {
- count++;
- }
-
- // pull of the name subtype, which is everything after the last '['
- String arrayTypeName = className.substring(count, className.length());
- // resolve the type using a recursive call, which will load any of the primitive signature
- // types as well as class names.
- Class arrayType = loadClass(arrayTypeName, classLoader);
-
- // Resolving array types require a little more work. The array classes are
- // created dynamically when the first instance of a given dimension and type is
- // created. We need to create one using reflection to do this.
- return getArrayClass(arrayType, count);
- }
-
-
- // ok, last chance. Now check for an array specification in Java language
- // syntax. This will be a type name followed by pairs of "[]" to indicate
- // the number of dimensions.
- if (className.endsWith("[]")) {
- // get the base component class name and the arrayDimensions
- int count = 0;
- int position = className.length();
-
- while (position > 1 && className.substring(position - 2, position).equals("[]")) {
- // count this dimension
- count++;
- // and step back the probe position.
- position -= 2;
- }
-
- // position now points at the location of the last successful test. This makes it
- // easy to pick off the class name.
-
- String typeName = className.substring(0, position);
-
- // load the base type, again, doing this recursively
- Class arrayType = loadClass(typeName, classLoader);
- // and turn this into the class object
- return getArrayClass(arrayType, count);
- }
-
- throw new ClassNotFoundException("Could not load class " + className + " from unknown classloader; " + classLoader);
- }
-
-
- /**
- * Map a class object back to a class name. The returned class object
- * must be "round trippable", which means
- * <p/>
- * type == ClassLoading.loadClass(ClassLoading.getClassName(type), classLoader)
- * <p/>
- * must be true. To ensure this, the class name is always returned in
- * method signature format.
- *
- * @param type The class object we convert into name form.
- * @return A string representation of the class name, in method signature
- * format.
- */
- public static String getClassName(Class type) {
- StringBuffer name = new StringBuffer();
-
- // we test these in reverse order from the resolution steps,
- // first handling arrays, then primitive types, and finally
- // "normal" class objects.
-
- // First handle arrays. If a class is an array, the type is
- // element stored at that level. So, for a 2-dimensional array
- // of ints, the top-level type will be "[I". We need to loop
- // down the hierarchy until we hit a non-array type.
- while (type.isArray()) {
- // add another array indicator at the front of the name,
- // and continue with the next type.
- name.append('[');
- type = type.getComponentType();
- }
-
- // we're down to the base type. If this is a primitive, then
- // we poke in the single-character type specifier.
- if (type.isPrimitive()) {
- name.append((String) CLASS_TO_SIGNATURE_MAP.get(type));
- }
- // a "normal" class. This gets expressing using the "Lmy.class.name;" syntax.
- else {
- name.append('L');
- name.append(type.getName());
- name.append(';');
- }
- return name.toString();
- }
-
- private static Class getArrayClass(Class type, int dimension) {
- // Array.newInstance() requires an array of the requested number of dimensions
- // that gives the size for each dimension. We just request 0 in each of the
- // dimensions, which is not unlike a black hole singularity.
- int[] dimensions = new int[dimension];
- // create an instance and return the associated class object.
- return Array.newInstance(type, dimensions).getClass();
- }
-
- public static Set getAllTypes(Class type) {
- Set allTypes = new LinkedHashSet();
- allTypes.add(type);
- allTypes.addAll(getAllSuperClasses(type));
- allTypes.addAll(getAllInterfaces(type));
- return allTypes;
- }
-
- private static Set getAllSuperClasses(Class clazz) {
- Set allSuperClasses = new LinkedHashSet();
- for (Class superClass = clazz.getSuperclass(); superClass != null; superClass = superClass.getSuperclass()) {
- allSuperClasses.add(superClass);
- }
- return allSuperClasses;
- }
-
- private static Set getAllInterfaces(Class clazz) {
- Set allInterfaces = new LinkedHashSet();
- LinkedList stack = new LinkedList();
- stack.addAll(Arrays.asList(clazz.getInterfaces()));
- while (!stack.isEmpty()) {
- Class intf = (Class) stack.removeFirst();
- if (!allInterfaces.contains(intf)) {
- allInterfaces.add(intf);
- stack.addAll(Arrays.asList(intf.getInterfaces()));
- }
- }
- return allInterfaces;
- }
-
- public static Set reduceInterfaces(Set source) {
- Class[] classes = (Class[]) source.toArray(new Class[source.size()]);
- classes = reduceInterfaces(classes);
- return new LinkedHashSet(Arrays.asList(classes));
- }
-
- /**
- * If there are multiple interfaces, and some of them extend each other,
- * eliminate the superclass in favor of the subclasses that extend them.
- *
- * If one of the entries is a class (not an interface), make sure it's
- * the first one in the array. If more than one of the entries is a
- * class, throws an IllegalArgumentException
- *
- * @param source the original list of interfaces
- * @return the equal or smaller list of interfaces
- */
- public static Class[] reduceInterfaces(Class[] source) {
- // use a copy of the source array
- source = (Class[]) source.clone();
-
- for (int leftIndex = 0; leftIndex < source.length-1; leftIndex++) {
- Class left = source[leftIndex];
- if(left == null) {
- continue;
- }
-
- for (int rightIndex = leftIndex +1; rightIndex < source.length; rightIndex++) {
- Class right = source[rightIndex];
- if(right == null) {
- continue;
- }
-
- if(left == right || right.isAssignableFrom(left)) {
- // right is the same as class or a sub class of left
- source[rightIndex] = null;
- } else if(left.isAssignableFrom(right)) {
- // left is the same as class or a sub class of right
- source[leftIndex] = null;
-
- // the left has been eliminated; move on to the next left
- break;
- }
- }
- }
-
- Class clazz = null;
- for (int i = 0; i < source.length; i++) {
- if (source[i] != null && !source[i].isInterface()) {
- if (clazz != null) {
- throw new IllegalArgumentException("Source contains two classes which are not subclasses of each other: " + clazz.getName() + ", " + source[i].getName());
- }
- clazz = source[i];
- source[i] = null;
- }
- }
-
- List list = new ArrayList(source.length);
- if (clazz != null) list.add(clazz);
- for (int i = 0; i < source.length; i++) {
- if(source[i] != null) {
- list.add(source[i]);
- }
- }
- return (Class[]) list.toArray(new Class[list.size()]);
- }
-}
-
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/DynamicStubClassLoader.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/DynamicStubClassLoader.java
deleted file mode 100644
index 82554a1c8f..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/DynamicStubClassLoader.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ejb.corba;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-import javax.rmi.CORBA.Stub;
-
-import net.sf.cglib.core.NamingPolicy;
-import net.sf.cglib.core.Predicate;
-import net.sf.cglib.proxy.Callback;
-import net.sf.cglib.proxy.CallbackFilter;
-import net.sf.cglib.proxy.Enhancer;
-import net.sf.cglib.proxy.FixedValue;
-import net.sf.cglib.proxy.MethodInterceptor;
-import net.sf.cglib.proxy.NoOp;
-
-/**
- * @version $Revision$ $Date$
- */
-public class DynamicStubClassLoader extends ClassLoader {
- private static final String PACKAGE_PREFIX = "org.omg.stub.";
-
- @Override
- public synchronized Class loadClass(final String name) throws ClassNotFoundException {
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-
- // check if the stub already exists first
- try {
- return classLoader.loadClass(name);
- } catch (ClassNotFoundException e) {
- }
-
- // if this is not a class from the org.omg.stub name space don't attempt to generate
- if (!name.startsWith(PACKAGE_PREFIX)) {
- throw new ClassNotFoundException("Could not load class: " + name);
- }
-
- // load the interfaces class we are attempting to create a stub for
- Class iface = loadStubInterfaceClass(name, classLoader);
-
- // create the stub builder
- try {
- Enhancer enhancer = new Enhancer();
- enhancer.setSuperclass(Stub.class);
- enhancer.setInterfaces(new Class[] {iface});
- enhancer.setCallbackFilter(FILTER);
- enhancer.setCallbackTypes(new Class[] {NoOp.class, MethodInterceptor.class, FixedValue.class});
- enhancer.setUseFactory(false);
- enhancer.setClassLoader(classLoader);
- enhancer.setNamingPolicy(new NamingPolicy() {
- public String getClassName(String s, String s1, Object o, Predicate predicate) {
- return name;
- }
- });
-
- // generate the class
- Class result = enhancer.createClass();
- assert result != null;
-
- StubMethodInterceptor interceptor = new StubMethodInterceptor(iface);
- Ids ids = new Ids(iface);
- Enhancer.registerStaticCallbacks(result, new Callback[] {NoOp.INSTANCE, interceptor, ids});
-
- return result;
- } catch (RuntimeException e) {
- throw e;
- } catch (Error e) {
- throw e;
- }
- }
-
- private Class loadStubInterfaceClass(String name, ClassLoader classLoader) throws ClassNotFoundException {
- try {
- int begin = name.lastIndexOf('.') + 1;
- String iPackage = name.substring(13, begin);
- String iName = iPackage + name.substring(begin + 1, name.length() - 5);
-
- return classLoader.loadClass(iName);
- } catch (ClassNotFoundException e) {
- // don't log exceptions from CosNaming because it attempts to load every
- // class bound into the name server
-
- //FIXME this variable is never read, can we remove the
- // whole block of code??
- //boolean shouldLog = true;
- StackTraceElement[] stackTrace = e.getStackTrace();
- for (int i = 0; i < stackTrace.length; i++) {
- StackTraceElement stackTraceElement = stackTrace[i];
- if (stackTraceElement.getClassName().equals("org.omg.CosNaming.NamingContextExtPOA") && stackTraceElement
- .getMethodName().equals("_invoke")) {
- //shouldLog = false;
- break;
- }
- }
-
- throw new ClassNotFoundException("Unable to generate stub", e);
- }
- }
-
- private static final CallbackFilter FILTER = new CallbackFilter() {
- public int accept(Method method) {
- // we don't intercept non-public methods like finalize
- if (!Modifier.isPublic(method.getModifiers())) {
- return 0;
- }
-
- if (method.getReturnType().equals(String[].class) && method.getParameterTypes().length == 0
- && method.getName().equals("_ids")) {
- return 2;
- }
-
- if (Modifier.isAbstract(method.getModifiers())) {
- return 1;
- }
-
- return 0;
- }
- };
-
- private static final class Ids implements FixedValue {
- private final String[] typeIds;
-
- public Ids(Class type) {
- typeIds = Java2IDLUtil.createCorbaIds(type);
- }
-
- public Object loadObject() throws Exception {
- return typeIds;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/Java2IDLUtil.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/Java2IDLUtil.java
deleted file mode 100644
index de8090c45b..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/Java2IDLUtil.java
+++ /dev/null
@@ -1,811 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ejb.corba;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.Method;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.UnexpectedException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.ejb.spi.HandleDelegate;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.rmi.PortableRemoteObject;
-
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.UserException;
-import org.omg.CORBA.portable.IDLEntity;
-import org.omg.CORBA.portable.ResponseHandler;
-import org.omg.CORBA.portable.UnknownException;
-import org.omg.CORBA_2_3.portable.InputStream;
-import org.omg.CORBA_2_3.portable.OutputStream;
-import org.omg.IOP.Codec;
-import org.omg.IOP.CodecFactory;
-import org.omg.IOP.ENCODING_CDR_ENCAPS;
-import org.omg.IOP.Encoding;
-
-/**
- * Various utility functions.
- * <p/>
- * Note: #getORB() and #getCodec() rely on UtilInitializer to initialize the ORB and codec.
- *
- * @version $Rev$ $Date$
- * @see UtilInitializer
- */
-public final class Java2IDLUtil {
- private static ORB orb;
- private static Codec codec;
- private static HandleDelegate handleDelegate;
-
- public static ORB getORB() {
- assert orb != null;
- return orb;
- }
-
-
-
- public static void setORB(ORB orb) throws UserException {
- if (Java2IDLUtil.orb == null) {
- Java2IDLUtil.orb = orb;
- CodecFactory factory = (CodecFactory) Java2IDLUtil.orb.resolve_initial_references("CodecFactory");
- codec = factory.create_codec(new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, (byte) 2));
- }
- }
-
- public static Codec getCodec() {
- assert codec != null;
- return codec;
- }
-
- public static HandleDelegate getHandleDelegate() throws NamingException {
- if (handleDelegate == null) {
- InitialContext ic = new InitialContext();
- handleDelegate = (HandleDelegate) ic.lookup("java:comp/HandleDelegate");
- }
- return handleDelegate;
- }
-
- private static final Pattern SCOPED_NAME_EXTRACTION_PATTERN = Pattern.compile("(\\\\\\\\)|(\\\\@)|(@)|(\\z)");
-
- /**
- * See csiv2 Specification 16.2.5 par. 63-64. We extract the username if any and un-escape any
- * escaped \ and @ characters.
- *
- * @param scopedNameBytes
- * @return
- * @throws UnsupportedEncodingException
- */
- public static String extractUserNameFromScopedName(byte[] scopedNameBytes) throws UnsupportedEncodingException {
- String scopedUserName = new String(scopedNameBytes, "UTF8");
- return extractUserNameFromScopedName(scopedUserName);
- }
-
- public static String extractUserNameFromScopedName(String scopedUserName) {
- Matcher m = SCOPED_NAME_EXTRACTION_PATTERN.matcher(scopedUserName);
- StringBuffer buf = new StringBuffer();
- while (m.find()) {
- m.appendReplacement(buf, "");
- if (m.group(1) != null) {
- buf.append('\\');
- } else if (m.group(2) != null) {
- buf.append("@");
- } else if (m.group(3) != null) {
- break;
- }
- }
- return buf.toString();
- }
-
- private static final Pattern SCOPED_NAME_ESCAPE_PATTERN = Pattern.compile("(\\\\)|(@)");
-
- public static String buildScopedUserName(String user, String domain) {
- StringBuffer buf = new StringBuffer();
- if (user != null) {
- escape(user, buf);
- }
- if (domain != null) {
- buf.append('@');
- escape(domain, buf);
- }
- return buf.toString();
- }
-
- private static void escape(String s, StringBuffer buf) {
- Matcher m = SCOPED_NAME_ESCAPE_PATTERN.matcher(s);
- while (m.find()) {
- m.appendReplacement(buf, "");
- if (m.group(1) != null) {
- buf.append("\\\\");
- } else if (m.group(2) != null) {
- buf.append("\\@");
- }
- }
- m.appendTail(buf);
- }
-
-
- public static String byteToString(byte[] data) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < data.length; i++) {
- buffer.append(HEXCHAR[(data[i] >>> 4) & 0x0F]);
- buffer.append(HEXCHAR[(data[i]) & 0x0F]);
- }
- return buffer.toString();
-
- }
-
- private static final char[] HEXCHAR = {
- '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
- };
-
- public static void writeObject(Class type, Object object, OutputStream out) {
- if (type == Void.TYPE) {
- // do nothing for a void
- } else if (type == Boolean.TYPE) {
- out.write_boolean(((Boolean) object).booleanValue());
- } else if (type == Byte.TYPE) {
- out.write_octet(((Byte) object).byteValue());
- } else if (type == Character.TYPE) {
- out.write_wchar(((Character) object).charValue());
- } else if (type == Double.TYPE) {
- out.write_double(((Double) object).doubleValue());
- } else if (type == Float.TYPE) {
- out.write_float(((Float) object).floatValue());
- } else if (type == Integer.TYPE) {
- out.write_long(((Integer) object).intValue());
- } else if (type == Long.TYPE) {
- out.write_longlong(((Long) object).longValue());
- } else if (type == Short.TYPE) {
- out.write_short(((Short) object).shortValue());
- } else {
- // object types must be written in the context of the CORBA application server
- // which properly write replaces our objects for CORBA
- // ApplicationServer oldApplicationServer = ServerFederation.getApplicationServer();
- try {
- // ServerFederation.setApplicationServer(corbaApplicationServer);
-
- // todo check if
- // copy the result to force replacement
- // CORBA does not call writeReplace on remote proxies
- //
- // HOWEVER, if this is an array, then we don't want to do the replacement
- // because we can end up with a replacement element that's not compatible with the
- // original array type, which results in an ArrayStoreException. Fortunately,
- // the Yoko RMI support appears to be able to sort this out for us correctly.
- if (object instanceof Serializable && !object.getClass().isArray()) {
- try {
- object = copyObj(Thread.currentThread().getContextClassLoader(), object);
- } catch (Exception e) {
- throw new UnknownException(e);
- }
- }
-
- if (type == Object.class || type == Serializable.class) {
- javax.rmi.CORBA.Util.writeAny(out, object);
- } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)) {
- out.write_Object((org.omg.CORBA.Object) object);
- } else if (Remote.class.isAssignableFrom(type)) {
- javax.rmi.CORBA.Util.writeRemoteObject(out, object);
- } else if (type.isInterface() && Serializable.class.isAssignableFrom(type)) {
- javax.rmi.CORBA.Util.writeAbstractObject(out, object);
- } else {
- out.write_value((Serializable) object, type);
- }
- } finally {
- // ServerFederation.setApplicationServer(oldApplicationServer);
- }
- }
- }
-
- private static Object copyObj(ClassLoader classLoader, Object object) throws IOException, ClassNotFoundException {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(object);
- oos.flush();
- oos.close();
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectInputStreamExt ois = new ObjectInputStreamExt(bais, classLoader);
- return ois.readObject();
- }
-
- public static Object readObject(Class type, InputStream in) {
- if (type == Void.TYPE) {
- return null;
- } else if (type == Boolean.TYPE) {
- return new Boolean(in.read_boolean());
- } else if (type == Byte.TYPE) {
- return new Byte(in.read_octet());
- } else if (type == Character.TYPE) {
- return new Character(in.read_wchar());
- } else if (type == Double.TYPE) {
- return new Double(in.read_double());
- } else if (type == Float.TYPE) {
- return new Float(in.read_float());
- } else if (type == Integer.TYPE) {
- return new Integer(in.read_long());
- } else if (type == Long.TYPE) {
- return new Long(in.read_longlong());
- } else if (type == Short.TYPE) {
- return new Short(in.read_short());
- } else if (type == Object.class || type == Serializable.class) {
- return javax.rmi.CORBA.Util.readAny(in);
- } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)) {
- return in.read_Object(type);
- } else if (Remote.class.isAssignableFrom(type)) {
- return PortableRemoteObject.narrow(in.read_Object(), type);
- } else if (type.isInterface() && Serializable.class.isAssignableFrom(type)) {
- return in.read_abstract_interface();
- } else {
- return in.read_value(type);
- }
- }
-
- public static void throwException(Method method, InputStream in) throws Throwable {
- // read the exception id
- final String id = in.read_string();
-
- // get the class name from the id
- if (!id.startsWith("IDL:")) {
- return;
- }
-
- Class[] exceptionTypes = method.getExceptionTypes();
- for (int i = 0; i < exceptionTypes.length; i++) {
- Class exceptionType = exceptionTypes[i];
-
- String exceptionId = getExceptionId(exceptionType);
- if (id.equals(exceptionId)) {
- throw (Throwable) in.read_value(exceptionType);
- }
- }
- throw new UnexpectedException(id);
- }
-
- public static OutputStream writeUserException(Method method, ResponseHandler reply, Exception exception) throws Exception {
- if (exception instanceof RuntimeException || exception instanceof RemoteException) {
- throw exception;
- }
-
- Class[] exceptionTypes = method.getExceptionTypes();
- for (int i = 0; i < exceptionTypes.length; i++) {
- Class exceptionType = exceptionTypes[i];
- if (!exceptionType.isInstance(exception)) {
- continue;
- }
-
- OutputStream out = (OutputStream) reply.createExceptionReply();
- String exceptionId = getExceptionId(exceptionType);
- out.write_string(exceptionId);
- out.write_value(exception);
- return out;
- }
- throw exception;
- }
-
- public static String getExceptionId(Class exceptionType) {
- String exceptionName = exceptionType.getName().replace('.', '/');
- if (exceptionName.endsWith("Exception")) {
- exceptionName = exceptionName.substring(0, exceptionName.length() - "Exception".length());
- }
- exceptionName += "Ex";
- String exceptionId = "IDL:" + exceptionName + ":1.0";
- return exceptionId;
- }
-
- public static String[] createCorbaIds(Class type) {
- List ids = new LinkedList();
- for (Iterator iterator = getAllInterfaces(type).iterator(); iterator.hasNext();) {
- Class superInterface = (Class) iterator.next();
- if (Remote.class.isAssignableFrom(superInterface) && superInterface != Remote.class) {
- ids.add("RMI:" + superInterface.getName() + ":0000000000000000");
- }
- }
- return (String[]) ids.toArray(new String[ids.size()]);
- }
-
- private static Set getAllInterfaces(Class intfClass) {
- Set allInterfaces = new LinkedHashSet();
-
- LinkedList stack = new LinkedList();
- stack.addFirst(intfClass);
-
- while (!stack.isEmpty()) {
- Class intf = (Class) stack.removeFirst();
- allInterfaces.add(intf);
- stack.addAll(0, Arrays.asList(intf.getInterfaces()));
- }
-
- return allInterfaces;
- }
-
- public static Map mapMethodToOperation(Class intfClass) {
- return iiopMap(intfClass, false);
- }
-
- public static Map mapOperationToMethod(Class intfClass) {
- return iiopMap(intfClass, true);
- }
-
- private static Map iiopMap(Class intfClass, boolean operationToMethod) {
- Method[] methods = getAllMethods(intfClass);
-
- // find every valid getter
- HashMap getterByMethod = new HashMap(methods.length);
- HashMap getterByName = new HashMap(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
- String methodName = method.getName();
-
- // no arguments allowed
- if (method.getParameterTypes().length != 0) {
- continue;
- }
-
- // must start with get or is
- String verb;
- if (methodName.startsWith("get") && methodName.length() > 3 && method.getReturnType() != void.class) {
- verb = "get";
- } else if (methodName.startsWith("is") && methodName.length() > 2 && method.getReturnType() == boolean.class) {
- verb = "is";
- } else {
- continue;
- }
-
- // must only throw Remote or Runtime Exceptions
- boolean exceptionsValid = true;
- Class[] exceptionTypes = method.getExceptionTypes();
- for (int j = 0; j < exceptionTypes.length; j++) {
- Class exceptionType = exceptionTypes[j];
- if (!RemoteException.class.isAssignableFrom(exceptionType) &&
- !RuntimeException.class.isAssignableFrom(exceptionType) &&
- !Error.class.isAssignableFrom(exceptionType)) {
- exceptionsValid = false;
- break;
- }
- }
- if (!exceptionsValid) {
- continue;
- }
-
- String propertyName;
- if (methodName.length() > verb.length() + 1 && Character.isUpperCase(methodName.charAt(verb.length() + 1))) {
- propertyName = methodName.substring(verb.length());
- } else {
- propertyName = Character.toLowerCase(methodName.charAt(verb.length())) + methodName.substring(verb.length() + 1);
- }
- getterByMethod.put(method, propertyName);
- getterByName.put(propertyName, method);
- }
-
- HashMap setterByMethod = new HashMap(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
- String methodName = method.getName();
-
- // must have exactally one arg
- if (method.getParameterTypes().length != 1) {
- continue;
- }
-
- // must return non void
- if (method.getReturnType() != void.class) {
- continue;
- }
-
- // must start with set
- if (!methodName.startsWith("set") || methodName.length() <= 3) {
- continue;
- }
-
- // must only throw Remote or Runtime Exceptions
- boolean exceptionsValid = true;
- Class[] exceptionTypes = method.getExceptionTypes();
- for (int j = 0; j < exceptionTypes.length; j++) {
- Class exceptionType = exceptionTypes[j];
- if (!RemoteException.class.isAssignableFrom(exceptionType) &&
- !RuntimeException.class.isAssignableFrom(exceptionType) &&
- !Error.class.isAssignableFrom(exceptionType)) {
- exceptionsValid = false;
- break;
- }
- }
- if (!exceptionsValid) {
- continue;
- }
-
- String propertyName;
- if (methodName.length() > 4 && Character.isUpperCase(methodName.charAt(4))) {
- propertyName = methodName.substring(3);
- } else {
- propertyName = Character.toLowerCase(methodName.charAt(3)) + methodName.substring(4);
- }
-
- // must have a matching getter
- Method getter = (Method) getterByName.get(propertyName);
- if (getter == null) {
- continue;
- }
-
- // setter property must match getter return value
- if (!method.getParameterTypes()[0].equals(getter.getReturnType())) {
- continue;
- }
- setterByMethod.put(method, propertyName);
- }
-
- // index the methods by name... used to determine which methods are overloaded
- HashMap overloadedMethods = new HashMap(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
- if (getterByMethod.containsKey(method) || setterByMethod.containsKey(method)) {
- continue;
- }
- String methodName = method.getName();
- List methodList = (List) overloadedMethods.get(methodName);
- if (methodList == null) {
- methodList = new LinkedList();
- overloadedMethods.put(methodName, methodList);
- }
- methodList.add(method);
- }
-
- // index the methods by lower case name... used to determine which methods differ only by case
- HashMap caseCollisionMethods = new HashMap(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
- if (getterByMethod.containsKey(method) || setterByMethod.containsKey(method)) {
- continue;
- }
- String lowerCaseMethodName = method.getName().toLowerCase();
- Set methodSet = (Set) caseCollisionMethods.get(lowerCaseMethodName);
- if (methodSet == null) {
- methodSet = new HashSet();
- caseCollisionMethods.put(lowerCaseMethodName, methodSet);
- }
- methodSet.add(method.getName());
- }
-
- String className = getClassName(intfClass);
- Map iiopMap = new HashMap(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
-
- String iiopName = (String) getterByMethod.get(method);
- if (iiopName != null) {
- // if we have a leading underscore prepend with J
- if (iiopName.charAt(0) == '_') {
- iiopName = "J_get_" + iiopName.substring(1);
- } else {
- iiopName = "_get_" + iiopName;
- }
- } else {
- iiopName = (String) setterByMethod.get(method);
- if (iiopName != null) {
- // if we have a leading underscore prepend with J
- if (iiopName.charAt(0) == '_') {
- iiopName = "J_set_" + iiopName.substring(1);
- } else {
- iiopName = "_set_" + iiopName;
- }
- } else {
- iiopName = method.getName();
-
- // if we have a leading underscore prepend with J
- if (iiopName.charAt(0) == '_') {
- iiopName = "J" + iiopName;
- }
- }
- }
-
- // if this name only differs by case add the case index to the end
- Set caseCollisions = (Set) caseCollisionMethods.get(method.getName().toLowerCase());
- if (caseCollisions != null && caseCollisions.size() > 1) {
- iiopName += upperCaseIndexString(iiopName);
- }
-
- // if this is an overloaded method append the parameter string
- List overloads = (List) overloadedMethods.get(method.getName());
- if (overloads != null && overloads.size() > 1) {
- iiopName += buildOverloadParameterString(method.getParameterTypes());
- }
-
- // if we have a leading underscore prepend with J
- iiopName = replace(iiopName, '$', "U0024");
-
- // if we have matched a keyword prepend with an underscore
- if (keywords.contains(iiopName.toLowerCase())) {
- iiopName = "_" + iiopName;
- }
-
- // if the name is the same as the class name, append an underscore
- if (iiopName.equalsIgnoreCase(className)) {
- iiopName += "_";
- }
-
- if (operationToMethod) {
- iiopMap.put(iiopName, method);
- } else {
- iiopMap.put(method, iiopName);
- }
- }
-
- return iiopMap;
- }
-
- private static Method[] getAllMethods(Class intfClass) {
- LinkedList methods = new LinkedList();
- for (Iterator iterator = getAllInterfaces(intfClass).iterator(); iterator.hasNext();) {
- Class intf = (Class) iterator.next();
- methods.addAll(Arrays.asList(intf.getDeclaredMethods()));
- }
-
- return (Method[]) methods.toArray(new Method[methods.size()]);
- }
-
- /**
- * Return the a string containing an underscore '_' index of each uppercase character in the IIOP name.
- *
- * This is used for distinction of names that only differ by case, since CORBA does not support case sensitive names.
- */
- private static String upperCaseIndexString(String iiopName) {
- StringBuffer stringBuffer = new StringBuffer();
- for (int i = 0; i < iiopName.length(); i++) {
- char c = iiopName.charAt(i);
- if (Character.isUpperCase(c)) {
- stringBuffer.append('_').append(i);
- }
- }
- return stringBuffer.toString();
- }
-
- /**
- * Replaces any occurances of the specified "oldChar" with the new string.
- *
- * This is used to replace occurances if '$' in CORBA names since '$' is a special character
- */
- private static String replace(String source, char oldChar, String newString) {
- StringBuffer stringBuffer = new StringBuffer(source.length());
- for (int i = 0; i < source.length(); i++) {
- char c = source.charAt(i);
- if (c == oldChar) {
- stringBuffer.append(newString);
- } else {
- stringBuffer.append(c);
- }
- }
- return stringBuffer.toString();
- }
-
- /**
- * Return the a string containing a double underscore '__' list of parameter types encoded using the Java to IDL rules.
- *
- * This is used for distinction of methods that only differ by parameter lists.
- */
- private static String buildOverloadParameterString(Class[] parameterTypes) {
- String name = "";
- if (parameterTypes.length ==0) {
- name += "__";
- } else {
- for (int i = 0; i < parameterTypes.length; i++) {
- Class parameterType = parameterTypes[i];
- name += buildOverloadParameterString(parameterType);
- }
- }
- return name.replace('.', '_');
- }
-
- /**
- * Returns a single parameter type encoded using the Java to IDL rules.
- */
- private static String buildOverloadParameterString(Class parameterType) {
- String name = "_";
-
- int arrayDimensions = 0;
- while (parameterType.isArray()) {
- arrayDimensions++;
- parameterType = parameterType.getComponentType();
- }
-
- // arrays start with org_omg_boxedRMI_
- if (arrayDimensions > 0) {
- name += "_org_omg_boxedRMI";
- }
-
- // IDLEntity types must be prefixed with org_omg_boxedIDL_
- if (IDLEntity.class.isAssignableFrom(parameterType)) {
- name += "_org_omg_boxedIDL";
- }
-
- // add package... some types have special mappings in corba
- String packageName = (String) specialTypePackages.get(parameterType.getName());
- if (packageName == null) {
- packageName = getPackageName(parameterType.getName());
- }
- if (packageName.length() > 0) {
- name += "_" + packageName;
- }
-
- // arrays now contain a dimension indicator
- if (arrayDimensions > 0) {
- name += "_" + "seq" + arrayDimensions;
- }
-
- // add the class name
- String className = (String) specialTypeNames.get(parameterType.getName());
- if (className == null) {
- className = buildClassName(parameterType);
- }
- name += "_" + className;
-
- return name;
- }
-
- /**
- * Returns a string containing an encoded class name.
- */
- private static String buildClassName(Class type) {
- if (type.isArray()) {
- throw new IllegalArgumentException("type is an array: " + type);
- }
-
- // get the classname
- String typeName = type.getName();
- int endIndex = typeName.lastIndexOf('.');
- if (endIndex < 0) {
- return typeName;
- }
- StringBuffer className = new StringBuffer(typeName.substring(endIndex + 1));
-
- // for innerclasses replace the $ separator with two underscores
- // we can't just blindly replace all $ characters since class names can contain the $ character
- if (type.getDeclaringClass() != null) {
- String declaringClassName = getClassName(type.getDeclaringClass());
- assert className.toString().startsWith(declaringClassName + "$");
- className.replace(declaringClassName.length(), declaringClassName.length() + 1, "__");
- }
-
- // if we have a leading underscore prepend with J
- if (className.charAt(0) == '_') {
- className.insert(0, "J");
- }
- return className.toString();
- }
-
- private static String getClassName(Class type) {
- if (type.isArray()) {
- throw new IllegalArgumentException("type is an array: " + type);
- }
-
- // get the classname
- String typeName = type.getName();
- int endIndex = typeName.lastIndexOf('.');
- if (endIndex < 0) {
- return typeName;
- }
- return typeName.substring(endIndex + 1);
- }
-
- private static String getPackageName(String interfaceName) {
- int endIndex = interfaceName.lastIndexOf('.');
- if (endIndex < 0) {
- return "";
- }
- return interfaceName.substring(0, endIndex);
- }
-
- private static final Map specialTypeNames;
- private static final Map specialTypePackages;
- private static final Set keywords;
-
- static {
- specialTypeNames = new HashMap();
- specialTypeNames.put("boolean", "boolean");
- specialTypeNames.put("char", "wchar");
- specialTypeNames.put("byte", "octet");
- specialTypeNames.put("short", "short");
- specialTypeNames.put("int", "long");
- specialTypeNames.put("long", "long_long");
- specialTypeNames.put("float", "float");
- specialTypeNames.put("double", "double");
- specialTypeNames.put("java.lang.Class", "ClassDesc");
- specialTypeNames.put("java.lang.String", "WStringValue");
- specialTypeNames.put("org.omg.CORBA.Object", "Object");
-
- specialTypePackages = new HashMap();
- specialTypePackages.put("boolean", "");
- specialTypePackages.put("char", "");
- specialTypePackages.put("byte", "");
- specialTypePackages.put("short", "");
- specialTypePackages.put("int", "");
- specialTypePackages.put("long", "");
- specialTypePackages.put("float", "");
- specialTypePackages.put("double", "");
- specialTypePackages.put("java.lang.Class", "javax.rmi.CORBA");
- specialTypePackages.put("java.lang.String", "CORBA");
- specialTypePackages.put("org.omg.CORBA.Object", "");
-
- keywords = new HashSet();
- keywords.add("abstract");
- keywords.add("any");
- keywords.add("attribute");
- keywords.add("boolean");
- keywords.add("case");
- keywords.add("char");
- keywords.add("const");
- keywords.add("context");
- keywords.add("custom");
- keywords.add("default");
- keywords.add("double");
- keywords.add("enum");
- keywords.add("exception");
- keywords.add("factory");
- keywords.add("false");
- keywords.add("fixed");
- keywords.add("float");
- keywords.add("in");
- keywords.add("inout");
- keywords.add("interface");
- keywords.add("long");
- keywords.add("module");
- keywords.add("native");
- keywords.add("object");
- keywords.add("octet");
- keywords.add("oneway");
- keywords.add("out");
- keywords.add("private");
- keywords.add("public");
- keywords.add("raises");
- keywords.add("readonly");
- keywords.add("sequence");
- keywords.add("short");
- keywords.add("string");
- keywords.add("struct");
- keywords.add("supports");
- keywords.add("switch");
- keywords.add("true");
- keywords.add("truncatable");
- keywords.add("typedef");
- keywords.add("union");
- keywords.add("unsigned");
- keywords.add("valuebase");
- keywords.add("valuetype");
- keywords.add("void");
- keywords.add("wchar");
- keywords.add("wstring");
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/ObjectInputStreamExt.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/ObjectInputStreamExt.java
deleted file mode 100644
index 1be4a98a48..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/ObjectInputStreamExt.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.ejb.corba;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectStreamClass;
-import java.lang.reflect.Proxy;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ObjectInputStreamExt extends ObjectInputStream {
-
- private ClassLoader classloader;
-
- public ObjectInputStreamExt(InputStream in, ClassLoader loader) throws IOException {
- super(in);
- this.classloader = loader;
- }
-
- @Override
- protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
- return ClassLoadingUtil.loadClass(classDesc.getName(), classloader);
- }
-
- @Override
- protected Class resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException {
- Class[] cinterfaces = new Class[interfaces.length];
- for (int i = 0; i < interfaces.length; i++)
- cinterfaces[i] = classloader.loadClass(interfaces[i]);
-
- try {
- return Proxy.getProxyClass(classloader, cinterfaces);
- } catch (IllegalArgumentException e) {
- throw new ClassNotFoundException(null, e);
- }
- }
-
- ClassLoader getClassloader() {
- return classloader;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/StubMethodInterceptor.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/StubMethodInterceptor.java
deleted file mode 100644
index 3ff0ed552a..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/StubMethodInterceptor.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.binding.ejb.corba;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Collections;
-import java.util.Map;
-
-import javax.ejb.EJBObject;
-import javax.rmi.CORBA.Stub;
-import javax.rmi.CORBA.Util;
-
-import net.sf.cglib.proxy.MethodInterceptor;
-import net.sf.cglib.proxy.MethodProxy;
-
-import org.omg.CORBA.SystemException;
-import org.omg.CORBA.portable.ApplicationException;
-import org.omg.CORBA.portable.RemarshalException;
-import org.omg.CORBA.portable.ServantObject;
-import org.omg.CORBA_2_3.portable.InputStream;
-import org.omg.CORBA_2_3.portable.OutputStream;
-
-/**
- * @version $Revision$ $Date$
- */
-public class StubMethodInterceptor implements MethodInterceptor {
- private static final Method ISIDENTICAL;
-
- static {
- try {
- ISIDENTICAL = EJBObject.class.getMethod("isIdentical", new Class[]{EJBObject.class});
- } catch (NoSuchMethodException e) {
- throw new ExceptionInInitializerError(e);
- }
- }
-
- private final Class type;
- private final Map operations;
-
- public StubMethodInterceptor(Class type) {
- this.type = type;
- this.operations = Collections.unmodifiableMap(org.apache.tuscany.sca.binding.ejb.corba.Java2IDLUtil.mapMethodToOperation(type));
- }
-
- public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
- Stub stub = (Stub) proxy;
-
- // handle is identical in stub to avoid unnecessary round trip
- if (method.equals(ISIDENTICAL)) {
- org.omg.CORBA.Object otherObject = (org.omg.CORBA.Object) args[0];
- return new Boolean(stub._is_equivalent(otherObject));
- }
-
- // get the operation name object
- String operationName = (String) operations.get(method);
- if (operationName == null) {
- throw new IllegalStateException("Unknown method: " + method);
- }
-
- while (true) {
- // if this is a stub to a remote object we invoke over the wire
- if (!Util.isLocal(stub)) {
-
- InputStream in = null;
- try {
- // create the request output stream
- OutputStream out = (OutputStream) stub._request(operationName, true);
-
- // write the arguments
- Class[] parameterTypes = method.getParameterTypes();
- for (int i = 0; i < parameterTypes.length; i++) {
- Class parameterType = parameterTypes[i];
- org.apache.tuscany.sca.binding.ejb.corba.Java2IDLUtil.writeObject(parameterType, args[i], out);
- }
-
- // send the invocation
- in = (InputStream) stub._invoke(out);
-
- // read the result
- Object result = org.apache.tuscany.sca.binding.ejb.corba.Java2IDLUtil.readObject(method.getReturnType(), in);
- return result;
- } catch (RemarshalException exception) {
- continue;
- } catch (ApplicationException exception) {
- org.apache.tuscany.sca.binding.ejb.corba.Java2IDLUtil.throwException(method, (InputStream) exception.getInputStream());
- } catch (SystemException e) {
- throw Util.mapSystemException(e);
- } finally {
- stub._releaseReply(in);
- }
- } else {
- // get the servant
- ServantObject servantObject = stub._servant_preinvoke(operationName, type);
- if (servantObject == null) {
- continue;
- }
-
- try {
- // copy the arguments
- Object[] argsCopy = Util.copyObjects(args, stub._orb());
-
- // invoke the servant
- Object result = null;
- try {
- result = method.invoke(servantObject.servant, argsCopy);
- } catch (InvocationTargetException e) {
- if (e.getCause() != null) {
- throw e.getCause();
- }
- throw e;
- }
-
- // copy the result
- result = Util.copyObject(result, stub._orb());
-
- return result;
- } catch (Throwable throwable) {
- // copy the exception
- Throwable throwableCopy = (Throwable) Util.copyObject(throwable, stub._orb());
-
- // if it is one of my exception rethrow it
- Class[] exceptionTypes = method.getExceptionTypes();
- for (int i = 0; i < exceptionTypes.length; i++) {
- Class exceptionType = exceptionTypes[i];
- if (exceptionType.isInstance(throwableCopy)) {
- throw throwableCopy;
- }
- }
-
- throw Util.wrapException(throwableCopy);
- } finally {
- stub._servant_postinvoke(servantObject);
- }
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/UtilInitializer.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/UtilInitializer.java
deleted file mode 100644
index f9aa9ffa22..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/corba/UtilInitializer.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.ejb.corba;
-
-import org.omg.CORBA.LocalObject;
-import org.omg.PortableInterceptor.ORBInitInfo;
-import org.omg.PortableInterceptor.ORBInitializer;
-
-/**
- * The sole purpose of this initializer is to register a non-singleton ORB
- * with the class <code>Util</code>.
- *
- * @version $Revision$ $Date$
- * @see Java2IDLUtil
- */
-public class UtilInitializer extends LocalObject implements ORBInitializer {
-
- private static final long serialVersionUID = 4901857563505370955L;
-
- /**
- * Called during ORB initialization. If it is expected that initial
- * services registered by an interceptor will be used by other
- * interceptors, then those initial services shall be registered at
- * this point via calls to
- * <code>ORBInitInfo.register_initial_reference</code>.
- *
- * @param info provides initialization attributes and operations by
- * which Interceptors can be registered.
- */
- public void pre_init(ORBInitInfo info) {
- }
-
- /**
- * Called during ORB initialization. If a service must resolve initial
- * references as part of its initialization, it can assume that all
- * initial references will be available at this point.
- * <p/>
- * Calling the <code>post_init</code> operations is not the final
- * task of ORB initialization. The final task, following the
- * <code>post_init</code> calls, is attaching the lists of registered
- * interceptors to the ORB. Therefore, the ORB does not contain the
- * interceptors during calls to <code>post_init</code>. If an
- * ORB-mediated call is made from within <code>post_init</code>, no
- * request interceptors will be invoked on that call.
- * Likewise, if an operation is performed which causes an IOR to be
- * created, no IOR interceptors will be invoked.
- *
- * @param info provides initialization attributes and
- * operations by which Interceptors can be registered.
- */
- public void post_init(ORBInitInfo info) {
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java
deleted file mode 100644
index 9247c1d3db..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.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.binding.ejb.provider;
-
-import org.apache.tuscany.sca.binding.ejb.EJBBinding;
-import org.apache.tuscany.sca.binding.ejb.util.EJBHandler;
-import org.apache.tuscany.sca.binding.ejb.util.NamingEndpoint;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-
-/**
- * EJBTargetInvoker
- *
- * @version $Rev$ $Date$
- */
-public class EJBBindingInvoker implements Invoker, DataExchangeSemantics {
-
- private Operation operation;
- private String location;
- private Class serviceInterface;
-
- public EJBBindingInvoker(EJBBinding ejbBinding, Class serviceInterface, Operation operation) {
- this.serviceInterface = serviceInterface;
- this.location = ejbBinding.getURI();
- this.operation = operation;
- }
-
- public Message invoke(Message msg) {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(serviceInterface.getClassLoader());
- Object resp = doInvoke(msg.getBody());
- msg.setBody(resp);
- } catch (Throwable e) {
- e.printStackTrace();
- msg.setFaultBody(e);
- } finally {
- Thread.currentThread().setContextClassLoader(tccl);
- }
- return msg;
- }
-
- /**
- * Invoke a EJB operation
- *
- * @param payload
- * @return
- */
- public Object doInvoke(final Object payload) {
-
- // construct NamingendPoint
- NamingEndpoint endpoint = getNamingEndpoint();
-
- // lookup home and ejb stub
- EJBHandler ejbHandler = new EJBHandler(endpoint, serviceInterface);
-
- String methodName = operation.getName();
-
- // invoke business method on ejb
- Object response = ejbHandler.invoke(methodName, (Object[])payload);
-
- return response;
- }
-
- protected NamingEndpoint getNamingEndpoint() {
- return new NamingEndpoint(location);
- }
-
- public boolean allowsPassByReference() {
- // EJB RMI/IIOP always pass by value
- return true;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingProviderFactory.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingProviderFactory.java
deleted file mode 100644
index a6ea583d0b..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingProviderFactory.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.ejb.provider;
-
-import org.apache.tuscany.sca.binding.ejb.EJBBinding;
-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;
-
-/**
- * A factory from creating the EJB binding provider.
- *
- * @version $Rev$ $Date$
- */
-public class EJBBindingProviderFactory implements BindingProviderFactory<EJBBinding> {
-
- public EJBBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- EJBBinding binding) {
- return new EJBBindingReferenceBindingProvider(component, reference, binding);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- EJBBinding binding) {
- return null;
- //throw new EJBBindingException("Service Binding not supported for EJB Binding");
- }
-
- public Class<EJBBinding> getModelType() {
- return EJBBinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingReferenceBindingProvider.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingReferenceBindingProvider.java
deleted file mode 100644
index 2a02bf0d08..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingReferenceBindingProvider.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.ejb.provider;
-
-import org.apache.tuscany.sca.binding.ejb.EJBBinding;
-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.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 ReferenceBindingProvider for the EJBBinding.
- *
- * @version $Rev$ $Date$
- */
-public class EJBBindingReferenceBindingProvider implements ReferenceBindingProvider {
- private EJBBinding ejbBinding;
- private RuntimeComponentReference reference;
-
- /**
- * Constructor
- *
- * @param component
- * @param reference
- * @param binding
- */
- public EJBBindingReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- EJBBinding binding) {
- this.reference = reference;
- this.ejbBinding = binding;
- }
-
- /**
- * {@inheritDoc}
- */
- public Invoker createInvoker(Operation operation) {
- return new EJBBindingInvoker(ejbBinding, ((JavaInterface)reference.getInterfaceContract().getInterface())
- .getJavaClass(), operation);
- }
-
- /**
- * {@inheritDoc}
- */
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- /**
- * {@inheritDoc}
- */
- public void start() {
- }
-
- /**
- * {@inheritDoc}
- */
- public void stop() {
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean supportsOneWayInvocation() {
- return true;
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBHandler.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBHandler.java
deleted file mode 100644
index d41dbd0a0f..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBHandler.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ejb.util;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.rmi.RemoteException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.ejb.EJBObject;
-import javax.rmi.CORBA.Util;
-
-import org.apache.tuscany.sca.binding.ejb.corba.ClassLoadingUtil;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.SystemException;
-import org.omg.CORBA.portable.ApplicationException;
-import org.omg.CORBA.portable.ObjectImpl;
-import org.omg.CORBA.portable.RemarshalException;
-import org.omg.CORBA.portable.ServantObject;
-import org.omg.CORBA_2_3.portable.InputStream;
-import org.omg.CORBA_2_3.portable.OutputStream;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * EJBMessageHandler
- *
- * @version $Rev$ $Date$
- */
-public class EJBHandler {
- private static final Map<String, Class> PRIMITIVE_TYPES = new HashMap<String, Class>();
- static {
- PRIMITIVE_TYPES.put("boolean", boolean.class);
- PRIMITIVE_TYPES.put("byte", byte.class);
- PRIMITIVE_TYPES.put("char", char.class);
- PRIMITIVE_TYPES.put("short", short.class);
- PRIMITIVE_TYPES.put("int", int.class);
- PRIMITIVE_TYPES.put("long", long.class);
- PRIMITIVE_TYPES.put("float", float.class);
- PRIMITIVE_TYPES.put("double", double.class);
- PRIMITIVE_TYPES.put("void", void.class);
- }
-
- private Object ejbStub;
-
- private InterfaceInfo interfaceInfo;
- private Class ejbInterface;
-
- public EJBHandler(NamingEndpoint namingEndpoint, Class ejbInterface) {
- this(namingEndpoint, InterfaceInfo.getInstance(ejbInterface));
- this.ejbInterface = ejbInterface;
- }
-
- // locates the stub
- private EJBHandler(NamingEndpoint namingEndpoint, InterfaceInfo ejbInterface) {
- try {
- this.ejbStub = EJBStubHelper.lookup(namingEndpoint, ejbInterface);
- this.interfaceInfo = ejbInterface;
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- private static Class loadClass(final String name) {
- try {
- return ClassLoadingUtil.loadClass(name, Thread.currentThread().getContextClassLoader());
- } catch (ClassNotFoundException e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- // invokes EJB method
- public Object invoke(String methodName, Object[] args) {
- Object response = null;
- try {
- if (ejbStub instanceof ObjectImpl) {
- ObjectImpl objectImpl = (ObjectImpl)ejbStub;
- // TODO: If the Java 2 security is turned on, then
- // the ORB will try to create proxy
- // from the interfaces defined on the stub
- if (System.getSecurityManager() == null && objectImpl._is_local()) {
- /*
- * CORBA.Stub is what the object from JNDI will be for a
- * remote EJB in the same JVM as the client, but with no
- * stub classes available on the client
- */
- response = invokeLocalCORBACall(objectImpl, methodName, args);
- } else {
- /*
- * _EJBObject_Stub is what the object from JNDI will be for
- * a remote EJB with no stub classes available on the client
- */
- response = invokeRemoteCORBACall(objectImpl, methodName, args);
- }
- } else {
- /*
- * A generated ejb stub or it must be an EJB in the same ear as
- * the client or an AppServer with a single ClassLoader, so
- * reflection can be used directly on the JNDI
- */
- JavaReflectionAdapter reflectionAdapter =
- JavaReflectionAdapter.createJavaReflectionAdapter(ejbStub.getClass());
- try {
- Method method = reflectionAdapter.getMethod(methodName);
- response = method.invoke(ejbStub, args);
- } catch (InvocationTargetException e) {
- Throwable t = e.getTargetException();
- // FIXME need to throw really a business exception.
- // ServiceBusinessException?
- // Tuscany core doesn't have ServiceBusinessException
- throw new ServiceRuntimeException(t);
- }
- }
-
- return response;
- } catch (Exception e) {
- // FIXME this be business exception? Tuscany core doesn't have
- // ServiceBusinessException
- throw new ServiceRuntimeException(e);
-
- } catch (Throwable e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * Get the IDL operation name for a java method
- *
- * @param methodName java method name
- * @return The IDL operation name
- */
- private String getOperation(String methodName) {
- if (interfaceInfo == null) {
- return methodName;
- }
- MethodInfo methodInfo = interfaceInfo.getMethod(methodName);
- if (methodInfo != null) {
- return methodInfo.getIDLName();
- } else {
- return null;
- }
- }
-
- /*
- * Derive the EJB interface name from the Stub When loading a stub class
- * corresponding to an interface or class <packagename>.<typename>, the
- * class <packagename>._<typename>_Stub shall be used if it exists;
- * otherwise, the class org.omg.stub.<packagename>._<typename>_Stub shall
- * be used.
- */
- private static String getInterface(String stubName) {
- int index = stubName.lastIndexOf('.');
- String packageName = null;
- String typeName = stubName;
- if (index != -1) {
- packageName = stubName.substring(0, index);
- if (packageName.startsWith("org.omg.stub.")) {
- packageName = packageName.substring("org.omg.stub.".length());
- }
- typeName = stubName.substring(index + 1);
- }
- if (typeName.startsWith("_") && typeName.endsWith("_Stub")) {
- typeName = typeName.substring(1, typeName.length() - "_Stub".length());
- }
- if (packageName != null)
- return packageName + "." + typeName;
- else
- return typeName;
- }
-
- /**
- * Invoke a method on the local CORBA object
- *
- * @param stub
- * @param methodName
- * @param args
- * @return
- * @throws RemoteException
- * @throws ServiceBusinessException
- */
- private Object invokeLocalCORBACall(final ObjectImpl stub, String methodName, Object[] args)
- throws RemoteException {
-
- final String operation = getOperation(methodName);
-
- Class type = loadClass(getInterface(stub.getClass().getName()));
- if (type == null)
- type = (ejbInterface != null) ? ejbInterface : EJBObject.class;
-
- ServantObject so = stub._servant_preinvoke(operation, type);
- if (so == null) {
- // The Servant is not local any more
- return invokeRemoteCORBACall(stub, methodName, args);
- }
- Object[] newArgs = null;
- ORB orb = stub._orb();
- try {
- if (args != null)
- newArgs = Util.copyObjects(args, orb);
- JavaReflectionAdapter reflectionAdapter =
- JavaReflectionAdapter.createJavaReflectionAdapter(so.servant.getClass());
- Method method = reflectionAdapter.getMethod(methodName);
- Object obj = reflectionAdapter.invoke(method, so.servant, newArgs);
- Object result = Util.copyObject(obj, orb);
- return result;
-
- } catch (InvocationTargetException e) {
- Throwable exCopy = (Throwable)Util.copyObject(e.getTargetException(), orb);
- MethodInfo methodInfo = interfaceInfo.getMethod(methodName);
- String[] exceptionTypes = methodInfo.getExceptionTypes();
- for (int i = 0; i < exceptionTypes.length; i++) {
- Class exceptionType =
- methodInfo.getMethod() != null ? methodInfo.getMethod().getExceptionTypes()[i]
- : loadClass(exceptionTypes[i]);
- if (exceptionType.isAssignableFrom(exCopy.getClass()))
- throw new ServiceRuntimeException(exCopy); // FIXME should
- // be business
- // exception?
- }
- throw Util.wrapException(exCopy);
- } catch (Throwable e) {
- // Other exceptions thrown from "invoke"
- throw new ServiceRuntimeException(e);
- } finally {
- stub._servant_postinvoke(so);
- }
- }
-
- /**
- * Invoke a method on a remote CORBA object
- *
- * @param stub The remote stub
- * @param methodName The name of the method
- * @param args Argument list
- * @return
- * @throws RemoteException
- * @throws ServiceBusinessException
- */
- private Object invokeRemoteCORBACall(ObjectImpl stub, String methodName, Object[] args) throws RemoteException {
-
- try {
- String operation = getOperation(methodName);
-
- MethodInfo methodInfo = interfaceInfo.getMethod(methodName);
- if (methodInfo == null) {
- throw new ServiceRuntimeException("Invalid Method " + methodName);
- }
- Class[] parameterTypes = null;
- Class returnType = null;
- if (methodInfo.getMethod() != null) {
- parameterTypes = methodInfo.getMethod().getParameterTypes();
- returnType = methodInfo.getMethod().getReturnType();
- } else {
- String[] types = methodInfo.getParameterTypes();
- if (args != null) {
- if (types.length != args.length)
- throw new ServiceRuntimeException(
- "The argument list doesn't match the method signature of " + methodName);
- }
-
- parameterTypes = new Class[types.length];
- for (int i = 0; i < types.length; i++) {
- parameterTypes[i] = loadClass(types[i]);
- }
- returnType = loadClass(methodInfo.getReturnType());
- }
-
- InputStream in = null;
- try {
- OutputStream out = (OutputStream)stub._request(operation, true);
-
- for (int i = 0; i < parameterTypes.length; i++) {
- // Object arg = (args.length < i) ? null : args[i];
- writeValue(out, args[i], parameterTypes[i]);
- }
- if (returnType == void.class) {
- // void return
- stub._invoke(out);
- return null;
- } else {
- // read the return value
- in = (InputStream)stub._invoke(out);
- Object response = readValue(in, returnType);
- return response;
- }
-
- } catch (ApplicationException ex) {
- in = (InputStream)ex.getInputStream();
- try {
- org.apache.tuscany.sca.binding.ejb.corba.Java2IDLUtil.throwException(methodInfo.getMethod(), in);
- return null;
- } catch (Throwable e) {
- throw new RemoteException(e.getMessage(), e);
- }
- } catch (RemarshalException ex) {
- return invokeRemoteCORBACall(stub, methodName, args);
- } finally {
- stub._releaseReply(in);
- }
- } catch (SystemException ex) {
- throw Util.mapSystemException(ex);
- }
- }
-
- /**
- * @param out
- * @param value
- * @param type
- */
- private void writeValue(OutputStream out, Object value, Class type) {
- org.apache.tuscany.sca.binding.ejb.corba.Java2IDLUtil.writeObject(type, value, out);
- }
-
- /**
- * @param in
- * @param type
- * @return
- */
- private Object readValue(InputStream in, Class type) {
- return org.apache.tuscany.sca.binding.ejb.corba.Java2IDLUtil.readObject(type, in);
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBLocator.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBLocator.java
deleted file mode 100644
index 0b97f42746..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBLocator.java
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ejb.util;
-
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.omg.CORBA.ORB;
-import org.omg.CosNaming.NamingContextExt;
-
-/**
- * CosNaming utility
- *
- * @version $Rev$ $Date$
- */
-class EJBLocator {
-
- /*
- * Root Context Initial Reference Key ------------
- * ----------------------------------- Server Root NameServiceServerRoot
- * Cell Persistent Root NameServiceCellPersistentRoot Cell Root
- * NameServiceCellRoot, NameService Node Root NameServiceNodeRoot
- */
- public static final String SERVER_ROOT = "NameServiceServerRoot";
- public static final String CELL_PERSISTENT_ROOT = "NameServiceCellPersistentRoot";
- public static final String CELL_ROOT = "NameServiceCellRoot";
- public static final String NODE_ROOT = "NameServiceNodeRoot";
- public static final String DEFAULT_ROOT = "NameService"; // Same as
- // CELL_ROOT
-
- public static final String DEFAULT_HOST = "127.0.0.1"; // Default host name
- // or IP address for
- // WebSphere
- public static final int DEFAULT_NAMING_PORT = 2809; // Default port
- public static final String NAMING_SERVICE = "NameService"; // The name of
- // the naming
- // service
- private static final Set<String> ROOTS =
- new HashSet<String>(Arrays.asList(new String[] {SERVER_ROOT, CELL_PERSISTENT_ROOT, CELL_ROOT, DEFAULT_ROOT,
- NODE_ROOT}));
-
- // private static final String CHARS_TO_ESCAPE = "\\/.";
- private static final String RFC2396 =
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789;/:?@&=+$,-_.!~*'()";
- private static final String HEX = "0123456789ABCDEF";
-
- private String hostName = DEFAULT_HOST;
- private int port = DEFAULT_NAMING_PORT;
- private String root = SERVER_ROOT;
-
- private ORB orb = null;
- private ObjectLocator locator = null;
- private boolean managed = true;
-
- EJBLocator(boolean managed) {
- this.managed = managed;
- if (!managed) {
- String url = AccessController.doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty(Context.PROVIDER_URL);
- }
- });
- processCorbaURL(url);
- }
- }
-
- EJBLocator(String hostName, int port) {
- this.hostName = (hostName == null) ? DEFAULT_HOST : hostName;
- this.port = port > 0 ? port : DEFAULT_NAMING_PORT;
- this.root = SERVER_ROOT;
- }
-
- EJBLocator(String hostName, int port, String root) {
- this(hostName, port);
- if (ROOTS.contains(root)) {
- this.root = root;
- } else {
- throw new IllegalArgumentException(root + " is not a legal root");
- }
- }
-
- EJBLocator(String corbaName, boolean managed) {
- this.managed = managed;
- if (corbaName.startsWith("corbaname:iiop:")) {
- processCorbaURL(corbaName);
- } else {
- throw new IllegalArgumentException(corbaName + " is not a legal corbaname");
- }
- }
-
- private void processCorbaURL(String url) {
- if (url != null && (url.startsWith("corbaname:iiop:") || url.startsWith("corbaloc:iiop:"))) {
- /**
- * corbaname:iiop:<hostName>:<port>/<root>#name corbaloc:iiop:<hostname>:<port>/<root>
- * For example,
- * "corbaname:iiop:localhost:2809/NameServiceServerRoot#ejb/MyEJBHome";
- * or "corbaloc:iiop:myhost:2809/NameServiceServerRoot"
- */
- String[] parts = url.split("(:|/|#)");
- if (parts.length > 2 && parts[2].length() > 0) {
- hostName = parts[2]; // The host name
- int index = hostName.lastIndexOf('@'); // version@hostname
- if (index != -1) {
- hostName = hostName.substring(index + 1);
- }
- }
- if (parts.length > 3 && parts[3].length() > 0) {
- port = Integer.parseInt(parts[3]); // The port number
- }
- if (parts.length > 4 && parts[4].length() > 0) {
- root = parts[4]; // The root of naming
- }
- }
- }
-
- /**
- * The corbaloc and corbaname formats enable you to provide a URL to access
- * CORBA objects. Use the corbaloc format for resolving to a particular
- * CORBAservice without going through a naming service. Use the corbaname
- * format to resolve a stringified name from a specific naming context.
- */
-
- /**
- * corbaname Syntax The full corbaname BNF is: &lt;corbaname&gt; =
- * "corbaname:"&lt;corbaloc_obj&gt;["#"&lt;string_name&gt;]
- * &lt;corbaloc_obj&gt; = &lt;obj_addr_list&gt; ["/"&lt;key_string&gt;]
- * &lt;obj_addr_list&gt; = as defined in a corbaloc URL &lt;key_string&gt; =
- * as defined in a corbaloc URL &lt;string_name&gt;= stringified Name
- * empty_string Where:
- * <ul>
- * <li>corbaloc_obj: portion of a corbaname URL that identifies the naming
- * context. The syntax is identical to its use in a corbaloc URL.
- * <li>obj_addr_list: as defined in a corbaloc URL
- * <li>key_string: as defined in a corbaloc URL.
- * <li>string_name: a stringified Name with URL escapes as defined below.
- * </ul>
- *
- * @param hostName The host name or IP address of the naming server
- * @param port The port number of the naming service
- * @param root The root of the namespace
- * @param name The JNDI name
- */
- private static String getCorbaname(String hostName, int port, String root, String name) {
- if (name == null) {
- return "corbaname:iiop:" + hostName + ":" + port + "/" + root;
- } else {
- return "corbaname:iiop:" + hostName + ":" + port + "/" + root + "#" + toCorbaname(name);
- }
- }
-
- String getCorbaname(String name) {
- return getCorbaname(hostName, port, root, name);
- }
-
- /**
- * Connect to the ORB.
- */
-
- // FIXME. May need to change the IBM classes if this binding is contributed
- // to Tuscany
- public ORB connect() {
- if (orb == null) {
- Properties props = new Properties();
- /*
- * This code is for IBM JVM props.put("org.omg.CORBA.ORBClass",
- * "com.ibm.CORBA.iiop.ORB");
- * props.put("com.ibm.CORBA.ORBInitRef.NameService",
- * getCorbaloc(NAMING_SERVICE));
- * props.put("com.ibm.CORBA.ORBInitRef.NameServiceServerRoot",
- * getCorbaloc("NameServiceServerRoot"));
- */
- orb = ORB.init((String[])null, props);
- }
- return orb;
- }
-
- /**
- * Replace substrings
- *
- * @param source The source string.
- * @param match The string to search for within the source string.
- * @param replace The replacement for any matching components.
- * @return
- */
- private static String replace(String source, String match, String replace) {
- int index = source.indexOf(match, 0);
- if (index >= 0) {
-
- // We have at least one match, so got to do the
- // work...
-
- StringBuffer result = new StringBuffer(source.length() + 16);
- int matchLength = match.length();
- int startIndex = 0;
-
- while (index >= 0) {
- result.append(source.substring(startIndex, index));
- result.append(replace);
- startIndex = index + matchLength;
- index = source.indexOf(match, startIndex);
- }
-
- // Grab the last piece, if any...
- if (startIndex < source.length()) {
- result.append(source.substring(startIndex));
- }
-
- return result.toString();
-
- } else {
- // No matches, just return the source...
- return source;
- }
- }
-
- /**
- * Resolved the JNDI name from the initial CosNaming context
- *
- * @param jndiName
- * @return resolved CORBA object
- * @throws NamingException
- */
- private static org.omg.CORBA.Object resovleString(NamingContextExt initCtx, String jndiName) throws NamingException {
- try {
- String name = stringify(jndiName);
- return initCtx.resolve_str(name);
- } catch (Exception e) {
- NamingException ne = new NamingException(e.getMessage());
- ne.setRootCause(e);
- throw ne;
- }
- }
-
- /**
- * Look up a CORBA object by its JNDI name
- *
- * @param jndiName
- * @return
- * @throws NamingException
- */
- org.omg.CORBA.Object stringToObject(String jndiName) throws NamingException {
- /*
- * Using an existing ORB and invoking string_to_object with a CORBA
- * object URL with multiple name server addresses to get an initial
- * context CORBA object URLs can contain more than one bootstrap server
- * address. Use this feature when attempting to obtain an initial
- * context from a server cluster. You can specify the bootstrap server
- * addresses for all servers in the cluster in the URL. The operation
- * will succeed if at least one of the servers is running, eliminating a
- * single point of failure. There is no guarantee of any particular
- * order in which the address list will be processed. For example, the
- * second bootstrap server address may be used to obtain the initial
- * context even though the first bootstrap server in the list is
- * available. An example of a corbaloc URL with multiple addresses
- * follows. obj =
- * orb.string_to_object("corbaloc::myhost1:9810,:myhost1:9811,:myhost2:9810/NameService");
- */
- String corbaName = null;
- if (jndiName.startsWith("corbaloc:") || jndiName.startsWith("corbaname:")) {
- // Keep the qualified URL
- corbaName = jndiName;
- } else {
- // Create a corbaname URL
- corbaName = getCorbaname(jndiName);
- }
-
- connect();
- org.omg.CORBA.Object obj = orb.string_to_object(corbaName);
- return obj;
- }
-
- private boolean isJndiConfigured() {
- if (managed)
- return true;
- Boolean provided = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
- public Boolean run() {
- String initCtxFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
- if (initCtxFactory == null) {
- URL file = Thread.currentThread().getContextClassLoader().getResource("jndi.properties");
- if (file != null) {
- return Boolean.TRUE;
- } else {
- return Boolean.FALSE;
- }
- } else {
- return Boolean.TRUE;
- }
- }
- });
- return provided.booleanValue();
- }
-
- /**
- * The character escape rules for the stringified name portion of an
- * corbaname are: US-ASCII alphanumeric characters are not escaped.
- * Characters outside this range are escaped, except for the following: ; / : ? @ & = + $ , - _ . ! ~ * ' ( )
- * corbaname Escape Mechanism The percent '%' character is used as an
- * escape. If a character that requires escaping is present in a name
- * component it is encoded as two hexadecimal digits following a "%"
- * character to represent the octet. (The first hexadecimal character
- * represent the highorder nibble of the octet, the second hexadecimal
- * character represents the low-order nibble.) If a '%' is not followed by
- * two hex digits, the stringified name is syntactically invalid.
- * @param s
- * @return RFC2396-encoded stringified name
- */
- static String encode2396(String s) {
- if (s == null) {
- return null;
- }
- StringBuffer encoded = new StringBuffer(s);
- for (int i = 0; i < encoded.length(); i++) {
- char c = encoded.charAt(i);
- if (RFC2396.indexOf(c) == -1) {
- encoded.setCharAt(i, '%');
- char[] ac = Integer.toHexString(c).toCharArray();
- if (ac.length == 2) {
- encoded.insert(i + 1, ac);
- } else if (ac.length == 1) {
- encoded.insert(i + 1, '0');
- encoded.insert(i + 2, ac[0]);
- } else {
- throw new IllegalArgumentException("Invalid character '" + c + "' in \"" + s + "\"");
- }
- i += 2; // NOPMD
- }
- }
- return encoded.toString();
- }
-
- /**
- * Decode an RFC2396-encoded string
- *
- * @param s
- * @return Plain string
- */
- static String decode2396(String s) {
- if (s == null) {
- return null;
- }
- StringBuffer decoded = new StringBuffer(s);
- for (int i = 0; i < decoded.length(); i++) {
- char c = decoded.charAt(i);
- if (c == '%') {
- if (i + 2 >= decoded.length()) {
- throw new IllegalArgumentException("Incomplete key_string escape sequence");
- }
- int j;
- j = HEX.indexOf(decoded.charAt(i + 1)) * 16 + HEX.indexOf(decoded.charAt(i + 2));
- decoded.setCharAt(i, (char)j);
- decoded.delete(i + 1, i + 3);
- } else if (RFC2396.indexOf(c) == -1) {
- throw new IllegalArgumentException("Invalid key_string character '" + c + "'");
- }
- }
- return decoded.toString();
- }
-
- /**
- * The backslash '\' character escapes the reserved meaning of '/', '.', and
- * '\' in a stringified name.
- *
- * @param jndiName
- * @return Escaped stringified name for CosNaming
- */
- private static String stringify(String jndiName) {
- // Escape . into \. since it's an INS naming delimiter
- return replace(encode2396(jndiName), ".", "\\.");
- }
-
- /**
- * Escape the "." into "%5C%2E"
- *
- * @param jndiName
- * @return corbaname treating "." as a literal
- */
- private static String toCorbaname(String jndiName) {
- // Escape . into %5C%2E (\.) since it's an INS naming delimiter
- // For example, sca.sample.StockQuote --->
- // sca%5C%2Esample%5C%2EStockQuote/StockQuote
- return replace(encode2396(jndiName), ".", "%5C%2E");
- }
-
- private ObjectLocator getObjectLocator() throws NamingException {
- if (locator != null) {
- return locator;
- }
- /*
- * For managed env, JNDI is assumed to be configured by default For
- * unmanaged environment, JNDI could have configured through
- * jndi.properties file
- */
- if (isJndiConfigured()) {
- locator = new JndiLocator();
- } else { // this is definitely JSE env without JNDI configured. Use
- // CORBA.
- locator = new CosNamingLocator();
- }
- return locator;
- }
-
- public Object locate(String jndiName) throws NamingException {
-
- Object result = getObjectLocator().locate(jndiName);
- return result;
- }
-
- private static interface ObjectLocator {
- Object locate(String name) throws NamingException;
- }
-
- private final class JndiLocator implements ObjectLocator {
- private Context context;
-
- private JndiLocator() throws NamingException {
- /*
- final Properties props = AccessController.doPrivileged(new PrivilegedAction<Properties>() {
- public Properties run() {
- return System.getProperties();
- }
- });
- Properties properties = new Properties();
- for (Map.Entry e : props.entrySet()) {
- String name = (String)e.getKey();
- if (name.startsWith("java.naming.")) {
- properties.setProperty(name, (String)e.getValue());
- }
- }
- // System.out.println(properties);
- this.context = new InitialContext(properties);
- */
- this.context = new InitialContext();
- }
-
- public Object locate(String name) throws NamingException {
- return context.lookup(name);
- }
- }
-
- private final class CosNamingLocator implements ObjectLocator {
- private NamingContextExt context;
-
- private CosNamingLocator() {
- }
-
- public Object locate(String name) throws NamingException {
- if (context != null) {
- return resovleString(context, name);
- } else {
- return stringToObject(name);
- }
- }
- }
-
- public void setHostEnv(boolean managed) {
- this.managed = managed;
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBObjectFactory.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBObjectFactory.java
deleted file mode 100644
index d34cfe1b16..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBObjectFactory.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.binding.ejb.util;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.rmi.RemoteException;
-import java.rmi.UnexpectedException;
-
-import javax.ejb.CreateException;
-import javax.ejb.EJBLocalHome;
-import javax.naming.NamingException;
-import javax.rmi.CORBA.Util;
-
-import org.omg.CORBA.SystemException;
-import org.omg.CORBA.portable.ApplicationException;
-import org.omg.CORBA.portable.ObjectImpl;
-import org.omg.CORBA.portable.RemarshalException;
-import org.omg.stub.java.rmi._Remote_Stub;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * Factor class that is used to create EJB Proxies.
- *
- * @version $Rev$ $Date$
- */
-final class EJBObjectFactory {
-
- private EJBObjectFactory() {
- }
-
- /**
- * Get either a generated of dynamic EJB stub using the specified JNDI
- * properties.
- * <p>
- * The returned stub will implement the specified stubInterface Interface.
- * If the underlying EJB stub is not assignable from the specified
- * stubInterface then a proxy is used to convert between the two.
- * <p>
- * The returned EJB stub may be either the pregenerated EJB stub or a
- * dynamic stub. This allows a client to invoke an EJB without requiring any
- * of the pregenerated EJB stub classes be available in the classpath.
- * <p>
- */
- static Object createStub(NamingEndpoint namingEndpoint, InterfaceInfo ejbInterface) throws NamingException,
- RemoteException, CreateException {
-
- EJBLocator locator = namingEndpoint.getLocator();
- Object homeObject = locator.locate(namingEndpoint.getJndiName());
- /*
- * The type of the object returned from the lookup is as follows: If the
- * generated stub exists on the classpath, it's an instance of that
- * type, otherwise, "org.omg.stub.java.rmi._Remote_Stub" or
- * "org.omg.stub.javax.ejb._EJBHome_Stub"
- */
- Object stub = getEJBStub(homeObject, ejbInterface);
- // Cache dynamic stub only
- return stub;
- }
-
- /**
- * @param homeObject
- * @param ejbHomeClass
- * @return
- * @throws RemoteException
- */
- private static Object getEJBStub(Object homeObject, InterfaceInfo ejbInterface) throws RemoteException,
- CreateException {
-
- Object stub = null;
-
- // Get the business interface of the EJB
- Class ejbInterfaceClass = null;
- try {
- ejbInterfaceClass = Thread.currentThread().getContextClassLoader().loadClass(ejbInterface.getName());
- } catch (ClassNotFoundException e) {
- // ignore
- }
-
- if (ejbInterfaceClass != null && ejbInterfaceClass.isInstance(homeObject)) {
- // EJB 3
- stub = homeObject;
- } else if (homeObject instanceof EJBLocalHome) {
- // Local EJB
- stub = createEJBLocalObject(homeObject);
- } else {
- // Handle dynamic stub
- if (homeObject instanceof ObjectImpl) {
- ObjectImpl objectImpl = (ObjectImpl)homeObject;
- stub = createEJBObject(objectImpl);
- }/**
- * Above checks will be satisfied if Bean is running on servers like WebSphere. With this
- * logic, client (SCA composite with EJB ref binding) doesn't need to include home class or
- * client stubs.
- *
- * Below check is needed SCA composite with EJB ref binding is accessing openEJB implementation.
- * For e.g if the bean is running on Geronimo.
- */
- else if ((javax.rmi.PortableRemoteObject.narrow(homeObject, javax.ejb.EJBHome.class)) instanceof javax.ejb.EJBHome) {
- stub = createEJBObjectFromHome(homeObject);
- } else
- throw new ServiceRuntimeException("Invalid stub type: " + homeObject.getClass());
- }
- return stub;
- }
-
- /**
- * Create a pre-generated EJB stub
- *
- * @param homeObject
- * @return
- * @throws RemoteException
- */
- static private Object createEJBLocalObject(Object homeObject) throws RemoteException {
-
- Object stub = null;
- try {
- // Find the "create()" method
- Method createMethod = homeObject.getClass().getMethod("create", null);
- // Create an EJB object
- stub = createMethod.invoke(homeObject, null);
- } catch (NoSuchMethodException e) {
- // "create()" method not found, it's still a dynamic stub
- stub = null;
- } catch (InvocationTargetException e) {
- throw new RemoteException(e.getTargetException().toString());
- } catch (Exception e) {
- throw new RemoteException(e.toString());
- }
- return stub;
- }
-
- /**
- * Here homeObject is instance of EJBHome
- *
- * @param homeObject
- * @return
- * @throws RemoteException
- */
- private static Object createEJBObjectFromHome(Object homeObject) throws RemoteException {
-
- Object stub = null;
- try {
- // Find the "create()" method
- Method createMethod = homeObject.getClass().getMethod("create", null);
- // Create an EJB object
- stub = createMethod.invoke(homeObject, null);
- } catch (NoSuchMethodException e) {
- // "create()" method not found, it's still a dynamic stub
- stub = null;
- } catch (InvocationTargetException e) {
- throw new RemoteException(e.getTargetException().toString());
- } catch (Exception e) {
- throw new RemoteException(e.toString());
- }
- return stub;
- }
-
- /**
- * Create an EJBObject using RMI/IIOP APIs
- *
- * @param ejbHomeObject
- * @return The EJBObject remote stub
- * @throws CreateException
- * @throws RemoteException
- */
- private static Object createEJBObject(ObjectImpl ejbHomeObject) throws CreateException, RemoteException {
-
- try {
- org.omg.CORBA_2_3.portable.InputStream in = null;
- try {
- org.omg.CORBA.portable.OutputStream out = ejbHomeObject._request("create", true);
- in = (org.omg.CORBA_2_3.portable.InputStream)ejbHomeObject._invoke(out);
- // The Remote stub should be available in JDK
- // TODO: [rfeng] Work around an issue in Apache Yoko which doesn't understand the org.omg.stub.*
- return in.read_Object(_Remote_Stub.class);
- } catch (ApplicationException ex) {
- in = (org.omg.CORBA_2_3.portable.InputStream)ex.getInputStream();
- String id = in.read_string();
- if (id.equals("IDL:javax/ejb/CreateEx:1.0")) {
- throw (CreateException)in.read_value(CreateException.class);
- }
- throw new UnexpectedException(id);
- } catch (RemarshalException ex) {
- return createEJBObject(ejbHomeObject);
- } finally {
- ejbHomeObject._releaseReply(in);
- }
- } catch (SystemException ex) {
- throw Util.mapSystemException(ex);
- }
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBStubHelper.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBStubHelper.java
deleted file mode 100644
index b699a02d1d..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/EJBStubHelper.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.ejb.util;
-
-import java.rmi.RemoteException;
-
-import javax.ejb.CreateException;
-import javax.naming.NamingException;
-
-import org.osoa.sca.ServiceRuntimeException;
-import org.osoa.sca.ServiceUnavailableException;
-
-final class EJBStubHelper {
-
- private static Object stub;
- private static ServiceRuntimeException exception;
-
- private EJBStubHelper() {
- }
-
- /**
- * @param owner
- * @param jndiName
- * @return
- */
-
- static Object lookup(NamingEndpoint endpoint, InterfaceInfo ejbInterface) {
- return getStub(endpoint, ejbInterface);
- }
-
- private static Object getStub(NamingEndpoint namingEndpoint, InterfaceInfo ejbInterface) {
- try {
- stub = EJBObjectFactory.createStub(namingEndpoint, ejbInterface);
- } catch (NamingException e) {
- exception = new ServiceUnavailableException(e);
- e.printStackTrace();
- throw (ServiceUnavailableException)exception;
- } catch (CreateException e) {
- exception = new ServiceUnavailableException(e);
- throw (ServiceUnavailableException)exception;
- } catch (RemoteException e) {
- exception = new ServiceRuntimeException(e);
- throw (ServiceRuntimeException)exception;
- }
-
- if (exception == null) {
- return stub; // Normal result
- } else {
- throw exception; // Throw the exception
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/InterfaceInfo.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/InterfaceInfo.java
deleted file mode 100644
index e60e526e01..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/InterfaceInfo.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.binding.ejb.util;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.apache.tuscany.sca.binding.ejb.corba.Java2IDLUtil;
-
-/**
- * The signature for a java interface
- *
- * @version $Rev$ $Date$
- */
-class InterfaceInfo implements Serializable {
-
- private static final Map<Class, InterfaceInfo> INTERFACES =
- Collections.synchronizedMap(new WeakHashMap<Class, InterfaceInfo>());
-
- private static final long serialVersionUID = 2314533906465094860L;
- private String name;
-
- private Map<String, MethodInfo> methods = new HashMap<String, MethodInfo>();
-
- InterfaceInfo(final Class iface) {
- super();
- if (iface == null) {
- throw new IllegalArgumentException("The interface cannot be null");
- }
- this.name = iface.getName();
- // SECURITY
- /*
- * Permission: accessDeclaredMembers : Access denied
- * (java.lang.RuntimePermission accessDeclaredMembers)
- */
- Map idlNames = AccessController.doPrivileged(new PrivilegedAction<Map>() {
- public Map run() {
- return Java2IDLUtil.mapMethodToOperation(iface);
- }
- });
- Iterator i = idlNames.entrySet().iterator();
- while (i.hasNext()) {
- Map.Entry entry = (Map.Entry)i.next();
- Method method = (Method)entry.getKey();
- MethodInfo methodInfo = new MethodInfo(method);
- methodInfo.setIDLName((String) entry.getValue());
- methods.put(method.getName(), methodInfo);
- methods.put(methodInfo.getIDLName(), methodInfo);
- }
- }
-
- static final synchronized InterfaceInfo getInstance(final Class iface) {
- InterfaceInfo info = (InterfaceInfo)INTERFACES.get(iface);
- if (info == null) {
- info = new InterfaceInfo(iface);
- INTERFACES.put(iface, info);
- }
- return info;
- }
-
- /**
- * @return
- */
- Map<String, MethodInfo> getMethods() {
- return methods;
- }
-
- /**
- * @return
- */
- MethodInfo getMethod(String name) {
- return (MethodInfo)methods.get(name);
- }
-
- /**
- * @return
- */
- String getName() {
- return name;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("interface ").append(name).append("{ \n");
- Iterator i = methods.values().iterator();
- while (i.hasNext()) {
- MethodInfo methodInfo = (MethodInfo)i.next();
- sb.append("\t").append(methodInfo).append("\n");
- }
- sb.append("};\n");
- return sb.toString();
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/JavaReflectionAdapter.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/JavaReflectionAdapter.java
deleted file mode 100644
index 5e7d6761d9..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/JavaReflectionAdapter.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.ejb.util;
-
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * An adapter for java classes, indexes the methods by name and provides an
- * invoke method that takes a method name.
- *
- * @version $Rev$ $Date$
- */
-final class JavaReflectionAdapter {
-
- private static Map<Class, JavaReflectionAdapter> adapters =
- Collections.synchronizedMap(new WeakHashMap<Class, JavaReflectionAdapter>());
-
- private static final Map<Class, Object> DEFAULT_VALUES = new HashMap<Class, Object>();
- static {
- DEFAULT_VALUES.put(boolean.class, Boolean.FALSE);
- DEFAULT_VALUES.put(byte.class, new Byte((byte)0));
- DEFAULT_VALUES.put(char.class, new Character((char)0));
- DEFAULT_VALUES.put(short.class, new Short((short)0));
- DEFAULT_VALUES.put(int.class, Integer.valueOf(0));
- DEFAULT_VALUES.put(long.class, new Long(0));
- DEFAULT_VALUES.put(float.class, new Float(0.0));
- DEFAULT_VALUES.put(double.class, new Double(0.0));
- }
-
- private Map<String, Method> methodMap = new HashMap<String, Method>();
-
- /**
- * Constructor
- *
- * @param clazz
- */
- private JavaReflectionAdapter(final Class clazz) {
- // Index the methods on the implementation class
- // FIXME J2 Security - promote this to callers of this method
- Method[] methods = AccessController.doPrivileged(new PrivilegedAction<Method[]>() {
- public Method[] run() {
- return clazz.getMethods();
- }
- });
- for (int i = 0; i < methods.length; i++) {
- methodMap.put(methods[i].getName(), methods[i]);
- }
- }
-
- /**
- * Create a java reflection adapter
- *
- * @param clazz
- */
- static synchronized JavaReflectionAdapter createJavaReflectionAdapter(Class clazz) {
- JavaReflectionAdapter adapter = (JavaReflectionAdapter)adapters.get(clazz);
- if (adapter == null) {
- adapter = new JavaReflectionAdapter(clazz);
- adapters.put(clazz, adapter);
- }
- return adapter;
- }
-
- /**
- * Return the specified method
- *
- * @param methodName
- * @return
- * @throws NoSuchMethodException
- */
- Method getMethod(String methodName) throws NoSuchMethodException {
-
- Method method = (Method)methodMap.get(methodName);
- if (method == null) {
- throw new NoSuchMethodException(methodName);
- }
- return method;
- }
-
- /**
- * Returns a map containing the methods on the class, keyed by name
- *
- * @return
- */
- Map getMethods() {
- return methodMap;
- }
-
- /**
- * Invoke a method using Java reflection.
- *
- * @param method
- * @param object
- * @param args
- * @return
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- */
- Object invoke(Method method, Object object, Object[] args) throws InvocationTargetException,
- IllegalAccessException {
- Class[] parameterTypes = method.getParameterTypes();
- for (int i = 0; i < parameterTypes.length; i++) {
- Class parameterType = parameterTypes[i];
- if (args[i] == null && parameterType.isPrimitive()) {
- args[i] = DEFAULT_VALUES.get(parameterType);
- }
- }
- return method.invoke(object, args);
- }
-
- /**
- * Set the java bean property
- *
- * @param bean
- * @param propertyName
- * @param value
- * @return
- */
- boolean setProperty(Object bean, String propertyName, Object value) {
- try {
- PropertyDescriptor propertyDescriptor = new PropertyDescriptor(propertyName, bean.getClass());
- Method writeMethod = propertyDescriptor.getWriteMethod();
- writeMethod.invoke(bean, new Object[] {value});
- return true;
- } catch (InvocationTargetException e) {
- throw new ServiceRuntimeException(e.getTargetException());
- } catch (Exception e) {
- return false;
- }
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/MethodInfo.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/MethodInfo.java
deleted file mode 100644
index e7ea7c9077..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/MethodInfo.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.binding.ejb.util;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * MetaData for a java method
- *
- * @version $Rev$ $Date$
- */
-class MethodInfo implements Serializable {
-
- /** Automatically generated javadoc for: serialVersionUID */
- private static final long serialVersionUID = -5557260979514687514L;
- private String name;
- private String returnType;
- private String[] parameterTypes;
- private String[] exceptionTypes;
-
- private String IDLName;
-
- private transient Method method;
-
- /**
- * Type Signature Java Type -------------- --------- Z boolean B byte C char
- * S short I int J long F float D double L fully-qualified-class ;
- * fully-qualified-class [ type type[] ( arg-types ) ret-type method type
- */
- private static final Map signatures = new HashMap();
- static {
- signatures.put("Z", boolean.class);
- signatures.put("B", byte.class);
- signatures.put("C", char.class);
- signatures.put("S", short.class);
- signatures.put("I", int.class);
- signatures.put("J", long.class);
- signatures.put("F", float.class);
- signatures.put("D", double.class);
- signatures.put("V", void.class);
- }
-
- MethodInfo(Method method) {
- this.method = method;
- this.name = method.getName();
- // this.declaringClass = method.getDeclaringClass().getName();
- this.returnType = method.getReturnType().getName();
- Class[] types = method.getParameterTypes();
- this.parameterTypes = new String[types.length];
- for (int i = 0; i < types.length; i++) {
- this.parameterTypes[i] = types[i].getName();
- }
- types = method.getExceptionTypes();
- this.exceptionTypes = new String[types.length];
- for (int i = 0; i < types.length; i++) {
- this.exceptionTypes[i] = types[i].getName();
- }
- IDLName = this.name;
- }
-
- MethodInfo(String name, String returnType, String[] parameterTypes, String[] exceptionTypes) {
- this.name = name;
- this.returnType = returnType;
- this.parameterTypes = parameterTypes;
- this.exceptionTypes = exceptionTypes;
- this.IDLName = name;
- }
-
- /**
- * Parse the class name from the internal signature Sample signatures: int
- * ---> I; int[] ---> [I Object ---> java/lang/Object Object[] --->
- * [Ljava/lang/Object;
- *
- * @param value
- * @return
- */
- private static String getName(String signature) {
- String name = signature;
- // Remove leading ARRAY ([) signatures
- int index = name.lastIndexOf('[');
- if (index != -1)
- name = name.substring(index + 1);
-
- // Remove L<...>;
- if (name.charAt(0) == 'L' && name.charAt(name.length() - 1) == ';')
- name = name.substring(1, name.length() - 1);
-
- // Primitive types
- Class primitiveClass = (Class)signatures.get(name);
- if (primitiveClass != null) {
- name = primitiveClass.getName();
- }
-
- for (int i = 0; i < index + 1; i++) {
- name = name + "[]";
- }
- return name;
- }
-
- /**
- * @return
- */
- String getName() {
- return name;
- }
-
- /**
- * @return
- */
- String[] getParameterTypes() {
- return parameterTypes;
- }
-
- /**
- * @return
- */
- String getReturnType() {
- return returnType;
- }
-
- /**
- * @return
- */
- String[] getExceptionTypes() {
- return exceptionTypes;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append(getName(returnType)).append(" ").append(name).append("(");
- for (int j = 0; j < parameterTypes.length; j++) {
- sb.append(getName(parameterTypes[j])).append(" ").append("arg" + j);
- if (j < (parameterTypes.length - 1))
- sb.append(", ");
- }
- sb.append(")");
- if (exceptionTypes.length > 0) {
- sb.append(" throws ");
- for (int k = 0; k < exceptionTypes.length; k++) {
- sb.append(exceptionTypes[k]);
- if (k < (exceptionTypes.length - 1))
- sb.append(", ");
- }
- }
- sb.append(";");
- return sb.toString();
- }
-
- /**
- * @return Returns the iDLName.
- */
- String getIDLName() {
- return IDLName;
- }
-
- /**
- * @param name The iDLName to set.
- */
- void setIDLName(String name) {
- IDLName = name;
- }
-
- /**
- * @return the method
- */
- Method getMethod() {
- return method;
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/NamingEndpoint.java b/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/NamingEndpoint.java
deleted file mode 100644
index 346b7c5cf6..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/util/NamingEndpoint.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.binding.ejb.util;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-public class NamingEndpoint {
- private String jndiName;
- private EJBLocator locator;
- private boolean managed = true;
-
- public NamingEndpoint(String hostName, int port, String jndiName) {
- this.jndiName = jndiName;
- this.locator = new EJBLocator(hostName, port);
- }
-
- public NamingEndpoint(String name) {
-
- /**
- * by default it's a managed environment means SCA composite with ref
- * binding is running on an AppServer. If running on J2SE, pass
- * -Dmanaged=false for the VM
- */
- final String managedEnv = AccessController.doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty("managed");
- }
- });
-
- if (managedEnv != null) {
- managed = Boolean.valueOf(managedEnv);
- }
-
- if ((!managed) && name.startsWith("corbaname:iiop:")) {
- /**
- * if (name.startsWith("corbaname:iiop:")) { corbaname:iiop:<hostName>:<port>/<root>#name
- * For example,
- * "corbaname:iiop:localhost:2809/NameServiceServerRoot#ejb/MyEJBHome";
- */
-
- String[] parts = split(name, '#');
- if (parts.length != 2) {
- throw new IllegalArgumentException("Invalid corbaname: " + name);
- }
-
- this.jndiName = name; // The logical JNDI name
- this.locator = new EJBLocator(parts[0], managed);
-
- } else {
- this.jndiName = name;
- this.locator = new EJBLocator(managed);
- }
-
- }
-
- private static String[] split(String str, char ch) {
- int index = str.lastIndexOf(ch);
- if (index == -1) {
- return new String[] {str, ""};
- } else {
- return new String[] {str.substring(0, index), str.substring(index + 1)};
- }
- }
-
- /**
- * @return Returns the jndiName.
- */
- public String getJndiName() {
- return jndiName;
- }
-
- public EJBLocator getLocator() {
- return locator;
- }
-
- public String getCorbaname() {
- return locator.getCorbaname(jndiName);
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof NamingEndpoint) {
- NamingEndpoint endpoint = (NamingEndpoint)obj;
- return jndiName.equals(endpoint.jndiName);
- }
- return false;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return jndiName.hashCode();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return jndiName;
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-ejb-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index a89f711da9..0000000000
--- a/branches/sca-android/modules/binding-ejb-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.ejb.provider.EJBBindingProviderFactory;model=org.apache.tuscany.sca.binding.ejb.EJBBinding
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/main/resources/binding-ejb-validation-messages.properties b/branches/sca-android/modules/binding-ejb-runtime/src/main/resources/binding-ejb-validation-messages.properties
deleted file mode 100644
index 28477dd3ac..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/main/resources/binding-ejb-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.
-#
-#
-UnknownEJBSessionType = Unknown EJB Session Type of {0} for {1}
-UnknownEJBVersion = Unknown EJB Version of {0} for {1}
-
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/BankManagerFacade.java b/branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/BankManagerFacade.java
deleted file mode 100644
index 28dafedaeb..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/BankManagerFacade.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 account;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- *
- * Compatible EJB interface
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface BankManagerFacade {
- Double getAccountBalance( String accountNo );
- void changeAccountBalance( String accountNo, Double balance );
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/Customer.java b/branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/Customer.java
deleted file mode 100644
index 49ece71f7a..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/Customer.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 account;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface Customer {
-
- /**
- * This method deposits the amount. method accesses external EJB to get the
- * current balance and add the amount to existing balance.
- *
- * @param accountNo The number of the account into which to deposit the money
- * @param amount The amount to be deposited
- * @return total amount in customer account after deposit
- */
- Double depositAmount(java.lang.String accountNo, Double amount);
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/CustomerImpl.java b/branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/CustomerImpl.java
deleted file mode 100644
index 3d3f785a50..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/account/CustomerImpl.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 account;
-
-import org.osoa.sca.ServiceRuntimeException;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Service;
-
-import calculator.AddService;
-
-@Service(Customer.class)
-public class CustomerImpl implements Customer {
-
- private AddService extEJBService = null;
-
- public AddService getExtEJBService() {
- return extEJBService;
- }
-
- @Reference
- public void setExtEJBService(AddService extEJBService) {
- this.extEJBService = extEJBService;
- }
-
- // this method invokes external EJB through EJB reference binding
- public Double depositAmount(java.lang.String accountNo, Double amount) {
-
- Double total = null;
-
- System.out.println("In component implementation. Invoking external EJB through EJB reference binding ");
-
- try {
- Double balance = extEJBService.add(amount.doubleValue(), 1000); //invoke external ejb through ejb reference binding
- total = balance + amount;
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- return total;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/calculator/AddService.java b/branches/sca-android/modules/binding-ejb-runtime/src/test/java/calculator/AddService.java
deleted file mode 100644
index 7cefba530a..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/calculator/AddService.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 calculator;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface AddService {
- double add(double n1, double n2);
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceHome.java b/branches/sca-android/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceHome.java
deleted file mode 100644
index 799bcaa672..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceHome.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 java.rmi.RemoteException;
-
-import javax.ejb.CreateException;
-import javax.ejb.EJBHome;
-
-public interface AddServiceHome extends EJBHome {
-
- AddService create() throws CreateException, RemoteException;
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/geronimo/samples/bank/ejb/BankManagerFacade.java b/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/geronimo/samples/bank/ejb/BankManagerFacade.java
deleted file mode 100644
index e480e648d9..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/geronimo/samples/bank/ejb/BankManagerFacade.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.
- */
-
-/*
- * Generated by XDoclet - Do not edit!
- */
-package org.apache.geronimo.samples.bank.ejb;
-
-// copied from the Geronimo Bank sample: http://cwiki.apache.org/GMOxDOC11/ejb-sample-application.html#EJBsampleapplication-overview
-
-/**
- * Remote interface for BankManagerFacadeBean.
- * @xdoclet-generated at ${TODAY}
- * @copyright The XDoclet Team
- *
- * @version $Rev$ $Date$
- */
-public interface BankManagerFacade
- extends javax.ejb.EJBObject
-{
-
- void changeAccountBalance( java.lang.String accountNo,java.lang.Double balance )
- throws java.rmi.RemoteException;
-
- java.lang.Double getAccountBalance( java.lang.String accountNo )
- throws java.rmi.RemoteException;
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/geronimo/samples/bank/ejb/BankManagerFacadeHome.java b/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/geronimo/samples/bank/ejb/BankManagerFacadeHome.java
deleted file mode 100644
index 0d02be3b95..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/geronimo/samples/bank/ejb/BankManagerFacadeHome.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.
- */
-
-/*
- * Generated by XDoclet - Do not edit!
- */
-
-// copied from the Geronimo Bank sample: http://cwiki.apache.org/GMOxDOC11/ejb-sample-application.html#EJBsampleapplication-overview
-
-package org.apache.geronimo.samples.bank.ejb;
-
-/**
- * Home interface for BankManagerFacadeBean.
- * @xdoclet-generated at ${TODAY}
- * @copyright The XDoclet Team
- *
- * @version $Rev$ $Date$
- */
-public interface BankManagerFacadeHome
- extends javax.ejb.EJBHome
-{
- String COMP_NAME="java:comp/env/ejb/BankManagerFacadeBean";
- String JNDI_NAME="org.apache.geronimo.samples.bank.ejb.BankManagerFacadeBean";
-
- org.apache.geronimo.samples.bank.ejb.BankManagerFacade create()
- throws javax.ejb.CreateException,java.rmi.RemoteException;
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/EJBReferenceTestCase.java b/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/EJBReferenceTestCase.java
deleted file mode 100644
index 82471acb16..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/EJBReferenceTestCase.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.ejb.tests;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import account.Customer;
-
-/**
- * Invokes the component which calls the reference using the EJB binding
- *
- * @version $Rev$ $Date$
- */
-public class EJBReferenceTestCase extends TestCase {
- private static final int MOCK_PORT = 8085;
- private SCADomain scaDomain;
-
- @Override
- protected void setUp() throws Exception {
- System.setProperty("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
- System.setProperty("java.naming.provider.url", "ejbd://localhost:" + MOCK_PORT);
- System.setProperty("managed", "false");
-
- scaDomain = SCADomain.newInstance("account/account.composite");
-
- // To capture the network traffic for the MockServer, uncomment the next line
- // new Thread(new SocketTracer(MOCK_PORT, OPENEJB_PORT)).start();
-
- // Start the mock server to simulate the remote EJB
- new Thread(new MockServer(MOCK_PORT)).start();
-
- // Wait enough for the server to be started
- Thread.sleep(500);
- }
-
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- public void testCalculator() throws Exception {
- Customer customer = scaDomain.getService(Customer.class, "CustomerComponent");
- // This is one of the customer numbers in bank application running on Geronimo
- String accountNo = "1234567890";
- Double balance = customer.depositAmount(accountNo, new Double(100));
- // System.out.println("Balance amount for account " + accountNo + " is $" + balance);
- assertEquals(1200.0, balance);
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/MockServer.java b/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/MockServer.java
deleted file mode 100644
index 48e87fb6d1..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/MockServer.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.binding.ejb.tests;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.ServerSocket;
-import java.net.Socket;
-
-public class MockServer implements Runnable {
-
- private int listen;
- byte[][] seq =
- {
- {79, 69, 74, 80, 47, 51, 46, 48, 1, -84, -19, 0, 5, 119, 58, 1, 27, 0, 54, 47, 104, 101, 108, 108, 111, 45,
- 97, 100, 100, 115, 101, 114, 118, 105, 99, 101, 47, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 66, 101,
- 97, 110, 47, 99, 97, 108, 99, 117, 108, 97, 116, 111, 114, 46, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101,
- 112},
-
- {79, 69, 74, 80, 47, 50, 46, 48, -84, -19, 0, 5, 119, 3, 1, 13, 1, 118, 114, 0, 25, 99, 97, 108, 99, 117, 108,
- 97, 116, 111, 114, 46, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 72, 111, 109, 101, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 120, 112, 118, 114, 0, 21, 99, 97, 108, 99, 117, 108, 97, 116, 111, 114, 46, 65, 100, 100, 83,
- 101, 114, 118, 105, 99, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 112, 112, 112, 119, 38, 7, 0, 31, 104,
- 101, 108, 108, 111, 45, 97, 100, 100, 115, 101, 114, 118, 105, 99, 101, 47, 65, 100, 100, 83, 101, 114, 118,
- 105, 99, 101, 66, 101, 97, 110, -1, -1, 0, 0},
-
- {79, 69, 74, 80, 47, 51, 46, 48, 0, -84, -19, 0, 5, 119, 1, 10, 116, 0, 31, 104, 101, 108, 108, 111, 45, 97,
- 100, 100, 115, 101, 114, 118, 105, 99, 101, 47, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 66, 101, 97,
- 110, 119, 2, -1, -1, 112, 119, 1, 1, 112, 118, 114, 0, 25, 99, 97, 108, 99, 117, 108, 97, 116, 111, 114, 46,
- 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 72, 111, 109, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 112,
- 119, 9, 0, 6, 99, 114, 101, 97, 116, 101, 0},
- {79, 69, 74, 80, 47, 50, 46, 48, -84, -19, 0, 5, 119, 2, 1, 4, 112},
-
- {79, 69, 74, 80, 47, 51, 46, 48, 0, -84, -19, 0, 5, 119, 1, 23, 116, 0, 31, 104, 101, 108, 108, 111, 45, 97,
- 100, 100, 115, 101, 114, 118, 105, 99, 101, 47, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 66, 101, 97,
- 110, 119, 2, -1, -1, 112, 119, 1, 1, 112, 118, 114, 0, 21, 99, 97, 108, 99, 117, 108, 97, 116, 111, 114, 46,
- 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 112, 119, 24, 0, 3, 97,
- 100, 100, 2, 4, 64, 89, 0, 0, 0, 0, 0, 0, 4, 64, -113, 64, 0, 0, 0, 0, 0},
- {79, 69, 74, 80, 47, 50, 46, 48, -84, -19, 0, 5, 119, 2, 1, 4, 115, 114, 0, 16, 106, 97, 118, 97, 46, 108, 97,
- 110, 103, 46, 68, 111, 117, 98, 108, 101, -128, -77, -62, 74, 41, 107, -5, 4, 2, 0, 1, 68, 0, 5, 118, 97,
- 108, 117, 101, 120, 114, 0, 16, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 78, 117, 109, 98, 101, 114,
- -122, -84, -107, 29, 11, -108, -32, -117, 2, 0, 0, 120, 112, 64, -111, 48, 0, 0, 0, 0, 0}
-
- };
-
- public MockServer(int listen) {
- this.listen = listen;
- }
-
- public void run() {
- try {
- ServerSocket ss = new ServerSocket(listen);
- for (int i = 0; i < seq.length; i += 2) {
- // System.out.println("Processing request[" + i/2 + "]");
- doExchange(ss.accept(), seq[i], seq[i + 1]);
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void doExchange(Socket socket, byte[] read, byte[] write) throws IOException, InterruptedException {
- Thread t2 = readBytes(socket, read.length);
- Thread t1 = writeBytes(socket, write);
- t1.join();
- t2.join();
- socket.close();
- }
-
- private Thread readBytes(Socket socket, int x) throws IOException, InterruptedException {
- byte[] buf = new byte[x];
- Thread t = new Reader(socket, buf);
- t.start();
- return t;
- }
-
- private Thread writeBytes(Socket socket, byte[] bs) throws IOException, InterruptedException {
- Thread t = new Writer(socket, bs);
- t.start();
- return t;
- }
-
- private static class Reader extends Thread {
-
- private InputStream is;
- private byte[] buf;
-
- Reader(Socket socket, byte[] buf) throws IOException {
- this.is = socket.getInputStream();
- this.buf = buf;
- }
-
- @Override
- public void run() {
- try {
- int totalSize = buf.length;
- int readSize = 0;
- int offset = 0;
- while (totalSize > 0 && (readSize = is.read(buf, offset, totalSize)) != -1) {
- offset += readSize;
- totalSize -= readSize;
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- }
-
- private static class Writer extends Thread {
-
- private OutputStream os;
- private byte[] buf;
-
- Writer(Socket socket, byte[] buf) throws IOException {
- this.os = socket.getOutputStream();
- this.buf = buf;
- }
-
- @Override
- public void run() {
- try {
- os.write(buf);
- os.flush();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/SocketTracer.java b/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/SocketTracer.java
deleted file mode 100644
index 66b3feb458..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/SocketTracer.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.binding.ejb.tests;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.ServerSocket;
-import java.net.Socket;
-
-/**
- * Displays the bytes flowing across a Socket connection.
- * Used to get the read count and reply data for the MockServer
- *
- * @version $Rev$ $Date$
- */
-public class SocketTracer implements Runnable {
-
- private int listen;
- private int send;
-
- SocketTracer(int listen, int send) {
- this.listen = listen;
- this.send = send;
- }
-
- public void run() {
- try {
- ServerSocket ss = new ServerSocket(listen);
- while (true) {
- Socket sin = ss.accept();
-
- Socket sout = new Socket("localhost", send);
-
- Thread st = new Thread(new Send(sin, sout));
- st.start();
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @param buf
- * @param count
- */
- static synchronized void dump(String str, byte[] buf, int count) {
- // System.out.println(Thread.currentThread());
- System.out.print(str+"{");
- for (int j = 0; j < count; j++) {
- if (j == count - 1) {
- System.out.println(buf[j] + "}, ");
- } else {
- System.out.print(buf[j] + ", ");
- }
- }
- }
-}
-
-
-class Send implements Runnable {
-
- Socket sin;
- Socket sout;
-
- Send(Socket sin, Socket sout) {
- this.sin = sin;
- this.sout = sout;
- }
-
- public void run() {
- try {
-
- Reply rr = new Reply(sout.getInputStream(), sin.getOutputStream());
- Thread rt = new Thread(rr);
- rt.start();
-
- OutputStream outout = sout.getOutputStream();
- InputStream is = sin.getInputStream();
- byte[] buf = new byte[4096];
- int i = 0;
- int count = 0;
- while ((i = is.read()) != -1) {
- buf[count++] = (byte)i;
- outout.write(i);
- }
- SocketTracer.dump("Req: ", buf, count);
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
-}
-
-class Reply implements Runnable {
-
- InputStream is;
- OutputStream outout;
-
- Reply(InputStream is, OutputStream outout) {
- this.is = is;
- this.outout = outout;
- }
-
- public void run() {
- try {
- byte[] buf = new byte[4096];
- int i = 0;
- int count = 0;
- while ((i = is.read()) != -1) {
- buf[count++] = (byte)i;
- outout.write(i);
- }
- SocketTracer.dump("Res: ", buf, count);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ejb-runtime/src/test/resources/account/account.composite b/branches/sca-android/modules/binding-ejb-runtime/src/test/resources/account/account.composite
deleted file mode 100644
index 14f77eed08..0000000000
--- a/branches/sca-android/modules/binding-ejb-runtime/src/test/resources/account/account.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" name="account">
-
- <!-- composite refrence with ejb binding. Modify host and port number in uri attribute based on where you have installed target ResumeBank EJB -->
-
- <component name="CustomerComponent">
- <implementation.java class="account.CustomerImpl" />
- <reference name="extEJBService">
- <!-- To use the CosNaming, use the following URI -->
- <!--
- <binding.ejb uri="corbaname:iiop:1.2@localhost:1050#AddServiceBean" />
- -->
- <binding.ejb uri="hello-addservice/AddServiceBean/calculator.AddService" />
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-ejb/LICENSE b/branches/sca-android/modules/binding-ejb/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-ejb/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-ejb/META-INF/README b/branches/sca-android/modules/binding-ejb/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-ejb/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-ejb/NOTICE b/branches/sca-android/modules/binding-ejb/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-ejb/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/branches/sca-android/modules/binding-ejb/pom.xml b/branches/sca-android/modules/binding-ejb/pom.xml
deleted file mode 100644
index 0a3b0c5967..0000000000
--- a/branches/sca-android/modules/binding-ejb/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-ejb</artifactId>
- <name>Apache Tuscany SCA EJB Binding Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.ejb</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.ejb*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBinding.java b/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBinding.java
deleted file mode 100644
index 271a113429..0000000000
--- a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBinding.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.binding.ejb;
-
-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.xml.Constants;
-
-/**
- * An implementation of EJBBinding.
- *
- * @version $Rev$ $Date$
- */
-public interface EJBBinding extends Binding, Base {
- // Constants used when describing the EJB binding
- // model and for setting up defaults
- String BINDING_EJB = "binding.ejb";
- QName BINDING_EJB_QNAME = new QName(Constants.SCA10_NS, BINDING_EJB);
-
- // Constants for the XML describing the EJB Binding
- String HOME_INTERFACE = "homeInterface";
- String EJB_LINK_NAME = "ejb-link-name";
- String SESSION_TYPE = "session-type";
- String EJB_VERSION = "ejb-version";
- String NAME = "name";
- String POLICY_SETS = "policySets";
- String REQUIRES = "requires";
- String URI = "uri";
-
- // Enums for the EJB Binding
- enum EJBVersion {
- EJB2, EJB3
- };
-
- enum SessionType {
- STATEFUL, STATELESS
- };
-
- /**
- * Gets the homeInterface.
- *
- * @return home interface of the service binding
- */
- String getHomeInterface();
-
- /**
- * Set homeInterface
- *
- * @param homeInterface
- */
- void setHomeInterface(String homeInterface);
-
- /**
- * get ejb-link-name
- *
- * @return ejb-link-name
- */
- String getEjbLinkName();
-
- /**
- * Set ejb-link-name
- *
- * @param ejb-link-name
- */
- void setEjbLinkName(String ejbLinkName);
-
- SessionType getSessionType();
- void setSessionType(SessionType sessionType);
-
- EJBVersion getEjbVersion();
- void setEjbVersion(EJBVersion ejbVersion);
-
- // FIXME: Should use Intent instead of String
- String getRequires();
- void setRequires(String requires);
-}
diff --git a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBindingException.java b/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBindingException.java
deleted file mode 100644
index 6e2c8d358f..0000000000
--- a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBindingException.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.ejb;
-
-/**
- * Exception for the EJB Binding
- *
- * @version $Rev$ $Date$
- */
-public class EJBBindingException extends RuntimeException {
- private static final long serialVersionUID = 1L;
-
- /**
- * {@inheritDoc}
- */
- public EJBBindingException() {
- super();
- }
-
- /**
- * {@inheritDoc}
- */
- public EJBBindingException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * {@inheritDoc}
- */
- public EJBBindingException(String message) {
- super(message);
- }
-
- /**
- * {@inheritDoc}
- */
- public EJBBindingException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBindingFactory.java b/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBindingFactory.java
deleted file mode 100644
index 13b069a6bb..0000000000
--- a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/EJBBindingFactory.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.ejb;
-
-/**
- * Factory for the EJB binding
- *
- * @version $Rev$ $Date$
- */
-public interface EJBBindingFactory {
-
- /**
- * Creates a new EJB binding.
- * @return the new EJB binding
- */
- EJBBinding createEJBBinding();
-
-}
diff --git a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingFactoryImpl.java b/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingFactoryImpl.java
deleted file mode 100644
index e84de86eca..0000000000
--- a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingFactoryImpl.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.ejb.impl;
-
-import org.apache.tuscany.sca.binding.ejb.EJBBinding;
-import org.apache.tuscany.sca.binding.ejb.EJBBindingFactory;
-
-/**
- * Factory class for building EJBBindings.
- *
- * @version $Rev$ $Date$
- *
- */
-public class EJBBindingFactoryImpl implements EJBBindingFactory {
-
- public EJBBinding createEJBBinding() {
- return new EJBBindingImpl();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingImpl.java b/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingImpl.java
deleted file mode 100644
index 4abed80aa3..0000000000
--- a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingImpl.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ejb.impl;
-
-import org.apache.tuscany.sca.binding.ejb.EJBBinding;
-
-/**
- * An implementation of EJBBinding.
- *
- * @version $Rev$ $Date$
- */
-public class EJBBindingImpl implements EJBBinding {
-
- /**
- * CORBA location For example,
- * "corbaname:iiop:localhost:2809/NameServiceServerRoot#ejb/MyEJBHome"
- */
- private String uri;
-
- /**
- * homeInterface. remote or local
- */
- private String homeInterface;
-
- /**
- * The ejb-link-name attribute allows a SCA client to bind to an EJB that is
- * packaged in the same JEE EAR file as the SCA client. This is functionally
- * equivalent to using the <ejb-link/> subelement of the <ejb-ref/> element
- * in s EJB deployment descriptor. Used only for Service binding
- */
- private String ejbLinkName;
-
- /**
- * The name of this binding
- */
- private String name;
-
- /**
- * Whether the binding is unresolved
- */
- private boolean unresolved;
-
- /**
- * Clone the binding
- */
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- /**
- * The type of session for this EJB Binding
- */
- private SessionType sessionType;
-
- /**
- * The EJB version for this EJB Binding
- */
- private EJBVersion ejbVersion;
-
- private String requires;
-
- /**
- * Constructor
- */
- public EJBBindingImpl() {
- super();
- unresolved = true;
- }
-
- /**
- * Gets the homeInterface.
- *
- * @return home interface of the service binding
- */
- public String getHomeInterface() {
- return homeInterface;
- }
-
- /**
- * Set homeInterface
- *
- * @param homeInterface
- */
- public void setHomeInterface(String homeInterface) {
- this.homeInterface = homeInterface;
- }
-
- /**
- * get ejb-link-name
- *
- * @return ejb-link-name
- */
- public String getEjbLinkName() {
- return ejbLinkName;
- }
-
- /**
- * Set ejb-link-name
- *
- * @param ejb-link-name
- */
- public void setEjbLinkName(String ejbLinkName) {
- this.ejbLinkName = ejbLinkName;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getURI() {
- return uri;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public boolean isUnresolved() {
- return this.unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public void setSessionType(SessionType ejb_version_enum) {
- this.sessionType = ejb_version_enum;
- }
-
- public void setEjbVersion(EJBVersion ejb_version_enum) {
- this.ejbVersion = ejb_version_enum;
- }
-
- public void setRequires(String requires) {
- this.requires = requires;
-
- }
-
- public SessionType getSessionType() {
- return sessionType;
- }
-
- public EJBVersion getEjbVersion() {
- return ejbVersion;
- }
-
- public String getRequires() {
- return requires;
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingProcessor.java b/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingProcessor.java
deleted file mode 100644
index 9a487e02d1..0000000000
--- a/branches/sca-android/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingProcessor.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.binding.ejb.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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-import org.apache.tuscany.sca.binding.ejb.EJBBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * A processor to read the XML that describes the EJB binding...
- *
- * <binding.ejb
- * homeInterface="NCName"?
- * ejb-link-name="NCName"?
- * session-type="stateful or stateless"?
- * ejb-version="EJB2 or EJB3"?
- * name="NCName"?
- * policySets=" sca:listOfQNames"?
- * requires="sca:listOfQNames"?
- * uri="anyURI"?
- * >
- *
- * <!-- additional elements here -->
- *
- * </binding.ejb>
- *
- * @version $Rev$ $Date$
- */
-public class EJBBindingProcessor implements StAXArtifactProcessor<EJBBindingImpl> {
- private PolicyFactory policyFactory;
- private PolicyAttachPointProcessor policyProcessor;
- private Monitor monitor;
-
- public EJBBindingProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.policyProcessor = new PolicyAttachPointProcessor(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 = new ProblemImpl(this.getClass().getName(), "binding-ejb-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public QName getArtifactType() {
- return EJBBinding.BINDING_EJB_QNAME;
- }
-
- /**
- * {@inheritDoc}
- */
- public EJBBindingImpl read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- EJBBindingImpl ejbBinding = new EJBBindingImpl();
-
- // Read the policies
- policyProcessor.readPolicies(ejbBinding, reader);
-
- // Read the name
- String name = reader.getAttributeValue(null, EJBBinding.NAME);
- if (name != null) {
- ejbBinding.setName(name);
- }
-
- // Read binding URI
- String uri = reader.getAttributeValue(null, EJBBinding.URI);
- if (uri != null) {
- ejbBinding.setURI(uri);
- }
-
- String homeInterface = reader.getAttributeValue(null, EJBBinding.HOME_INTERFACE);
- if (homeInterface != null) {
- ejbBinding.setHomeInterface(homeInterface);
- }
-
- String ejbLinkName = reader.getAttributeValue(null, EJBBinding.EJB_LINK_NAME);
- if (ejbLinkName != null) {
- ejbBinding.setEjbLinkName(ejbLinkName);
- }
-
- String sessionType = reader.getAttributeValue(null, EJBBinding.SESSION_TYPE);
- if (sessionType != null) {
- if (sessionType.equals("stateless")) {
- ejbBinding.setSessionType(EJBBinding.SessionType.STATELESS);
- } else if (sessionType.equals("stateful")) {
- ejbBinding.setSessionType(EJBBinding.SessionType.STATEFUL);
- } else {
- error("UnknownEJBSessionType", reader, sessionType, name);
- //throw new ContributionReadException("Unknown EJB Session Type of " + sessionType + " for " + name);
- }
- }
-
- String ejbVersion = reader.getAttributeValue(null, EJBBinding.EJB_VERSION);
- if (ejbVersion != null) {
- if (ejbVersion.equals("EJB2")) {
- ejbBinding.setEjbVersion(EJBBinding.EJBVersion.EJB2);
- } else if (ejbVersion.equals("EJB3")) {
- ejbBinding.setEjbVersion(EJBBinding.EJBVersion.EJB3);
- } else {
- error("UnknownEJBVersion", reader, ejbVersion, name);
- //throw new ContributionReadException("Unknown EJB Version of " + ejbVersion + " for " + name);
- }
- }
-
- // TODO: Read requires
- String requires = reader.getAttributeValue(null, EJBBinding.REQUIRES);
- if (requires != null) {
- ejbBinding.setRequires(requires);
- }
-
- return ejbBinding;
- }
-
- public void write(EJBBindingImpl ejbBinding, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- // Write a <binding.ejb>
- writer.writeStartElement(Constants.SCA10_NS, EJBBinding.BINDING_EJB);
-
- if (ejbBinding.getName() != null){
- writer.writeAttribute(EJBBinding.NAME, ejbBinding.getName());
- }
-
- if (ejbBinding.getURI() != null){
- writer.writeAttribute(EJBBinding.URI, ejbBinding.getURI());
- }
-
-
- // FIXME Implement the rest
-
- writer.writeEndElement();
- }
-
- public Class<EJBBindingImpl> getModelType() {
- return EJBBindingImpl.class;
- }
-
- public void resolve(EJBBindingImpl ejbBinding, ModelResolver modelResolver) throws ContributionResolveException {
- }
-}
diff --git a/branches/sca-android/modules/binding-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ejb.EJBBindingFactory b/branches/sca-android/modules/binding-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ejb.EJBBindingFactory
deleted file mode 100644
index c445a82ecb..0000000000
--- a/branches/sca-android/modules/binding-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ejb.EJBBindingFactory
+++ /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.ejb.impl.EJBBindingFactoryImpl
diff --git a/branches/sca-android/modules/binding-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/binding-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 82e85ef067..0000000000
--- a/branches/sca-android/modules/binding-ejb/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.ejb.impl.EJBBindingProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#binding.ejb,model=org.apache.tuscany.sca.binding.ejb.EJBBinding
diff --git a/branches/sca-android/modules/binding-ejb/src/main/resources/binding-ejb-validation-messages.properties b/branches/sca-android/modules/binding-ejb/src/main/resources/binding-ejb-validation-messages.properties
deleted file mode 100644
index 28477dd3ac..0000000000
--- a/branches/sca-android/modules/binding-ejb/src/main/resources/binding-ejb-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.
-#
-#
-UnknownEJBSessionType = Unknown EJB Session Type of {0} for {1}
-UnknownEJBVersion = Unknown EJB Version of {0} for {1}
-
diff --git a/branches/sca-android/modules/binding-gdata-gsoc/LICENSE b/branches/sca-android/modules/binding-gdata-gsoc/LICENSE
deleted file mode 100644
index d645695673..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/branches/sca-android/modules/binding-gdata-gsoc/META-INF/README b/branches/sca-android/modules/binding-gdata-gsoc/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-gdata-gsoc/NOTICE b/branches/sca-android/modules/binding-gdata-gsoc/NOTICE
deleted file mode 100644
index a86f96ba80..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/NOTICE
+++ /dev/null
@@ -1,8 +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/branches/sca-android/modules/binding-gdata-gsoc/pom.xml b/branches/sca-android/modules/binding-gdata-gsoc/pom.xml
deleted file mode 100644
index 173dcbe0b8..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-gdata-gsoc</artifactId>
- <name>Apache Tuscany SCA Gdata Binding Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.gdata</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.gdata*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/GdataBinding.java b/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/GdataBinding.java
deleted file mode 100644
index ab2acef234..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/GdataBinding.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.gdata;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-/**
- * Gdata binding model.
- *
- * @version $Rev$ $Date$
- */
-public interface GdataBinding extends Binding {
-
- /**
- * Returns the title of the GData collection.
- * @return
- */
- String getTitle();
-
- /**
- * Sets the title of the GData collection.
- * @param title
- */
- void setTitle(String title);
-
- String getUsername();
- String getPassword();
- String getServiceType();
- void setUsername(String username);
- void setPassword(String password);
- void setServiceType(String serviceType);
-}
diff --git a/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/GdataBindingFactory.java b/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/GdataBindingFactory.java
deleted file mode 100644
index 847bb6956b..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/GdataBindingFactory.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.gdata;
-
-/**
- * Factory for the GData binding
- *
- */
-public interface GdataBindingFactory {
-
- /**
- * Creates a new GData binding.
- * @return the new GData binding
- */
- GdataBinding createGdataBinding();
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingFactoryImpl.java b/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingFactoryImpl.java
deleted file mode 100644
index 656776c358..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingFactoryImpl.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.gdata.impl;
-
-import org.apache.tuscany.sca.binding.gdata.GdataBinding;
-import org.apache.tuscany.sca.binding.gdata.GdataBindingFactory;
-
-/**
- * Factory for the GData binding model.
- *
- */
-public class GdataBindingFactoryImpl implements GdataBindingFactory {
-
- public GdataBinding createGdataBinding() {
- return new GdataBindingImpl();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingImpl.java b/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingImpl.java
deleted file mode 100644
index c389bacdc9..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingImpl.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.binding.gdata.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.OptimizableBinding;
-import org.apache.tuscany.sca.binding.gdata.GdataBinding;
-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;
-
-/**
- * Implementation of the GData binding model.
- *
- */
-class GdataBindingImpl implements GdataBinding, PolicySetAttachPoint {
-
- private String name;
- private String uri;
- private String title;
- private String username;
- private String password;
- private String serviceType;
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private IntentAttachPointType intentAttachPointType;
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- public String getName() {
- return name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public String getUsername(){
- return username;
- }
-
- public String getPassword(){
- return password;
- }
-
- public String getServiceType(){
- return serviceType;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
-
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public boolean isUnresolved() {
- // The binding is always resolved
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- // The binding is always resolved
- }
-
- 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 void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java b/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java
deleted file mode 100644
index 1cd0f72a93..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.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.binding.gdata.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-//import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.impl.IntentAttachPointTypeFactoryImpl;
-
-import org.apache.tuscany.sca.binding.gdata.GdataBinding;
-import org.apache.tuscany.sca.binding.gdata.GdataBindingFactory;
-
-/**
- * A processor for <binding.gdata> elements.
- */
-public class GdataBindingProcessor implements StAXArtifactProcessor<GdataBinding> {
-
- private QName BINDING_GDATA = new QName("http://tuscany.apache.org/xmlns/sca/1.0", "binding.gdata");
-
- private final GdataBindingFactory factory;
-
- //private PolicyAttachPointProcessor policyProcessor;
-
- public GdataBindingProcessor(ModelFactoryExtensionPoint modelFactories) {
- this.factory = modelFactories.getFactory(GdataBindingFactory.class);
- System.out.println("[Debug Info]GdataBindingProcessor reached");
- //this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- }
-
- public QName getArtifactType() {
- return BINDING_GDATA;
- }
-
- public Class<GdataBinding> getModelType() {
- return GdataBinding.class;
- }
-
- public GdataBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- GdataBinding gdataBinding = factory.createGdataBinding();
- IntentAttachPointType bindingType = new IntentAttachPointTypeFactoryImpl().createBindingType();
- bindingType.setName(getArtifactType());
- bindingType.setUnresolved(true);
- ((PolicySetAttachPoint)gdataBinding).setType(bindingType);
-
- String name = reader.getAttributeValue(null, "name");
- if (name != null) {
- gdataBinding.setName(name);
- }
-
- String uri = reader.getAttributeValue(null, "uri");
- if (uri != null) {
- gdataBinding.setURI(uri);
- }
-
- String serviceType = reader.getAttributeValue(null, "serviceType");
- if (serviceType != null) {
- gdataBinding.setServiceType(serviceType);
- }
-
- String username = reader.getAttributeValue(null, "username");
- if (username != null) {
- gdataBinding.setUsername(username);
- }
-
- String password = reader.getAttributeValue(null, "password");
- if (password != null) {
- gdataBinding.setPassword(password);
- }
-
- //policyProcessor.readPolicies(echoBinding, reader);
-
- return gdataBinding;
- }
-
- public void write(GdataBinding gdataBinding, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- //policyProcessor.writePolicyPrefixes(gdataBinding, writer);
- writer.writeStartElement(BINDING_GDATA.getNamespaceURI(), BINDING_GDATA.getLocalPart());
- //policyProcessor.writePolicyAttributes(gdataBinding, writer);
-
- if (gdataBinding.getName() != null) {
- writer.writeAttribute("name", gdataBinding.getName());
- }
-
- if (gdataBinding.getURI() != null) {
- writer.writeAttribute("uri", gdataBinding.getURI());
- }
-
- if (gdataBinding.getServiceType() != null) {
- writer.writeAttribute("serviceType", gdataBinding.getServiceType());
- }
-
- if (gdataBinding.getUsername() != null) {
- writer.writeAttribute("username", gdataBinding.getUsername());
- }
-
- if (gdataBinding.getPassword() != null) {
- writer.writeAttribute("password", gdataBinding.getPassword());
- }
-
- writer.writeEndElement();
- }
-
-
- //FIXME: Resolve the attached policySet, might not needed (the echo binding implementation example)
- public void resolve(GdataBinding gdataBinding, ModelResolver resolver) throws ContributionResolveException {
- PolicySetAttachPoint policySetAttachPoint = (PolicySetAttachPoint)gdataBinding;
- List<Intent> requiredIntents = new ArrayList<Intent>();
- Intent resolvedIntent = null;
- for ( Intent intent : policySetAttachPoint.getRequiredIntents() ) {
- resolvedIntent = resolver.resolveModel(Intent.class, intent);
- requiredIntents.add(resolvedIntent);
- }
- policySetAttachPoint.getRequiredIntents().clear();
- policySetAttachPoint.getRequiredIntents().addAll(requiredIntents);
-
- 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/branches/sca-android/modules/binding-gdata-gsoc/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.gdata.GdataBindingFactory b/branches/sca-android/modules/binding-gdata-gsoc/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.gdata.GdataBindingFactory
deleted file mode 100644
index 21688a62a6..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.gdata.GdataBindingFactory
+++ /dev/null
@@ -1,18 +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.
-
-# Implementation class for the model factory
-org.apache.tuscany.sca.binding.gdata.impl.GdataBindingFactoryImpl \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-gdata-gsoc/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/binding-gdata-gsoc/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 4e71818f7b..0000000000
--- a/branches/sca-android/modules/binding-gdata-gsoc/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.gdata.impl.GdataBindingProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#binding.gdata,model=org.apache.tuscany.sca.binding.gdata.GdataBinding,factory=org.apache.tuscany.sca.binding.gdata.GdataBindingFactory \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/LICENSE b/branches/sca-android/modules/binding-gdata-runtime-gsoc/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/META-INF/README b/branches/sca-android/modules/binding-gdata-runtime-gsoc/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/NOTICE b/branches/sca-android/modules/binding-gdata-runtime-gsoc/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/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/branches/sca-android/modules/binding-gdata-runtime-gsoc/pom.xml b/branches/sca-android/modules/binding-gdata-runtime-gsoc/pom.xml
deleted file mode 100644
index 2f216faa55..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/pom.xml
+++ /dev/null
@@ -1,210 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-gdata-runtime-gsoc</artifactId>
- <name>Apache Tuscany SCA Gdata Binding Extension Runtime GSOC</name>
-
- <repositories>
- <repository>
- <id>com.google.gdata</id>
- <url>http://people.apache.org/~lresende/google-gdata/maven/</url>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-gdata-gsoc</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.abdera</groupId>
- <artifactId>abdera-core</artifactId>
- <version>0.4.0-incubating</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>com.google.gdata</groupId>
- <artifactId>gdata-client</artifactId>
- <version>1.0</version>
- </dependency>
-
- <dependency>
- <groupId>com.google.gdata</groupId>
- <artifactId>gdata-client-meta</artifactId>
- <version>1.0</version>
- </dependency>
-
- <dependency>
- <groupId>com.google.gdata</groupId>
- <artifactId>gdata-core</artifactId>
- <version>1.0</version>
- </dependency>
-
- <dependency>
- <groupId>com.google.gdata</groupId>
- <artifactId>gdata-media</artifactId>
- <version>1.0</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- </exclusions>
- </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.gdata.extension
- </Bundle-SymbolicName>
- <Bundle-Description>
- ${pom.name}
- </Bundle-Description>
- <Export-Package>
- org.apache.tuscany.sca.binding.gdata*
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/Collection.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/Collection.java
deleted file mode 100644
index 5400e0b90f..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/Collection.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.gdata.collection;
-
-import com.google.gdata.client.Query;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Provides access to a collection of resources using Gdata.
- */
-@Remotable
-public interface Collection {
-
- /**
- * Get a GData feed for a collection of resources.
- *
- * @return the GData feed
- */
- Feed getFeed();
-
- /**
- * Get a GData feed for a collection of resources resulting from a query.
- *
- * @param queryString a query string
- * @return the GData feed
- */
- Feed query(Query query);
-
- /**
- * Creates a new entry.
- *
- * @param entry
- * @return
- */
- Entry post(Entry entry);
-
- /**
- * Retrieves an entry.
- *
- * @param id
- * @return
- */
- Entry get(String id) throws NotFoundException;
-
- /**
- * Update an entry.
- *
- * @param id
- * @param entry
- * @return
- */
- void put(String id, Entry entry) throws NotFoundException;
-
- /**
- * Delete an entry.
- *
- * @param id
- */
- void delete(String id) throws NotFoundException;
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/MediaCollection.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/MediaCollection.java
deleted file mode 100644
index 31e16e5f56..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/MediaCollection.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.gdata.collection;
-
-import java.io.InputStream;
-
-import org.osoa.sca.annotations.Remotable; // import
- // org.apache.abdera.model.Entry;
-
-import com.google.gdata.data.Entry;
-
-/**
- * Provides access to a collection of resources using Atom.
- */
-@Remotable
-public interface MediaCollection extends Collection {
-
- /**
- * Creates a new media entry
- *
- * @param title
- * @param slug
- * @param contentType
- * @param media
- */
- Entry postMedia(String title, String slug, String contentType, InputStream media);
-
- /**
- * Update a media entry.
- *
- * @param id
- * @param contentType
- * @param media
- * @return
- */
- void putMedia(String id, String contentType, InputStream media) throws NotFoundException;
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/NotFoundException.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/NotFoundException.java
deleted file mode 100644
index 4fc32d4d37..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/NotFoundException.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.gdata.collection;
-
-/**
- * Indicates that a resource could not be found.
- *
- * @version $Rev$ $Date$
- */
-public class NotFoundException extends Exception {
- private static final long serialVersionUID = -5046027674128627383L;
-
- public NotFoundException() {
- }
-
- public NotFoundException(String message) {
- super(message);
- }
-
- public NotFoundException(Throwable cause) {
- super(cause);
- }
-
- public NotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingInvoker.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingInvoker.java
deleted file mode 100644
index 859318a306..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingInvoker.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.gdata.provider;
-
-import static org.apache.tuscany.sca.binding.gdata.provider.GdataBindingUtil.entry;
-import static org.apache.tuscany.sca.binding.gdata.provider.GdataBindingUtil.feedEntry;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.DeleteMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.PutMethod;
-import org.apache.tuscany.sca.binding.gdata.collection.NotFoundException;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.osoa.sca.ServiceRuntimeException;
-
-import com.google.gdata.client.GoogleService;
-import com.google.gdata.client.Query;
-import com.google.gdata.data.Feed;
-import com.google.gdata.util.ResourceNotFoundException;
-import com.google.gdata.util.ServiceException;
-
-/**
- * Invoker for the GData binding.
- */
-class GdataBindingInvoker implements Invoker, DataExchangeSemantics {
-
- Operation operation;
- String uri;
- HttpClient httpClient;
- String authorizationHeader;
- GdataReferenceBindingProvider provider;
- GoogleService googleService;
-
- GdataBindingInvoker(Operation operation,
- String uri,
- GoogleService googleService,
- HttpClient httpClient,
- String authorizationHeader,
- GdataReferenceBindingProvider bindingProvider) {
- this.operation = operation;
- this.uri = uri;
- this.googleService = googleService;
- this.httpClient = httpClient;
- this.authorizationHeader = authorizationHeader;
- this.provider = bindingProvider;
-
- }
-
- public Message invoke(Message msg) {
- // Shouldn't get here, as the only supported methods are
- // defined in the ResourceCollection interface, and implemented
- // by specific invoker subclasses
- throw new UnsupportedOperationException(operation.getName());
- }
-
-
- /**
- * Get operation invoker
- */
- public static class GetInvoker extends GdataBindingInvoker {
- public GetInvoker(Operation operation,
- String uri,
- GoogleService googleService,
- HttpClient httpClient,
- String authorizationHeader,
- GdataReferenceBindingProvider bindingProvider) {
- super(operation, uri, googleService, httpClient, authorizationHeader, bindingProvider);
- }
-
- @SuppressWarnings("finally")
- @Override
- public Message invoke(Message msg) {
-
- // Get the entry id from the message body
- String id = (String)((Object[])msg.getBody())[0];
-
- // Send an HTTP GET
- GetMethod getMethod = new GetMethod(uri + "/" + id);
- getMethod.setRequestHeader("Authorization", authorizationHeader);
-
- try {
- URL entryURL = new URL(uri + "/" + id);
- com.google.gdata.data.Entry feedEntry = googleService.getEntry(entryURL, com.google.gdata.data.Entry.class);
- msg.setBody(feedEntry);
- } catch (IOException ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } catch (ServiceException ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- return msg;
- }
-
- }
- }
-
- /**
- * Post operation invoker
- */
- public static class PostInvoker extends GdataBindingInvoker {
-
- public PostInvoker(Operation operation,
- String uri,
- GoogleService googleService,
- HttpClient httpClient,
- String authorizationHeader,
- GdataReferenceBindingProvider bindingProvider) {
- super(operation, uri, googleService, httpClient, authorizationHeader, bindingProvider);
- }
-
- @SuppressWarnings("finally")
- @Override
- public Message invoke(Message msg) {
-
- System.out.println("[Debug Info]GdataBindingInvoker.PostInvoker --- invoke method reached");
- // Post an entry
- Object[] args = (Object[])msg.getBody();
- com.google.gdata.data.Entry feedEntry = null;
-
- if (provider.supportsFeedEntries()) {
-
- // Expect an GData entry
-
- System.out.println("[Debug Info]GdataBindingInvoker.PostInvoker --- supportsFeedEntries: " + provider
- .supportsFeedEntries());
- feedEntry = (com.google.gdata.data.Entry)args[0];
-
- System.out.println("[Debug Info]GdataBindingInvoker.PostInvoker --- feedEntry title: " + feedEntry
- .getTitle().getPlainText());
-
- } else {
- // Expect a key and data item
- Entry<Object, Object> entry = new Entry<Object, Object>(args[0], args[1]);
-
- // FIXME: this needs to be examinated more....
- feedEntry =
- feedEntry(entry, provider.getItemClassType(), provider.getItemXMLType(), provider.getMediator());
- }
-
-
- try {
-
- com.google.gdata.data.Entry createdEntry = googleService.insert(new URL(uri), feedEntry);
-
- msg.setBody(createdEntry);
-
- } catch (IOException ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } catch (ServiceException ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- return msg;
- }
- }
- }
-
-
-
- /**
- * Put operation invoker
- */
- public static class PutInvoker extends GdataBindingInvoker {
-
- public PutInvoker(Operation operation,
- String uri,
- GoogleService googleService,
- HttpClient httpClient,
- String authorizationHeader,
- GdataReferenceBindingProvider bindingProvider) {
- super(operation, uri, googleService, httpClient, authorizationHeader, bindingProvider);
- }
-
- @SuppressWarnings("finally")
- @Override
- public Message invoke(Message msg) {
-
- // Put an entry
- Object[] args = (Object[])msg.getBody();
- String id;
- com.google.gdata.data.Entry feedEntry = null;
- if (provider.supportsFeedEntries()) {
- // Expect a key and GData entry
- id = (String)args[0];
- feedEntry = (com.google.gdata.data.Entry)args[1];
- } else {
-
- // Expect a key and data item
- id = (String)args[0];
- Entry<Object, Object> entry = new Entry<Object, Object>(id, args[1]);
-
- // FIXME: The following statement needs to be modified
- // accordingly
- /*
- * feedEntry = feedEntry(entry, provider.getItemClassType(),
- * provider.getItemXMLType(), provider.getMediator(),
- * abderaFactory);
- */
- }
-
- // Send an HTTP PUT <Localhost>
- PutMethod putMethod = new PutMethod(uri + "/" + id);
- putMethod.setRequestHeader("Authorization", authorizationHeader);
- try {
- URL entryURL = new URL(uri + "/" + id);
-
- com.google.gdata.data.Entry toUpdateEntry = googleService.getEntry(entryURL, com.google.gdata.data.Entry.class);
-
- System.out.println("EditHtml:" + toUpdateEntry.getEditLink().getHref());
-
- URL editURL = new URL(toUpdateEntry.getEditLink().getHref());
-
- com.google.gdata.data.Entry updatedEntry = googleService.update(editURL, feedEntry);
-
- msg.setBody(updatedEntry);
-
- } catch (IOException ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } catch (ServiceException ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- return msg;
- } }
- }
-
- /**
- * Delete operation invoker
- */
- public static class DeleteInvoker extends GdataBindingInvoker {
-
- public DeleteInvoker(Operation operation,
- String uri,
- GoogleService googleService,
- HttpClient httpClient,
- String authorizationHeader,
- GdataReferenceBindingProvider bindingProvider) {
- super(operation, uri, googleService, httpClient, authorizationHeader, bindingProvider);
- }
-
- @SuppressWarnings("finally")
- @Override
- public Message invoke(Message msg) {
-
- // Delete an entry
- String id = (String)((Object[])msg.getBody())[0];
-
- // Send an HTTP DELETE(Localhost)
- DeleteMethod deleteMethod = new DeleteMethod(uri + "/" + id);
- deleteMethod.setRequestHeader("Authorization", authorizationHeader);
-
- try {
- URL entryURL = new URL(uri + "/" + id);
-
- com.google.gdata.data.Entry toUpdateEntry = googleService.getEntry(entryURL, com.google.gdata.data.Entry.class);
-
- System.out.println("EditHtml:" + toUpdateEntry.getEditLink().getHref());
-
- URL editURL = new URL(toUpdateEntry.getEditLink().getHref());
-
- googleService.delete(editURL);
-
- } catch (IOException ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } catch (ServiceException ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- return msg;
- }
- }
-
- }
-
-
- /**
- * GetAll operation invoker
- */
- public static class GetAllInvoker extends GdataBindingInvoker {
-
- public GetAllInvoker(Operation operation,
- String uri,
- GoogleService googleService,
- HttpClient httpClient,
- String authorizationHeader,
- GdataReferenceBindingProvider bindingProvider) {
- super(operation, uri, googleService, httpClient, authorizationHeader, bindingProvider);
- }
-
- @SuppressWarnings("finally")
- @Override
- public Message invoke(Message msg) {
-
- // Send an HTTP GET
- GetMethod getMethod = new GetMethod(uri);
- getMethod.setRequestHeader("Authorization", authorizationHeader);
-
- System.out.println("[Debug Info] GdataBindingInvoker.GetAllInvoker.invoke---feedURL: " + uri);
-
- try {
-
- Feed feed = googleService.getFeed(new URL(uri), Feed.class);
- msg.setBody(feed);
-
- } catch (ResourceNotFoundException ex) {
- msg.setFaultBody(new ResourceNotFoundException("Invalid Resource at " + uri));
- } catch (ServiceException ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } catch (Exception ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- return msg;
- }
-
- }
- }
-
- /**
- * Query operation invoker
- */
- public static class QueryInvoker extends GdataBindingInvoker {
-
- public QueryInvoker(Operation operation,
- String uri,
- GoogleService googleService,
- HttpClient httpClient,
- String authorizationHeader,
- GdataReferenceBindingProvider bindingProvider) {
- super(operation, uri, googleService, httpClient, authorizationHeader, bindingProvider);
- }
-
- @SuppressWarnings("finally")
- @Override
- public Message invoke(Message msg) {
-
- // Send an HTTP GET
- GetMethod getMethod = new GetMethod(uri);
- getMethod.setRequestHeader("Authorization", authorizationHeader);
-
- Object[] args = (Object[])msg.getBody();
- Query myQuery = (Query)args[0];
-
- System.out.println("[Debug Info] GdataBindingInvoker.QueryInvoker.invoke---feedURL: " + uri);
-
- try {
-
- Feed resultFeed = googleService.query(myQuery, Feed.class);
- msg.setBody(resultFeed);
-
- } catch (ResourceNotFoundException ex) {
- msg.setFaultBody(new ResourceNotFoundException("Invalid Resource at " + uri));
- } catch (ServiceException ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } catch (Exception ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- return msg;
- }
-
-
- }
- }
-
-
-
- /**
- * PostMedia operation invoker
- */
- public static class PostMediaInvoker extends GdataBindingInvoker {
-
- public PostMediaInvoker(Operation operation,
- String uri,
- GoogleService googleService,
- HttpClient httpClient,
- String authorizationHeader,
- GdataReferenceBindingProvider bindingProvider) {
- super(operation, uri, googleService, httpClient, authorizationHeader, bindingProvider);
- }
-
- @Override
- public Message invoke(Message msg) {
- // TODO implement
- return super.invoke(msg);
- }
- }
-
- /**
- * PutMedia operation invoker
- */
- public static class PutMediaInvoker extends GdataBindingInvoker {
-
- public PutMediaInvoker(Operation operation,
- String uri,
- GoogleService googleService,
- HttpClient httpClient,
- String authorizationHeader,
- GdataReferenceBindingProvider bindingProvider) {
- super(operation, uri, googleService, httpClient, authorizationHeader, bindingProvider);
- }
-
- @Override
- public Message invoke(Message msg) {
- // TODO implement
- return super.invoke(msg);
- }
- }
-
- public boolean allowsPassByReference() {
- // TODO Auto-generated method stub
- return true;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java
deleted file mode 100644
index c09c1f7788..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java
+++ /dev/null
@@ -1,746 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.gdata.provider;
-
-import static org.apache.tuscany.sca.binding.gdata.provider.GdataBindingUtil.entry;
-import static org.apache.tuscany.sca.binding.gdata.provider.GdataBindingUtil.feedEntry;
-
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.StringTokenizer;
-import java.util.logging.Logger;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-
-import org.apache.abdera.parser.ParseException;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.databinding.Mediator;
-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.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-import com.google.gdata.data.ExtensionProfile;
-import com.google.gdata.data.ParseSource;
-import com.google.gdata.data.PlainTextConstruct;
-import com.google.gdata.util.ServiceException;
-
-/**
- * A resource collection binding listener, implemented as a Servlet and
- * registered in a Servlet host provided by the SCA hosting runtime.
- */
-class GdataBindingListenerServlet extends HttpServlet {
- private static final Logger logger = Logger.getLogger(GdataBindingListenerServlet.class.getName());
- private static final long serialVersionUID = 1L;
-
- private RuntimeWire wire;
- private Invoker getFeedInvoker;
- private Invoker getAllInvoker;
- private Invoker queryInvoker;
- private Invoker getInvoker;
- private Invoker postInvoker;
- private Invoker postMediaInvoker;
- private Invoker putInvoker;
- private Invoker putMediaInvoker;
- private Invoker deleteInvoker;
- private MessageFactory messageFactory;
- private String title;
- private Mediator mediator;
- private DataType<?> itemClassType;
- private DataType<?> itemXMLType;
- private boolean supportsFeedEntries;
-
- /**
- * Constructs a new binding listener.
- *
- * @param wire
- * @param messageFactory
- * @param feedType
- */
- GdataBindingListenerServlet(RuntimeWire wire, MessageFactory messageFactory, Mediator mediator, String title) {
- this.wire = wire;
- this.messageFactory = messageFactory;
- this.mediator = mediator;
- this.title = title;
-
- // Get the invokers for the supported operations
- Operation getOperation = null;
- for (InvocationChain invocationChain : this.wire.getInvocationChains()) {
- invocationChain.setAllowsPassByReference(true);
- Operation operation = invocationChain.getTargetOperation();
- String operationName = operation.getName();
-
- if (operationName.equals("getFeed")) {
-
- //System.out.println("[Debug Info]GdataBindingListenerServlet constructor --- operation: getFeed");
- getFeedInvoker = invocationChain.getHeadInvoker();
-
- } else if (operationName.equals("getAll")) {
-
- getAllInvoker = invocationChain.getHeadInvoker();
-
- } else if (operationName.equals("query")) {
-
- queryInvoker = invocationChain.getHeadInvoker();
-
- } else if (operationName.equals("get")) {
-
- //System.out.println("[Debug Info]GdataBindingListenerServlet Constructor --- opeartion: get");
- getInvoker = invocationChain.getHeadInvoker();
- getOperation = operation;
-
- } else if (operationName.equals("put")) {
-
- putInvoker = invocationChain.getHeadInvoker();
-
- } else if (operationName.equals("putMedia")) {
-
- putMediaInvoker = invocationChain.getHeadInvoker();
-
- } else if (operationName.equals("post")) {
-
- //System.out.println("[Debug Info]GdataBindingListenerServlet Constructor --- opeartion: post");
- postInvoker = invocationChain.getHeadInvoker();
-
- } else if (operationName.equals("postMedia")) {
- postMediaInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("delete")) {
- deleteInvoker = invocationChain.getHeadInvoker();
- }
- }
-
- //System.out.println("[Debug Info]GdataBindingListenerServlet constructor --- I am good here 00");
-
- // Determine the collection item type
- itemXMLType = new DataTypeImpl<Class<?>>(String.class.getName(), String.class, String.class);
- Class<?> itemClass = getOperation.getOutputType().getPhysical();
-
- if (itemClass == com.google.gdata.data.Entry.class) {
- supportsFeedEntries = true;
- }
- DataType<XMLType> outputType = getOperation.getOutputType();
- QName qname = outputType.getLogical().getElementName();
- qname = new QName(qname.getNamespaceURI(), itemClass.getSimpleName());
- itemClassType = new DataTypeImpl<XMLType>("java:complexType", itemClass, new XMLType(qname, null));
-
- System.out.println("[Debug Info]GdataBindingListenerServlet --- initilized!");
- }
-
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // No authentication required for a get request
- System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- I am good here 00");
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
-
- System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- request.getRequestURI(): " + request
- .getRequestURI());
- System.out.println("[Debug Info]GdataBindingListenerServlet doGet()--- path: " + path);
-
- // FIXME: Log this get http request, commented out for testing
- logger.fine("get " + request.getRequestURI());
-
- // Handle an Atom request
- if (path != null && path.equals("/atomsvc")) {
-
- //FIXME: This needs to be fixed, for /atomsvc
-
- /*
- System.out.println("GdataBindingListenerServlet doGet(): I am good here brach 01");
- // Return the Atom service document
- response.setContentType("application/atomsvc+xml; charset=utf-8");
- Service service = abderaFactory.newService();
- // service.setText("service");
-
- Workspace workspace = abderaFactory.newWorkspace();
- workspace.setTitle("resource");
-
- String href = request.getRequestURL().toString();
- href = href.substring(0, href.length() - "/atomsvc".length());
-
- Collection collection = workspace.addCollection("collection", "atom/feed");
- collection.setTitle("entries");
- collection.setAttributeValue("href", href);
- collection.setAccept("entry");
- collection.addCategories().setFixed(false);
-
- workspace.addCollection(collection);
-
- service.addWorkspace(workspace);
-
- // FIXME add prettyPrint support
- try {
- service.getDocument().writeTo(response.getOutputStream());
- } catch (IOException ioe) {
- throw new ServletException(ioe);
- }
- */
-
- } else if (path == null || path.length() == 0 || path.equals("/")) {
-
- // get HTTP request asking for a feed
-
- System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- I am good here brach 02");
-
- // Return a feed containing the entries in the collection
- com.google.gdata.data.Feed feed = null;
-
- if (supportsFeedEntries) {
-
- System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- supportsFeedEntries: " + supportsFeedEntries);
-
- // The service implementation supports feed entries, invoke its
- // getFeed operation
- Message requestMessage = messageFactory.createMessage();
- Message responseMessage;
- if (request.getQueryString() != null) {
- System.out.println("getQueryString != null");
- requestMessage.setBody(new Object[] {request.getQueryString()});
- responseMessage = queryInvoker.invoke(requestMessage);
- } else {
- System.out.println("getQueryString == null");
- responseMessage = getFeedInvoker.invoke(requestMessage);
- }
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
-
- //System.out.println("response msg class:" + responseMessage.getBody().getClass());
-
- feed = (com.google.gdata.data.Feed)responseMessage.getBody();
-
- System.out.println("feed title: " + feed.getTitle().getPlainText());
-
- } else {
-
- System.out.println("GdataBindingListenerServlet doGet(): do not supportsFeedEntries");
-
- // The service implementation does not support feed entries,
- // invoke its getAll operation to get the data item collection,
- // then create
- // feed entries from the items
- Message requestMessage = messageFactory.createMessage();
- Message responseMessage;
- if (request.getQueryString() != null) {
- requestMessage.setBody(new Object[] {request.getQueryString()});
- responseMessage = queryInvoker.invoke(requestMessage);
- } else {
- responseMessage = getAllInvoker.invoke(requestMessage);
-
- //System.out
- // .println("GdataBindingListner.doGet(): get msg from getAllInvoker.invoke()" + responseMessage
- // .getBody().toString());
-
- }
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- Entry<Object, Object>[] collection = (Entry<Object, Object>[])responseMessage.getBody();
- if (collection != null) {
-
- // Create the feed
- feed = new com.google.gdata.data.Feed();
-
- // Set the feed title
- if (title != null) {
- feed.setTitle(new PlainTextConstruct(title));
- } else {
- feed.setTitle(new PlainTextConstruct("Feed title"));
- }
-
- // Add entries to the feed
- ArrayList<com.google.gdata.data.Entry> entries = new ArrayList<com.google.gdata.data.Entry>();
- for (Entry<Object, Object> entry : collection) {
- com.google.gdata.data.Entry feedEntry = feedEntry(entry, itemClassType, itemXMLType, mediator);
- entries.add(feedEntry);
- }
- feed.setEntries(entries);
-
- }
- }
- if (feed != null) {
-
- // //System.out.println("feed(from the http response)is not
- // null");
-
- // Write a GData feed using Atom representation
- response.setContentType("application/atom+xml; charset=utf-8");
-
- // Generate the corresponding Atom representation of the feed
- StringWriter stringWriter = new StringWriter();
- com.google.gdata.util.common.xml.XmlWriter w =
- new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
- feed.generateAtom(w, new ExtensionProfile());
- w.flush();
-
- // Write the Atom representation(XML) into Http response content
- OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
- PrintWriter out = new PrintWriter(response.getOutputStream());
- out.println(stringWriter.toString());
- out.close();
-
- System.out.println("Feed content in plain text:" + stringWriter.toString());
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- } else if (path.startsWith("/")) {
-
- // get HTTP request asking for an entry
-
- // Return a specific entry in the collection
- com.google.gdata.data.Entry feedEntry = null;
-
- // Invoke the get operation on the service implementation
- Message requestMessage = messageFactory.createMessage();
- String id = path.substring(1);
- requestMessage.setBody(new Object[] {id});
- Message responseMessage = getInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
-
- if (supportsFeedEntries) {
- // The service implementation returns a feed entry
- feedEntry = (com.google.gdata.data.Entry)responseMessage.getBody();
-
- System.out.println("entry title: " + feedEntry.getTitle().getPlainText());
-
- } else {
- // The service implementation only returns a data item, create
- // an entry
- // from it
- Entry<Object, Object> entry = new Entry<Object, Object>(id, responseMessage.getBody());
- // FIXME The line below needs to be fixed
- // feedEntry = feedEntry(entry, itemClassType, itemXMLType,
- // mediator, abderaFactory);
- }
-
- // Write the Gdata entry
- if (feedEntry != null) {
-
- // Write a GData entry using Atom representation
- response.setContentType("application/atom+xml; charset=utf-8");
-
- // Generate the corresponding Atom representation of the feed
- StringWriter stringWriter = new StringWriter();
- com.google.gdata.util.common.xml.XmlWriter w =
- new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
- feedEntry.generateAtom(w, new ExtensionProfile());
- w.flush();
-
- // Write the Atom representation(XML) into Http response content
- OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
- PrintWriter out = new PrintWriter(response.getOutputStream());
- out.println(stringWriter.toString());
- out.close();
-
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- } else {
- // Path doesn't match any known pattern
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- }
-
- @Override
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
- IOException {
-
- System.out.println("[Debug Info]GdataBindingListenerServlet doPost() --- reached");
-
- // Authenticate the user
- String user = processAuthorizationHeader(request);
- if (user == null) {
- unauthorized(response);
- return;
- }
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
-
- System.out.println("[Debug Info]GdataBindingListenerServlet path --- " + path);
-
- if (path == null || path.length() == 0 || path.equals("/")) {
- // Create a new Gdata entry
- com.google.gdata.data.Entry createdFeedEntry = null;
- String contentType = request.getContentType();
-
- if (contentType != null && contentType.startsWith("application/atom+xml")) {
-
- // Read the entry from the request
- com.google.gdata.data.Entry feedEntry = null;
- try {
- ParseSource source = new ParseSource(request.getReader());
- feedEntry = com.google.gdata.data.Entry.readEntry(source, com.google.gdata.data.Entry.class, null);
- } catch (ParseException pe) {
- throw new ServletException(pe);
- } catch (com.google.gdata.util.ParseException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (ServiceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- // Let the component implementation create it
- if (supportsFeedEntries) {
-
- // The service implementation supports feed entries, pass
- // the entry to it
- Message requestMessage = messageFactory.createMessage();
-
- requestMessage.setBody(new Object[] {feedEntry});
-
- Message responseMessage = postInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- createdFeedEntry = responseMessage.getBody();
- } else {
-
- // The service implementation does not support feed entries,
- // pass the data item to it
- Message requestMessage = messageFactory.createMessage();
- Entry<Object, Object> entry = entry(feedEntry, itemClassType, itemXMLType, mediator);
- requestMessage.setBody(new Object[] {entry.getKey(), entry.getData()});
- Message responseMessage = postInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- entry.setKey(responseMessage.getBody());
-
- createdFeedEntry = feedEntry(entry, itemClassType, itemXMLType, mediator);
- }
-
- } else if (contentType != null) {
-
- // Create a new media entry
-
- // Get incoming headers
- String title = request.getHeader("Title");
- String slug = request.getHeader("Slug");
-
- // Let the component implementation create the media entry
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[] {title, slug, contentType, request.getInputStream()});
- Message responseMessage = postMediaInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- createdFeedEntry = responseMessage.getBody();
- } else {
- response.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- }
-
- // A new entry was created successfully
- if (createdFeedEntry != null) {
-
- // Set location of the created entry in the Location header
- // Link link = createdFeedEntry.getSelfLink();
- // if (link != null) {
- // response.addHeader("Location", link.getHref().toString());
- // }
-
- // Write the created Atom entry
- response.setStatus(HttpServletResponse.SC_CREATED);
- response.setContentType("application/atom+xml; charset=utf-8");
- try {
-
- // Generate the corresponding Atom representation of the
- // feed
- StringWriter stringWriter = new StringWriter();
- com.google.gdata.util.common.xml.XmlWriter w =
- new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
- createdFeedEntry.generateAtom(w, new ExtensionProfile());
- w.flush();
-
- // Write the Atom representation(XML) into Http response
- // content
- OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
- PrintWriter out = new PrintWriter(response.getOutputStream());
- out.println(stringWriter.toString());
- out.close();
-
- } catch (ParseException pe) {
- throw new ServletException(pe);
- }
-
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- }
-
- private Writer getWriter(HttpServletResponse response) throws UnsupportedEncodingException, IOException {
- Writer writer = new OutputStreamWriter(response.getOutputStream(), "UTF-8");
- return writer;
- }
-
-
- @Override
- protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // Authenticate the user
- String user = processAuthorizationHeader(request);
- if (user == null) {
- unauthorized(response);
- return;
- }
-
- // Get the request path
- String path = request.getRequestURI().substring(request.getServletPath().length());
-
- System.out.println("[Debug Info] localServlet doPut --- path: " + path);
-
- if (path != null && path.startsWith("/")) {
- String id = path.substring(1);
-
- // Update an Atom entry
- String contentType = request.getContentType();
- if (contentType != null && contentType.startsWith("application/atom+xml")) {
-
- // Read the entry from the request
- com.google.gdata.data.Entry feedEntry = null;
- try {
- ParseSource source = new ParseSource(request.getReader());
- feedEntry = com.google.gdata.data.Entry.readEntry(source, com.google.gdata.data.Entry.class, null);
-
- System.out.println("[Debug Info] localServlet doPut --- feedEntry title: " + feedEntry.getTitle().getPlainText());
- } catch (ParseException pe) {
- throw new ServletException(pe);
- } catch (com.google.gdata.util.ParseException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (ServiceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
-
- // Let the component implementation create it
- if (supportsFeedEntries) {
-
- System.out.println("[Debug Info] localServlet doPut --- supportsFeedEntries: " + supportsFeedEntries);
-
- // The service implementation supports feed entries, pass
- // the entry to it
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[] {id, feedEntry});
- Message responseMessage = putInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- }
- } else {
-
- // The service implementation does not support feed entries,
- // pass the data item to it
- Message requestMessage = messageFactory.createMessage();
- Entry<Object, Object> entry = entry(feedEntry, itemClassType, itemXMLType, mediator);
- requestMessage.setBody(new Object[] {entry.getKey(), entry.getData()});
- Message responseMessage = putInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- }
- }
-
- // Write the Gdata entry
- if (feedEntry != null) {
-
- // Write a GData entry using Atom representation
- response.setContentType("application/atom+xml; charset=utf-8");
-
- // Generate the corresponding Atom representation of the feed
- StringWriter stringWriter = new StringWriter();
- com.google.gdata.util.common.xml.XmlWriter w =
- new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
- feedEntry.generateAtom(w, new ExtensionProfile());
- w.flush();
-
- // Write the Atom representation(XML) into Http response content
- OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
- PrintWriter out = new PrintWriter(response.getOutputStream());
- out.println(stringWriter.toString());
- out.close();
-
- }
-
- } else if (contentType != null) {
-
- // Updated a media entry
-
- // Let the component implementation create the media entry
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[] {id, contentType, request.getInputStream()});
- Message responseMessage = putMediaInvoker.invoke(requestMessage);
- Object body = responseMessage.getBody();
- if (responseMessage.isFault()) {
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- }
- } else {
- response.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- }
-
-
-
-
- @Override
- protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException,
- IOException {
-
- // Authenticate the user
- String user = processAuthorizationHeader(request);
- if (user == null) {
- unauthorized(response);
- return;
- }
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
-
- String id;
- if (path != null && path.startsWith("/")) {
- id = path.substring(1);
- } else {
- id = "";
- }
-
- // Delete a specific entry from the collection
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[] {id});
- Message responseMessage = deleteInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- }
- }
-
-
-
- /**
- * Process the authorization header
- *
- * @param request
- * @return
- * @throws ServletException
- */
- private String processAuthorizationHeader(HttpServletRequest request) throws ServletException {
-
- // FIXME temporarily disabling this as it doesn't work with all browsers
- if (true)
- return "admin";
-
- try {
- String authorization = request.getHeader("Authorization");
- if (authorization != null) {
- StringTokenizer tokens = new StringTokenizer(authorization);
- if (tokens.hasMoreTokens()) {
- String basic = tokens.nextToken();
- if (basic.equalsIgnoreCase("Basic")) {
- String credentials = tokens.nextToken();
- String userAndPassword = new String(Base64.decodeBase64(credentials.getBytes()));
- int colon = userAndPassword.indexOf(":");
- if (colon != -1) {
- String user = userAndPassword.substring(0, colon);
- String password = userAndPassword.substring(colon + 1);
-
- // Authenticate the User.
- if (authenticate(user, password)) {
- return user;
- }
- }
- }
- }
- }
- } catch (Exception e) {
- throw new ServletException(e);
- }
- return null;
- }
-
- /**
- * Authenticate a user.
- *
- * @param user
- * @param password
- * @return
- */
- private boolean authenticate(String user, String password) {
- // TODO Handle this using SCA security policies
- return ("admin".equals(user) && "admin".equals(password));
- }
-
- /**
- * Reject an unauthorized request.
- *
- * @param response
- */
- private void unauthorized(HttpServletResponse response) throws IOException {
- response.setHeader("WWW-Authenticate", "BASIC realm=\"Tuscany\"");
- response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingProviderFactory.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingProviderFactory.java
deleted file mode 100644
index fa99f4cb1b..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingProviderFactory.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.binding.gdata.provider;
-
-import org.apache.tuscany.sca.binding.gdata.GdataBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.impl.MediatorImpl;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-import com.google.gdata.util.AuthenticationException;
-
-/**
- * Implementation of a Binding provider factory for the Atom binding.
- */
-public class GdataBindingProviderFactory implements BindingProviderFactory<GdataBinding> {
-
- private MessageFactory messageFactory;
- private Mediator mediator;
- private ServletHost servletHost;
-
- public GdataBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- this.servletHost = servletHosts.getServletHosts().get(0);
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- this.messageFactory = modelFactories.getFactory(MessageFactory.class);
- this.mediator =
- new MediatorImpl(extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class), extensionPoints
- .getExtensionPoint(TransformerExtensionPoint.class));
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- GdataBinding binding) {
- try {
- return new GdataReferenceBindingProvider(component, reference, binding, mediator);
- } catch (AuthenticationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- return null; //Google authentication error! : This exception needs to be handled into a better way
- }
-
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- GdataBinding binding) {
- return new GdataServiceBindingProvider(component, service, binding, servletHost, messageFactory, mediator);
- }
-
- public Class<GdataBinding> getModelType() {
- return GdataBinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingUtil.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingUtil.java
deleted file mode 100644
index 86fc8fd43f..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingUtil.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.gdata.provider;
-
-import java.util.Date;
-
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.interfacedef.DataType;
-
-import com.google.gdata.data.DateTime;
-import com.google.gdata.data.PlainTextConstruct;
-import com.google.gdata.data.TextContent;
-
-/**
- * Utility methods used in this package.
- *
- */
-class GdataBindingUtil {
-
- /**
- * Create a data item from an GData entry.
- *
- * @param feedEntry
- * @param itemClassType
- * @param itemXMLType
- * @param mediator
- * @return
- */
- static Entry<Object, Object> entry(com.google.gdata.data.Entry feedEntry,
- DataType<?> itemClassType,
- DataType<?> itemXMLType,
- Mediator mediator) {
- if (feedEntry != null) {
- if (itemClassType.getPhysical() == Item.class) {
- String key = feedEntry.getId().toString();
-
- Item item = new Item();
- item.setTitle(feedEntry.getTitle().toString());
- TextContent content = (TextContent)feedEntry.getContent();
- item.setContents(content.getContent().getPlainText());
-
- for (com.google.gdata.data.Link link : feedEntry.getLinks()) {
- if (link.getRel() == null || "self".equals(link.getRel())) {
- if (item.getLink() == null) {
- item.setLink(link.getHref().toString());
- }
- } else if ("related".equals(link.getRel())) {
- item.setRelated(link.getHref().toString());
- } else if ("alternate".equals(link.getRel())) {
- item.setAlternate(link.getHref().toString());
- }
- }
-
- Date date = new Date(feedEntry.getUpdated().getValue());
- item.setDate(date);
- return new Entry<Object, Object>(key, item);
-
- } else {
- String key = null;
- if (feedEntry.getId() != null) {
- key = feedEntry.getId();
- }
-
- // Create the item from XML
- if (feedEntry.getContent() == null) {
- return null;
- }
-
- TextContent content = (TextContent)feedEntry.getContent();
- String value = content.getContent().getPlainText();
- Object data = mediator.mediate(value, itemXMLType, itemClassType, null);
- return new Entry<Object, Object>(key, data);
- }
- } else {
- return null;
- }
- }
-
- /**
- * Create an Gdata entry for a key and item from a collection.
- *
- * @param entry
- * @param itemClassType
- * @param itemXMLType
- * @param mediator
- * @param factory
- * @return
- */
- static com.google.gdata.data.Entry feedEntry(Entry<Object, Object> entry,
- DataType<?> itemClassType,
- DataType<?> itemXMLType,
- Mediator mediator) {
-
- Object key = entry.getKey();
- Object data = entry.getData();
- if (data instanceof Item) {
- Item item = (Item)data;
-
- com.google.gdata.data.Entry feedEntry = new com.google.gdata.data.Entry();
- if (key != null) {
- feedEntry.setId(key.toString());
- }
- feedEntry.setTitle(new PlainTextConstruct(item.getTitle()));
- feedEntry.setContent(new PlainTextConstruct(item.getContents()));
-
- String href = item.getLink();
- if (href == null && key != null) {
- href = key.toString();
- }
-
- if (href != null) {
- feedEntry.addHtmlLink(href, "", "");
- }
- String related = item.getRelated();
- if (related != null) {
- feedEntry.addHtmlLink(related, "", "related");
- }
- String alternate = item.getAlternate();
- if (alternate != null) {
- feedEntry.addHtmlLink(alternate, "", "alternate");
- }
-
- Date date = item.getDate();
- if (date != null) {
- DateTime datetime = new DateTime(date);
- feedEntry.setUpdated(datetime);
- }
- return feedEntry;
-
- } else if (data != null) {
-
- com.google.gdata.data.Entry feedEntry = new com.google.gdata.data.Entry();
- feedEntry.setId(key.toString());
- feedEntry.setTitle(new PlainTextConstruct("item"));
-
- // Convert the item to XML
- String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
-
- // Might be wrong because the example uses XML datatype, I am using
- // plainText here
- feedEntry.setContent(new PlainTextConstruct(value));
-
- feedEntry.addHtmlLink(key.toString(), "", "");
- return feedEntry;
-
- } else {
- return null;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataReferenceBindingProvider.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataReferenceBindingProvider.java
deleted file mode 100644
index 70bf58a161..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataReferenceBindingProvider.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.binding.gdata.provider;
-
-import java.net.URI;
-
-import javax.xml.namespace.QName;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpConnectionManager;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.tuscany.sca.binding.gdata.GdataBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-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;
-
-import com.google.gdata.client.GoogleService;
-import com.google.gdata.util.AuthenticationException;
-
-/**
- * Implementation of the Atom binding provider.
- *
- * @version $Rev$ $Date$
- */
-class GdataReferenceBindingProvider implements ReferenceBindingProvider {
-
- private RuntimeComponentReference reference;
- private GdataBinding binding;
- private String authorizationHeader;
- private GoogleService googleService;
- private HttpClient httpClient;
- private Mediator mediator;
- private DataType<?> itemClassType;
- private DataType<?> itemXMLType;
- private boolean supportsFeedEntries;
-
- /**
- * Constructs a new AtomReferenceBindingProvider
- *
- * @param component
- * @param reference
- * @param binding
- * @param mediator
- * @throws AuthenticationException
- */
- GdataReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- GdataBinding binding,
- Mediator mediator) throws AuthenticationException {
- this.reference = reference;
- this.binding = binding;
- this.mediator = mediator;
-
- // Prepare authorization header
- String authorization = "admin" + ":" + "admin";
- authorizationHeader = "Basic " + new String(Base64.encodeBase64(authorization.getBytes()));
-
-
- // Prepare gdata header
- String serviceType = binding.getServiceType();
- String usernane = binding.getUsername();
- String password = binding.getPassword();
-
- System.out.println("[Debug Info] binding.getServiceType()" + serviceType);
- System.out.println("[Debug Info] binding.getName()" +usernane);
- System.out.println("[Debug Info] binding.getPassword()" + password);
-
- googleService = new GoogleService(serviceType, "");
- if(binding.getUsername().equals("admin") == false && binding.getPassword().equals("admin")==false){
- googleService.setUserCredentials(binding.getUsername(),binding.getPassword());
- }
-
-
-
- // Create an HTTP client
- HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
- connectionManager.getParams().setDefaultMaxConnectionsPerHost(10);
- connectionManager.getParams().setConnectionTimeout(60000);
- httpClient = new HttpClient(connectionManager);
- }
-
- public Invoker createInvoker(Operation operation) {
-
- String operationName = operation.getName();
-
- // //System.out.println("GdataReferenceBindingProvider.createInvoker---operationName:"
- // + operationName);
-
- if (operationName.equals("get")) {
-
- // Determine the collection item type
- itemXMLType = new DataTypeImpl<Class<?>>(String.class.getName(), String.class, String.class);
- Class<?> itemClass = operation.getOutputType().getPhysical();
- DataType<XMLType> outputType = operation.getOutputType();
- QName qname = outputType.getLogical().getElementName();
- qname = new QName(qname.getNamespaceURI(), itemClass.getSimpleName());
- itemClassType = new DataTypeImpl<XMLType>("java:complexType", itemClass, new XMLType(qname, null));
-
- if (itemClassType.getPhysical() == com.google.gdata.data.Entry.class) {
- supportsFeedEntries = true;
- }
-
- return new GdataBindingInvoker.GetInvoker(operation, binding.getURI(), googleService, httpClient, authorizationHeader, this);
-
- } else if (operationName.equals("post")) {
-
- return new GdataBindingInvoker.PostInvoker(operation, binding.getURI(), googleService, httpClient, authorizationHeader, this);
-
- } else if (operationName.equals("put")) {
-
- return new GdataBindingInvoker.PutInvoker(operation, binding.getURI(), googleService, httpClient, authorizationHeader,
- this);
- } else if (operationName.equals("delete")) {
- return new GdataBindingInvoker.DeleteInvoker(operation, binding.getURI(), googleService, httpClient, authorizationHeader,
- this);
- } else if (operationName.equals("getFeed") || operationName.equals("getAll")) {
-
- // //System.out.println("GdataReferenceBindingProvider
- // CreateInvoker: getFeed or getAll");
-
- return new GdataBindingInvoker.GetAllInvoker(operation, binding.getURI(), googleService, httpClient, authorizationHeader,
- this);
-
- } else if (operationName.equals("postMedia")) {
- return new GdataBindingInvoker.PostMediaInvoker(operation, binding.getURI(), googleService, httpClient,
- authorizationHeader, this);
- } else if (operationName.equals("putMedia")) {
- return new GdataBindingInvoker.PutMediaInvoker(operation, binding.getURI(), googleService, httpClient,
- authorizationHeader, this);
- } else if (operationName.equals("query")) {
- return new GdataBindingInvoker.QueryInvoker(operation, binding.getURI(), googleService, httpClient, authorizationHeader,
- this);
- }
-
- return new GdataBindingInvoker(operation, binding.getURI(), googleService, httpClient, authorizationHeader, this);
- }
-
-
-
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
-
-
- public void start() {
-
- // Configure the HTTP client credentials
- Credentials credentials = new UsernamePasswordCredentials("admin", "admin");
- httpClient.getParams().setAuthenticationPreemptive(true);
- URI uri = URI.create(binding.getURI());
- httpClient.getState().setCredentials(new AuthScope(uri.getHost(), uri.getPort()), credentials);
-
- // Find the get operation on the reference interface
- if (true) {
- return;
- }
- }
-
- public void stop() {
-
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- /**
- * Returns the mediator.
- *
- * @return
- */
- Mediator getMediator() {
- return mediator;
- }
-
- /**
- * Returns the item class type.
- *
- * @return
- */
- DataType<?> getItemClassType() {
- return itemClassType;
- }
-
- /**
- * Returns the item XML type.
- *
- * @return
- */
- DataType<?> getItemXMLType() {
- return itemXMLType;
- }
-
- /**
- * Returns true if the invoker should work with Atom feed entries.
- *
- * @return
- */
- boolean supportsFeedEntries() {
- return supportsFeedEntries;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataServiceBindingProvider.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataServiceBindingProvider.java
deleted file mode 100644
index 10faf74371..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataServiceBindingProvider.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.binding.gdata.provider;
-
-import org.apache.tuscany.sca.binding.gdata.GdataBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-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.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Implementation of the Atom binding provider.
- *
- * @version $Rev$ $Date$
- */
-class GdataServiceBindingProvider implements ServiceBindingProvider {
-
- private RuntimeComponentService service;
- private GdataBinding binding;
- private ServletHost servletHost;
- private MessageFactory messageFactory;
- private String servletMapping;
- private Mediator mediator;
-
- GdataServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- GdataBinding binding,
- ServletHost servletHost,
- MessageFactory messageFactory,
- Mediator mediator) {
- this.service = service;
- this.binding = binding;
- this.servletHost = servletHost;
- this.messageFactory = messageFactory;
- this.mediator = mediator;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- RuntimeComponentService componentService = (RuntimeComponentService)service;
- RuntimeWire wire = componentService.getRuntimeWire(binding);
-
- GdataBindingListenerServlet servlet =
- new GdataBindingListenerServlet(wire, messageFactory, mediator, binding.getTitle());
-
- servletMapping = binding.getURI();
- if (!servletMapping.endsWith("/")) {
- servletMapping += "/";
- }
- if (!servletMapping.endsWith("*")) {
- servletMapping += "*";
- }
- servletHost.addServletMapping(servletMapping, servlet);
-
- // Save the actual binding URI in the binding
- binding.setURI(servletHost.getURLMapping(binding.getURI()).toString());
- }
-
- public void stop() {
- servletHost.removeServletMapping(servletMapping);
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index 5e380eb4e0..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/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.gdata.provider.GdataBindingProviderFactory;model=org.apache.tuscany.sca.binding.gdata.GdataBinding
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/resources/tuscany-binding-gdata.xsd b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/resources/tuscany-binding-gdata.xsd
deleted file mode 100644
index 5148e2ef2d..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/main/resources/tuscany-binding-gdata.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.
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://echo"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:e="http://echo"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0"/>
-
- <element name="binding.gdata" type="e:GdataBinding"/>
-
- <complexType name="GdataBinding">
- <complexContent>
- <extension base="sca:Binding">
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/Consumer.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/Consumer.java
deleted file mode 100644
index 2517c7233a..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/Consumer.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.gdata;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.PlainTextConstruct;
-
-public class Consumer {
-
- public static void main(String[] args) throws Exception {
-
- //Initialize the GData client service (Reference Binding test)
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/ConsumerGoogleBlogger.composite");
- CustomerClient testService = scaDomain.getService(CustomerClient.class, "CustomerClient");
-
-
- Feed feed = testService.clientGetFeed();
-
- System.out.println("#Entries(Before post): "+ testService.clientGetFeed().getEntries().size());
-
- /*
- String entryID = "tag:blogger.com,1999:blog-4520949313432095990.post-973462497533349425";
- Entry entry = testService.clientGetEntry(entryID);
- System.out.println("Entry id: " + entry.getId());
- */
-
- Entry myEntry = new Entry();
- myEntry.setTitle(new PlainTextConstruct("titleByConsumer2"));
- myEntry.setContent(new PlainTextConstruct("contentByConsmer2"));
- testService.clientPost(myEntry);
-
- System.out.println("#Entries(After post): "+ testService.clientGetFeed().getEntries().size());
-
- String entryID = "tag:blogger.com,1999:blog-4520949313432095990.post-973462497533349425";
- Entry entry = testService.clientGetEntry(entryID);
- System.out.println("Entry id: " + entry.getId());
-
-
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/ConsumerProviderTestCase.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/ConsumerProviderTestCase.java
deleted file mode 100644
index 3ac79e5f0a..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/ConsumerProviderTestCase.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.binding.gdata;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.PlainTextConstruct;
-
-public class ConsumerProviderTestCase extends TestCase {
-
- private SCADomain scaDomainProvider = null;
- private SCADomain scaDomainConsumer = null;
- private CustomerClient testService = null;
-
- @Before
- @Override
- public void setUp() throws Exception {
- System.out.println("Method Test Start-----------------------------------------------------------------------");
-
- // Setup the local GData servlet (Service Binding test)
- scaDomainProvider = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/Provider.composite");
- System.out.println("[Debug Info] Provider.composite ready...");
-
- // Initialize the GData client service (Reference Binding test)
- scaDomainConsumer = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/Consumer.composite");
- testService = scaDomainConsumer.getService(CustomerClient.class, "CustomerClient");
- }
-
- @After
- @Override
- public void tearDown() {
- scaDomainProvider.close();
- System.out.println("Method Test End------------------------------------------------------------------------");
- System.out.println("\n\n");
- }
-
-
- @Test
- public void testClientGetFeed() throws Exception {
- Feed feed = testService.clientGetFeed();
- System.out.println(feed.getTitle().getPlainText());
- assertNotNull(feed);
- // Given we are testing on the localhost providing feed, we know the
- // feed title is "Feedtitle(LocalHostServlet)"
- assertEquals("Feedtitle(LocalHostServlet)", feed.getTitle().getPlainText());
- }
-
- @Test
- public void testClientGetEntry() throws Exception {
- String entryID = "urn:uuid:customer-0";
- Entry entry = testService.clientGetEntry(entryID);
- System.out.println("entryID in testcase: " + entry.getId());
- assertEquals(entryID, entry.getId());
- }
-
- @Test
- public void testClientPost() throws Exception {
- Entry newEntry = new Entry();
- newEntry.setTitle(new PlainTextConstruct("NewEntry title by Post"));
- newEntry.setContent(new PlainTextConstruct("NewEntry Content by Post"));
- Entry postedEntry = testService.clientPost(newEntry);
- assertEquals("NewEntry title by Post", postedEntry.getTitle().getPlainText());
- }
-
-
-
- @Test
- public void testClientPut() throws Exception {
- String newTitleValue = "newTitleValueByPut";
- String entryID = "urn:uuid:customer-0";
- System.out.println("Before clientPut");
- testService.clientPut(entryID, newTitleValue);
- System.out.println("After clientPut");
- Entry updatedEntry = testService.clientGetEntry(entryID);
- System.out.println("title: "+ updatedEntry.getTitle().getPlainText());
- assertEquals(newTitleValue, updatedEntry.getTitle().getPlainText());
- }
-
-
-
- @Test
- public void testClientDelete() throws Exception {
-
- // We first create a new entry, then delete it
-
- // Post a new entry
- Entry newEntry = new Entry();
- newEntry.setTitle(new PlainTextConstruct("NewEntry title to be deleted"));
- newEntry.setContent(new PlainTextConstruct("NewEntry Content to be delted"));
- Entry confirmedNewEntry = testService.clientPost(newEntry);
-
- Thread.sleep(300);
-
- Feed feed00 = testService.clientGetFeed();
- int entryNum00 = feed00.getEntries().size(); // The number of entries
- // before deleting
- System.out.println("entryNum00:" + entryNum00);
-
- // Delete this newly created entry
- String entryID = confirmedNewEntry.getId();
- Thread.sleep(300);
-
- System.out.println("confirmed entry ID: " + confirmedNewEntry.getId());
- System.out.println("confirmed entry title: " + confirmedNewEntry.getTitle().getPlainText());
-
- System.out.println("Before test clientDelete");
- testService.clientDelete(entryID);
- System.out.println("After test clientDelete");
-
- Feed feed01 = testService.clientGetFeed();
- int entryNum01 = feed01.getEntries().size();
- System.out.println("entryNum01:" + entryNum01); // The number of entries after deleting
-
- //assertEquals(1, entryNum00 - entryNum01);
- }
-
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClient.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClient.java
deleted file mode 100644
index 7aa0a8961c..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClient.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.gdata;
-
-import com.google.gdata.client.Query;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-
-public interface CustomerClient {
-
- Feed clientGetFeed() throws Exception;
-
- Entry clientGetEntry(String entryID) throws Exception;
-
- Entry clientPost(Entry entry) throws Exception;
-
- void clientDelete(String entryID) throws Exception;
-
- void clientPut(String entryID, String newTitle) throws Exception;
-
- Feed clientQuery(Query query) throws Exception;
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClientImpl.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClientImpl.java
deleted file mode 100644
index a2b1da894d..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClientImpl.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.binding.gdata;
-
-import com.google.gdata.client.Query;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.PlainTextConstruct;
-
-import org.apache.tuscany.sca.binding.gdata.collection.Collection;
-import org.apache.tuscany.sca.binding.gdata.collection.NotFoundException;
-import org.osoa.sca.annotations.Reference;
-
-public class CustomerClientImpl implements CustomerClient {
-
- @Reference
- public Collection resourceCollection;
-
- // Call Collection.getFeed()
- public Feed clientGetFeed() throws Exception {
- // Get all the entries from the provider, return in a single feed
- System.out.println(">>> get the feed from the provider service");
- Feed feed = resourceCollection.getFeed();
- System.out.println("\n\n!!! Fetched feed title: " + feed.getTitle().getPlainText());
- int i = 0;
- for (Object o : feed.getEntries()) {
- com.google.gdata.data.Entry e = (com.google.gdata.data.Entry)o;
- System.out.print("Entry" + i + "\t");
- System.out.println(" id = " + e.getId() + "\t title = " + e.getTitle().getPlainText());
- i++;
- }
- return feed;
- }
-
-
- // Call Collection.get(entryID)
- public Entry clientGetEntry(String entryID) throws Exception {
- // Get an existing entry based on its id
- System.out.println(">>> get an existing entry from the provider service");
- Entry entry = resourceCollection.get(entryID);
- System.out.println("\n\n!!! Entry retrieved with id=" + entry.getId()
- + " title="
- + entry.getTitle().getPlainText());
- return entry;
- }
-
-
- // Call Collection.post(newEntry)
- public Entry clientPost(Entry newEntry) throws Exception {
- // Put a new entry to the provider
- System.out.println(">>> post a new entry to the provider service");
- Entry confirmedNewEntry = resourceCollection.post(newEntry);
- System.out.println("!!! New entry posted with id=" + confirmedNewEntry.getId()
- + " title="
- + confirmedNewEntry.getTitle().getPlainText());
- System.out.println("\n");
- return confirmedNewEntry;
- }
-
-
- // Call Collection.delete(newEntry)
- public void clientDelete(String entryID) throws Exception {
- // Put a new entry to the provider
- System.out.println(">>> delete an existing entry from the provider service");
- System.out.println(">>> delete id=" + "urn:uuid:customer-1");
- resourceCollection.delete(entryID);
- System.out.println("!!! entry with id" + entryID);
- System.out.println("\n");
- }
-
-
-
- // Call Collection.put(entry, updatedTitle)
- public void clientPut(String entryID, String newTitle) throws Exception {
-
- System.out.println("clientPut");
- // Put a new entry to the provider
- System.out.println(">>> put id=" + entryID + " title=" + newTitle);
- Entry entry = resourceCollection.get(entryID);
-
- //change the title of this entry
- entry.setTitle(new PlainTextConstruct(newTitle));
- resourceCollection.put(entryID, entry);
- System.out.println("!!! Updated entry with id=" + entry.getId() + " title=" + entry.getTitle());
- System.out.println("\n");
- }
-
-
-
- // Call Collection.getFeed()
- public Feed clientQuery(Query query) throws Exception {
- // Get all the entries from the provider, return in a single feed
- System.out.println(">>> query the service");
- Feed feed = resourceCollection.query(query);
- System.out.println("\n\n!!! Query result feed title: " + feed.getTitle().getPlainText());
- int i = 0;
- for (Object o : feed.getEntries()) {
- com.google.gdata.data.Entry e = (com.google.gdata.data.Entry)o;
- System.out.print("Entry" + i + "\t");
- System.out.println(" id = " + e.getId() + "\t title = " + e.getTitle().getPlainText());
- i++;
- }
- return feed;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerCollectionImpl.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerCollectionImpl.java
deleted file mode 100644
index 3c11fb70b9..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerCollectionImpl.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.binding.gdata;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import com.google.gdata.client.Query;
-import com.google.gdata.data.DateTime;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.Link;
-import com.google.gdata.data.PlainTextConstruct;
-
-import org.apache.tuscany.sca.binding.gdata.collection.Collection;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("COMPOSITE")
-public class CustomerCollectionImpl implements Collection {
-
-
- private Map<String, Entry> entries = new HashMap<String, Entry>();
-
- /**
- * Default constructor that initializes collection with couple customer
- * entries
- */
- public CustomerCollectionImpl() {
-
- for (int i = 0; i < 4; i++) {
- // id is supposed to be generated in a random way, but for the
- // purpose of testing, we just make them as static ids
-
- // String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
-
- String id = "urn:uuid:customer-" + String.valueOf(i);
- Entry entry = new Entry();
- entry.setId(id);
- entry.setTitle(new PlainTextConstruct("EntryTitle_" + i));
- entry.setContent(new PlainTextConstruct("content_" + i));
- entry.setUpdated(DateTime.now());
- // FIXME: The following three lines of code need to be fixed to add
- // HTML links.
- Link link = new Link();
- link.setType(Link.Type.ATOM);
- link.setRel(Link.Rel.ENTRY_EDIT);
- link.setHref("http://localhost:8084/customer" + "/" + id);
- entry.getLinks().add(link);
-
- // entry.addHtmlLink(""+id, "", "edit");
- // entry.addHtmlLink(""+id, "", "alternate");
- entries.put(id, entry);
- System.out.println(">>> id=" + id);
- }
- }
-
- public Entry post(Entry entry) {
- System.out.println(">>> ResourceCollectionImpl.post entry=" + entry.getTitle());
-
- String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
- entry.setId(id);
-
- Link link = new Link();
- link.setType(Link.Type.ATOM);
- link.setRel(Link.Rel.ENTRY_EDIT);
- link.setHref("http://localhost:8084/customer" + "/" + id);
- entry.getLinks().add(link);
-
- //entry.addLink("" + id, "edit"); entry.addLink("" + id, "alternate");
- entry.setUpdated(DateTime.now());
-
- // entry.addHtmlLink("http://www.google.com", "languageType", "edit");
- // entry.addHtmlLink("http://www.google.com", "languageType",
- // "alternate");
-
- entries.put(id, entry);
- System.out.println(">>> ResourceCollectionImpl.post return id=" + id);
- return entry;
- }
-
- public Entry get(String id) {
- System.out.println(">>> ResourceCollectionImpl.get id= " + id);
- return entries.get(id);
- }
-
- public void put(String id, Entry entry) {
- System.out.println(">>> ResourceCollectionImpl.put id=" + id + " entry=" + entry.getTitle().getPlainText());
- entry.setUpdated(DateTime.now());
- entries.put(id, entry);
- }
-
-
- public void delete(String id) {
- System.out.println(">>> ResourceCollectionImpl.delete id=" + id);
- entries.remove(id);
- }
-
-
- public Feed getFeed() {
- System.out.println(">>> ResourceCollectionImpl.get collection");
-
- Feed feed = new Feed();
- feed.setTitle(new PlainTextConstruct("Feedtitle(LocalHostServlet)"));
- feed.setSubtitle(new PlainTextConstruct("Subtitle: This is a sample feed"));
- feed.setUpdated(DateTime.now());
- // FIXME: The following two lines of code need to be fixed
- // feed.addHtmlLink("", "", "");
- // feed.addHtmlLink("", "languageType", "self");
- ArrayList<Entry> entryList = new ArrayList<Entry>();
- for (Entry entry : entries.values()) {
- entryList.add(entry);
- }
- feed.setEntries(entryList);
-
- return feed;
- }
-
- //FIXME: need to be modified
- public Feed query(Query query) {
- System.out.println(">>> ResourceCollectionImpl.query collection ");
- return getFeed();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleBloggerServiceTestCase.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleBloggerServiceTestCase.java
deleted file mode 100644
index b4f6ec7b36..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleBloggerServiceTestCase.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.binding.gdata;
-
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.google.gdata.client.Query;
-import com.google.gdata.data.DateTime;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.PlainTextConstruct;
-
-public class GoogleBloggerServiceTestCase extends TestCase{
-
- private SCADomain scaDomainConsumer = null;
- private CustomerClient testService = null;
-
- public GoogleBloggerServiceTestCase(){
-
- }
-
- @Before
- @Override
- public void setUp() throws Exception {
- System.out.println("Method Test Start-----------------------------------------------------------------------");
-
- //Initialize the GData client service (Reference Binding test)
- scaDomainConsumer = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/ConsumerGoogleBlogger.composite");
- testService = scaDomainConsumer.getService(CustomerClient.class, "CustomerClient");
- }
-
- @After
- @Override
- public void tearDown(){
- System.out.println("Method Test End------------------------------------------------------------------------");
- System.out.println("\n\n");
- }
-
- @Test
- public void testClientGetFeed() throws Exception {
- Feed feed = testService.clientGetFeed();
- System.out.println("feed title: " + feed.getTitle().getPlainText());
- assertEquals("gdata binding tuscany test", feed.getTitle().getPlainText());
- }
-
-
- @Test
- public void testClientGetEntry() throws Exception {
- String entryID = "8308734583601887890";
- Entry blogEntry = testService.clientGetEntry(entryID);
- System.out.println("Entry ID: " + blogEntry.getId());
- assertTrue(blogEntry.getId().endsWith(entryID));
- System.out.println("------------------------------------------------------------\n\n");
- }
-
-
- @Test
- public void testClientPut() throws Exception {
- String entryID = "2889832689497686762";
- String newBlogEntryTitle = "updatedTitleByTestCase2";
- testService.clientPut(entryID, newBlogEntryTitle); //update the title
- Thread.sleep(300);
- Entry updatedEntry = testService.clientGetEntry(entryID);
- assertEquals(newBlogEntryTitle, updatedEntry.getTitle().getPlainText());
- }
-
-
-
- @Test
- public void testClientPost() throws Exception {
- String blogEntryTitle = "titleByBloogerTestcase000";
- Entry newEntry = new Entry();
- newEntry.setTitle(new PlainTextConstruct(blogEntryTitle));
- newEntry.setContent(new PlainTextConstruct("contentByBloggerTestCase000"));
- Entry postedEntry = testService.clientPost(newEntry);
- assertEquals(blogEntryTitle, postedEntry.getTitle().getPlainText());
- }
-
-
- @Test
- public void testClientDelete() throws Exception {
-
- //This test case might fail
- //because Google blogger service has limitation on new posts allowed everyday/every hour?
-
- System.out.println("testClientDelete");
- //We create a new post, and then delete it
- Entry newEntry = new Entry();
- newEntry.setTitle(new PlainTextConstruct("blogEntryShouldNotApear"));
- newEntry.setContent(new PlainTextConstruct("contentByBloggerShouldNotAppear"));
- Entry postedEntry = testService.clientPost(newEntry);
- Thread.sleep(300);
- int idStartPosition = postedEntry.getId().lastIndexOf("-");
- String postedEntryID = postedEntry.getId().substring(idStartPosition+1);
- System.out.println("postedEntryID: " + postedEntryID );
-
- //Before deletion
- Entry entry00 = testService.clientGetEntry(postedEntryID);
- System.out.println("Before Deleteion: " + entry00.getId());
-
- //Delete this entry
- testService.clientDelete(postedEntryID);
-
- //Worked: this newly posted entry did not appear in the blogspot website,
- //But we need a Junit assertion here
- //Link: http://haibotuscany.blogspot.com/feeds/posts/default/
- //FIXME: Need an assertion here
- //Assert(....);
- }
-
-
- @Test
- public void testClientQuery() throws Exception {
- Query myQuery = new Query(new URL("http://haibotuscany.blogspot.com/feeds/posts/default"));
- myQuery.setMaxResults(100);
- //myQuery.setUpdatedMin(startTime);
- myQuery.setUpdatedMax(DateTime.now());
- Feed resultFeed = testService.clientQuery(myQuery);
- System.out.println("Query result feed title: " + resultFeed.getTitle().getPlainText());
- System.out.println("Query result entry number: "+ resultFeed.getEntries().size());
- //assertEquals("gdata binding tuscany test", resultFeed.getTitle().getPlainText());
- }
-
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleCalendarServiceTestCase.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleCalendarServiceTestCase.java
deleted file mode 100644
index 882716575b..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleCalendarServiceTestCase.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.gdata;
-
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.google.gdata.client.Query;
-import com.google.gdata.data.DateTime;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.PlainTextConstruct;
-
-public class GoogleCalendarServiceTestCase extends TestCase{
-
- private SCADomain scaDomainConsumer = null;
- private CustomerClient testService = null;
-
- public GoogleCalendarServiceTestCase(){
-
- }
-
- @Before
- @Override
- public void setUp() throws Exception {
- System.out.println("Method Test Start-----------------------------------------------------------------------");
-
- //Initialize the GData client service (Reference Binding test)
- scaDomainConsumer = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/ConsumerGoogleCalendar.composite");
- testService = scaDomainConsumer.getService(CustomerClient.class, "CustomerClient");
- }
-
- @After
- @Override
- public void tearDown(){
- System.out.println("Method Test End------------------------------------------------------------------------");
- System.out.println("\n\n");
- }
-
- @Test
- public void testClientGetFeed() throws Exception {
- Feed feed = testService.clientGetFeed();
- System.out.println("feed title: " + feed.getTitle().getPlainText());
- assertEquals("gsoc gosc", feed.getTitle().getPlainText());
- }
-
-
- @Test
- public void testClientGetEntry() throws Exception {
- String entryID = "1c76lcl70jg9r0fm18rcbneea8";
- Entry blogEntry = testService.clientGetEntry(entryID);
- System.out.println("Entry ID: " + blogEntry.getId());
- assertTrue(blogEntry.getId().endsWith(entryID));
- System.out.println("------------------------------------------------------------\n\n");
- }
-
-
- @Test
- public void testClientPut() throws Exception {
- String entryID = "1c76lcl70jg9r0fm18rcbneea8";
- String newBlogEntryTitle = "updatedTitleByGoogleContactsConsumerTestCase";
- testService.clientPut(entryID, newBlogEntryTitle); //update the title
- Thread.sleep(300);
- Entry updatedEntry = testService.clientGetEntry(entryID);
- assertEquals(newBlogEntryTitle, updatedEntry.getTitle().getPlainText());
- }
-
-
-
- @Test
- public void testClientPost() throws Exception {
- String blogEntryTitle = "titleByGoogleCalendarTestcase";
- Entry newEntry = new Entry();
- newEntry.setTitle(new PlainTextConstruct(blogEntryTitle));
- newEntry.setContent(new PlainTextConstruct("contentByGoogleCalendarTestCase"));
- Entry postedEntry = testService.clientPost(newEntry);
- assertEquals(blogEntryTitle, postedEntry.getTitle().getPlainText());
- }
-
-
- @Test
- public void testClientDelete() throws Exception {
-
- //This test case might fail
- //because Google blogger service has limitation on new posts allowed everyday/every hour?
-
- System.out.println("testClientDelete");
- //We create a new post, and then delete it
- Entry newEntry = new Entry();
- newEntry.setTitle(new PlainTextConstruct("calendarEntryShouldNotApear"));
- newEntry.setContent(new PlainTextConstruct("calendarByBloggerShouldNotAppear"));
- Entry postedEntry = testService.clientPost(newEntry);
- Thread.sleep(300);
-
- System.out.println("ID: " + postedEntry.getId());
-
- int idStartPosition = postedEntry.getId().lastIndexOf("/");
- String postedEntryID = postedEntry.getId().substring(idStartPosition+1);
- System.out.println("postedEntryID: " + postedEntryID );
-
- //Before deletion
- Entry entry00 = testService.clientGetEntry(postedEntryID);
- System.out.println("Before Deleteion: " + entry00.getId());
-
- //Delete this entry
- testService.clientDelete(postedEntryID);
-
- //Worked: this newly posted entry did not appear in the contact list
- //But we need a Junit assertion here
- //Link: http://haibotuscany.blogspot.com/feeds/posts/default/
- //FIXME: Need an assertion here
- //Assert(....);
- }
-
-
- @Test
- public void testClientQuery() throws Exception {
- Query myQuery = new Query(new URL("http://www.google.com/calendar/feeds/haibotuscany@gmail.com/private/full"));
- myQuery.setMaxResults(100);
- //myQuery.setUpdatedMin(startTime);
- myQuery.setUpdatedMax(DateTime.now());
-
- //Google Calendar service supports full-text search
- String queryString = "event0";
- myQuery.setFullTextQuery(queryString);
-
- Feed resultFeed = testService.clientQuery(myQuery);
- System.out.println("Query result feed title: " + resultFeed.getTitle().getPlainText());
- System.out.println("Query result entry number: "+ resultFeed.getEntries().size());
- //assertEquals("gdata binding tuscany test", resultFeed.getTitle().getPlainText());
- }
-
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java
deleted file mode 100644
index 959c153074..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.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.binding.gdata;
-
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.google.gdata.client.Query;
-import com.google.gdata.data.DateTime;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.PlainTextConstruct;
-
-public class GoogleContactsServiceTestCase extends TestCase{
-
- private SCADomain scaDomainConsumer = null;
- private CustomerClient testService = null;
-
- public GoogleContactsServiceTestCase(){
-
- }
-
- @Before
- @Override
- public void setUp() throws Exception {
- System.out.println("Method Test Start-----------------------------------------------------------------------");
-
- //Initialize the GData client service (Reference Binding test)
- scaDomainConsumer = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/ConsumerGoogleContacts.composite");
- testService = scaDomainConsumer.getService(CustomerClient.class, "CustomerClient");
- }
-
- @After
- @Override
- public void tearDown(){
- System.out.println("Method Test End------------------------------------------------------------------------");
- System.out.println("\n\n");
- }
-
- @Test
- public void testClientGetFeed() throws Exception {
- Feed feed = testService.clientGetFeed();
- System.out.println("feed title: " + feed.getTitle().getPlainText());
- assertEquals("Haibo Zhao's Contacts", feed.getTitle().getPlainText());
- }
-
-
- @Test
- public void testClientGetEntry() throws Exception {
- String entryID = "12feeeb38ab87365";
- Entry contactEntry = testService.clientGetEntry(entryID);
- System.out.println("Entry ID: " + contactEntry.getId());
- assertTrue(contactEntry.getId().endsWith(entryID));
- System.out.println("------------------------------------------------------------\n\n");
- }
-
-
- @Test
- public void testClientPut() throws Exception {
- String entryID = "12feeeb38ab87365";
- String newBlogEntryTitle = "updatedTitleByGoogleContactsConsumerTestCase";
- testService.clientPut(entryID, newBlogEntryTitle); //update the title
- Thread.sleep(300);
- Entry updatedEntry = testService.clientGetEntry(entryID);
- assertEquals(newBlogEntryTitle, updatedEntry.getTitle().getPlainText());
- }
-
-
-
- @Test
- public void testClientPost() throws Exception {
- String blogEntryTitle = "titleByGoogleContactsTestcase";
- Entry newEntry = new Entry();
- newEntry.setTitle(new PlainTextConstruct(blogEntryTitle));
- newEntry.setContent(new PlainTextConstruct("contentByGoogleContactsTestCase"));
- Entry postedEntry = testService.clientPost(newEntry);
- assertEquals(blogEntryTitle, postedEntry.getTitle().getPlainText());
- }
-
-
- @Test
- public void testClientDelete() throws Exception {
-
- //This test case might fail
- //because Google blogger service has limitation on new posts allowed everyday/every hour?
-
- System.out.println("testClientDelete");
- //We create a new post, and then delete it
- Entry newEntry = new Entry();
- newEntry.setTitle(new PlainTextConstruct("contactEntryShouldNotApear"));
- newEntry.setContent(new PlainTextConstruct("contactByBloggerShouldNotAppear"));
- Entry postedEntry = testService.clientPost(newEntry);
- Thread.sleep(300);
-
- System.out.println("ID: " + postedEntry.getId());
-
- int idStartPosition = postedEntry.getId().lastIndexOf("/");
- String postedEntryID = postedEntry.getId().substring(idStartPosition+1);
- System.out.println("postedEntryID: " + postedEntryID );
-
- //Before deletion
- Entry entry00 = testService.clientGetEntry(postedEntryID);
- System.out.println("Before Deleteion: " + entry00.getId());
-
- //Delete this entry
- testService.clientDelete(postedEntryID);
-
- //Worked: this newly posted entry did not appear in the contact list
- //But we need a Junit assertion here
- //Link: http://haibotuscany.blogspot.com/feeds/posts/default/
- //FIXME: Need an assertion here
- //Assert(....);
- }
-
-
- @Test
- public void testClientQuery() throws Exception {
- Query myQuery = new Query(new URL("http://www.google.com/m8/feeds/contacts/default/base"));
- myQuery.setMaxResults(100);
- //myQuery.setUpdatedMin(startTime);
- myQuery.setUpdatedMax(DateTime.now());
- Feed resultFeed = testService.clientQuery(myQuery);
- System.out.println("Query result feed title: " + resultFeed.getTitle().getPlainText());
- System.out.println("Query result entry number: "+ resultFeed.getEntries().size());
- //assertEquals("gdata binding tuscany test", resultFeed.getTitle().getPlainText());
- }
-
-
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/Provider.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/Provider.java
deleted file mode 100644
index 21bff30256..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/Provider.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.gdata;
-
-import java.io.IOException;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class Provider {
-
- public static void main(String[] args) {
-
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/Provider.composite");
- System.out.println("Provider.composite ready...");
-
- try {
- System.in.read();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- scaDomain.close();
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/StartLocalhostServlet.java b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/StartLocalhostServlet.java
deleted file mode 100644
index 2773398426..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/java/org/apache/tuscany/sca/binding/gdata/StartLocalhostServlet.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.gdata;
-
-import java.io.IOException;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class StartLocalhostServlet {
-
- public static void main(String[] args) {
-
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/Provider.composite");
- System.out.println("Provider.composite ready...");
-
- try {
- System.in.read();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- scaDomain.close();
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/log4j.properties b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/log4j.properties
deleted file mode 100644
index 33eaf11c1f..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/log4j.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.
-#
-
-# Set root logger level to WARN and its only appender to CONSOLE
-log4j.rootLogger=INFO, CONSOLE
-
-
-# Console appender
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p %x - %m\n
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/Consumer.composite b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/Consumer.composite
deleted file mode 100644
index a7941a2056..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/Consumer.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://customer"
- name="Consumer">
-
- <component name="CustomerClient">
- <implementation.java class="org.apache.tuscany.sca.binding.gdata.CustomerClientImpl"/>
- <reference name="resourceCollection">
- <tuscany:binding.gdata uri="http://localhost:8084/customer" serviceType="localServiceBinding" username="admin" password="admin"/>
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleBlogger.composite b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleBlogger.composite
deleted file mode 100644
index 078873c44f..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleBlogger.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://customer"
- name="Consumer">
-
- <component name="CustomerClient">
- <implementation.java class="org.apache.tuscany.sca.binding.gdata.CustomerClientImpl"/>
- <reference name="resourceCollection">
- <tuscany:binding.gdata uri="http://haibotuscany.blogspot.com/feeds/posts/default" serviceType="blogger" username="haibotuscany@gmail.com" password="gsocgsocgsoc"/>
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleCalendar.composite b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleCalendar.composite
deleted file mode 100644
index 7e0c925482..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleCalendar.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://customer"
- name="Consumer">
-
- <component name="CustomerClient">
- <implementation.java class="org.apache.tuscany.sca.binding.gdata.CustomerClientImpl"/>
- <reference name="resourceCollection">
- <tuscany:binding.gdata uri="http://www.google.com/calendar/feeds/haibotuscany@gmail.com/private/full" serviceType="cl" username="haibotuscany@gmail.com" password="gsocgsocgsoc"/>
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleContacts.composite b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleContacts.composite
deleted file mode 100644
index bc1ea7a8a9..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/ConsumerGoogleContacts.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://customer"
- name="Consumer">
-
- <component name="CustomerClient">
- <implementation.java class="org.apache.tuscany.sca.binding.gdata.CustomerClientImpl"/>
- <reference name="resourceCollection">
- <tuscany:binding.gdata uri="http://www.google.com/m8/feeds/contacts/default/base" serviceType="cp" username="haibotuscany@gmail.com" password="gsocgsocgsoc"/>
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/Provider.composite b/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/Provider.composite
deleted file mode 100644
index a4cf00dc84..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime-gsoc/src/test/resources/org/apache/tuscany/sca/binding/gdata/Provider.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace = "http://customer"
- name="Provider">
-
- <service name="customer" promote="CustomerCollection">
- <tuscany:binding.gdata uri = "http://localhost:8084/customer"/>
- </service>
-
- <component name="CustomerCollection">
- <implementation.java class="org.apache.tuscany.sca.binding.gdata.CustomerCollectionImpl"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-gdata-runtime/LICENSE b/branches/sca-android/modules/binding-gdata-runtime/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-gdata-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/branches/sca-android/modules/binding-gdata-runtime/META-INF/README b/branches/sca-android/modules/binding-gdata-runtime/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-gdata-runtime/NOTICE b/branches/sca-android/modules/binding-gdata-runtime/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-gdata-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/branches/sca-android/modules/binding-gdata-runtime/deployGdataToMaven.sh b/branches/sca-android/modules/binding-gdata-runtime/deployGdataToMaven.sh
deleted file mode 100755
index 306ad19f66..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/deployGdataToMaven.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-mvn gpg:sign-and-deploy-file -DgroupId=com.google.gdata -DartifactId=gdata-core -Dversion=1.0 -Dpackaging=jar -Dfile=gdata-core-1.0.jar -DrepositoryId=apache.people -Durl=scp://people.apache.org/home/lresende/public_html/google-gdata/maven -Dkeyname=lresende
-
-mvn gpg:sign-and-deploy-file -DgroupId=com.google.gdata -DartifactId=gdata-client -Dversion=1.0 -Dpackaging=jar -Dfile=gdata-client-1.0.jar -DrepositoryId=apache.people -Durl=scp://people.apache.org/home/lresende/public_html/google-gdata/maven -Dkeyname=lresende
-
-mvn gpg:sign-and-deploy-file -DgroupId=com.google.gdata -DartifactId=gdata-client-meta -Dversion=1.0 -Dpackaging=jar -Dfile=gdata-client-meta-1.0.jar -DrepositoryId=apache.people -Durl=scp://people.apache.org/home/lresende/public_html/google-gdata/maven -Dkeyname=lresende
-
-mvn gpg:sign-and-deploy-file -DgroupId=com.google.gdata -DartifactId=gdata-media -Dversion=1.0 -Dpackaging=jar -Dfile=gdata-media-1.0.jar -DrepositoryId=apache.people -Durl=scp://people.apache.org/home/lresende/public_html/google-gdata/maven -Dkeyname=lresende
diff --git a/branches/sca-android/modules/binding-gdata-runtime/pom.xml b/branches/sca-android/modules/binding-gdata-runtime/pom.xml
deleted file mode 100644
index ec29af0b0f..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/pom.xml
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-gdata-runtime</artifactId>
- <name>Apache Tuscany SCA GData Binding Extension Runtime</name>
-
- <repositories>
- <repository>
- <id>com.google.gdata</id>
- <url>http://people.apache.org/~lresende/google-gdata/maven/</url>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-gdata</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.google.gdata</groupId>
- <artifactId>gdata-core</artifactId>
- <version>1.0</version>
- </dependency>
-
- <dependency>
- <groupId>com.google.gdata</groupId>
- <artifactId>gdata-client</artifactId>
- <version>1.0</version>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <artifactId>commons-codec</artifactId>
- <groupId>commons-codec</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <artifactId>servlet-api</artifactId>
- <groupId>javax.servlet</groupId>
- </exclusion>
- <exclusion>
- <artifactId>avalon-framework</artifactId>
- <groupId>avalon-framework</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.atom.abdera</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.atom*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/Collection.java b/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/Collection.java
deleted file mode 100644
index 2679071ea8..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/Collection.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.binding.gdata.collection;
-
-import com.google.gdata.data.BaseEntry;
-import com.google.gdata.data.BaseFeed;
-
-import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Provides access to a collection of resources using Atom.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface Collection {
-
- /**
- * Get an Atom feed for a collection of resources.
- *
- * @return the Atom feed
- */
- BaseFeed<? extends BaseFeed, ? extends BaseEntry> getFeed();
-
- /**
- * Get an Atom feed for a collection of resources resulting
- * from a query.
- *
- * @param queryString a query string
- * @return the Atom feed
- */
- BaseFeed<? extends BaseFeed, ? extends BaseEntry> query(String queryString);
-
- /**
- * Creates a new entry.
- *
- * @param entry
- * @return
- */
- BaseEntry post(BaseEntry entry);
-
- /**
- * Retrieves an entry.
- *
- * @param id
- * @return
- */
- BaseEntry get(String id) throws NotFoundException;
-
- /**
- * Update an entry.
- *
- * @param id
- * @param entry
- * @return
- */
- BaseEntry put(String id, BaseEntry entry) throws NotFoundException;
-
- /**
- * Delete an entry.
- *
- * @param id
- */
- void delete(String id) throws NotFoundException;
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/MediaCollection.java b/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/MediaCollection.java
deleted file mode 100644
index b9252d097a..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/collection/MediaCollection.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.binding.gdata.collection;
-
-import com.google.gdata.data.BaseEntry;
-import java.io.InputStream;
-
-import org.osoa.sca.annotations.Remotable;
-
-import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
-
-/**
- * Provides access to a collection of resources using Atom.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface MediaCollection extends Collection {
-
- /**
- * Creates a new media entry
- *
- * @param title
- * @param slug
- * @param contentType
- * @param media
- */
- BaseEntry postMedia(String title, String slug, String contentType, InputStream media);
-
- /**
- * Update a media entry.
- *
- * @param id
- * @param contentType
- * @param media
- * @return
- */
- void putMedia(String id, String contentType, InputStream media) throws NotFoundException;
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingInvoker.java b/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingInvoker.java
deleted file mode 100644
index d2c5ed4017..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingInvoker.java
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.gdata.provider;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.osoa.sca.ServiceRuntimeException;
-
-import com.google.gdata.client.GoogleService;
-import com.google.gdata.client.Query;
-import com.google.gdata.data.BaseEntry;
-import com.google.gdata.data.BaseFeed;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.ExtensionProfile;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.ParseSource;
-import com.google.gdata.util.AuthenticationException;
-import java.net.URL;
-import com.google.gdata.util.ResourceNotFoundException;
-import com.google.gdata.util.common.xml.XmlWriter;
-import java.io.StringWriter;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.DeleteMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.PutMethod;
-import org.apache.commons.httpclient.methods.StringRequestEntity;
-import org.apache.tuscany.sca.binding.gdata.GDataBinding;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-
-/**
- * Invoker for the Atom binding.
- *
- * @version $Rev$ $Date$
- */
-class GDataBindingInvoker implements Invoker, DataExchangeSemantics {
-
- Operation operation;
- GDataBinding binding;
- HttpClient httpClient;
- String authorizationHeader;
- GoogleService service;
-
- GDataBindingInvoker(Operation operation, GDataBinding binding, HttpClient httpClient, String authorizationHeader) {
- this.operation = operation;
- this.binding = binding;
- this.httpClient = httpClient;
- this.authorizationHeader = authorizationHeader;
-
- //Create the GoogleService
- if (!binding.getServiceType().equals("sca")) {
- this.service = new GoogleService(binding.getServiceType(), "");
-
- try {
- service.setUserCredentials(binding.getUsername(), binding.getPassword());
- } catch (AuthenticationException ex) {
- //FIXME - promote the exception
- Logger.getLogger(GDataReferenceBindingProvider.class.getName()).log(Level.SEVERE, null, ex);
- }
-
- this.service.setConnectTimeout(60000);
- }
- }
-
- public Message invoke(Message msg) {
- // Shouldn't get here, as the only supported methods are
- // defined in the ResourceCollection interface, and implemented
- // by specific invoker subclasses
- throw new UnsupportedOperationException(operation.getName());
- }
-
- /**
- * Get operation invoker
- */
- public static class GetInvoker extends GDataBindingInvoker {
-
- public GetInvoker(Operation operation, GDataBinding binding, HttpClient httpClient, String authorizationHeader) {
- super(operation, binding, httpClient, authorizationHeader);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- BaseEntry entry;
- GetMethod getMethod = null;
- boolean parsing = false;
-
- String id = (String) ((Object[]) msg.getBody())[0];
-
- try {
- // serviceType == "sca" - Send an HTTP GET
- if (service == null) {
- getMethod = new GetMethod(binding.getURI() + "/" + id);
- getMethod.setRequestHeader("Authorization", authorizationHeader);
-
- httpClient.executeMethod(getMethod);
- int status = getMethod.getStatusCode();
-
- // Read the Atom feed
- if (status == 200) {
-
- parsing = true;
-
- ParseSource parser = new ParseSource(getMethod.getResponseBodyAsStream());
- entry = BaseEntry.readEntry(parser);
-
- msg.setBody(entry);
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } // serviceType != "sca" - Use GoogleService
- else {
- entry = service.getEntry(new URL(id), Entry.class);
- msg.setBody(entry);
- }
- } catch (ResourceNotFoundException ex) {
- msg.setFaultBody(new ResourceNotFoundException("Invalid Resource at " + binding.getURI()));
- } catch (Exception ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- if (service == null && !parsing) {
- getMethod.releaseConnection();
- }
- return msg;
- }
-
- }
- }
-
- /**
- * Post operation invoker
- */
- public static class PostInvoker extends GDataBindingInvoker {
-
- public PostInvoker(Operation operation, GDataBinding binding, HttpClient httpClient, String authorizationHeader) {
- super(operation, binding, httpClient, authorizationHeader);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- BaseEntry entry = (BaseEntry) ((Object[]) msg.getBody())[0];
- BaseEntry returnedEntry;
-
- PostMethod postMethod = null;
- boolean parsing = false;
-
- try {
- // serviceType == "sca" - Send an HTTP POST
- if (service == null) {
- postMethod = new PostMethod(binding.getURI());
- postMethod.setRequestHeader("Authorization", authorizationHeader);
-
- // Write the Atom entry
- StringWriter strWriter = new StringWriter();
- XmlWriter writer = new XmlWriter(strWriter);
- entry.generateAtom(writer, new ExtensionProfile());
- writer.flush();
- writer.close();
-
- postMethod.setRequestHeader("Content-type", "application/atom+xml; charset=utf-8");
- postMethod.setRequestEntity(new StringRequestEntity(strWriter.toString()));
-
- httpClient.executeMethod(postMethod);
- int status = postMethod.getStatusCode();
-
- // Read the Atom feed
- if (status == 200 || status == 201) {
-
- parsing = true;
-
- ParseSource parser = new ParseSource(postMethod.getResponseBodyAsStream());
- returnedEntry = BaseEntry.readEntry(parser);
-
- msg.setBody(returnedEntry);
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } // serviceType != "sca" - Use GoogleService
- else {
- returnedEntry = service.insert(new URL(binding.getURI()), entry);
- msg.setBody(returnedEntry);
- }
- } catch (ResourceNotFoundException ex) {
- msg.setFaultBody(new ResourceNotFoundException("Invalid Resource at " + binding.getURI()));
- } catch (Exception ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- if (service == null && !parsing) {
- postMethod.releaseConnection();
- }
- return msg;
- }
-
- }
- }
-
- /**
- * Put operation invoker
- */
- public static class PutInvoker extends GDataBindingInvoker {
-
- public PutInvoker(Operation operation, GDataBinding binding, HttpClient httpClient, String authorizationHeader) {
- super(operation, binding, httpClient, authorizationHeader);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- BaseEntry updatedEntry;
- String id = (String) ((Object[]) msg.getBody())[0];
- BaseEntry entry = (BaseEntry) ((Object[]) msg.getBody())[1];
-
- PutMethod putMethod = null;
- boolean parsing = false;
-
- try {
- // serviceType == "sca" - Send an HTTP PUT
- if (service == null) {
- putMethod = new PutMethod(binding.getURI() + "/" + id);
- putMethod.setRequestHeader("Authorization", authorizationHeader);
-
- // Write the Atom entry
- StringWriter strWriter = new StringWriter();
- XmlWriter writer = new XmlWriter(strWriter);
- entry.generateAtom(writer, new ExtensionProfile());
- writer.flush();
- writer.close();
-
- putMethod.setRequestHeader("Content-type", "application/atom+xml; charset=utf-8");
- putMethod.setRequestEntity(new StringRequestEntity(strWriter.toString()));
-
- httpClient.executeMethod(putMethod);
- int status = putMethod.getStatusCode();
-
- // Read the Atom feed
- if (status == 200 || status == 201) {
-
- parsing = true;
-
- ParseSource parser = new ParseSource(putMethod.getResponseBodyAsStream());
- updatedEntry = BaseEntry.readEntry(parser);
-
- msg.setBody(updatedEntry);
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } // serviceType != "sca" - Use GoogleService
- else {
- updatedEntry = service.update(new URL(id), entry);
- msg.setBody(updatedEntry);
- }
- } catch (ResourceNotFoundException ex) {
- msg.setFaultBody(new ResourceNotFoundException("Invalid Resource at " + binding.getURI()));
- } catch (Exception ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- if (service == null && !parsing) {
- putMethod.releaseConnection();
- }
- return msg;
- }
- }
- }
-
- /**
- * Delete operation invoker
- */
- public static class DeleteInvoker extends GDataBindingInvoker {
-
- public DeleteInvoker(Operation operation, GDataBinding binding, HttpClient httpClient, String authorizationHeader) {
- super(operation, binding, httpClient, authorizationHeader);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- DeleteMethod deleteMethod = null;
-
- String id = (String) ((Object[]) msg.getBody())[0];
-
- try {
- // serviceType == "sca" - Send an HTTP DELETE
- if (service == null) {
- deleteMethod = new DeleteMethod(binding.getURI() + "/" + id);
- deleteMethod.setRequestHeader("Authorization", authorizationHeader);
-
- httpClient.executeMethod(deleteMethod);
- int status = deleteMethod.getStatusCode();
-
- // Read the Atom feed
- if (status == 200) {
- msg.setBody(null);
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } // serviceType != "sca" - Use GoogleService
- else {
- service.delete(new URL(id));
- msg.setBody(null);
- }
- } catch (ResourceNotFoundException ex) {
- msg.setFaultBody(new ResourceNotFoundException("Invalid Resource at " + binding.getURI()));
- } catch (Exception ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- if (service == null) {
- deleteMethod.releaseConnection();
- }
- return msg;
- }
-
- }
- }
-
- /**
- * GetAll operation invoker
- */
- public static class GetAllInvoker extends GDataBindingInvoker {
-
- public GetAllInvoker(Operation operation, GDataBinding binding, HttpClient httpClient, String authorizationHeader) {
- super(operation, binding, httpClient, authorizationHeader);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- BaseFeed feed;
- GetMethod getMethod = null;
- boolean parsing = false;
-
- try {
- // serviceType == "sca" - Send an HTTP GET
- if (service == null) {
- getMethod = new GetMethod(binding.getURI());
- getMethod.setRequestHeader("Authorization", authorizationHeader);
-
- httpClient.executeMethod(getMethod);
- int status = getMethod.getStatusCode();
-
- // Read the Atom feed
- if (status == 200) {
-
- parsing = true;
-
- ParseSource parser = new ParseSource(getMethod.getResponseBodyAsStream());
- feed = BaseFeed.readFeed(parser);
-
- msg.setBody(feed);
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } // serviceType != "sca" - Use GoogleService
- else {
- feed = service.getFeed(new URL(binding.getURI()), Feed.class);
- msg.setBody(feed);
- }
- } catch (ResourceNotFoundException ex) {
- msg.setFaultBody(new ResourceNotFoundException("Invalid Resource at " + binding.getURI()));
- } catch (Exception ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- if (service == null && !parsing) {
- getMethod.releaseConnection();
- }
- return msg;
- }
- }
- }
-
- /**
- * Query operation invoker
- */
- public static class QueryInvoker extends GDataBindingInvoker {
-
- public QueryInvoker(Operation operation, GDataBinding binding, HttpClient httpClient, String authorizationHeader) {
- super(operation, binding, httpClient, authorizationHeader);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- BaseFeed feed;
- GetMethod getMethod = null;
- boolean parsing = false;
-
- String queryString = (String) ((Object[]) msg.getBody())[0];
-
- try {
- // serviceType == "sca" - Send an HTTP GET
- if (service == null) {
- getMethod = new GetMethod(binding.getURI());
- getMethod.setRequestHeader("Authorization", authorizationHeader);
- getMethod.setQueryString(queryString);
-
- httpClient.executeMethod(getMethod);
- int status = getMethod.getStatusCode();
-
- // Read the Atom feed
- if (status == 200) {
-
- parsing = true;
-
- ParseSource parser = new ParseSource(getMethod.getResponseBodyAsStream());
- feed = BaseFeed.readFeed(parser);
-
- msg.setBody(feed);
-
- } else if (status == 404) {
- msg.setFaultBody(new NotFoundException());
- } else {
- msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
- }
-
- } // serviceType != "sca" - Use GoogleService
- else {
- Query query = new Query(new URL(binding.getURI()));
- query.setFullTextQuery(queryString);
- feed = service.query(query, Feed.class);
- msg.setBody(feed);
- }
- } catch (ResourceNotFoundException ex) {
- msg.setFaultBody(new ResourceNotFoundException("Invalid Resource at " + binding.getURI()));
- } catch (Exception ex) {
- msg.setFaultBody(new ServiceRuntimeException(ex));
- } finally {
- if (service == null && !parsing) {
- getMethod.releaseConnection();
- }
- return msg;
- }
- }
- }
-
- /**
- * PostMedia operation invoker
- */
- public static class PostMediaInvoker extends GDataBindingInvoker {
-
- public PostMediaInvoker(Operation operation, GDataBinding binding, HttpClient httpClient, String authorizationHeader) {
- super(operation, binding, httpClient, authorizationHeader);
- }
-
- @Override
- public Message invoke(Message msg) {
- // TODO implement
- return super.invoke(msg);
- }
- }
-
- /**
- * PutMedia operation invoker
- */
- public static class PutMediaInvoker extends GDataBindingInvoker {
-
- public PutMediaInvoker(Operation operation, GDataBinding binding, HttpClient httpClient, String authorizationHeader) {
- super(operation, binding, httpClient, authorizationHeader);
- }
-
- @Override
- public Message invoke(Message msg) {
- // TODO implement
- return super.invoke(msg);
- }
- }
-
- public boolean allowsPassByReference() {
- return true;
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingListenerServlet.java b/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingListenerServlet.java
deleted file mode 100644
index 1f9318070d..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingListenerServlet.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.gdata.provider;
-
-import com.google.gdata.data.BaseEntry;
-import com.google.gdata.data.BaseFeed;
-import com.google.gdata.data.ExtensionProfile;
-import com.google.gdata.data.Link;
-import com.google.gdata.data.ParseSource;
-import com.google.gdata.util.ServiceException;
-import com.google.gdata.util.common.xml.XmlWriter;
-import java.io.IOException;
-import java.net.URLDecoder;
-import java.util.logging.Logger;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Message;
-
-class GDataBindingListenerServlet extends HttpServlet {
-
- private static final Logger logger = Logger.getLogger(GDataBindingListenerServlet.class.getName());
- private RuntimeWire wire;
- private Invoker getFeedInvoker;
- private Invoker queryInvoker;
- private Invoker getInvoker;
- private Invoker postInvoker;
- private Invoker postMediaInvoker;
- private Invoker putInvoker;
- private Invoker putMediaInvoker;
- private Invoker deleteInvoker;
- private MessageFactory messageFactory;
- private String title;
- private Mediator mediator;
-// private DataType<?> itemClassType;
-// private DataType<?> itemXMLType;
-// private boolean supportsFeedEntries;
-
- GDataBindingListenerServlet(RuntimeWire wire, MessageFactory messageFactory, Mediator mediator, String title) {
- this.wire = wire;
- this.messageFactory = messageFactory;
- this.mediator = mediator;
- this.title = title;
-
- // Get the invokers for the supported operations
- //Operation getOperation = null;
- for (InvocationChain invocationChain : this.wire.getInvocationChains()) {
- invocationChain.setAllowsPassByReference(true);
- Operation operation = invocationChain.getTargetOperation();
- String operationName = operation.getName();
- if (operationName.equals("getFeed")) {
- getFeedInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("query")) {
- queryInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("get")) {
- getInvoker = invocationChain.getHeadInvoker();
- //getOperation = operation;
- } else if (operationName.equals("put")) {
- putInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("putMedia")) {
- putMediaInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("post")) {
- postInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("postMedia")) {
- postMediaInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("delete")) {
- deleteInvoker = invocationChain.getHeadInvoker();
- }
- }
-
-// // Determine the collection item type
-// itemXMLType = new DataTypeImpl<Class<?>>(String.class.getName(), String.class, String.class);
-// Class<?> itemClass = getOperation.getOutputType().getPhysical();
-// if (itemClass == BaseEntry.class) {
-// supportsFeedEntries = true;
-// }
-// DataType<XMLType> outputType = getOperation.getOutputType();
-// QName qname = outputType.getLogical().getElementName();
-// qname = new QName(qname.getNamespaceURI(), itemClass.getSimpleName());
-// itemClassType = new DataTypeImpl<XMLType>("java:complexType", itemClass, new XMLType(qname, null));
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- int servletPathLength = request.getContextPath().length() + request.getServletPath().length();
-
- String path = URLDecoder.decode(request.getRequestURI().substring(servletPathLength), "UTF-8");
-
- logger.fine("get " + request.getRequestURI());
-
- if (path != null && path.equals("/atomsvc")) {
- //FIX-ME - Doing nothing
- } else if (path == null || path.length() == 0 || path.equals("/")) {
-
- // Return a feed containing the entries in the collection
- BaseFeed feed = null;
-
- Message requestMessage = messageFactory.createMessage();
- Message responseMessage;
- if (request.getQueryString() != null) {
- requestMessage.setBody(new Object[]{request.getQueryString()});
- responseMessage = queryInvoker.invoke(requestMessage);
- } else {
- responseMessage = getFeedInvoker.invoke(requestMessage);
- }
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable) responseMessage.getBody());
- }
-
- // The service implementation supports feed entries, invoke its getFeed operation
- feed = (BaseFeed) responseMessage.getBody();
-
- if (feed != null) {
-
- // Write the Atom feed
- response.setContentType("application/atom+xml; charset=utf-8");
- try {
-
- XmlWriter writer = new XmlWriter(response.getWriter());
- feed.generateAtom(writer, new ExtensionProfile());
- writer.flush();
- writer.close();
-
- } catch (IOException ioe) {
- throw new ServletException(ioe);
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- } else if (path.startsWith("/")) {
- // Return a specific entry in the collection
- BaseEntry feedEntry;
-
- // Invoke the get operation on the service implementation
- Message requestMessage = messageFactory.createMessage();
- String id = path.substring(1);
- requestMessage.setBody(new Object[]{id});
- Message responseMessage = getInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable) responseMessage.getBody());
- }
-
- // The service implementation returns a feed entry
- feedEntry = responseMessage.getBody();
-
- // Write the Atom entry
- if (feedEntry != null) {
- response.setContentType("application/atom+xml; charset=utf-8");
- try {
- XmlWriter writer = new XmlWriter(response.getWriter());
- feedEntry.generateAtom(writer, new ExtensionProfile());
- writer.flush();
- writer.close();
- } catch (IOException ioe) {
- throw new ServletException(ioe);
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- } else {
- // Path doesn't match any known pattern
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- }
-
- @Override
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // FIX-ME: Authenticate the user
-
-// String user = processAuthorizationHeader(request);
-// if (user == null) {
-// unauthorized(response);
-// return;
-// }
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
-
- if (path == null || path.length() == 0 || path.equals("/")) {
-
- BaseEntry createdFeedEntry = null;
-
- // Create a new Atom entry
- String contentType = request.getContentType();
- if (contentType != null && contentType.startsWith("application/atom+xml")) {
-
- // Read the entry from the request
- BaseEntry feedEntry;
- try {
- ParseSource parser = new ParseSource(request.getReader());
- feedEntry = BaseEntry.readEntry(parser);
-
- } catch (ServiceException ex) {
- throw new ServletException(ex);
- }
-
- // The service implementation supports feed entries, pass the entry to it
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[]{feedEntry});
- Message responseMessage = postInvoker.invoke(requestMessage);
-
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable) responseMessage.getBody());
- }
-
- createdFeedEntry = responseMessage.getBody();
-
- } else if (contentType != null) {
-
- // Create a new media entry
-
- // Get incoming headers
- String reqTitle = request.getHeader("Title");
- String slug = request.getHeader("Slug");
-
- // Let the component implementation create the media entry
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[]{reqTitle, slug, contentType, request.getInputStream()});
- Message responseMessage = postMediaInvoker.invoke(requestMessage);
-
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable) responseMessage.getBody());
- }
- createdFeedEntry = responseMessage.getBody();
- } else {
- response.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- }
-
- // A new entry was created successfully
- if (createdFeedEntry != null) {
-
- // Set location of the created entry in the Location header
- Link link = createdFeedEntry.getSelfLink();
- if (link != null) {
- response.addHeader("Location", link.getHref().toString());
- }
-
- // Write the created Atom entry
- response.setStatus(HttpServletResponse.SC_CREATED);
- response.setContentType("application/atom+xml; charset=utf-8");
- try {
-
- XmlWriter writer = new XmlWriter(response.getWriter());
- createdFeedEntry.generateAtom(writer, new ExtensionProfile());
- writer.flush();
- writer.close();
-
- } catch (IOException ioe) {
- throw new ServletException(ioe);
- }
-
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- }
-
- @Override
- protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // FIX-ME: Authenticate the user
-
-// String user = processAuthorizationHeader(request);
-// if (user == null) {
-// unauthorized(response);
-// return;
-// }
-
- // Get the request path
- String path = request.getRequestURI().substring(request.getServletPath().length());
-
- BaseEntry createdFeedEntry = null;
-
- if (path != null && path.startsWith("/")) {
- String id = path.substring(1);
-
- // Update an Atom entry
- String contentType = request.getContentType();
- if (contentType != null && contentType.startsWith("application/atom+xml")) {
-
- // Read the entry from the request
- BaseEntry feedEntry;
- try {
- ParseSource parser = new ParseSource(request.getReader());
- feedEntry = BaseEntry.readEntry(parser);
-
- } catch (ServiceException ex) {
- throw new ServletException(ex);
- }
-
- // Let the component implementation create it
-
- // The service implementation supports feed entries, pass the entry to it
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[]{id, feedEntry});
- Message responseMessage = putInvoker.invoke(requestMessage);
-
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable) responseMessage.getBody());
- }
- }
-
- createdFeedEntry = responseMessage.getBody();
-
- } else if (contentType != null) {
-
- // Updated a media entry
-
- // Let the component implementation create the media entry
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[]{id, contentType, request.getInputStream()});
- Message responseMessage = putMediaInvoker.invoke(requestMessage);
- Object body = responseMessage.getBody();
- if (responseMessage.isFault()) {
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable) responseMessage.getBody());
- }
- }
-
- createdFeedEntry = responseMessage.getBody();
-
- } else {
- response.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- }
-
- // A new entry was created successfully
- if (createdFeedEntry != null) {
-
- // Set location of the created entry in the Location header
- Link link = createdFeedEntry.getSelfLink();
- if (link != null) {
- response.addHeader("Location", link.getHref().toString());
- }
-
- // Write the created Atom entry
- response.setStatus(HttpServletResponse.SC_CREATED);
- response.setContentType("application/atom+xml; charset=utf-8");
- try {
-
- XmlWriter writer = new XmlWriter(response.getWriter());
- createdFeedEntry.generateAtom(writer, new ExtensionProfile());
- writer.flush();
- writer.close();
-
- } catch (IOException ioe) {
- throw new ServletException(ioe);
- }
-
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- }
-
- @Override
- protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // FIX-ME: Authenticate the user
-// String user = processAuthorizationHeader(request);
-// if (user == null) {
-// unauthorized(response);
-// return;
-// }
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
-
- String id;
- if (path != null && path.startsWith("/")) {
- id = path.substring(1);
- } else {
- id = "";
- }
-
- // Delete a specific entry from the collection
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[]{id});
- Message responseMessage = deleteInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
- if (body.getClass().getName().endsWith(".NotFoundException")) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- } else {
- throw new ServletException((Throwable) responseMessage.getBody());
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingProviderFactory.java b/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingProviderFactory.java
deleted file mode 100644
index bace6f68bb..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataBindingProviderFactory.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.gdata.provider;
-
-import org.apache.tuscany.sca.binding.gdata.GDataBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.impl.MediatorImpl;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Implementation of a Binding provider factory for the Atom binding.
- *
- * @version $Rev$ $Date$
- */
-public class GDataBindingProviderFactory implements BindingProviderFactory<GDataBinding> {
-
- private MessageFactory messageFactory;
- private Mediator mediator;
- private ServletHost servletHost;
-
- public GDataBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- this.servletHost = servletHosts.getServletHosts().get(0);
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- this.messageFactory = modelFactories.getFactory(MessageFactory.class);
- this.mediator = new MediatorImpl(extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class),
- extensionPoints.getExtensionPoint(TransformerExtensionPoint.class));
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- GDataBinding binding) {
- return new GDataReferenceBindingProvider(component, reference, binding);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- GDataBinding binding) {
- return new GDataServiceBindingProvider(component, service, binding, servletHost, messageFactory, mediator);
- }
-
- public Class<GDataBinding> getModelType() {
- return GDataBinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataReferenceBindingProvider.java b/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataReferenceBindingProvider.java
deleted file mode 100644
index 198edbaa88..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataReferenceBindingProvider.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.binding.gdata.provider;
-
-
-import org.apache.tuscany.sca.binding.gdata.GDataBinding;
-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;
-import org.apache.commons.httpclient.HttpClient;
-import java.net.URI;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.HttpConnectionManager;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.auth.AuthScope;
-
-/**
- * Implementation of the Atom binding provider.
- *
- * @version $Rev$ $Date$
- */
-class GDataReferenceBindingProvider implements ReferenceBindingProvider {
-
- private RuntimeComponentReference reference;
- private GDataBinding binding;
- private HttpClient httpClient;
- private String authorizationHeader;
-
- /**
- * Constructs a new AtomReferenceBindingProvider
- * @param component
- * @param reference
- * @param binding
- * @param mediator
- */
- GDataReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- GDataBinding binding) {
- this.reference = reference;
- this.binding = binding;
-
- // Prepare authorization header
- //String authorization = "admin" + ":" + "admin";
- String authorization = "gsocstudent2008" + ":" + "gsoc2008";
- authorizationHeader = "Basic " + new String(Base64.encodeBase64(authorization.getBytes()));
-
- // Create an HTTP client
- HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
- connectionManager.getParams().setDefaultMaxConnectionsPerHost(10);
- connectionManager.getParams().setConnectionTimeout(60000);
- httpClient = new HttpClient(connectionManager);
- }
-
-
-
- public Invoker createInvoker(Operation operation) {
-
- String operationName = operation.getName();
- if (operationName.equals("get")) {
- return new GDataBindingInvoker.GetInvoker(operation, binding, httpClient, authorizationHeader);
- } else if (operationName.equals("post")) {
- return new GDataBindingInvoker.PostInvoker(operation, binding, httpClient, authorizationHeader);
- } else if (operationName.equals("put")) {
- return new GDataBindingInvoker.PutInvoker(operation, binding, httpClient, authorizationHeader);
- } else if (operationName.equals("delete")) {
- return new GDataBindingInvoker.DeleteInvoker(operation, binding, httpClient, authorizationHeader);
- } else if (operationName.equals("getFeed") || operationName.equals("getAll")) {
- return new GDataBindingInvoker.GetAllInvoker(operation, binding, httpClient, authorizationHeader);
- } else if (operationName.equals("postMedia")) {
- return new GDataBindingInvoker.PostMediaInvoker(operation, binding, httpClient, authorizationHeader);
- } else if (operationName.equals("putMedia")) {
- return new GDataBindingInvoker.PutMediaInvoker(operation, binding, httpClient, authorizationHeader);
- } else if (operationName.equals("query")) {
- return new GDataBindingInvoker.QueryInvoker(operation, binding, httpClient, authorizationHeader);
- }
-
- return new GDataBindingInvoker(operation, binding, httpClient, authorizationHeader);
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- public void start() {
- // Configure the HTTP client credentials
- //Credentials credentials = new UsernamePasswordCredentials("admin", "admin");
- Credentials credentials = new UsernamePasswordCredentials("gsocstudent2008", "gsoc2008");
- httpClient.getParams().setAuthenticationPreemptive(true);
- URI uri = URI.create(binding.getURI());
- httpClient.getState().setCredentials(new AuthScope(uri.getHost(), uri.getPort()), credentials);
-
- // Find the get operation on the reference interface
- if (true) {
- return;
- }
- }
-
- public void stop() {
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataServiceBindingProvider.java b/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataServiceBindingProvider.java
deleted file mode 100644
index bb5739324c..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GDataServiceBindingProvider.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.binding.gdata.provider;
-
-import org.apache.tuscany.sca.binding.gdata.GDataBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-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.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-class GDataServiceBindingProvider implements ServiceBindingProvider {
-
- private RuntimeComponentService service;
- private GDataBinding binding;
- private ServletHost servletHost;
- private MessageFactory messageFactory;
- private String servletMapping;
- private Mediator mediator;
-
- GDataServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- GDataBinding binding,
- ServletHost servletHost,
- MessageFactory messageFactory,
- Mediator mediator) {
-
- this.service = service;
- this.binding = binding;
- this.servletHost = servletHost;
- this.messageFactory = messageFactory;
- this.mediator = mediator;
- }
-
- public void start() {
- RuntimeComponentService componentService = (RuntimeComponentService) service;
- RuntimeWire wire = componentService.getRuntimeWire(binding);
-
- GDataBindingListenerServlet servlet =
- new GDataBindingListenerServlet(wire, messageFactory, mediator, binding.getTitle());
-
- servletMapping = binding.getURI();
- if (!servletMapping.endsWith("/")) {
- servletMapping += "/";
- }
- if (!servletMapping.endsWith("*")) {
- servletMapping += "*";
- }
- servletHost.addServletMapping(servletMapping, servlet);
-
- // Save the actual binding URI in the binding
- binding.setURI(servletHost.getURLMapping(binding.getURI()).toString());
- }
-
- public void stop() {
- servletHost.removeServletMapping(servletMapping);
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-gdata-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index 7b655eb6b7..0000000000
--- a/branches/sca-android/modules/binding-gdata-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.gdata.provider.GDataBindingProviderFactory;model=org.apache.tuscany.sca.binding.gdata.GDataBinding
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumer.java b/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumer.java
deleted file mode 100644
index 35a692ac67..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumer.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.gdata.calendarconsumer;
-
-import com.google.gdata.data.BaseEntry;
-import com.google.gdata.data.DateTime;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.Person;
-import com.google.gdata.data.PlainTextConstruct;
-import com.google.gdata.data.extensions.EventEntry;
-import com.google.gdata.data.extensions.When;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class CalendarConsumer {
-
- public static void main(String... args) throws Exception {
-
- SCADomain scaDomain;
- CalendarConsumerImpl resourceCollection;
-
- //init
- scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/CalendarConsumer.composite");
- resourceCollection = scaDomain.getService(CalendarConsumerImpl.class, "CalendarConsumer");
-
- //test methods
- System.out.println(
- "\n//--------------------------" +
- "\n// Get the Feed" +
- "\n//--------------------------\n");
-
- Feed feed = (Feed) resourceCollection.getFeed();
-
- System.out.println("Feed content - " + feed.getUpdated().toString() + ":\n");
- for (Entry e : feed.getEntries()) {
- System.out.println("# " + e.getTitle().getPlainText());
- }
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Post a new Entry" +
- "\n//--------------------------\n");
-
- EventEntry entry = new EventEntry();
-
- entry.setTitle(new PlainTextConstruct("GSoC extra activity"));
- entry.setContent(new PlainTextConstruct("Reading the book Beautiful Code"));
-
- Person author = new Person("GSoC Student 2008", null, "gsocstudent2008@gmail.com");
- entry.getAuthors().add(author);
-
- DateTime startTime = DateTime.parseDateTime("2008-07-30T15:00:00-08:00");
- DateTime endTime = DateTime.parseDateTime("2008-07-30T17:00:00-08:00");
- When eventTimes = new When();
- eventTimes.setStartTime(startTime);
- eventTimes.setEndTime(endTime);
- entry.addTime(eventTimes);
-
- BaseEntry returnedEntry = resourceCollection.post(entry);
-
- System.out.println("# " + returnedEntry.getTitle().getPlainText());
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Get an Entry" +
- "\n//--------------------------\n");
-
- BaseEntry searchedEntry = resourceCollection.get(returnedEntry.getSelfLink().getHref());
-
- System.out.println("# " + searchedEntry.getTitle().getPlainText());
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Update an Entry" +
- "\n//--------------------------\n");
-
- searchedEntry.setTitle(new PlainTextConstruct("GSoC extra activity(opcional)"));
- BaseEntry updatedEntry = resourceCollection.put(searchedEntry.getEditLink().getHref(), searchedEntry);
-
- System.out.println("# " + updatedEntry.getTitle().getPlainText());
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Delete an Entry" +
- "\n//--------------------------\n");
-
- resourceCollection.delete(updatedEntry.getEditLink().getHref());
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Execute a query" +
- "\n//--------------------------\n");
-
- feed = (Feed) resourceCollection.query("Students");
-
- System.out.println("Feed content - " + feed.getUpdated().toString() + ":\n");
- for (Entry e : feed.getEntries()) {
- System.out.println("# " + e.getTitle().getPlainText());
- }
-
- //close
- scaDomain.close();
-
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumerImpl.java b/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumerImpl.java
deleted file mode 100644
index 8da6977c2c..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumerImpl.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.binding.gdata.calendarconsumer;
-
-import com.google.gdata.data.BaseEntry;
-import com.google.gdata.data.BaseFeed;
-
-import org.apache.tuscany.sca.binding.gdata.collection.Collection;
-import org.osoa.sca.annotations.Reference;
-
-public class CalendarConsumerImpl {
-
- @Reference
- public Collection resourceCollection;
-
- public BaseFeed getFeed() {
- return resourceCollection.getFeed();
- }
-
- public BaseEntry post(BaseEntry entry) {
- return resourceCollection.post(entry);
- }
-
- public BaseEntry get(String id) throws org.apache.tuscany.sca.implementation.data.collection.NotFoundException {
- return resourceCollection.get(id);
- }
-
- public BaseEntry put(String id, BaseEntry entry) throws org.apache.tuscany.sca.implementation.data.collection.NotFoundException {
- return resourceCollection.put(id, entry);
- }
-
- public void delete(String id) throws org.apache.tuscany.sca.implementation.data.collection.NotFoundException {
- resourceCollection.delete(id);
- }
-
- public BaseFeed query(String queryString) {
- return resourceCollection.query(queryString);
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumerTest.java b/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumerTest.java
deleted file mode 100644
index 361b9b122d..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/calendarconsumer/CalendarConsumerTest.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.binding.gdata.calendarconsumer;
-
-import com.google.gdata.data.BaseEntry;
-import com.google.gdata.data.DateTime;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.Person;
-import com.google.gdata.data.PlainTextConstruct;
-import com.google.gdata.data.extensions.EventEntry;
-import com.google.gdata.data.extensions.When;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
-
-import org.junit.Test;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import static org.junit.Assert.assertNotNull;
-
-//FIX-ME: the tests are executed in an incorrect order
-public class CalendarConsumerTest {
-
- private static SCADomain scaDomain;
- private Feed feed;
- private BaseEntry returnedEntry;
- private BaseEntry searchedEntry;
- private BaseEntry updatedEntry;
- private static CalendarConsumerImpl consumer;
-
- @BeforeClass
- public static void init() {
- scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/CalendarConsumer.composite");
- consumer = scaDomain.getService(CalendarConsumerImpl.class, "CalendarConsumer");
- }
-
- @AfterClass
- public static void close() {
- scaDomain.close();
- }
-
- @Test
- public void getFeed() {
- System.out.println("getfeed");
- feed = (Feed) consumer.getFeed();
- assertNotNull(feed);
- }
-
- @Test
- public void post() {
- System.out.println("post");
- EventEntry entry = new EventEntry();
-
- entry.setTitle(new PlainTextConstruct("GSoC extra activity"));
- entry.setContent(new PlainTextConstruct("Reading the book Beautiful Code"));
-
- Person author = new Person("GSoC Student 2008", null, "gsocstudent2008@gmail.com");
- entry.getAuthors().add(author);
-
- DateTime startTime = DateTime.parseDateTime("2008-07-22T15:00:00-08:00");
- DateTime endTime = DateTime.parseDateTime("2008-07-22T17:00:00-08:00");
- When eventTimes = new When();
- eventTimes.setStartTime(startTime);
- eventTimes.setEndTime(endTime);
- entry.addTime(eventTimes);
-
- returnedEntry = consumer.post(entry);
- assertNotNull(returnedEntry);
- }
-
- @Test
- public void get() {
- System.out.println("get");
- try {
- searchedEntry = consumer.get(returnedEntry.getSelfLink().getHref());
- assertNotNull(searchedEntry);
- } catch (NotFoundException ex) {
- Logger.getLogger(CalendarConsumerTest.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
-
- @Test
- public void put() {
- System.out.println("put");
- try {
- searchedEntry.setTitle(new PlainTextConstruct("GSoC extra activity(opcional)"));
- updatedEntry = consumer.put(searchedEntry.getEditLink().getHref(), searchedEntry);
- assertNotNull(updatedEntry);
- } catch (NotFoundException ex) {
- Logger.getLogger(CalendarConsumerTest.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
-
- @Test
- public void delete() {
- System.out.println("delete");
- try {
- consumer.delete(updatedEntry.getEditLink().getHref());
- } catch (NotFoundException ex) {
- Logger.getLogger(CalendarConsumerTest.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
-
- @Test
- public void query() {
- System.out.println("query");
- feed = (Feed) consumer.query("Students");
- assertNotNull(feed);
- }// public void testCustomerCollection() throws Exception {
-//
-// System.out.println(
-// "\n//--------------------------" +
-// "\n// Get the Feed" +
-// "\n//--------------------------\n");
-//
-// Feed feed = (Feed) resourceCollection.getFeed();
-//
-// System.out.println("Feed content - " + feed.getUpdated().toString() + ":\n");
-// for (Entry e : feed.getEntries()) {
-// System.out.println("# " + e.getTitle().getPlainText());
-// }
-//
-// System.out.println(
-// "\n//--------------------------" +
-// "\n// Post a new Entry" +
-// "\n//--------------------------\n");
-//
-// EventEntry entry = new EventEntry();
-//
-// entry.setTitle(new PlainTextConstruct("GSoC extra activity"));
-// entry.setContent(new PlainTextConstruct("Reading the book Beautiful Code"));
-//
-// Person author = new Person("GSoC Student 2008", null, "gsocstudent2008@gmail.com");
-// entry.getAuthors().add(author);
-//
-// DateTime startTime = DateTime.parseDateTime("2008-06-19T15:00:00-08:00");
-// DateTime endTime = DateTime.parseDateTime("2008-06-19T17:00:00-08:00");
-// When eventTimes = new When();
-// eventTimes.setStartTime(startTime);
-// eventTimes.setEndTime(endTime);
-// entry.addTime(eventTimes);
-//
-// BaseEntry returnedEntry = resourceCollection.post(entry);
-//
-// System.out.println("# " + returnedEntry.getTitle().getPlainText());
-//
-// System.out.println(
-// "\n//--------------------------" +
-// "\n// Get an Entry" +
-// "\n//--------------------------\n");
-//
-// BaseEntry searchedEntry = resourceCollection.get(returnedEntry.getSelfLink().getHref());
-//
-// System.out.println("# " + searchedEntry.getTitle().getPlainText());
-//
-// System.out.println(
-// "\n//--------------------------" +
-// "\n// Update an Entry" +
-// "\n//--------------------------\n");
-//
-// searchedEntry.setTitle(new PlainTextConstruct("GSoC extra activity(opcional)"));
-// BaseEntry updatedEntry = resourceCollection.put(searchedEntry.getEditLink().getHref(), searchedEntry);
-//
-// System.out.println("# " + updatedEntry.getTitle().getPlainText());
-//
-// System.out.println(
-// "\n//--------------------------" +
-// "\n// Delete an Entry" +
-// "\n//--------------------------\n");
-//
-// resourceCollection.delete(updatedEntry.getEditLink().getHref());
-//
-// System.out.println(
-// "\n//--------------------------" +
-// "\n// Execute a query" +
-// "\n//--------------------------\n");
-//
-// feed = (Feed) resourceCollection.query("Students");
-//
-// System.out.println("Feed content - " + feed.getUpdated().toString() + ":\n");
-// for (Entry e : feed.getEntries()) {
-// System.out.println("# " + e.getTitle().getPlainText());
-// }
-//
-// }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/Consumer.java b/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/Consumer.java
deleted file mode 100644
index 00055f28b2..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/Consumer.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.gdata.consumerprovider;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class Consumer {
-
- public static void main(String[] args) throws Exception {
-
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/Consumer.composite");
-
- CustomerClient testService = scaDomain.getService(CustomerClient.class, "CustomerClient");
-
- testService.testCustomerCollection();
-
- scaDomain.close();
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerClient.java b/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerClient.java
deleted file mode 100644
index 1d42c9b1a4..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerClient.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.binding.gdata.consumerprovider;
-
-public interface CustomerClient {
-
- void testCustomerCollection() throws Exception;
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerClientImpl.java b/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerClientImpl.java
deleted file mode 100644
index d6261618bf..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerClientImpl.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.binding.gdata.consumerprovider;
-
-import com.google.gdata.data.BaseEntry;
-import com.google.gdata.data.BaseFeed;
-import com.google.gdata.data.DateTime;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.Person;
-import com.google.gdata.data.PlainTextConstruct;
-import com.google.gdata.data.Source;
-import com.google.gdata.data.extensions.EventEntry;
-import com.google.gdata.data.extensions.When;
-import org.apache.tuscany.sca.binding.gdata.collection.Collection;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("COMPOSITE")
-public class CustomerClientImpl implements CustomerClient {
-
- @Reference
- public Collection resourceCollection;
-
- public void testCustomerCollection() throws Exception {
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Get the Feed" +
- "\n//--------------------------\n");
-
- BaseFeed<? extends BaseFeed, ? extends BaseEntry> feed = resourceCollection.getFeed();
-
- System.out.println("Feed content - " + feed.getUpdated().toString() + ":\n");
- for (BaseEntry e : feed.getEntries()) {
- System.out.println("# " + e.getTitle().getPlainText());
- }
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Post a new Entry" +
- "\n//--------------------------\n");
-
- EventEntry entry = new EventEntry();
-
- entry.setTitle(new PlainTextConstruct("Activity"));
- entry.setContent(new PlainTextConstruct("Reading the book Beautiful Code"));
-
- Person author = new Person("GSoC Student 2008", null, "gsocstudent2008@gmail.com");
- entry.getAuthors().add(author);
-
- DateTime startTime = DateTime.parseDateTime("2008-06-19T15:00:00-08:00");
- DateTime endTime = DateTime.parseDateTime("2008-06-19T17:00:00-08:00");
- When eventTimes = new When();
- eventTimes.setStartTime(startTime);
- eventTimes.setEndTime(endTime);
- entry.addTime(eventTimes);
-
- BaseEntry returnedEntry = resourceCollection.post(entry);
-
- System.out.println("# " + returnedEntry.getTitle().getPlainText());
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Get an Entry" +
- "\n//--------------------------\n");
-
- BaseEntry searchedEntry = resourceCollection.get(returnedEntry.getId());
- System.out.println("# " + searchedEntry.getTitle().getPlainText());
-
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Update an Entry" +
- "\n//--------------------------\n");
-
- searchedEntry.setTitle(new PlainTextConstruct("Activity (opcional)"));
- BaseEntry updatedEntry = resourceCollection.put(searchedEntry.getId(), searchedEntry);
-
- System.out.println("# " + updatedEntry.getTitle().getPlainText());
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Delete an Entry" +
- "\n//--------------------------\n");
-
- resourceCollection.delete(updatedEntry.getId());
-
- System.out.println(
- "\n//--------------------------" +
- "\n// Execute a query" +
- "\n//--------------------------\n");
-
- feed = (Feed)(Source) resourceCollection.query("GSoC");
-
- System.out.println("Feed content - " + feed.getUpdated().toString() + ":\n");
- for (BaseEntry e : feed.getEntries()) {
- System.out.println("# " + e.getTitle().getPlainText());
- }
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerCollectionImpl.java b/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerCollectionImpl.java
deleted file mode 100644
index 8233d01dd9..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/CustomerCollectionImpl.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.gdata.consumerprovider;
-
-import com.google.gdata.data.BaseEntry;
-import com.google.gdata.data.BaseFeed;
-import com.google.gdata.data.DateTime;
-import com.google.gdata.data.Entry;
-import com.google.gdata.data.Feed;
-import com.google.gdata.data.PlainTextConstruct;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TimeZone;
-import java.util.UUID;
-import org.apache.tuscany.sca.binding.gdata.collection.Collection;
-import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("COMPOSITE")
-public class CustomerCollectionImpl implements Collection {
-
- private Map<String, BaseEntry> entries;
-
- public CustomerCollectionImpl() {
- entries = new HashMap<String, BaseEntry>();
-
- BaseEntry entry = new Entry();
- entry.setId("urn:uuid:customer-0");
- entry.setTitle(new PlainTextConstruct("An exampling entry - GSoC"));
-
- entries.put(entry.getId(), entry);
- }
-
- public BaseFeed<? extends BaseFeed, ? extends BaseEntry> getFeed() {
- System.out.println(">>> CustomerCollectionImpl.getFeed");
-
- BaseFeed feed = new Feed();
- feed.setTitle(new PlainTextConstruct("Customers Feed"));
- feed.setSubtitle(new PlainTextConstruct("This is a sample feed"));
- feed.setUpdated(new DateTime());
-
- //FIX-ME
- //feed.addHtmlLink("", "", ""); //feed.addLink("");
- //feed.addHtmlLink("", "self", ""); //feed.addLink("", "self");
- feed.addHtmlLink("http://localhost:8086/customer", "", "");
-
- feed.setEntries(new ArrayList(entries.values()));
-
- return feed;
- }
-
- public BaseFeed<? extends BaseFeed, ? extends BaseEntry> query(String queryString) {
- System.out.println(">>> CustomerCollectionImpl.query collection " + queryString);
- return getFeed();
- }
-
- public BaseEntry post(BaseEntry entry) {
- System.out.println(">>> CustomerCollectionImpl.post entry=" + entry.getTitle().getPlainText());
-
- String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
- entry.setId(id);
-
- //FIX-ME
- entry.addHtmlLink("" + id, "edit", "");
- entry.addHtmlLink("" + id, "alternate", "");
-
- DateTime dateTime = new DateTime(new Date(), TimeZone.getTimeZone("America/Los_Angeles"));
- entry.setUpdated(dateTime);
-
- entries.put(id, entry);
-
- System.out.println(">>> CustomerCollectionImpl.post return id=" + id);
-
- return entry;
- }
-
- public BaseEntry get(String id) throws NotFoundException {
- System.out.println(">>> CustomerCollectionImpl.get id=" + id);
-
- return entries.get(id);
- }
-
- public BaseEntry put(String id, BaseEntry entry) throws NotFoundException {
- System.out.println(">>> CustomerCollectionImpl.put id=" + id + " entry=" + entry.getTitle());
-
- DateTime dateTime = new DateTime(new Date(), TimeZone.getTimeZone("America/Los_Angeles"));
- entry.setUpdated(dateTime);
-
- entries.put(id, entry);
-
- return entries.get(id);
- }
-
- public void delete(String id) throws NotFoundException {
- System.out.println(">>> CustomerCollectionImpl.delete id=" + id);
- entries.remove(id);
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/Provider.java b/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/Provider.java
deleted file mode 100644
index 9beca538df..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/consumerprovider/Provider.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.gdata.consumerprovider;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class Provider {
-
- public static void main(String[] args) throws Exception {
-
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/Provider.composite");
-
- System.out.println("Ready for consultings...");
- System.in.read();
-
- scaDomain.close();
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/CalendarConsumer.composite b/branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/CalendarConsumer.composite
deleted file mode 100644
index a208852f16..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/CalendarConsumer.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://customer"
- name="CalendarConsumerComposite">
-
- <component name="CalendarConsumer">
- <implementation.java class="org.apache.tuscany.sca.binding.gdata.calendarconsumer.CalendarConsumerImpl"/>
- <reference name="resourceCollection">
- <tuscany:binding.gdata uri="http://www.google.com/calendar/feeds/gsocstudent2008@gmail.com/private/full" serviceType="cl" username="gsocstudent2008@gmail.com" password="gsoc2008"/>
- </reference>
- </component>
-
-</composite> \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/Consumer.composite b/branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/Consumer.composite
deleted file mode 100644
index e381f458b6..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/Consumer.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://customer"
- name="Consumer">
-
- <component name="CustomerClient">
- <implementation.java class="org.apache.tuscany.sca.binding.gdata.consumerprovider.CustomerClientImpl"/>
- <reference name="resourceCollection">
- <tuscany:binding.gdata uri="http://localhost:8086/customer" username="gsocstudent2008" password="gsoc2008" serviceType="sca"/>
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/Provider.composite b/branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/Provider.composite
deleted file mode 100644
index e7ddb38ff0..0000000000
--- a/branches/sca-android/modules/binding-gdata-runtime/src/test/resources/org/apache/tuscany/sca/binding/gdata/Provider.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace = "http://customer"
- name="Provider">
-
- <service name="customer" promote="CustomerCollection">
- <tuscany:binding.gdata uri = "http://localhost:8086/customer" username="gsocstudent2008" password="gsoc2008" serviceType="cl"/>
- </service>
-
- <component name="CustomerCollection">
- <implementation.java class="org.apache.tuscany.sca.binding.gdata.consumerprovider.CustomerCollectionImpl"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-gdata/LICENSE b/branches/sca-android/modules/binding-gdata/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/binding-gdata/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-gdata/META-INF/README b/branches/sca-android/modules/binding-gdata/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-gdata/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-gdata/NOTICE b/branches/sca-android/modules/binding-gdata/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/binding-gdata/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/branches/sca-android/modules/binding-gdata/pom.xml b/branches/sca-android/modules/binding-gdata/pom.xml
deleted file mode 100644
index 96f43ffeb0..0000000000
--- a/branches/sca-android/modules/binding-gdata/pom.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-gdata</artifactId>
- <name>Apache Tuscany SCA Gdata Binding Extension GSOC</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.atom</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.atom*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataBinding.java b/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataBinding.java
deleted file mode 100644
index c1868f05dc..0000000000
--- a/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataBinding.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.binding.gdata;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-/**
- * GData binding model.
- *
- * @version $Rev$ $Date$
- */
-public interface GDataBinding extends Binding {
-
- /**
- * Returns the title of the Atom collection.
- * @return
- */
- String getTitle();
-
- /**
- * Sets the title of the Atom collection.
- * @param title
- */
- void setTitle(String title);
-
- /*
- * Returns the username of a Google account
- * @return
- */
- String getUsername();
-
- /*
- * Sets the username of a Google account
- * @param username
- */
- void setUsername(String username);
-
- /*
- * Returns the password of a Google account
- * @return
- */
- String getPassword();
-
- /*
- * Sets the password of a Google account
- * @param password
- */
- void setPassword(String password);
-
- /*
- * Retruns the name of the Google service to which we are connecting. Sample names of services might include "cl" (Calendar), "mail" (GMail), or "blogger" (Blogger)
- * @return
- */
- String getServiceType();
-
- /*
- * Sets the name of the Google service to which we are connecting. Sample names of services might include "cl" (Calendar), "mail" (GMail), or "blogger" (Blogger)
- * @param serviceType
- */
- void setServiceType(String serviceType);
-}
diff --git a/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataBindingFactory.java b/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataBindingFactory.java
deleted file mode 100644
index ec2f179fdb..0000000000
--- a/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataBindingFactory.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.gdata;
-
-/**
- * Factory for the GData binding
- *
- * @version $Rev$ $Date$
- */
-public interface GDataBindingFactory {
-
- /**
- * Creates a new Atom binding.
- * @return the new Atom binding
- */
- GDataBinding createAtomBinding();
-
-}
diff --git a/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataImplementationProcessor.java b/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataImplementationProcessor.java
deleted file mode 100644
index 5797629bed..0000000000
--- a/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataImplementationProcessor.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.gdata;
-
-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.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-public class GDataImplementationProcessor implements StAXArtifactProcessor<GDataBinding> {
-
- private GDataBindingFactory gdataFactory;
- protected static final QName BINDING_GDATA = new QName(Constants.SCA10_TUSCANY_NS, "binding.gdata");
-
- public GDataImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
-
- this.gdataFactory = (GDataBindingFactory) modelFactories.getFactory(GDataBindingFactory.class);
- }
-
- public GDataBinding read(XMLStreamReader reader) {
-
- assert BINDING_GDATA.equals(reader.getName());
-
- GDataBinding gdataBinding = gdataFactory.createAtomBinding();
-
- /*
- * <tuscany:binding.gdata uri="..."
- * login="..."
- * password="..."/>
- */
-
- String uri = reader.getAttributeValue(null, "uri");
- String serviceType = reader.getAttributeValue(null, "serviceType");
- String login = reader.getAttributeValue(null, "username");
- String password = reader.getAttributeValue(null, "password");
-
- gdataBinding.setURI(uri);
- gdataBinding.setServiceType(serviceType);
- gdataBinding.setUsername(login);
- gdataBinding.setPassword(password);
-
- return gdataBinding;
- }
-
- public void write(GDataBinding gdataBinding, XMLStreamWriter writer) throws XMLStreamException {
- if (gdataBinding != null) {
- writer.writeStartElement(BINDING_GDATA.getNamespaceURI(), BINDING_GDATA.getLocalPart());
-
- if (gdataBinding.getURI() != null) {
- writer.writeAttribute("uri", gdataBinding.getURI());
- }
-
- if (gdataBinding.getServiceType() != null) {
- writer.writeAttribute("serviceType", gdataBinding.getServiceType());
- }
- if (gdataBinding.getUsername() != null) {
- writer.writeAttribute("username", gdataBinding.getUsername());
- }
- if (gdataBinding.getPassword() != null) {
- writer.writeAttribute("password", gdataBinding.getPassword());
- }
-
- writer.writeEndElement();
- }
- }
-
- public QName getArtifactType() {
- return BINDING_GDATA;
- }
-
- public void resolve(GDataBinding arg0, ModelResolver arg1) throws ContributionResolveException {
- }
-
- public Class<GDataBinding> getModelType() {
- return GDataBinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GDataBindingFactoryImpl.java b/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GDataBindingFactoryImpl.java
deleted file mode 100644
index e0c3bfbe78..0000000000
--- a/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GDataBindingFactoryImpl.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.gdata.impl;
-
-import org.apache.tuscany.sca.binding.gdata.GDataBinding;
-import org.apache.tuscany.sca.binding.gdata.GDataBindingFactory;
-
-/**
- * Factory for the GData binding model.
- *
- * @version $Rev$ $Date$
- */
-public class GDataBindingFactoryImpl implements GDataBindingFactory {
-
- public GDataBinding createAtomBinding() {
- return new GDataBindingImpl();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GDataBindingImpl.java b/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GDataBindingImpl.java
deleted file mode 100644
index baba882c4c..0000000000
--- a/branches/sca-android/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GDataBindingImpl.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.binding.gdata.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.gdata.GDataBinding;
-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;
-
-/**
- * Implementation of the GData binding model.
- *
- * @version $Rev$ $Date$
- */
-class GDataBindingImpl implements GDataBinding, PolicySetAttachPoint {
-
- private String password;
- private String username;
- private String name;
- private String serviceType;
- private String uri;
- private String title;
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private IntentAttachPointType intentAttachPointType;
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- 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 String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public boolean isUnresolved() {
- // The binding is always resolved
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- // The binding is always resolved
- }
-
- 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;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
- public String getUsername() {
- return this.username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getPassword() {
- return this.password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getServiceType() {
- return this.serviceType;
- }
-
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
-}
diff --git a/branches/sca-android/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.gdata.GDataBindingFactory b/branches/sca-android/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.gdata.GDataBindingFactory
deleted file mode 100644
index 48be99b507..0000000000
--- a/branches/sca-android/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.gdata.GDataBindingFactory
+++ /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.gdata.impl.GDataBindingFactoryImpl \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 92aad3d44d..0000000000
--- a/branches/sca-android/modules/binding-gdata/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.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#binding.gdata,model=org.apache.tuscany.sca.binding.gdata.GDataBinding,factory=org.apache.tuscany.sca.binding.gdata.GDataBindingFactory
-org.apache.tuscany.sca.binding.gdata.GDataImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#binding.gdata,model=org.apache.tuscany.sca.binding.gdata.GDataBinding,factory=org.apache.tuscany.sca.binding.gdata.GDataBindingFactory \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-http-runtime/LICENSE b/branches/sca-android/modules/binding-http-runtime/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-http-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/branches/sca-android/modules/binding-http-runtime/META-INF/README b/branches/sca-android/modules/binding-http-runtime/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-http-runtime/NOTICE b/branches/sca-android/modules/binding-http-runtime/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-http-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/branches/sca-android/modules/binding-http-runtime/pom.xml b/branches/sca-android/modules/binding-http-runtime/pom.xml
deleted file mode 100644
index cd3d0e7c99..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/pom.xml
+++ /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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-http-runtime</artifactId>
- <name>Apache Tuscany SCA HTTP Binding Runtime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-resource-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.http.runtime</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.http*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java b/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java
deleted file mode 100644
index 582742bd3f..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.http.provider;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URLDecoder;
-import java.text.ParseException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.tuscany.sca.binding.http.CacheContext;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-
-/**
- * Servlet responsible for dispatching HTTP requests to the
- * target component implementation.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPBindingListenerServlet extends HttpServlet {
- private static final long serialVersionUID = 2865466417329430610L;
-
- private MessageFactory messageFactory;
- private Invoker getInvoker;
- private Invoker conditionalGetInvoker;
- private Invoker putInvoker;
- private Invoker conditionalPutInvoker;
- private Invoker postInvoker;
- private Invoker conditionalPostInvoker;
- private Invoker deleteInvoker;
- private Invoker conditionalDeleteInvoker;
-
- /**
- * Constructs a new HTTPServiceListenerServlet.
- */
- public HTTPBindingListenerServlet(MessageFactory messageFactory) {
- this.messageFactory = messageFactory;
- }
-
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
- // Redirect to a URL ending with / to make relative hrefs work
- // relative to the served resource.
- response.sendRedirect(request.getRequestURL().append('/').toString());
- return;
- }
-
- // Invoke the get operation on the service implementation
- Message requestMessage = messageFactory.createMessage();
- String id = path.substring(1);
-
- Message responseMessage = null;
- CacheContext cacheContext = null;
- try {
- cacheContext = CacheContext.getCacheContextFromRequest(request);
- } catch (ParseException e) {
- }
-
- // Route message based on availability of cache info and cache methods
- if (( cacheContext != null ) && (cacheContext.isEnabled()) && (conditionalGetInvoker != null )) {
- requestMessage.setBody(new Object[] {id, cacheContext});
- responseMessage = conditionalGetInvoker.invoke(requestMessage);
- } else {
- requestMessage.setBody(new Object[] {id});
- responseMessage = getInvoker.invoke(requestMessage);
- }
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
-
- int index = -1;
- if ( -1 < (index = body.getClass().getName().indexOf( "NotModifiedException")) ) {
- if ( index > -1 )
- response.sendError( HttpServletResponse.SC_NOT_MODIFIED, body.toString().substring( index ));
- else
- response.sendError( HttpServletResponse.SC_NOT_MODIFIED );
- return;
- } else if ( -1 < (index = body.getClass().getName().indexOf( "PreconditionFailedException")) ) {
- if ( index > -1 )
- response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED, body.toString().substring( index ));
- else
- response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED );
- return;
- }
-
- throw new ServletException((Throwable)responseMessage.getBody());
- }
-
- // Write the response from the service implementation to the response
- // output stream
- InputStream is = (InputStream)responseMessage.getBody();
- OutputStream os = response.getOutputStream();
- byte[] buffer = new byte[2048];
- for (;;) {
- int n = is.read(buffer);
- if (n <= 0)
- break;
- os.write(buffer, 0, n);
- }
- os.flush();
- os.close();
- }
-
- @Override
- protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
- // Redirect to a URL ending with / to make relative hrefs work
- // relative to the served resource.
- response.sendRedirect(request.getRequestURL().append('/').toString());
- return;
- }
-
- // Invoke the get operation on the service implementation
- Message requestMessage = messageFactory.createMessage();
- String id = path.substring(1);
-
- Message responseMessage = null;
- CacheContext cacheContext = null;
- try {
- cacheContext = CacheContext.getCacheContextFromRequest(request);
- } catch (ParseException e) {
- }
-
- // Route message based on availability of cache info and cache methods
- if (( cacheContext != null ) && (cacheContext.isEnabled()) && (conditionalDeleteInvoker != null )) {
- requestMessage.setBody(new Object[] {id, cacheContext});
- responseMessage = conditionalDeleteInvoker.invoke(requestMessage);
- } else {
- requestMessage.setBody(new Object[] {id});
- responseMessage = deleteInvoker.invoke(requestMessage);
- }
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
-
- int index = -1;
- if ( -1 < (index = body.getClass().getName().indexOf( "NotModifiedException")) ) {
- if ( index > -1 )
- response.sendError( HttpServletResponse.SC_NOT_MODIFIED, body.toString().substring( index ));
- else
- response.sendError( HttpServletResponse.SC_NOT_MODIFIED );
- return;
- } else if ( -1 < (index = body.getClass().getName().indexOf( "PreconditionFailedException")) ) {
- if ( index > -1 )
- response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED, body.toString().substring( index ));
- else
- response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED );
- return;
- }
-
- throw new ServletException((Throwable)responseMessage.getBody());
- }
-
- // Write the response from the service implementation to the response
- // output stream
- InputStream is = (InputStream)responseMessage.getBody();
- OutputStream os = response.getOutputStream();
- byte[] buffer = new byte[2048];
- for (;;) {
- int n = is.read(buffer);
- if (n <= 0)
- break;
- os.write(buffer, 0, n);
- }
- os.flush();
- os.close();
- }
-
- @Override
- protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
- // Redirect to a URL ending with / to make relative hrefs work
- // relative to the served resource.
- response.sendRedirect(request.getRequestURL().append('/').toString());
- return;
- }
-
- // Invoke the get operation on the service implementation
- Message requestMessage = messageFactory.createMessage();
- String id = path.substring(1);
-
- Message responseMessage = null;
- CacheContext cacheContext = null;
- try {
- cacheContext = CacheContext.getCacheContextFromRequest(request);
- } catch (ParseException e) {
- }
-
- // Route message based on availability of cache info and cache methods
- if (( cacheContext != null ) && (cacheContext.isEnabled()) && (conditionalPutInvoker != null )) {
- requestMessage.setBody(new Object[] {id, cacheContext});
- responseMessage = conditionalPutInvoker.invoke(requestMessage);
- } else {
- requestMessage.setBody(new Object[] {id});
- responseMessage = putInvoker.invoke(requestMessage);
- }
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
-
- int index = -1;
- if ( -1 < (index = body.getClass().getName().indexOf( "NotModifiedException")) ) {
- if ( index > -1 )
- response.sendError( HttpServletResponse.SC_NOT_MODIFIED, body.toString().substring( index ));
- else
- response.sendError( HttpServletResponse.SC_NOT_MODIFIED );
- return;
- } else if ( -1 < (index = body.getClass().getName().indexOf( "PreconditionFailedException")) ) {
- if ( index > -1 )
- response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED, body.toString().substring( index ));
- else
- response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED );
- return;
- }
-
- throw new ServletException((Throwable)responseMessage.getBody());
- }
-
- // Write the response from the service implementation to the response
- // output stream
- InputStream is = (InputStream)responseMessage.getBody();
- OutputStream os = response.getOutputStream();
- byte[] buffer = new byte[2048];
- for (;;) {
- int n = is.read(buffer);
- if (n <= 0)
- break;
- os.write(buffer, 0, n);
- }
- os.flush();
- os.close();
- }
-
- @Override
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
- // Redirect to a URL ending with / to make relative hrefs work
- // relative to the served resource.
- response.sendRedirect(request.getRequestURL().append('/').toString());
- return;
- }
-
- // Invoke the get operation on the service implementation
- Message requestMessage = messageFactory.createMessage();
- // String id = path.substring(1);
-
- Message responseMessage = null;
- CacheContext cacheContext = null;
- try {
- cacheContext = CacheContext.getCacheContextFromRequest(request);
- } catch (ParseException e) {
- }
-
- // Route message based on availability of cache info and cache methods
- if (( cacheContext != null ) && (cacheContext.isEnabled()) && (conditionalPostInvoker != null )) {
- requestMessage.setBody(new Object[] {cacheContext});
- responseMessage = conditionalPostInvoker.invoke(requestMessage);
- } else {
- requestMessage.setBody(new Object[] {});
- responseMessage = postInvoker.invoke(requestMessage);
- }
- if (responseMessage.isFault()) {
- Object body = responseMessage.getBody();
-
- int index = -1;
- if ( -1 < (index = body.getClass().getName().indexOf( "NotModifiedException")) ) {
- if ( index > -1 )
- response.sendError( HttpServletResponse.SC_NOT_MODIFIED, body.toString().substring( index ));
- else
- response.sendError( HttpServletResponse.SC_NOT_MODIFIED );
- return;
- } else if ( -1 < (index = body.getClass().getName().indexOf( "PreconditionFailedException")) ) {
- if ( index > -1 )
- response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED, body.toString().substring( index ));
- else
- response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED );
- return;
- }
-
- throw new ServletException((Throwable)responseMessage.getBody());
- }
-
- // Put ETag and LastModified in response.
- CacheContext cc = (CacheContext)responseMessage.getBody();
- response.setHeader( "ETag", cc.getETag() );
- response.setHeader( "LastModified", cc.getLastModified() );
- }
-
- /**
- * @return the getInvoker
- */
- public Invoker getGetInvoker() {
- return getInvoker;
- }
-
- /**
- * @param getInvoker the getInvoker to set
- */
- public void setGetInvoker(Invoker getInvoker) {
- this.getInvoker = getInvoker;
- }
-
- /**
- * @return the conditionalGetInvoker
- */
- public Invoker getConditionalGetInvoker() {
- return conditionalGetInvoker;
- }
-
- /**
- * @param conditionalGetInvoker the conditionalGetInvoker to set
- */
- public void setConditionalGetInvoker(Invoker conditionalGetInvoker) {
- this.conditionalGetInvoker = conditionalGetInvoker;
- }
-
- /**
- * @return the putInvoker
- */
- public Invoker getPutInvoker() {
- return putInvoker;
- }
-
- /**
- * @param putInvoker the putInvoker to set
- */
- public void setPutInvoker(Invoker putInvoker) {
- this.putInvoker = putInvoker;
- }
-
- /**
- * @return the conditionalPutInvoker
- */
- public Invoker getConditionalPutInvoker() {
- return conditionalPutInvoker;
- }
-
- /**
- * @param conditionalPutInvoker the conditionalPutInvoker to set
- */
- public void setConditionalPutInvoker(Invoker conditionalPutInvoker) {
- this.conditionalPutInvoker = conditionalPutInvoker;
- }
-
- /**
- * @return the postInvoker
- */
- public Invoker getPostInvoker() {
- return postInvoker;
- }
-
- /**
- * @param postInvoker the postInvoker to set
- */
- public void setPostInvoker(Invoker postInvoker) {
- this.postInvoker = postInvoker;
- }
-
- /**
- * @return the conditionalPostInvoker
- */
- public Invoker getConditionalPostInvoker() {
- return conditionalPostInvoker;
- }
-
- /**
- * @param conditionalPostInvoker the conditionalPostInvoker to set
- */
- public void setConditionalPostInvoker(Invoker conditionalPostInvoker) {
- this.conditionalPostInvoker = conditionalPostInvoker;
- }
-
- /**
- * @return the deleteInvoker
- */
- public Invoker getDeleteInvoker() {
- return deleteInvoker;
- }
-
- /**
- * @param deleteInvoker the deleteInvoker to set
- */
- public void setDeleteInvoker(Invoker deleteInvoker) {
- this.deleteInvoker = deleteInvoker;
- }
-
- /**
- * @return the conditionalDeleteInvoker
- */
- public Invoker getConditionalDeleteInvoker() {
- return conditionalDeleteInvoker;
- }
-
- /**
- * @param conditionalDeleteInvoker the conditionalDeleteInvoker to set
- */
- public void setConditionalDeleteInvoker(Invoker conditionalDeleteInvoker) {
- this.conditionalDeleteInvoker = conditionalDeleteInvoker;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingProviderFactory.java b/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingProviderFactory.java
deleted file mode 100644
index fccd10f3cd..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingProviderFactory.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.http.provider;
-
-import org.apache.tuscany.sca.binding.http.HTTPBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-
-/**
- * Factory for HTTP binding providers.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPBindingProviderFactory implements BindingProviderFactory<HTTPBinding> {
-
- private MessageFactory messageFactory;
- private ServletHost servletHost;
-
- public HTTPBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- this.servletHost = servletHosts.getServletHosts().get(0);
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- messageFactory = modelFactories.getFactory(MessageFactory.class);
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference, HTTPBinding binding) {
- return null;
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service, HTTPBinding binding) {
- return new HTTPServiceBindingProvider(component, service, binding, messageFactory, servletHost);
- }
-
- public Class<HTTPBinding> getModelType() {
- return HTTPBinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPGetListenerServlet.java b/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPGetListenerServlet.java
deleted file mode 100644
index e20d420d49..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPGetListenerServlet.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.binding.http.provider;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URLDecoder;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-
-/**
- * Servlet responsible for dispatching HTTP GET requests to the
- * target component implementation.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPGetListenerServlet extends HttpServlet {
- private static final long serialVersionUID = 2865466417329430610L;
-
- private MessageFactory messageFactory;
- private Invoker getInvoker;
-
- /**
- * Constructs a new HTTPServiceListenerServlet.
- */
- public HTTPGetListenerServlet(Invoker getInvoker, MessageFactory messageFactory) {
- this.getInvoker = getInvoker;
- this.messageFactory = messageFactory;
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
-
- // Redirect to a URL ending with / to make relative hrefs work
- // relative to the served resource.
- response.sendRedirect(request.getRequestURL().append('/').toString());
- return;
- }
-
- // Invoke the get operation on the service implementation
- Message requestMessage = messageFactory.createMessage();
- String id = path.substring(1);
- requestMessage.setBody(new Object[] {id});
- Message responseMessage = getInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
-
- // Write the response from the service implementation to the response
- // output stream
- InputStream is = (InputStream)responseMessage.getBody();
- OutputStream os = response.getOutputStream();
- byte[] buffer = new byte[2048];
- for (;;) {
- int n = is.read(buffer);
- if (n <= 0)
- break;
- os.write(buffer, 0, n);
- }
- os.flush();
- os.close();
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java b/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java
deleted file mode 100644
index 0a8f74edca..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.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.binding.http.provider;
-
-import javax.servlet.Servlet;
-
-import org.apache.tuscany.sca.binding.http.HTTPBinding;
-import org.apache.tuscany.sca.host.http.ServletHost;
-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.MessageFactory;
-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;
-
-/**
- * Implementation of an HTTP binding provider.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPServiceBindingProvider implements ServiceBindingProvider {
-
- private RuntimeComponentService service;
- private HTTPBinding binding;
- private MessageFactory messageFactory;
- private ServletHost servletHost;
- private String servletMapping;
- private HTTPBindingListenerServlet bindingListenerServlet;
-
- public HTTPServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- HTTPBinding binding,
- MessageFactory messageFactory,
- ServletHost servletHost) {
- this.service = service;
- this.binding = binding;
- this.messageFactory = messageFactory;
- this.servletHost = servletHost;
- }
-
- public void start() {
- // Get the invokers for the supported operations
- RuntimeComponentService componentService = (RuntimeComponentService) service;
- RuntimeWire wire = componentService.getRuntimeWire(binding);
- Servlet servlet = null;
- bindingListenerServlet = new HTTPBindingListenerServlet( messageFactory );
- for (InvocationChain invocationChain : wire.getInvocationChains()) {
- Operation operation = invocationChain.getTargetOperation();
- String operationName = operation.getName();
- if (operationName.equals("get")) {
- Invoker getInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setGetInvoker(getInvoker);
- servlet = bindingListenerServlet;
- } else if (operationName.equals("conditionalGet")) {
- Invoker conditionalGetInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setConditionalGetInvoker(conditionalGetInvoker);
- servlet = bindingListenerServlet;
- } else if (operationName.equals("delete")) {
- Invoker deleteInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setDeleteInvoker(deleteInvoker);
- servlet = bindingListenerServlet;
- } else if (operationName.equals("conditionalDelete")) {
- Invoker conditionalDeleteInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setConditionalDeleteInvoker(conditionalDeleteInvoker);
- servlet = bindingListenerServlet;
- } else if (operationName.equals("put")) {
- Invoker putInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setPutInvoker(putInvoker);
- servlet = bindingListenerServlet;
- } else if (operationName.equals("conditionalPut")) {
- Invoker conditionalPutInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setConditionalPutInvoker(conditionalPutInvoker);
- servlet = bindingListenerServlet;
- } else if (operationName.equals("post")) {
- Invoker postInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setPostInvoker(postInvoker);
- servlet = bindingListenerServlet;
- } else if (operationName.equals("conditionalPost")) {
- Invoker conditionalPostInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setConditionalPostInvoker(conditionalPostInvoker);
- servlet = bindingListenerServlet;
- } else if (operationName.equals("service")) {
- Invoker serviceInvoker = invocationChain.getHeadInvoker();
- servlet = new HTTPServiceListenerServlet(serviceInvoker, messageFactory);
- break;
- }
- }
- if (servlet == null) {
- throw new IllegalStateException("No get or service method found on the service");
- }
-
- // Create our HTTP service listener Servlet and register it with the
- // Servlet host
- servletMapping = binding.getURI();
- if (!servletMapping.endsWith("/")) {
- servletMapping += "/";
- }
- if (!servletMapping.endsWith("*")) {
- servletMapping += "*";
- }
- servletHost.addServletMapping(servletMapping, servlet);
- }
-
- public void stop() {
- // Unregister the Servlet from the Servlet host
- servletHost.removeServletMapping(servletMapping);
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return null;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceListenerServlet.java b/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceListenerServlet.java
deleted file mode 100644
index 03b91c4db2..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceListenerServlet.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.http.provider;
-
-import java.io.IOException;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-
-/**
- * Servlet responsible for dispatching HTTP service requests to the
- * target component implementation.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPServiceListenerServlet implements Servlet {
-
- private ServletConfig config;
- private MessageFactory messageFactory;
- private Invoker serviceInvoker;
-
- /**
- * Constructs a new HTTPServiceListenerServlet.
- */
- public HTTPServiceListenerServlet(Invoker serviceInvoker, MessageFactory messageFactory) {
- this.serviceInvoker = serviceInvoker;
- this.messageFactory = messageFactory;
- }
-
- public ServletConfig getServletConfig() {
- return config;
- }
-
- public String getServletInfo() {
- return "";
- }
-
- public void init(ServletConfig config) throws ServletException {
- this.config = config;
- }
-
- public void destroy() {
- }
-
- public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
-
- // Dispatch the service interaction to the service invoker
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[]{request, response});
- Message responseMessage = serviceInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- // Turn a fault into an exception
- //throw new ServletException((Throwable)responseMessage.getBody());
- Throwable e = (Throwable)responseMessage.getBody();
- ((HttpServletResponse)response).sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index 0fa8d44c08..0000000000
--- a/branches/sca-android/modules/binding-http-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.http.provider.HTTPBindingProviderFactory;model=org.apache.tuscany.sca.binding.http.HTTPBinding
diff --git a/branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java b/branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java
deleted file mode 100644
index e5cad080a6..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.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.binding.http;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.text.MessageFormat;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * HTTP binding unit tests.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPBindingTestCase extends TestCase {
-
- private static final String REQUEST1_HEADER =
- "GET /httpservice/test 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 String REQUEST3_HEADER =
- "GET /httpget/{0} HTTP/1.0\n" + "Host: localhost\n"
- + "Content-Type: text/xml\n"
- + "Connection: close\n"
- + "Content-Length: ";
- private static final String REQUEST3_CONTENT = "";
- private static final String REQUEST3 =
- REQUEST3_HEADER + REQUEST3_CONTENT.getBytes().length + "\n\n" + REQUEST3_CONTENT;
-
- private static final int HTTP_PORT = 8085;
-
- private SCADomain scaDomain;
-
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("test.composite");
- }
-
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- /**
- * Test invoking a POJO service implementation using the HTTP binding.
- * @throws Exception
- */
- public void testServiceImplementation() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
-
- String document = read(client);
- assertTrue(document.indexOf("<body><p>hey</body>") != -1);
- }
-
- /**
- * Test invoking a POJO get method implementation using the HTTP binding.
- * @throws Exception
- */
- public void testGetImplementation() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String request = MessageFormat.format( REQUEST3, index );
- os.write( request.getBytes());
- os.flush();
-
- String document = read(client);
- assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- }
-
- /**
- * Test getting a static resource provided using the HTTP binding.
- * @throws Exception
- */
- public void testStaticResourceImplementation() throws Exception {
- 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);
- }
-
- /**
- * Read response stream from the given socket.
- * @param socket
- * @return
- * @throws IOException
- */
- private 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/branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestGetImpl.java b/branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestGetImpl.java
deleted file mode 100644
index 0df279dedd..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestGetImpl.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.binding.http;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-/**
- * Test service implementation that implements a get method.
- *
- * @version $Rev$ $Date$
- */
-public class TestGetImpl {
-
- public InputStream get(String id) {
- System.out.println( "DOB: TestGetImpl id=" + id );
- return new ByteArrayInputStream(("<html><body><p>item=" + id + "</body></html>").getBytes());
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java b/branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java
deleted file mode 100644
index 11945c8cd1..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.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.http;
-
-import java.io.IOException;
-
-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 org.osoa.sca.annotations.Service;
-
-/**
- * Test service implementation.
- *
- * @version $Rev$ $Date$
- */
-
-@Service(Servlet.class)
-public class TestServiceImpl implements Servlet {
-
- public void init(ServletConfig config) throws ServletException {
- }
-
- public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
- //HttpServletResponse httpResponse = (HttpServletResponse)response;
- response.getOutputStream().print("<html><body><p>hey</body></html>");
- }
-
- public void destroy() {
- }
-
- public ServletConfig getServletConfig() {
- return null;
- }
-
- public String getServletInfo() {
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-http-runtime/src/test/resources/content/test.html b/branches/sca-android/modules/binding-http-runtime/src/test/resources/content/test.html
deleted file mode 100644
index f4b79d7f01..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/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/branches/sca-android/modules/binding-http-runtime/src/test/resources/test.composite b/branches/sca-android/modules/binding-http-runtime/src/test/resources/test.composite
deleted file mode 100644
index 62c4af4e22..0000000000
--- a/branches/sca-android/modules/binding-http-runtime/src/test/resources/test.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://sample/test"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sr="http://sample/test"
- name="test">
-
- <component name="ResourceServiceComponent">
- <tuscany:implementation.resource location="content"/>
- <service name="Resource">
- <tuscany:binding.http uri="http://localhost:8085/webcontent"/>
- </service>
- </component>
-
- <component name="HTTPServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.http.TestServiceImpl"/>
- <service name="Servlet">
- <tuscany:binding.http uri="http://localhost:8085/httpservice"/>
- </service>
- </component>
-
- <component name="HTTPGetComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.http.TestGetImpl"/>
- <service name="TestGetImpl">
- <tuscany:binding.http uri="http://localhost:8085/httpget"/>
- </service>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-http/LICENSE b/branches/sca-android/modules/binding-http/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-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/branches/sca-android/modules/binding-http/META-INF/README b/branches/sca-android/modules/binding-http/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-http/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-http/NOTICE b/branches/sca-android/modules/binding-http/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-http/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/branches/sca-android/modules/binding-http/pom.xml b/branches/sca-android/modules/binding-http/pom.xml
deleted file mode 100644
index 919f4c3d2b..0000000000
--- a/branches/sca-android/modules/binding-http/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-http</artifactId>
- <name>Apache Tuscany SCA HTTP Binding Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.http</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.http*</Export-Package>
- <Import-Package>org.apache.tuscany.sca.assembly.xml;version="1.4", *</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/CacheContext.java b/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/CacheContext.java
deleted file mode 100644
index aa80b7a40b..0000000000
--- a/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/CacheContext.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.binding.http;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * A class to store cache settings for Atom and HTTP requests and responses.
- *
- * Predicates are statements that work in conjunction with
- * ETags and LastModified dates to determine if a precondition
- * or postcondition is satisfied.
- * See HTTP specification for how predicates wrk:
- * http://tools.ietf.org/html/rfc2616
- * Example predicates in HTTP include If-Match, If-None-Match,
- * If-Modified-Since, If-Unmodified-Since, If-Range.
-
- */
-public class CacheContext {
- public static final SimpleDateFormat RFC822DateFormat = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss Z" ); // RFC 822 date time
-
- public boolean enabled;
- public String eTag;
- public String lastModified;
- public Date lastModifiedDate;
- public boolean ifModifiedSince;
- public boolean ifUnmodifiedSince;
- public boolean ifMatch;
- public boolean ifNoneMatch;
- public boolean ifRange;
-
- /**
- * An ETag is a unique ID for an item. It changes when
- * a field in the item or the update date changes.
- * See HTTP specification for how ETags work:
- * http://tools.ietf.org/html/rfc2616
- * @return the eTag
- */
- public String getETag() {
- return eTag;
- }
- /**
- * @param tag the eTag to set
- */
- public void setETag(String tag) {
- eTag = tag;
- enabled = true;
- }
- /**
- * The LastModified date is the time the item was last
- * changed. See HTTP specification for how ETags work:
- * http://tools.ietf.org/html/rfc2616
- * @return the lastModified
- */
- public String getLastModified() {
- return lastModified;
- }
- /**
- * The LastModified date is the time the item was last
- * changed. See HTTP specification for how ETags work:
- * http://tools.ietf.org/html/rfc2616
- * @return the lastModified
- */
- public Date getLastModifiedAsDate() {
- return lastModifiedDate;
- }
- /**
- * @param lastModified the lastModified to set
- */
- public void setLastModified(String lastModified) throws java.text.ParseException {
- this.lastModified = lastModified;
- // Catch date formatting on input to help debugging.
- lastModifiedDate = RFC822DateFormat.parse( lastModified );
- enabled = true;
- }
-
- /**
- * @param lastModified the lastModified to set
- */
- public void setLastModified(Date updated) {
- this.lastModified = RFC822DateFormat.format( updated );
- lastModifiedDate = updated;
- enabled = true;
- }
-
- /**
- * @return the ifModifedSince
- */
- public boolean isIfModifiedSince() {
- return ifModifiedSince;
- }
- /**
- * @param ifModifedSince the ifModifedSince to set
- */
- public void setIfModifiedSince(boolean ifModifiedSince) {
- this.ifModifiedSince = ifModifiedSince;
- if ( ifModifiedSince )
- enabled = true;
- }
- /**
- * @return the ifUnModifiedSince
- */
- public boolean isIfUnmodifiedSince() {
- return ifUnmodifiedSince;
- }
- /**
- * @param ifUnModifiedSince the ifUnModifiedSince to set
- */
- public void setIfUnmodifiedSince(boolean ifUnmodifiedSince) {
- this.ifUnmodifiedSince = ifUnmodifiedSince;
- if ( ifUnmodifiedSince )
- enabled = true;
- }
- /**
- * @return the ifMatch
- */
- public boolean isIfMatch() {
- return ifMatch;
- }
- /**
- * @param ifMatch the ifMatch to set
- */
- public void setIfMatch(boolean ifMatch) {
- this.ifMatch = ifMatch;
- if ( ifMatch )
- enabled = true;
- }
- /**
- * @return the ifNoneMatch
- */
- public boolean isIfNoneMatch() {
- return ifNoneMatch;
- }
- /**
- * @param ifNoneMatch the ifNoneMatch to set
- */
- public void setIfNoneMatch(boolean ifNoneMatch) {
- this.ifNoneMatch = ifNoneMatch;
- if ( ifNoneMatch )
- enabled = true;
- }
- /**
- * @return the ifRange
- */
- public boolean isIfRange() {
- return ifRange;
- }
- /**
- * @param ifRange the ifRange to set
- */
- public void setIfRange(boolean ifRange) {
- this.ifRange = ifRange;
- if ( ifRange )
- enabled = true;
- }
-
- public String toString() {
- final String PREDPREFIX = ", predicates=";
- StringBuffer sb = new StringBuffer(PREDPREFIX);
- if ( ifMatch || ifNoneMatch || ifModifiedSince || ifUnmodifiedSince || ifRange ) {
- if ( ifMatch ) {
- if ( sb.length() > PREDPREFIX.length() ) sb.append( ", ");
- sb.append("If-Match");
- }
- if ( ifNoneMatch ) {
- if ( sb.length() > PREDPREFIX.length() ) sb.append( ", ");
- sb.append("If-None-Match");
- }
- if ( ifModifiedSince ) {
- if ( sb.length() > PREDPREFIX.length() ) sb.append( ", ");
- sb.append("If-Modified-Since");
- }
- if ( ifUnmodifiedSince ) {
- if ( sb.length() > PREDPREFIX.length() ) sb.append( ", ");
- sb.append("If-UnModified-Since");
- }
- if ( ifRange ) {
- if ( sb.length() > PREDPREFIX.length() ) sb.append( ", ");
- sb.append("If-Range");
- }
- } else {
- sb.append("null");
- }
-
- return "eTag=" + eTag + ", lastModified=" + lastModified
- + sb.toString();
- }
-
- /**
- * Gets the cache context information (ETag, LastModified, predicates) from the Http request.
- * @param request
- * @return
- */
- public static CacheContext getCacheContextFromRequest( HttpServletRequest request ) throws java.text.ParseException {
- CacheContext context = new CacheContext();
-
- String eTag = request.getHeader( "If-Match" );
- if ( eTag != null ) {
- context.setETag( eTag );
- context.setIfMatch( true );
- }
- eTag = request.getHeader( "If-None-Match" );
- if ( eTag != null ) {
- context.setETag( eTag );
- context.setIfNoneMatch( true );
- }
- String lastModifiedString = request.getHeader( "If-Modified-Since" );
- if ( lastModifiedString != null ) {
- context.setLastModified( lastModifiedString );
- context.setIfModifiedSince( true );
- }
- lastModifiedString = request.getHeader( "If-Unmodified-Since" );
- if ( lastModifiedString != null ) {
- context.setLastModified( lastModifiedString );
- context.setIfUnmodifiedSince( true );
- }
- lastModifiedString = request.getHeader( "If-Range" );
- if ( lastModifiedString != null ) {
- context.setLastModified( lastModifiedString );
- context.setIfRange( true );
- }
- return context;
- }
- /**
- * Enabled is true whenever ETag, LastModified, or predicate is set.
- * @return the enabled
- */
- public boolean isEnabled() {
- return enabled;
- }
- /**
- * @param enabled the enabled to set
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-}
diff --git a/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBinding.java b/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBinding.java
deleted file mode 100644
index 6192b92dfe..0000000000
--- a/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBinding.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.http;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-
-/**
- * HTTP binding model.
- *
- * @version $Rev$ $Date$
-*/
-public interface HTTPBinding extends Binding {
-}
diff --git a/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBindingFactory.java b/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBindingFactory.java
deleted file mode 100644
index 370e4cdb67..0000000000
--- a/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBindingFactory.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.http;
-
-/**
- * Factory for the HTTP binding model.
- *
- * @version $Rev$ $Date$
- */
-public interface HTTPBindingFactory {
-
- /**
- * Creates a new HTTP binding.
- * @return a new HTTP binding
- */
- HTTPBinding createHTTPResourceBinding();
-
-}
diff --git a/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingFactoryImpl.java b/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingFactoryImpl.java
deleted file mode 100644
index 7e72b7dd85..0000000000
--- a/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingFactoryImpl.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.http.impl;
-
-import org.apache.tuscany.sca.binding.http.HTTPBinding;
-import org.apache.tuscany.sca.binding.http.HTTPBindingFactory;
-
-/**
- * Factory for the HTTP binding model.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPBindingFactoryImpl implements HTTPBindingFactory {
-
- public HTTPBinding createHTTPResourceBinding() {
- return new HTTPBindingImpl();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java b/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
deleted file mode 100644
index 69d2bd7d25..0000000000
--- a/branches/sca-android/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.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.http.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.OptimizableBinding;
-import org.apache.tuscany.sca.binding.http.HTTPBinding;
-
-
-/**
- * Implementation of the HTTP binding model.
- *
- * @version $Rev$ $Date$
- */
-class HTTPBindingImpl implements HTTPBinding {
-
- private String name;
- private String uri;
-
- public String getName() {
- return name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- // The sample binding is always resolved
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.http.HTTPBindingFactory b/branches/sca-android/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.http.HTTPBindingFactory
deleted file mode 100644
index 44da6b166c..0000000000
--- a/branches/sca-android/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.http.HTTPBindingFactory
+++ /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.http.impl.HTTPBindingFactoryImpl
diff --git a/branches/sca-android/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index cc07784cb7..0000000000
--- a/branches/sca-android/modules/binding-http/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.http,model=org.apache.tuscany.sca.binding.http.HTTPBinding,factory=org.apache.tuscany.sca.binding.http.HTTPBindingFactory
diff --git a/branches/sca-android/modules/binding-jms-runtime/LICENSE b/branches/sca-android/modules/binding-jms-runtime/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-jms-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/branches/sca-android/modules/binding-jms-runtime/META-INF/README b/branches/sca-android/modules/binding-jms-runtime/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-jms-runtime/NOTICE b/branches/sca-android/modules/binding-jms-runtime/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-jms-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/branches/sca-android/modules/binding-jms-runtime/pom.xml b/branches/sca-android/modules/binding-jms-runtime/pom.xml
deleted file mode 100644
index 62eb3de60d..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/pom.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <name>Apache Tuscany SCA JMS Binding Runtime</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-axiom</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.jms.runtime</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.jms.provider*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java
deleted file mode 100644
index 2fcb07a07f..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.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.binding.jms.provider;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-import javax.jms.Session;
-
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * Base MessageProcessor for the JMSBinding.
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractMessageProcessor implements JMSMessageProcessor {
-
- protected String operationPropertyName;
- protected boolean xmlFormat = true;
-
- public AbstractMessageProcessor(JMSBinding jmsBinding) {
- this.operationPropertyName = jmsBinding.getOperationSelectorPropertyName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tuscany.binding.jms.OperationAndDataBinding#getOperationName(javax.jms.Message)
- */
- public String getOperationName(Message message) {
- try {
-
- return message.getStringProperty(operationPropertyName);
-
- } catch (JMSException e) {
- throw new JMSBindingException("Exception retreiving operation name from message", e);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tuscany.binding.jms.OperationAndDataBinding#setOperationName(javax.jms.Message, java.lang.String)
- */
- public void setOperationName(String operationName, Message message) {
- try {
-
- message.setStringProperty(operationPropertyName, operationName);
-
- } catch (JMSException e) {
- throw new JMSBindingException("Exception setting the operation name on message", e);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tuscany.binding.jms.OperationAndDataBinding#extractPayload(javax.jms.Session, java.lang.Object)
- */
- public Message insertPayloadIntoJMSMessage(Session session, Object o) {
- return createJMSMessage(session, o);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tuscany.binding.jms.OperationAndDataBinding#extractPayload(javax.jms.Message)
- */
- public Object extractPayloadFromJMSMessage(Message msg) {
- try {
- if (msg.getBooleanProperty(JMSBindingConstants.FAULT_PROPERTY)) {
- throw new ServiceRuntimeException("remote service exception, see nested exception", (Throwable)((ObjectMessage)msg).getObject());
- }
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- }
- return extractPayload(msg);
- }
-
- public Message createFaultMessage(Session session, Throwable o) {
- try {
-
- ObjectMessage message = session.createObjectMessage();
- message.setObject(o);
- message.setBooleanProperty(JMSBindingConstants.FAULT_PROPERTY, true);
- return message;
-
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- }
- }
-
- protected abstract Object[] extractPayload(Message msg);
-
- protected abstract Message createJMSMessage(Session session, Object o);
-
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingInvoker.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingInvoker.java
deleted file mode 100644
index a14e2bd018..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingInvoker.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.jms.provider;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.naming.NamingException;
-
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * Invoker for the JMS binding.
- *
- * @version $Rev$ $Date$
- */
-public class JMSBindingInvoker implements Invoker, DataExchangeSemantics {
-
- protected Operation operation;
- protected String operationName;
-
- protected JMSBinding jmsBinding;
- protected JMSResourceFactory jmsResourceFactory;
- protected JMSMessageProcessor requestMessageProcessor;
- protected JMSMessageProcessor responseMessageProcessor;
- protected Destination bindingRequestDest;
- protected Destination bindingReplyDest;
- protected RuntimeComponentReference reference;
-
- public JMSBindingInvoker(JMSBinding jmsBinding, Operation operation, JMSResourceFactory jmsResourceFactory, RuntimeComponentReference reference) {
-
- this.operation = operation;
- operationName = operation.getName();
-
- this.jmsBinding = jmsBinding;
- this.jmsResourceFactory = jmsResourceFactory;
- this.reference = reference;
- this.requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding);
- this.responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(jmsBinding);
-
- try {
-
- bindingRequestDest = lookupDestination();
- bindingReplyDest = lookupResponseDestination();
-
- } catch (NamingException e) {
- throw new JMSBindingException(e);
- }
-
- }
-
- /**
- * Looks up the Destination Queue for the JMS Binding
- *
- * @return The Destination Queue
- * @throws NamingException Failed to lookup Destination Queue
- * @throws JMSBindingException Failed to lookup Destination Queue
- * @see #lookupDestinationQueue(boolean)
- */
- protected Destination lookupDestination() throws NamingException, JMSBindingException {
- return lookupDestinationQueue(false);
- }
-
- /**
- * Looks up the Destination Response Queue for the JMS Binding
- *
- * @return The Destination Response Queue
- * @throws NamingException Failed to lookup Destination Response Queue
- * @throws JMSBindingException Failed to lookup Destination Response Queue
- * @see #lookupDestinationQueue(boolean)
- */
- protected Destination lookupResponseDestination() throws NamingException, JMSBindingException {
- return lookupDestinationQueue(true);
- }
-
- /**
- * Looks up the Destination Queue for the JMS Binding.
- * <p>
- * What happens in the look up will depend on the create mode specified for the JMS Binding:
- * <ul>
- * <li>always - the JMS queue is always created. It is an error if the queue already exists
- * <li>ifnotexist - the JMS queue is created if it does not exist. It is not an error if the queue already exists
- * <li>never - the JMS queue is never created. It is an error if the queue does not exist
- * </ul>
- * See the SCA JMS Binding specification for more information.
- * <p>
- *
- * @param isReponseQueue <code>true</code> if we are creating a response queue.
- * <code>false</code> if we are creating a request queue
- * @return The Destination queue.
- * @throws NamingException Failed to lookup JMS queue
- * @throws JMSBindingException Failed to lookup JMS Queue. Probable cause is that
- * the JMS queue's current existence/non-existence is not compatible with
- * the create mode specified on the binding
- */
- protected Destination lookupDestinationQueue(boolean isReponseQueue) throws NamingException, JMSBindingException {
- String queueName;
- String queueType;
- String qCreateMode;
-
- if (isReponseQueue) {
- queueName = jmsBinding.getResponseDestinationName();
- queueType = "JMS Response Destination ";
- qCreateMode = jmsBinding.getResponseDestinationCreate();
- if (JMSBindingConstants.DEFAULT_RESPONSE_DESTINATION_NAME.equals(queueName)) {
- return null;
- }
- } else {
- queueName = jmsBinding.getDestinationName();
- queueType = "JMS Destination ";
- qCreateMode = jmsBinding.getDestinationCreate();
- }
-
- Destination dest = jmsResourceFactory.lookupDestination(queueName);
-
- if (qCreateMode.equals(JMSBindingConstants.CREATE_ALWAYS)) {
- // In this mode, the queue must not already exist as we are creating it
- if (dest != null) {
- throw new JMSBindingException(queueType + queueName
- + " already exists but has create mode of \""
- + qCreateMode
- + "\" while registering binding "
- + jmsBinding.getName()
- + " invoker");
- }
- // Create the queue
- dest = jmsResourceFactory.createDestination(queueName);
-
- } else if (qCreateMode.equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
- // In this mode, the queue may nor may not exist. It will be created if it does not exist
- if (dest == null) {
- dest = jmsResourceFactory.createDestination(queueName);
- }
-
- } else if (qCreateMode.equals(JMSBindingConstants.CREATE_NEVER)) {
- // In this mode, the queue must have already been created.
- if (dest == null) {
- throw new JMSBindingException(queueType + queueName
- + " not found but create mode of \""
- + qCreateMode
- + "\" while registering binding "
- + jmsBinding.getName()
- + " invoker");
- }
- }
-
- // Make sure we ended up with a queue
- if (dest == null) {
- throw new JMSBindingException(queueType + queueName
- + " not found with create mode of \""
- + qCreateMode
- + "\" while registering binding "
- + jmsBinding.getName()
- + " invoker");
- }
-
- return dest;
- }
-
- public org.apache.tuscany.sca.invocation.Message invoke(org.apache.tuscany.sca.invocation.Message tuscanyMsg) {
- try {
-
- Object resp = invokeTarget(tuscanyMsg);
- tuscanyMsg.setBody(resp);
-
- } catch (InvocationTargetException e) {
- tuscanyMsg.setFaultBody(e.getCause());
- } catch (ServiceRuntimeException e) {
- if (e.getCause() instanceof InvocationTargetException) {
- if ((e.getCause().getCause() instanceof RuntimeException)) {
- tuscanyMsg.setFaultBody(e.getCause());
- } else {
- tuscanyMsg.setFaultBody(e.getCause().getCause());
- }
- } else {
- tuscanyMsg.setFaultBody(e);
- }
- } catch (Throwable e) {
- tuscanyMsg.setFaultBody(e);
- }
- return tuscanyMsg;
- }
-
- protected Object invokeTarget(org.apache.tuscany.sca.invocation.Message tuscanyMsg) throws InvocationTargetException {
- try {
- Session session = jmsResourceFactory.createSession();
- try {
-
- Destination replyToDest = getReplyToDestination(session);
-
- Message requestMsg = sendRequest(tuscanyMsg, session, replyToDest);
-
- if (replyToDest == null) {
- return null;
- } else {
- Message replyMsg = receiveReply(session, replyToDest, requestMsg.getJMSMessageID());
- Object[] response = (Object[])responseMessageProcessor.extractPayloadFromJMSMessage(replyMsg);
- return (response != null && response.length > 0) ? response[0] : null;
- }
-
- } finally {
- session.close();
- }
- } catch (JMSException e) {
- throw new InvocationTargetException(e);
- } catch (NamingException e) {
- throw new InvocationTargetException(e);
- }
- }
-
- protected Destination getReplyToDestination(Session session) throws JMSException, JMSBindingException, NamingException {
- Destination replyToDest;
- if (operation.isNonBlocking()) {
- replyToDest = null;
- } else {
- if (bindingReplyDest != null) {
- replyToDest = bindingReplyDest;
- } else {
- replyToDest = session.createTemporaryQueue();
- }
- }
- return replyToDest;
- }
-
- protected Message sendRequest(org.apache.tuscany.sca.invocation.Message tuscanyMsg, Session session, Destination replyToDest) throws JMSException, JMSBindingException,
- NamingException {
-
- Message requestMsg = requestMessageProcessor.insertPayloadIntoJMSMessage(session, tuscanyMsg.getBody());
-
- setHeaders(tuscanyMsg, requestMsg);
-
- requestMsg.setJMSReplyTo(replyToDest);
-
- Destination requestDest = getRequestDestination(tuscanyMsg, session);
-
- MessageProducer producer = session.createProducer(requestDest);
-
- if (jmsBinding.getOperationJMSTimeToLive(operationName) != null) {
- producer.setTimeToLive(jmsBinding.getOperationJMSTimeToLive(operationName));
- }
-
- try {
- producer.send(requestMsg);
- } finally {
- producer.close();
- }
- return requestMsg;
- }
-
- protected Destination getRequestDestination(org.apache.tuscany.sca.invocation.Message tuscanyMsg, Session session) throws JMSBindingException, NamingException, JMSException {
- Destination requestDestination;
- if (reference.isCallback()) {
- String toURI = tuscanyMsg.getTo().getURI();
- if (toURI != null && toURI.startsWith("jms:")) {
- // the msg to uri contains the callback destination name
- // this is an jms physical name not a jndi name so need to use session.createQueue
- requestDestination = session.createQueue(toURI.substring(4));
- } else {
- requestDestination = lookupDestination();
- }
- } else {
- requestDestination = bindingRequestDest;
- }
-
- return requestDestination;
- }
-
- protected void setHeaders(org.apache.tuscany.sca.invocation.Message tuscanyMsg, Message jmsMsg) throws JMSException {
-
- requestMessageProcessor.setOperationName(jmsBinding.getNativeOperationName(operationName), jmsMsg);
-
- if (jmsBinding.getOperationJMSDeliveryMode(operationName) != null) {
- if (jmsBinding.getOperationJMSDeliveryMode(operationName)) {
- jmsMsg.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
- } else {
- jmsMsg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
- }
- }
-
- if (jmsBinding.getOperationJMSCorrelationId(operationName) != null) {
- jmsMsg.setJMSCorrelationID(jmsBinding.getOperationJMSCorrelationId(operationName));
- }
-
- if (jmsBinding.getOperationJMSPriority(operationName) != null) {
- jmsMsg.setJMSPriority(jmsBinding.getOperationJMSPriority(operationName));
- }
-
- if (jmsBinding.getOperationJMSType(operationName) != null) {
- jmsMsg.setJMSType(jmsBinding.getOperationJMSType(operationName));
- }
-
- ReferenceParameters parameters = tuscanyMsg.getFrom().getReferenceParameters();
-
- Object conversationID = parameters.getConversationID();
- if (conversationID != null) {
- jmsMsg.setStringProperty(JMSBindingConstants.CONVERSATION_ID_PROPERTY, conversationID.toString());
- }
-
- if (hasCallback()) {
-
- if (parameters.getCallbackID() != null) {
- jmsMsg.setStringProperty(JMSBindingConstants.CALLBACK_ID_PROPERTY, parameters.getCallbackID().toString());
- }
-
- String callbackDestName = getCallbackDestinationName(reference);
- if (callbackDestName != null) {
- jmsMsg.setStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY, callbackDestName);
- }
- }
-
- for (String propName : jmsBinding.getPropertyNames()) {
- Object value = jmsBinding.getProperty(propName);
- jmsMsg.setObjectProperty(propName, value);
- }
-
- Map<String, Object> operationProperties = jmsBinding.getOperationProperties(operationName);
- if (operationProperties != null) {
- for (String propName : operationProperties.keySet()) {
- Object value = operationProperties.get(propName);
- jmsMsg.setObjectProperty(propName, value);
- }
- }
- }
-
- protected boolean hasCallback() {
- if (operation.getInterface() instanceof JavaInterface) {
- JavaInterface jiface = (JavaInterface)operation.getInterface();
- if (jiface.getCallbackClass() != null) {
- return true;
- }
- }
- return false;
- }
-
- protected Message receiveReply(Session session, Destination replyToDest, String requestMsgId) throws JMSException, NamingException {
- String msgSelector = "JMSCorrelationID = '" + requestMsgId + "'";
- MessageConsumer consumer = session.createConsumer(replyToDest, msgSelector);
-
- long receiveWait;
- if (jmsBinding.getOperationJMSTimeToLive(operationName) != null) {
- receiveWait = jmsBinding.getOperationJMSTimeToLive(operationName) * 2;
- } else {
- receiveWait = JMSBindingConstants.DEFAULT_TIME_TO_LIVE;
- }
-
- Message replyMsg;
- try {
- jmsResourceFactory.startConnection();
- replyMsg = consumer.receive(receiveWait);
- } finally {
- consumer.close();
- }
- if (replyMsg == null) {
- throw new JMSBindingException("No reply message received on " + replyToDest + " for message id " + requestMsgId);
- }
- return replyMsg;
- }
-
- protected String getCallbackDestinationName(RuntimeComponentReference reference) {
- RuntimeComponentService s = (RuntimeComponentService)reference.getCallbackService();
- JMSBinding b = s.getBinding(JMSBinding.class);
- if (b != null) {
- JMSBindingServiceBindingProvider bp = (JMSBindingServiceBindingProvider)s.getBindingProvider(b);
- return bp.getDestinationName();
- }
- return null;
- }
-
- public boolean allowsPassByReference() {
- // JMS always pass by value
- return true;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java
deleted file mode 100644
index 1990e553e0..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.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.binding.jms.provider;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.naming.NamingException;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
-import org.apache.tuscany.sca.core.assembly.EndpointReferenceImpl;
-import org.apache.tuscany.sca.core.invocation.MessageImpl;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Listener for the JMSBinding.
- *
- * @version $Rev$ $Date$
- */
-public class JMSBindingListener implements MessageListener {
-
- private static final Logger logger = Logger.getLogger(JMSBindingListener.class.getName());
-
- private static final String ON_MESSAGE_METHOD_NAME = "onMessage";
- private JMSBinding jmsBinding;
- private Binding targetBinding;
- private JMSResourceFactory jmsResourceFactory;
- private RuntimeComponentService service;
- private JMSMessageProcessor requestMessageProcessor;
- private JMSMessageProcessor responseMessageProcessor;
- private String correlationScheme;
- private List<Operation> serviceOperations;
-
- public JMSBindingListener(JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeComponentService service, Binding targetBinding) throws NamingException {
- this.jmsBinding = jmsBinding;
- this.jmsResourceFactory = jmsResourceFactory;
- this.service = service;
- this.targetBinding = targetBinding;
- requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding);
- responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(jmsBinding);
- correlationScheme = jmsBinding.getCorrelationScheme();
- serviceOperations = service.getInterfaceContract().getInterface().getOperations();
-
- }
-
- public void onMessage(Message requestJMSMsg) {
- logger.log(Level.FINE, "JMS service '" + service.getName() + "' received message " + requestJMSMsg);
- try {
- Object responsePayload = invokeService(requestJMSMsg);
- sendReply(requestJMSMsg, responsePayload, false);
- } catch (Throwable e) {
- logger.log(Level.SEVERE, "Exception invoking service '" + service.getName(), e);
- sendReply(requestJMSMsg, e, true);
- }
- }
-
- /**
- * Turn the JMS message back into a Tuscany message and invoke the target component
- *
- * @param requestJMSMsg
- * @return
- * @throws JMSException
- * @throws InvocationTargetException
- */
- protected Object invokeService(Message requestJMSMsg) throws JMSException, InvocationTargetException {
-
- String operationName = requestMessageProcessor.getOperationName(requestJMSMsg);
- Operation operation = getTargetOperation(operationName);
-
- MessageImpl tuscanyMsg = new MessageImpl();
- tuscanyMsg.setOperation(operation);
- if ("onMessage".equals(operation.getName())) {
- tuscanyMsg.setBody(new Object[]{requestJMSMsg});
- } else {
- Object requestPayload = requestMessageProcessor.extractPayloadFromJMSMessage(requestJMSMsg);
- tuscanyMsg.setBody(requestPayload);
- }
-
- setHeaderProperties(requestJMSMsg, tuscanyMsg, operation);
-
- return service.getRuntimeWire(targetBinding).invoke(operation, tuscanyMsg);
- }
-
- protected Operation getTargetOperation(String operationName) {
- Operation operation = null;
-
- if (serviceOperations.size() == 1) {
-
- // SCA JMS Binding Specification - Rule 1.5.1 line 203
- operation = serviceOperations.get(0);
-
- } else if (operationName != null) {
-
- // SCA JMS Binding Specification - Rule 1.5.1 line 205
- for (Operation op : serviceOperations) {
- if (op.getName().equals(operationName)) {
- operation = op;
- break;
- }
- }
-
- } else {
-
- // SCA JMS Binding Specification - Rule 1.5.1 line 207
- for (Operation op : serviceOperations) {
- if (op.getName().equals(ON_MESSAGE_METHOD_NAME)) {
- operation = op;
- break;
- }
- }
- }
-
- if (operation == null) {
- throw new JMSBindingException("Can't find operation " + (operationName != null ? operationName : ON_MESSAGE_METHOD_NAME));
- }
-
- return operation;
- }
-
- protected void setHeaderProperties(Message requestJMSMsg, MessageImpl tuscanyMsg, Operation operation) throws JMSException {
-
- EndpointReference from = new EndpointReferenceImpl(null);
- tuscanyMsg.setFrom(from);
- from.setCallbackEndpoint(new EndpointReferenceImpl("/")); // TODO: whats this for?
- ReferenceParameters parameters = from.getReferenceParameters();
-
- String conversationID = requestJMSMsg.getStringProperty(JMSBindingConstants.CONVERSATION_ID_PROPERTY);
- if (conversationID != null) {
- parameters.setConversationID(conversationID);
- }
-
- if (service.getInterfaceContract().getCallbackInterface() != null) {
-
- String callbackdestName = requestJMSMsg.getStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY);
- if (callbackdestName == null && operation.isNonBlocking()) {
- // if the request has a replyTo but this service operation is oneway but the service uses callbacks
- // then use the replyTo as the callback destination
- Destination replyTo = requestJMSMsg.getJMSReplyTo();
- if (replyTo != null) {
- callbackdestName = (replyTo instanceof Queue) ? ((Queue)replyTo).getQueueName() : ((Topic)replyTo).getTopicName();
- }
- }
-
- if (callbackdestName != null) {
- // append "jms:" to make it an absolute uri so the invoker can determine it came in on the request
- // as otherwise the invoker should use the uri from the service callback binding
- parameters.setCallbackReference(new EndpointReferenceImpl("jms:" + callbackdestName));
- }
-
- String callbackID = requestJMSMsg.getStringProperty(JMSBindingConstants.CALLBACK_ID_PROPERTY);
- if (callbackID != null) {
- parameters.setCallbackID(callbackID);
- }
- }
- }
-
- protected void sendReply(Message requestJMSMsg, Object responsePayload, boolean isFault) {
- try {
-
- if (requestJMSMsg.getJMSReplyTo() == null) {
- // assume no reply is expected
- if (responsePayload != null) {
- logger.log(Level.FINE, "JMS service '" + service.getName() + "' dropped response as request has no replyTo");
- }
- return;
- }
-
- Session session = jmsResourceFactory.createSession();
- Message replyJMSMsg;
- if (isFault) {
- replyJMSMsg = responseMessageProcessor.createFaultMessage(session, (Throwable)responsePayload);
- } else {
- replyJMSMsg = responseMessageProcessor.insertPayloadIntoJMSMessage(session, responsePayload);
- }
-
- replyJMSMsg.setJMSDeliveryMode(requestJMSMsg.getJMSDeliveryMode());
- replyJMSMsg.setJMSPriority(requestJMSMsg.getJMSPriority());
-
- if (correlationScheme == null || JMSBindingConstants.CORRELATE_MSG_ID.equalsIgnoreCase(correlationScheme)) {
- replyJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSMessageID());
- } else if (JMSBindingConstants.CORRELATE_CORRELATION_ID.equalsIgnoreCase(correlationScheme)) {
- replyJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSCorrelationID());
- }
-
- Destination destination = requestJMSMsg.getJMSReplyTo();
- MessageProducer producer = session.createProducer(destination);
-
- producer.send(replyJMSMsg);
-
- producer.close();
- session.close();
-
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- } catch (NamingException e) {
- throw new JMSBindingException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingProviderFactory.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingProviderFactory.java
deleted file mode 100644
index e0cd756849..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingProviderFactory.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jms.provider;
-
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-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.apache.tuscany.sca.work.WorkScheduler;
-
-/**
- * A factory from creating the JMS binding provider.
- *
- * @version $Rev$ $Date$
- */
-public class JMSBindingProviderFactory implements BindingProviderFactory<JMSBinding> {
-
- private WorkScheduler workScheduler;
- private ExtensionPointRegistry extensionPoints;
-
- public JMSBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- workScheduler = utilities.getUtility(WorkScheduler.class);
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference, JMSBinding binding) {
- return new JMSBindingReferenceBindingProvider(component, reference, binding, extensionPoints);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service, JMSBinding binding) {
- return new JMSBindingServiceBindingProvider(component, service, binding, binding, workScheduler, extensionPoints);
- }
-
- public Class<JMSBinding> getModelType() {
- return JMSBinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
deleted file mode 100644
index 4266a6c7c8..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.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.binding.jms.provider;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jms.JMSException;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
-import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
-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.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 JMS reference binding provider.
- *
- * @version $Rev$ $Date$
- */
-public class JMSBindingReferenceBindingProvider implements ReferenceBindingProvider {
-
- private RuntimeComponentReference reference;
- private JMSBinding jmsBinding;
- private List<JMSBindingInvoker> jmsBindingInvokers = new ArrayList<JMSBindingInvoker>();
- private JMSResourceFactory jmsResourceFactory;
- private RuntimeComponent component;
- private InterfaceContract wsdlInterfaceContract;
- private ExtensionPointRegistry extensions;
-
- public JMSBindingReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference, JMSBinding binding, ExtensionPointRegistry extensions) {
- this.reference = reference;
- this.jmsBinding = binding;
- this.extensions = extensions;
- jmsResourceFactory = new JMSResourceFactory(binding.getConnectionFactoryName(), binding.getInitialContextFactoryName(), binding.getJndiURL());
-
- if (XMLTextMessageProcessor.class.isAssignableFrom(JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding).getClass())) {
- setXMLDataBinding(reference);
- }
-
- }
-
- protected void setXMLDataBinding(RuntimeComponentReference reference) {
-
- WebServiceBindingFactory wsFactory = extensions.getExtensionPoint(WebServiceBindingFactory.class);
- WebServiceBinding wsBinding = wsFactory.createWebServiceBinding();
- BindingWSDLGenerator.generateWSDL(component, reference, wsBinding, extensions, null);
- wsdlInterfaceContract = wsBinding.getBindingInterfaceContract();
- wsdlInterfaceContract.getInterface().resetDataBinding(OMElement.class.getName());
-
- // TODO: TUSCANY-xxx, section 5.2 "Default Data Binding" in the JMS binding spec
-
-// try {
-// InterfaceContract ic = (InterfaceContract)reference.getInterfaceContract().clone();
-//
-// Interface ii = (Interface)ic.getInterface().clone();
-// ii.resetDataBinding("org.apache.axiom.om.OMElement");
-// ic.setInterface(ii);
-// reference.setInterfaceContract(ic);
-//
-// } catch (CloneNotSupportedException e) {
-// throw new RuntimeException(e);
-// }
- }
-
- public Invoker createInvoker(Operation operation) {
-
- if (jmsBinding.getDestinationName().equals(JMSBindingConstants.DEFAULT_DESTINATION_NAME)) {
- if (!reference.isCallback()) {
- throw new JMSBindingException("No destination specified for reference " + reference.getName());
- }
- }
-
- JMSBindingInvoker invoker = new JMSBindingInvoker(jmsBinding, operation, jmsResourceFactory, reference);
- jmsBindingInvokers.add(invoker);
- return invoker;
- }
-
- public boolean supportsOneWayInvocation() {
- return true;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- if (wsdlInterfaceContract != null) {
- return wsdlInterfaceContract;
- } else {
- if (reference.getInterfaceContract() == null) {
- return reference.getReference().getInterfaceContract();
- } else {
- return reference.getInterfaceContract();
- }
- }
- }
-
- public void start() {
-
- }
-
- public void stop() {
- try {
- jmsResourceFactory.closeConnection();
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
deleted file mode 100644
index 7db640b7d1..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jms.provider;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.naming.NamingException;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
-import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-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.work.WorkScheduler;
-
-/**
- * Implementation of the JMS service binding provider.
- *
- * @version $Rev$ $Date$
- */
-public class JMSBindingServiceBindingProvider implements ServiceBindingProvider {
- private static final Logger logger = Logger.getLogger(JMSBindingServiceBindingProvider.class.getName());
-
- private RuntimeComponentService service;
- private Binding targetBinding;
- private JMSBinding jmsBinding;
- private JMSResourceFactory jmsResourceFactory;
- private MessageConsumer consumer;
- private WorkScheduler workScheduler;
- private boolean running;
-
- private Destination destination;
-
- private ExtensionPointRegistry extensionPoints;
-
- private RuntimeComponent component;
- private InterfaceContract wsdlInterfaceContract;
-
- public JMSBindingServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service, Binding targetBinding, JMSBinding binding, WorkScheduler workScheduler, ExtensionPointRegistry extensionPoints) {
- this.component = component;
- this.service = service;
- this.jmsBinding = binding;
- this.workScheduler = workScheduler;
- this.targetBinding = targetBinding;
- this.extensionPoints = extensionPoints;
-
- jmsResourceFactory = new JMSResourceFactory(binding.getConnectionFactoryName(), binding.getInitialContextFactoryName(), binding.getJndiURL());
-
- if (jmsBinding.getDestinationName().equals(JMSBindingConstants.DEFAULT_DESTINATION_NAME)) {
- if (!service.isCallback()) {
- // use the SCA service name as the default destination name
- jmsBinding.setDestinationName(service.getName());
- }
- }
-
- if (XMLTextMessageProcessor.class.isAssignableFrom(JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding).getClass())) {
- if (!isOnMessage()) {
- setXMLDataBinding(service);
- }
- }
-
- }
-
- protected boolean isOnMessage() {
- InterfaceContract ic = getBindingInterfaceContract();
- if (ic.getInterface().getOperations().size() != 1) {
- return false;
- }
- return "onMessage".equals(ic.getInterface().getOperations().get(0).getName());
- }
-
- protected void setXMLDataBinding(RuntimeComponentService service) {
- if (service.getInterfaceContract() != null) {
- WebServiceBindingFactory wsFactory = extensionPoints.getExtensionPoint(WebServiceBindingFactory.class);
- WebServiceBinding wsBinding = wsFactory.createWebServiceBinding();
- BindingWSDLGenerator.generateWSDL(component, service, wsBinding, extensionPoints, null);
- wsdlInterfaceContract = wsBinding.getBindingInterfaceContract();
- wsdlInterfaceContract.getInterface().resetDataBinding(OMElement.class.getName());
-
- // TODO: TUSCANY-xxx, section 5.2 "Default Data Binding" in the JMS binding spec
-
-// try {
-// InterfaceContract ic = (InterfaceContract)service.getInterfaceContract().clone();
-// Interface ii = ic.getInterface();
-// if (ii.getOperations().size() == 1 && "onMessage".equals(ii.getOperations().get(0).getName())) {
-// return;
-// }
-// ii = (Interface)ii.clone();
-// ii.resetDataBinding("org.apache.axiom.om.OMElement");
-// ic.setInterface(ii);
-// service.setInterfaceContract(ic);
-//
-// } catch (CloneNotSupportedException e) {
-// throw new RuntimeException(e);
-// }
- }
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- if (wsdlInterfaceContract != null) {
- return wsdlInterfaceContract;
- } else {
- return service.getInterfaceContract();
- }
- }
-
- public boolean supportsOneWayInvocation() {
- return true;
- }
-
- public void start() {
- this.running = true;
-
- try {
- registerListerner();
- } catch (Exception e) {
- throw new JMSBindingException("Error starting JMSServiceBinding", e);
- }
- }
-
- public void stop() {
- this.running = false;
- try {
- consumer.close();
- jmsResourceFactory.closeConnection();
- } catch (Exception e) {
- // if using an embedded broker then when shutting down Tuscany the broker may get closed
- // before this stop method is called. I can't see how to detect that so for now just
- // ignore the exception if the message is that the transport is already disposed
- if (!"Transport disposed.".equals(e.getMessage())) {
- throw new JMSBindingException("Error stopping JMSServiceBinding", e);
- }
- }
- }
-
- private void registerListerner() throws NamingException, JMSException {
-
- Session session = jmsResourceFactory.createSession();
- destination = lookupDestinationQueue();
- if (destination == null) {
- destination = session.createTemporaryQueue();
- }
-
- if (jmsBinding.getJMSSelector() != null) {
- consumer = session.createConsumer(destination, jmsBinding.getJMSSelector());
- } else {
- consumer = session.createConsumer(destination);
- }
-
- final JMSBindingListener listener = new JMSBindingListener(jmsBinding, jmsResourceFactory, service, targetBinding);
- try {
-
- consumer.setMessageListener(listener);
- jmsResourceFactory.startConnection();
-
- } catch (javax.jms.IllegalStateException e) {
-
- // setMessageListener not allowed in JEE container so use Tuscany threads
-
- jmsResourceFactory.startConnection();
- workScheduler.scheduleWork(new Runnable() {
- public void run() {
- try {
- while (running) {
- final Message msg = consumer.receive();
- workScheduler.scheduleWork(new Runnable() {
- public void run() {
- try {
- listener.onMessage(msg);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- logger.log(Level.INFO, "JMS " + (service.isCallback() ? "callback service" : "service")
- + " '"
- + service.getName()
- + "' listening on destination "
- + ((destination instanceof Queue) ? ((Queue)destination).getQueueName() : ((Topic)destination).getTopicName()));
- }
-
- /**
- * Looks up the Destination Queue for the JMS Binding.
- * <p>
- * What happens in the look up will depend on the create mode specified for the JMS Binding:
- * <ul>
- * <li>always - the JMS queue is always created. It is an error if the queue already exists
- * <li>ifnotexist - the JMS queue is created if it does not exist. It is not an error if the queue already exists
- * <li>never - the JMS queue is never created. It is an error if the queue does not exist
- * </ul>
- * See the SCA JMS Binding specification for more information.
- * <p>
- *
- * @return The Destination queue.
- * @throws NamingException Failed to lookup JMS queue
- * @throws JMSBindingException Failed to lookup JMS Queue. Probable cause is that the JMS queue's current existence/non-existence is not
- * compatible with the create mode specified on the binding
- */
- private Destination lookupDestinationQueue() throws NamingException, JMSBindingException {
-
- if (service.isCallback() && JMSBindingConstants.DEFAULT_DESTINATION_NAME.equals(jmsBinding.getDestinationName())) {
- // if its a callback service returning null indicates to use a temporary queue
- return null;
- }
-
- Destination destination = jmsResourceFactory.lookupDestination(jmsBinding.getDestinationName());
-
- String qCreateMode = jmsBinding.getDestinationCreate();
- if (qCreateMode.equals(JMSBindingConstants.CREATE_ALWAYS)) {
- // In this mode, the queue must not already exist as we are creating it
- if (destination != null) {
- throw new JMSBindingException("JMS Destination " + jmsBinding.getDestinationName()
- + " already exists but has create mode of \""
- + qCreateMode
- + "\" while registering service "
- + service.getName()
- + " listener");
- }
-
- // Create the queue
- destination = jmsResourceFactory.createDestination(jmsBinding.getDestinationName());
-
- } else if (qCreateMode.equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
- // In this mode, the queue may nor may not exist. It will be created if it does not exist
- if (destination == null) {
- destination = jmsResourceFactory.createDestination(jmsBinding.getDestinationName());
- }
-
- } else if (qCreateMode.equals(JMSBindingConstants.CREATE_NEVER)) {
- // In this mode, the queue must have already been created.
- if (destination == null) {
- throw new JMSBindingException("JMS Destination " + jmsBinding.getDestinationName()
- + " not found but create mode of \""
- + qCreateMode
- + "\" while registering service "
- + service.getName()
- + " listener");
- }
- }
-
- // Make sure we ended up with a queue
- if (destination == null) {
- throw new JMSBindingException("JMS Destination " + jmsBinding.getDestinationName()
- + " not found with create mode of \""
- + qCreateMode
- + "\" while registering service "
- + service.getName()
- + " listener");
- }
-
- return destination;
- }
-
- public String getDestinationName() {
- try {
- if (destination instanceof Queue) {
- return ((Queue)destination).getQueueName();
- } else if (destination instanceof Topic) {
- return ((Topic)destination).getTopicName();
- } else {
- return null;
- }
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- }
- }
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSMessageProcessor.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSMessageProcessor.java
deleted file mode 100644
index 821b9d7873..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSMessageProcessor.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.binding.jms.provider;
-
-import javax.jms.Message;
-import javax.jms.Session;
-
-/**
- * Interface for a component that does operation selection and message payload processing
- *
- * @version $Rev$ $Date$
- */
-public interface JMSMessageProcessor {
-
- /**
- * Get the operation name from a JMS Message
- */
- String getOperationName(Message message);
-
- /**
- * Set the operation name on a JMS Message
- */
- void setOperationName(String operationName, Message message);
-
- /**
- * Extracts the payload from a JMS Message
- */
- Object extractPayloadFromJMSMessage(Message msg);
-
- /**
- * Create a JMS Message containing the payload
- */
- Message insertPayloadIntoJMSMessage(Session session, Object payload);
-
- /**
- * Create a JMS Message for reporting an exception
- */
- Message createFaultMessage(Session session, Throwable responsePayload);
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSMessageProcessorUtil.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSMessageProcessorUtil.java
deleted file mode 100644
index 699b1cb176..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSMessageProcessorUtil.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.jms.provider;
-
-import java.lang.reflect.Constructor;
-
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
-
-/**
- * Utility methods to load JMS message processors.
- *
- * @version $Rev: $ $Date: $
- */
-public class JMSMessageProcessorUtil {
-
- /**
- * Used to create instances of the JMSResourceFactory and RequestMessageProcessor and ResponseMessageProcessor from
- * string based class name provided in the configuration
- *
- * @param cl ClassLoader
- * @param className the string based class name to load and instantiate
- * @return the new object
- */
- private static Object instantiate(ClassLoader cl, String className, JMSBinding binding) {
- Object instance;
- if (cl == null) {
- cl = binding.getClass().getClassLoader();
- }
-
- try {
- Class<?> clazz;
-
- try {
- clazz = cl.loadClass(className);
- } catch (ClassNotFoundException e) {
- clazz = binding.getClass().getClassLoader().loadClass(className);
- }
-
- Constructor<?> constructor = clazz.getDeclaredConstructor(new Class[] {JMSBinding.class});
- instance = constructor.newInstance(binding);
-
- } catch (Throwable e) {
- throw new JMSBindingException("Exception instantiating OperationAndDataBinding class", e);
- }
-
- return instance;
- }
-
- public static JMSMessageProcessor getRequestMessageProcessor(JMSBinding binding) {
- return (JMSMessageProcessor)instantiate(null, binding.getRequestMessageProcessorName(), binding);
- }
-
- public static JMSMessageProcessor getResponseMessageProcessor(JMSBinding binding) {
- return (JMSMessageProcessor)instantiate(null, binding.getResponseMessageProcessorName(), binding);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
deleted file mode 100644
index a1308d98cf..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.jms.provider;
-
-import java.util.Properties;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
-
-/**
- * Abstracts away any JMS provide specific feature from the JMS binding
- *
- * @version $Rev$ $Date$
- */
-public class JMSResourceFactory {
-
- private String initialContextFactoryName;
- private String connectionFactoryName = "ConnectionFactory";
- private String jndiURL;
-
- private Connection connection;
- private Context context;
- private boolean isConnectionStarted;
-
- public JMSResourceFactory(String connectionFactoryName, String initialContextFactoryName, String jndiURL) {
- if (connectionFactoryName != null && connectionFactoryName.trim().length() > 0) {
- this.connectionFactoryName = connectionFactoryName.trim();
- }
- if (initialContextFactoryName != null && initialContextFactoryName.trim().length() > 0) {
- this.initialContextFactoryName = initialContextFactoryName.trim();
- }
- if (jndiURL != null) {
- this.jndiURL = jndiURL.trim();
- }
- }
-
- /*
- * This is a simple implementation where a connection is created per binding Ideally the resource factory should be
- * able to leverage the host environment to provide connection pooling if it can. E.g. if Tuscany is running inside
- * an AppServer Then we could leverage the JMS resources it provides
- *
- * @see org.apache.tuscany.binding.jms.JMSResourceFactory#getConnection()
- */
- public Connection getConnection() throws NamingException, JMSException {
- if (connection == null) {
- createConnection();
- }
- return connection;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tuscany.binding.jms.JMSResourceFactory#createSession()
- */
- public Session createSession() throws JMSException, NamingException {
- return getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tuscany.binding.jms.JMSResourceFactory#startConnection()
- */
- public void startConnection() throws JMSException, NamingException {
- if (!isConnectionStarted) {
- getConnection().start();
- isConnectionStarted = true;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tuscany.binding.jms.JMSResourceFactory#closeConnection()
- */
- public void closeConnection() throws JMSException {
- if (connection != null) {
- try {
- connection.close();
- } catch (JMSException e) {
- // if using an embedded broker then when shutting down Tuscany the broker may get closed
- // before this stop method is called. I can't see how to detect that so for now just
- // ignore the exception if the message is that the transport is already disposed
- if (!e.getMessage().contains("disposed")) {
- throw e;
- }
- }
- }
- }
-
- private void createConnection() throws NamingException, JMSException {
- ConnectionFactory connectionFactory = (ConnectionFactory)jndiLookUp(connectionFactoryName);
- if (connectionFactory == null) {
- throw new JMSBindingException("connection factory not found: " + connectionFactoryName);
- }
- connection = connectionFactory.createConnection();
- }
-
- private synchronized Context getInitialContext() throws NamingException {
- if (context == null) {
- Properties props = new Properties();
-
- if (initialContextFactoryName != null) {
- props.setProperty(Context.INITIAL_CONTEXT_FACTORY, initialContextFactoryName);
- }
- if (jndiURL != null) {
- props.setProperty(Context.PROVIDER_URL, jndiURL);
- }
-
- initJREEnvironment(props);
-
- context = new InitialContext(props);
- }
- return context;
- }
-
- /**
- * If using the WAS JMS Client with a non-IBM JRE then an additional
- * environment property needs to be set to initialize the ORB correctly.
- * See: http://www-1.ibm.com/support/docview.wss?uid=swg24012804
- */
- private void initJREEnvironment(Properties props) {
- if ("com.ibm.websphere.naming.WsnInitialContextFactory".equals(props.get(Context.INITIAL_CONTEXT_FACTORY))) {
- String vendor = System.getProperty("java.vendor");
- if (vendor == null || !vendor.contains("IBM")) {
- props.setProperty("com.ibm.CORBA.ORBInit", "com.ibm.ws.sib.client.ORB");
- }
- }
- }
-
- public Destination lookupDestination(String destName) throws NamingException {
- if (JMSBindingConstants.DEFAULT_DESTINATION_NAME.equals(destName)) {
- return null;
- }
-
- Destination dest = (Destination)jndiLookUp(destName);
- if (dest == null) {
- dest = lookupPhysical(destName);
- }
- return dest;
- }
-
- protected Destination lookupPhysical(String jndiName) {
-
- // TODO: the SCA JMS spec says a destination name may be a non-jndi plain destination name
-
-// Session session = null;
-// try {
-//
-// Destination dest;
-// session = createSession();
-// dest = session.createQueue(jndiName);
-// return dest;
-//
-// } catch (JMSException e) {
-// throw new JMSBindingException(e);
-// } catch (NamingException e) {
-// throw new JMSBindingException(e);
-// } finally {
-// if (session != null) {
-// try {
-// session.close();
-// } catch (JMSException e) {
-// throw new JMSBindingException(e);
-// }
-// }
-// }
- return null;
- }
-
- /**
- * You can create a destination in ActiveMQ (and have it appear in JNDI) by putting "dynamicQueues/" in front of the queue name being looked up
- */
- public Destination createDestination(String jndiName) throws NamingException {
- return lookupDestination("dynamicQueues/" + jndiName);
- }
-
- protected Object jndiLookUp(String name) {
- Object o = null;
- try {
- o = getInitialContext().lookup("java:comp/env/" + name);
- } catch (NamingException ex) {
- // ignore
- }
- if (o == null) {
- try {
- o = getInitialContext().lookup(name);
- } catch (NamingException ex) {
- // ignore
- }
- }
- return o;
- }
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/ObjectMessageProcessor.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/ObjectMessageProcessor.java
deleted file mode 100644
index e9ae3cecaa..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/ObjectMessageProcessor.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.jms.provider;
-
-import java.io.Serializable;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-import javax.jms.Session;
-
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
-
-/**
- * MessageProcessor for sending/receiving Serializable objects with the JMSBinding.
- *
- * @version $Rev$ $Date$
- */
-public class ObjectMessageProcessor extends AbstractMessageProcessor {
-
- public ObjectMessageProcessor(JMSBinding jmsBinding) {
- super(jmsBinding);
- }
-
- @Override
- protected Object[] extractPayload(Message msg) {
- try {
-
- Object o = ((ObjectMessage)msg).getObject();
- if (o != null && o.getClass().isArray()) {
- return (Object[])o;
- } else {
- return new Object[] { o};
- }
-
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- }
- }
-
- @Override
- protected Message createJMSMessage(Session session, Object o) {
- try {
-
- if (!(o instanceof Serializable)) {
- throw new IllegalStateException("JMS ObjectMessage payload not Serializable: " + o);
- }
-
- ObjectMessage message = session.createObjectMessage();
- message.setObject((Serializable)o);
- return message;
-
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/TextMessageProcessor.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/TextMessageProcessor.java
deleted file mode 100644
index d8490c6223..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/TextMessageProcessor.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.binding.jms.provider;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
-
-/**
- * MessageProcessor for sending/receiving javax.jms.TextMessage with the JMSBinding.
- *
- * @version $Rev$ $Date$
- */
-public class TextMessageProcessor extends AbstractMessageProcessor {
-
- public TextMessageProcessor(JMSBinding jmsBinding) {
- super(jmsBinding);
- }
-
- @Override
- protected Object[] extractPayload(Message msg) {
- try {
-
- if (!(msg instanceof TextMessage)) {
- throw new IllegalStateException("expecting JMS TextMessage: " + msg);
- }
-
- return new Object[] {((TextMessage)msg).getText()};
-
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- }
- }
-
- @Override
- protected Message createJMSMessage(Session session, Object o) {
- try {
-
- TextMessage message = session.createTextMessage();
- message.setText(String.valueOf(o));
- return message;
-
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/XMLTextMessageProcessor.java b/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/XMLTextMessageProcessor.java
deleted file mode 100644
index 88dd41cc57..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/XMLTextMessageProcessor.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.binding.jms.provider;
-
-import java.io.StringReader;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
-
-/**
- * MessageProcessor for sending/receiving XML javax.jms.TextMessage with the JMSBinding.
- *
- * @version $Rev$ $Date$
- */
-public class XMLTextMessageProcessor extends AbstractMessageProcessor {
-
- public XMLTextMessageProcessor(JMSBinding jmsBinding) {
- super(jmsBinding);
- }
-
- @Override
- protected Object[] extractPayload(Message msg) {
- try {
-
- String xml = ((TextMessage)msg).getText();
- Object[] os;
- if (xml != null) {
- XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xml));
- StAXOMBuilder builder = new StAXOMBuilder(reader);
- os = new Object[] {builder.getDocumentElement()};
- } else {
- os = new Object[] {};
- }
- return os;
-
- } catch (XMLStreamException e) {
- throw new JMSBindingException(e);
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- }
- }
-
- @Override
- protected Message createJMSMessage(Session session, Object o) {
- try {
-
- TextMessage message = session.createTextMessage();
-
- if (o instanceof OMElement) {
- message.setText(o.toString());
- } else if ((o instanceof Object[]) && ((Object[])o)[0] instanceof OMElement) {
- message.setText(((Object[])o)[0].toString());
- } else if (o != null) {
- throw new IllegalStateException("expecting OMElement payload: " + o);
- }
-
- return message;
-
- } catch (JMSException e) {
- throw new JMSBindingException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-jms-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index dec0991984..0000000000
--- a/branches/sca-android/modules/binding-jms-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.jms.provider.JMSBindingProviderFactory;model=org.apache.tuscany.sca.binding.jms.impl.JMSBinding
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java b/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
deleted file mode 100644
index fb80362457..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.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.jms;
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Service;
-
-/**
- * This class implements the HelloWorld service.
- *
- * @version $Rev$ $Date$
- */
-@Service(HelloWorldService.class)
-public class HelloWorldClientImpl implements HelloWorldService {
-
- private HelloWorldService serviceA;
-
- @Reference
- public void setServiceA(HelloWorldService service) {
- this.serviceA = service;
- }
-
- public String sayHello(String name) {
- return serviceA.sayHello(name);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java b/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
deleted file mode 100644
index 515da3144a..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/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 org.apache.tuscany.sca.binding.jms;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Interface for the HelloWorld Service.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface HelloWorldService {
- String sayHello(String name);
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java b/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
deleted file mode 100644
index a8808c1bd1..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.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.jms;
-
-/**
- * Implementation of the HelloWorldService.
- *
- * @version $Rev$ $Date$
- */
-public class HelloWorldServiceImpl implements HelloWorldService {
-
- public String sayHello(String name) {
- return "jmsHello " + name;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/OperationSelectionTestCaseFIXME.java b/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/OperationSelectionTestCaseFIXME.java
deleted file mode 100644
index 03cc0bf1c4..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/OperationSelectionTestCaseFIXME.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.binding.jms;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jms.TextMessage;
-
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.provider.JMSBindingListener;
-import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
-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.impl.OperationImpl;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.easymock.EasyMock;
-import org.junit.Test;
-
-/**
- * This unit test is used to ensure that a JMS Message delivered to a Component will select the correct operation based
- * on the details in section 1.5 of the JMS Binding specification.
- *
- * @version $Rev$ $Date$
- */
-public class OperationSelectionTestCaseFIXME {
- /**
- * This test attempts to invoke a Service with a Single method where scaOperationName is not specified in the JMS
- * Message
- * <p>
- * Expected behaviour is that the single method will be invoked as scaOperationName is ignored
- *
- * @throws Exception Failed
- */
- @Test
- public void testServiceWithOnlyOneOperationScaOperationNameNotSpecified() throws Exception {
- // Create the operation we should match
- final Operation expectedOperation = newOperation("myOperation");
-
- // Create the list of operations for the Service
- final List<Operation> operations = new ArrayList<Operation>();
- operations.add(expectedOperation);
-
- // The name of the Operation in the JMS Message - not specified
- final String scaOperationName = null;
-
- // Do the test
- doTestJMSBinding(expectedOperation, operations, scaOperationName);
- }
-
- /**
- * This test attempts to invoke a Service with a Single method where scaOperationName in the JMS Message matches the
- * method name on the Service
- * <p>
- * Expected behaviour is that the single method will be invoked as scaOperationName is ignored
- *
- * @throws Exception Failed
- */
- @Test
- public void testServiceWithOnlyOneOperationScaOperationNameMatches() throws Exception {
- // Create the operation we should match
- final Operation expectedOperation = newOperation("myOperation");
-
- // Create the list of operations for the Service
- final List<Operation> operations = new ArrayList<Operation>();
- operations.add(expectedOperation);
-
- // The name of the Operation in the JMS Message - matches operation name
- final String scaOperationName = expectedOperation.getName();
-
- // Do the test
- doTestJMSBinding(expectedOperation, operations, scaOperationName);
- }
-
- /**
- * This test attempts to invoke a Service with a Single method where scaOperationName in the JMS Message is
- * different the method name on the Service
- * <p>
- * Expected behaviour is that the single method will be invoked as scaOperationName is ignored
- *
- * @throws Exception Failed
- */
- @Test
- public void testServiceWithOnlyOneOperationScaOperationNameDifferent() throws Exception {
- // Create the operation we should match
- final Operation expectedOperation = newOperation("myOperation");
-
- // Create the list of operations for the Service
- final List<Operation> operations = new ArrayList<Operation>();
- operations.add(expectedOperation);
-
- // The name of the Operation in the JMS Message - different to operation name
- final String scaOperationName = "Does Not Match Opeation Name";
-
- // Do the test
- doTestJMSBinding(expectedOperation, operations, scaOperationName);
- }
-
- /**
- * This test attempts to invoke a Service with a multiple operations where scaOperationName specified in the JMS
- * Message matches an operation name
- * <p>
- * Expected behaviour is that the named method will be invoked.
- *
- * @throws Exception Failed
- */
- @Test
- public void testServiceWithMultipleOperationsScaOperationNameSpecified() throws Exception {
- // Create the list of operations for the Service
- final List<Operation> operations = new ArrayList<Operation>();
- for (int i = 0; i < 5; i++) {
- operations.add(newOperation("operation" + i));
- }
-
- // Now try and invoke each operation
- for (Operation expectedOperation : operations) {
- // The name of the Operation in the JMS Message
- final String scaOperationName = expectedOperation.getName();
-
- // Do the test
- doTestJMSBinding(expectedOperation, operations, scaOperationName);
- }
- }
-
- /**
- * This test attempts to invoke a Service with a multiple operations where scaOperationName specified in the JMS
- * Message is not set so we invoke the onMessage() method
- * <p>
- * Expected behaviour is that the onMessage() method should be used instead
- *
- * @throws Exception Failed
- */
- @Test
- public void testServiceWithMultipleOperationsScaOperationNotSpecified() throws Exception {
- // Create the list of operations for the Service
- final List<Operation> operations = new ArrayList<Operation>();
- for (int i = 0; i < 5; i++) {
- operations.add(newOperation("operation" + i));
- }
-
- // Add the onMessage operation to the Service Contract
- final Operation onMessageOperation = newOperation("onMessage");
- operations.add(onMessageOperation);
-
- // The name of the Operation in the JMS Message is not set so it will attempt
- // to invoke the onMessage() method
- final String scaOperationName = null;
-
- // Do the test
- doTestJMSBinding(onMessageOperation, operations, scaOperationName);
- }
-
- /**
- * This is the test method that will attempt to unit test invoking a Service with the specified operations using a
- * JMS Message with the specified scaOperationName to ensure that it invokes the expectedOperation
- *
- * @param expectedOperation The Operation we are expecting to be invoked over JMS
- * @param operations The list of Operations supported by the Service
- * @param scaOperationName The value to set scaOperationName in the JMS Message
- * @throws Exception Failed
- */
- private void doTestJMSBinding(Operation expectedOperation, List<Operation> operations, String scaOperationName)
- throws Exception {
- // Create the test JMS Binding
- final JMSBinding jmsBinding = new JMSBinding();
- JMSResourceFactory jmsResourceFactory = null;
-
- // Extra information for the method we are invoking
- final String operationParams = "Hello";
- final Object operationReturnValue = "Operation Success";
-
- // Mock up the Service. Basically, it is going to call:
- // List<Operation> opList = service.getInterfaceContract().getInterface().getOperations();
- final InterfaceContract ifaceContract = EasyMock.createStrictMock(InterfaceContract.class);
- final RuntimeComponentService service = EasyMock.createStrictMock(RuntimeComponentService.class);
- final Interface iface = EasyMock.createStrictMock(Interface.class);
- EasyMock.expect(iface.getOperations()).andReturn(operations);
- EasyMock.expect(ifaceContract.getInterface()).andReturn(iface);
- EasyMock.expect(service.getInterfaceContract()).andReturn(ifaceContract);
-
- // Mock up getting and invoking the RuntimeWire. It is going to call:
- // service.getRuntimeWire(jmsBinding).invoke(operation, (Object[])requestPayload);
- final RuntimeWire runtimeWire = EasyMock.createStrictMock(RuntimeWire.class);
- EasyMock.expect(service.getRuntimeWire(jmsBinding)).andReturn(runtimeWire);
- EasyMock.expect(runtimeWire.invoke(expectedOperation, new Object[] {operationParams}))
- .andReturn(operationReturnValue);
-
- // Create the JMS Binding Listener
- final JMSBindingListener bindingListener = new JMSBindingListener(jmsBinding, jmsResourceFactory, service, null);
-
- // Simulate a message
- final TextMessage requestJMSMsg = EasyMock.createStrictMock(TextMessage.class);
- EasyMock.expect(requestJMSMsg.getStringProperty("scaOperationName")).andReturn(scaOperationName);
- EasyMock.expect(requestJMSMsg.getText()).andReturn(operationParams);
- EasyMock.expect(requestJMSMsg.getJMSReplyTo()).andReturn(null);
-
- // Lets put all the mocks into replay mode
- // EasyMock.replay(iface);
- EasyMock.replay(ifaceContract);
- EasyMock.replay(service);
- EasyMock.replay(requestJMSMsg);
- EasyMock.replay(runtimeWire);
-
- // Do the test
- bindingListener.onMessage(requestJMSMsg);
-
- // Verify our Mock objects
- // EasyMock.verify(iface);
- // EasyMock.verify(ifaceContract);
- // EasyMock.verify(service);
- // EasyMock.verify(requestJMSMsg);
- // EasyMock.verify(runtimeWire);
- }
-
- private static Operation newOperation(String name) {
- Operation operation = new OperationImpl();
- operation.setName(name);
- return operation;
- }
-}
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/test/resources/simple/client.composite b/branches/sca-android/modules/binding-jms-runtime/src/test/resources/simple/client.composite
deleted file mode 100644
index dcea428493..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/test/resources/simple/client.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"
- name="RPCComposite">
-
- <component name="HelloWorldClient">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldClientImpl"/>
- <reference name="serviceA" />
- </component>
-
- <reference name="serviceA" promote="HelloWorldClient/serviceA">
- <interface.java interface="org.apache.tuscany.sca.binding.jms.HelloWorldService" />
- <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61616">
- <destination name="DestQueueA"/>
- <response>
- <destination name="RespQueueA"/>
- </response>
- </binding.jms>
- </reference>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-jms-runtime/src/test/resources/simple/service.composite b/branches/sca-android/modules/binding-jms-runtime/src/test/resources/simple/service.composite
deleted file mode 100644
index 44b7b29610..0000000000
--- a/branches/sca-android/modules/binding-jms-runtime/src/test/resources/simple/service.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"
- name="RPCComposite">
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldServiceImpl"/>
- <service name="HelloWorldService">
- <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61616">
- <destination name="DestQueueA" create="always"/>
- <response>
- <destination name="RespQueueA" create="always"/>
- </response>
- </binding.jms>
- </service>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-jms/LICENSE b/branches/sca-android/modules/binding-jms/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-jms/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-jms/META-INF/README b/branches/sca-android/modules/binding-jms/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-jms/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-jms/NOTICE b/branches/sca-android/modules/binding-jms/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-jms/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/branches/sca-android/modules/binding-jms/pom.xml b/branches/sca-android/modules/binding-jms/pom.xml
deleted file mode 100644
index 21535235fb..0000000000
--- a/branches/sca-android/modules/binding-jms/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-jms</artifactId>
- <name>Apache Tuscany SCA JMS Binding Model</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.jms</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.jms*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java b/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java
deleted file mode 100644
index bd493bb658..0000000000
--- a/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java
+++ /dev/null
@@ -1,572 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.jms.impl;
-
-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;
-
-/**
- * Models a binding to a JMS resource.
- *
- * @version $Rev$ $Date$
- */
-
-public class JMSBinding implements Binding {
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- // properties required to implement the Tuscany binding extension SPI
- private String uri = null;
- private String name = null;
- private boolean unresolved = false;
- private List<Object> extensions = new ArrayList<Object>();
-
- // Properties required to describe the JMS binding model
-
- private String correlationScheme = JMSBindingConstants.CORRELATE_MSG_ID;
- private String initialContextFactoryName;
- private String jndiURL;
-
- private String destinationName = JMSBindingConstants.DEFAULT_DESTINATION_NAME;
- private String destinationType = JMSBindingConstants.DESTINATION_TYPE_QUEUE;
- private String destinationCreate = JMSBindingConstants.CREATE_IF_NOT_EXIST;
-
- private String connectionFactoryName = JMSBindingConstants.DEFAULT_CONNECTION_FACTORY_NAME;
- private String connectionFactoryCreate = JMSBindingConstants.CREATE_IF_NOT_EXIST;
-
- private String activationSpecName = null;
- private String activationSpecCreate = null;
-
- private String responseActivationSpecName = null;
- private String responseActivationSpecCreate = null;
-
- private String responseDestinationName = JMSBindingConstants.DEFAULT_RESPONSE_DESTINATION_NAME;
- private String responseDestinationType = JMSBindingConstants.DESTINATION_TYPE_QUEUE;
- private String responseDestinationCreate = JMSBindingConstants.CREATE_IF_NOT_EXIST;
-
- private String responseConnectionFactoryName = JMSBindingConstants.DEFAULT_CONNECTION_FACTORY_NAME;
- private String responseConnectionFactoryCreate = JMSBindingConstants.CREATE_IF_NOT_EXIST;
-
- // Provides the name of the factory that interfaces to the JMS API for us.
- private String jmsResourceFactoryName = JMSBindingConstants.DEFAULT_RF_CLASSNAME;
-
- // Message processors used to deal with the request and response messages
- public String requestMessageProcessorName = JMSBindingConstants.DEFAULT_MP_CLASSNAME;
- public String responseMessageProcessorName = JMSBindingConstants.DEFAULT_MP_CLASSNAME;
-
- // The JMS message property used to hold the name of the operation being called
- private String operationSelectorPropertyName = JMSBindingConstants.DEFAULT_OPERATION_PROP_NAME;
-
- // If the operation selector is derived automatically from the service interface it's stored here
- private String operationSelectorName = null;
-
- private String replyTo;
- private String jmsType;
- private String jmsCorrelationId;
- private Boolean deliveryModePersistent;
- private Long timeToLive;
- private Integer jmsPriority;
-
- private Map<String, Object> properties = new HashMap<String, Object>();
- private Map<String, Map<String, Object>> operationProperties = new HashMap<String, Map<String,Object>>();
- private Map<String, String> nativeOperationNames = new HashMap<String, String>();
- private Map<String, String> operationJMSTypes = new HashMap<String, String>();
- private Map<String, String> operationJMSCorrelationIds = new HashMap<String, String>();
- private Map<String, Boolean> operationJMSDeliveryModes = new HashMap<String, Boolean>();
- private Map<String, Long> operationJMSTimeToLives = new HashMap<String, Long>();
- private Map<String, Integer> operationJMSPriorities = new HashMap<String, Integer>();
- private String jmsSelector;
- private String requestConnectionName;
- private String responseConnectionName;
- private JMSBinding requestConnectionBinding;
- private JMSBinding responseConnectionBinding;
-
- public JMSBinding() {
- super();
- }
-
- /**
- * Returns the binding URI.
- *
- * @return the binding URI
- */
- public String getURI() {
- return this.uri;
- }
-
- /**
- * Sets the binding URI.
- *
- * @param uri the binding URI
- */
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- /**
- * Returns the binding name.
- *
- * @return the binding name
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Sets the binding name.
- *
- * @param name the binding name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- public boolean isUnresolved() {
- return this.unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public List<Object> getExtensions() {
- return extensions;
- }
-
- // Methods for getting/setting JMS binding model information
- // as derived from the XML of the binding.jms element
-
- public void setCorrelationScheme(String correlationScheme) {
- this.correlationScheme = correlationScheme;
- }
-
- public String getCorrelationScheme() {
- return correlationScheme;
- }
-
- public String getInitialContextFactoryName() {
- return initialContextFactoryName;
- }
-
- public void setInitialContextFactoryName(String initialContextFactoryName) {
- this.initialContextFactoryName = initialContextFactoryName;
- }
-
- public String getJndiURL() {
- return this.jndiURL;
- }
-
- public void setJndiURL(String jndiURL) {
- this.jndiURL = jndiURL;
- }
-
- public String getDestinationName() {
- if (requestConnectionBinding != null && requestConnectionBinding.getDestinationName() != null) {
- return requestConnectionBinding.getDestinationName();
- } else {
- return destinationName;
- }
- }
-
- public void setDestinationName(String destinationName) {
- this.destinationName = destinationName;
- }
-
- public String getDestinationType() {
- if (requestConnectionBinding != null && requestConnectionBinding.getDestinationType() != null) {
- return requestConnectionBinding.getDestinationType();
- } else {
- return destinationType;
- }
- }
-
- public void setDestinationType(String destinationType) {
- this.destinationType = destinationType;
- }
-
- public String getDestinationCreate() {
- if (requestConnectionBinding != null && requestConnectionBinding.getDestinationCreate() != null) {
- return requestConnectionBinding.getDestinationCreate();
- } else {
- return this.destinationCreate;
- }
- }
-
- public void setDestinationCreate(String create) {
- this.destinationCreate = create;
- }
-
- public String getConnectionFactoryName() {
- if (requestConnectionBinding != null && requestConnectionBinding.getConnectionFactoryName() != null) {
- return requestConnectionBinding.getConnectionFactoryName();
- } else {
- return connectionFactoryName;
- }
- }
-
- public void setConnectionFactoryName(String connectionFactoryName) {
- this.connectionFactoryName = connectionFactoryName;
- }
-
- public String getConnectionFactoryCreate() {
- if (requestConnectionBinding != null && requestConnectionBinding.getConnectionFactoryCreate() != null) {
- return requestConnectionBinding.getConnectionFactoryCreate();
- } else {
- return this.connectionFactoryCreate;
- }
- }
-
- public void setConnectionFactoryCreate(String create) {
- this.connectionFactoryCreate = create;
- }
-
- public String getActivationSpecName() {
- if (requestConnectionBinding != null && requestConnectionBinding.getActivationSpecName() != null) {
- return requestConnectionBinding.getActivationSpecName();
- } else {
- return activationSpecName;
- }
- }
-
- public void setActivationSpecName(String activationSpecName) {
- this.activationSpecName = activationSpecName;
- }
-
- public String getActivationSpecCreate() {
- if (requestConnectionBinding != null && requestConnectionBinding.getActivationSpecCreate() != null) {
- return requestConnectionBinding.getActivationSpecCreate();
- } else {
- return this.activationSpecCreate;
- }
- }
-
- public void setActivationSpecCreate(String create) {
- this.activationSpecCreate = create;
- }
-
- public String getResponseDestinationName() {
- if (requestConnectionBinding != null && requestConnectionBinding.getResponseDestinationName() != null) {
- return requestConnectionBinding.getResponseDestinationName();
- } else {
- return this.responseDestinationName;
- }
- }
-
- public void setResponseDestinationName(String name) {
- this.responseDestinationName = name;
- }
-
- public String getResponseDestinationType() {
- if (requestConnectionBinding != null && requestConnectionBinding.getResponseDestinationType() != null) {
- return requestConnectionBinding.getResponseDestinationType();
- } else {
- return this.responseDestinationType;
- }
- }
-
- public void setResponseDestinationType(String type) {
- this.responseDestinationType = type;
- }
-
- public String getResponseDestinationCreate() {
- if (requestConnectionBinding != null && requestConnectionBinding.getResponseDestinationCreate() != null) {
- return requestConnectionBinding.getResponseDestinationCreate();
- } else {
- return this.responseDestinationCreate;
- }
- }
-
- public void setResponseDestinationCreate(String create) {
- this.responseDestinationCreate = create;
- }
-
- public String getResponseConnectionFactoryName() {
- if (requestConnectionBinding != null && requestConnectionBinding.getResponseConnectionFactoryName() != null) {
- return requestConnectionBinding.getResponseConnectionFactoryName();
- } else {
- return responseConnectionFactoryName;
- }
- }
-
- public void setResponseConnectionFactoryName(String connectionFactoryName) {
- this.responseConnectionFactoryName = connectionFactoryName;
- }
-
- public String getResponseConnectionFactoryCreate() {
- if (requestConnectionBinding != null && requestConnectionBinding.getResponseConnectionFactoryCreate() != null) {
- return requestConnectionBinding.getResponseConnectionFactoryCreate();
- } else {
- return this.responseConnectionFactoryCreate;
- }
- }
-
- public void setResponseConnectionFactoryCreate(String create) {
- this.responseConnectionFactoryCreate = create;
- }
-
- public String getResponseActivationSpecName() {
- if (requestConnectionBinding != null && requestConnectionBinding.getResponseActivationSpecName() != null) {
- return requestConnectionBinding.getResponseActivationSpecName();
- } else {
- return responseActivationSpecName;
- }
- }
-
- public void setResponseActivationSpecName(String activationSpecName) {
- this.responseActivationSpecName = activationSpecName;
- }
-
- public String getResponseActivationSpecCreate() {
- if (requestConnectionBinding != null && requestConnectionBinding.getResponseActivationSpecCreate() != null) {
- return requestConnectionBinding.getResponseActivationSpecCreate();
- } else {
- return this.responseActivationSpecCreate;
- }
- }
-
- public void setResponseActivationSpecCreate(String create) {
- this.responseActivationSpecCreate = create;
- }
-
- public String getJmsResourceFactoryName() {
- return jmsResourceFactoryName;
- }
-
- public void setJmsResourceFactoryName(String jmsResourceFactoryName) {
- this.jmsResourceFactoryName = jmsResourceFactoryName;
- }
-
- public void setRequestMessageProcessorName(String name) {
- this.requestMessageProcessorName = name;
- }
-
- public String getRequestMessageProcessorName() {
- return requestMessageProcessorName;
- }
-
- public void setResponseMessageProcessorName(String name) {
- this.responseMessageProcessorName = name;
- }
-
- public String getResponseMessageProcessorName() {
- return responseMessageProcessorName;
- }
-
- public String getOperationSelectorPropertyName() {
- return operationSelectorPropertyName;
- }
-
- public void setOperationSelectorPropertyName(String operationSelectorPropertyName) {
- this.operationSelectorPropertyName = operationSelectorPropertyName;
- }
-
- public String getOperationSelectorName() {
- return operationSelectorName;
- }
-
- public void setOperationSelectorName(String operationSelectorName) {
- this.operationSelectorName = operationSelectorName;
- }
-
- public String getReplyTo() {
- return replyTo;
- }
-
- public void setReplyTo(String replyTo) {
- this.replyTo = replyTo;
- }
-
- public String getJMSType() {
- return jmsType;
- }
- public void setJMSType(String jmsType) {
- this.jmsType = jmsType;
- }
-
- public String getJMSCorrelationId() {
- return jmsCorrelationId;
- }
-
- public void setJMSCorrelationId(String jmsCorrelationId) {
- this.jmsCorrelationId = jmsCorrelationId;
- }
-
- public Boolean isdeliveryModePersistent() {
- return deliveryModePersistent;
- }
- public void setJMSDeliveryMode(boolean persistent) {
- this.deliveryModePersistent = Boolean.valueOf(persistent);
- }
-
- public Integer getJMSPriority() {
- return jmsPriority;
- }
-
- public void setJMSPriority(int jmsPriority) {
- this.jmsPriority = Integer.valueOf(jmsPriority);
- }
-
- public Long getJMSTimeToLive() {
- return timeToLive.longValue();
- }
-
- public void setJMSTimeToLive(long timeToLive) {
- this.timeToLive = Long.valueOf(timeToLive);
- }
-
- public Set<String> getPropertyNames() {
- return properties.keySet();
- }
-
- public Object getProperty(String name) {
- return properties.get(name);
- }
-
- public void setProperty(String name, Object value) {
- properties.put(name, value);
- }
-
- public Map<String, Object> getOperationProperties(String opName) {
- return operationProperties.get(opName);
- }
-
- public void setOperationProperty(String opName, String propName, Object value) {
- Map<String, Object> props = operationProperties.get(opName);
- if (props == null) {
- props = new HashMap<String, Object>();
- operationProperties.put(opName, props);
- }
- props.put(propName, value);
- }
-
- public boolean hasNativeOperationName(String opName) {
- return nativeOperationNames.containsKey(opName);
- }
-
- public String getNativeOperationName(String opName) {
- if (nativeOperationNames.containsKey(opName)) {
- return nativeOperationNames.get(opName);
- } else {
- return opName;
- }
- }
-
- public void setNativeOperationName(String opName, String nativeOpName) {
- this.nativeOperationNames .put(opName, nativeOpName);
- }
-
- public String getOperationJMSType(String opName) {
- if (operationJMSTypes.containsKey(opName)) {
- return operationJMSTypes.get(opName);
- } else {
- return jmsType;
- }
- }
- public void setOperationJMSType(String opName, String jmsType) {
- this.operationJMSTypes.put(opName, jmsType);
- }
-
- public String getOperationJMSCorrelationId(String opName) {
- if (operationJMSCorrelationIds.containsKey(opName)) {
- return operationJMSCorrelationIds.get(opName);
- } else {
- return jmsCorrelationId;
- }
- }
- public void setOperationJMSCorrelationId(String opName, String jmsCorrelationId) {
- operationJMSCorrelationIds.put(opName, jmsCorrelationId);
- }
-
- public Boolean getOperationJMSDeliveryMode(String opName) {
- if (operationJMSDeliveryModes.containsKey(opName)) {
- return operationJMSDeliveryModes.get(opName);
- } else {
- return deliveryModePersistent;
- }
- }
- public void setOperationJMSDeliveryMode(String opName, boolean b) {
- operationJMSDeliveryModes.put(opName, b);
- }
-
- public Long getOperationJMSTimeToLive(String opName) {
- if (operationJMSTimeToLives.containsKey(opName)) {
- return operationJMSTimeToLives.get(opName);
- } else {
- return timeToLive;
- }
- }
- public void setOperationJMSTimeToLive(String opName, Long ttl) {
- operationJMSTimeToLives.put(opName, ttl);
- }
-
- public Integer getOperationJMSPriority(String opName) {
- if (operationJMSPriorities.containsKey(opName)) {
- return operationJMSPriorities.get(opName);
- } else {
- return jmsPriority;
- }
- }
- public void setOperationJMSPriority(String opName, int p) {
- operationJMSPriorities.put(opName, p);
- }
-
- public String getJMSSelector() {
- return jmsSelector;
- }
- public void setJMSSelector(String jmsSelector) {
- this.jmsSelector = jmsSelector;
- }
-
- public String getRequestConnectionName() {
- return requestConnectionName;
- }
-
- public void setRequestConnectionName(String requestConnectionName) {
- this.requestConnectionName = requestConnectionName;
- }
-
- public void setResponseConnectionName(String responseConnectionName) {
- this.responseConnectionName = responseConnectionName;
- }
- public String getResponseConnectionName() {
- return responseConnectionName;
- }
-
- public void setRequestConnectionBinding(JMSBinding binding) {
- this.requestConnectionBinding = binding;
- }
- public JMSBinding getRequestConnectionBinding() {
- return requestConnectionBinding;
- }
-
- public void setResponseConnectionBinding(JMSBinding binding) {
- this.responseConnectionBinding = binding;
- }
- public JMSBinding getResponseConnectionBinding() {
- return responseConnectionBinding;
- }
-}
diff --git a/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingConstants.java b/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingConstants.java
deleted file mode 100644
index 7317c2118d..0000000000
--- a/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingConstants.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.jms.impl;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-
-/**
- * Constants for the JMS binding.
- *
- * @version $Rev$ $Date$
- */
-public interface JMSBindingConstants {
-
- // Constants used when describing the JMS binding
- // model and for setting up defaults
- String BINDING_JMS = "binding.jms";
- QName BINDING_JMS_QNAME = new QName(Constants.SCA10_NS, BINDING_JMS);
- String CORRELATE_MSG_ID = "requestmsgidtocorrelid";
- String CORRELATE_CORRELATION_ID = "requestcorrelidtocorrelid";
- String CORRELATE_NONE = "none";
- List<String> VALID_CORRELATION_SCHEMES =
- Arrays.asList(new String[] {CORRELATE_MSG_ID, CORRELATE_CORRELATION_ID, CORRELATE_NONE});
- String DESTINATION_TYPE_QUEUE = "queue"; // 0
- String DESTINATION_TYPE_TOPIC = "topic"; // 1
- List<String> VALID_DESTINATION_TYPES =
- Arrays.asList(new String[] {DESTINATION_TYPE_QUEUE, DESTINATION_TYPE_TOPIC});
- String CREATE_ALWAYS = "always";
- String CREATE_NEVER = "never";
- String CREATE_IF_NOT_EXIST = "ifnotexist";
- String DEFAULT_DESTINATION_NAME = "NODESTINATION";
- String DEFAULT_RESPONSE_DESTINATION_NAME = "NORESPONSEDESTINATION";
- String DEFAULT_CONNECTION_FACTORY_NAME = "ConnectionFactory";
- String DEFAULT_CONTEXT_FACTORY_NAME = "org.apache.activemq.jndi.ActiveMQInitialContextFactory";
- String DEFAULT_JNDI_URL = "tcp://localhost:61616";
- int DEFAULT_TIME_TO_LIVE = 20000; // in milliseconds
- int DEFAULT_PRIORITY = 1;
- int NON_PERSISTENT = 1; // Maps to javax.jms.DeliveryMode
- String DEFAULT_RF_CLASSNAME = "org.apache.tuscany.sca.host.jms.activemq.JMSResourceFactoryImpl";
- String XML_MP_CLASSNAME = "org.apache.tuscany.sca.binding.jms.provider.XMLTextMessageProcessor";
- String TEXT_MP_CLASSNAME = "org.apache.tuscany.sca.binding.jms.provider.TextMessageProcessor";
- String OBJECT_MP_CLASSNAME = "org.apache.tuscany.sca.binding.jms.provider.ObjectMessageProcessor";
- String DEFAULT_MP_CLASSNAME = XML_MP_CLASSNAME;
- String DEFAULT_OPERATION_PROP_NAME = "scaOperationName";
-
- String FAULT_PROPERTY = "org_apache_tuscany_sca_fault";
-
- String CALLBACK_ID_PROPERTY = "CallbackID";
- String CALLBACK_Q_PROPERTY = "scaCallbackQueue ";
- String CONVERSATION_ID_PROPERTY = "scaConversationId";
-
-}
diff --git a/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingException.java b/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingException.java
deleted file mode 100644
index 0928e02082..0000000000
--- a/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingException.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.jms.impl;
-
-/**
- * Base exception for the JMSBinding.
- *
- * @version $Rev$ $Date$
- */
-public class JMSBindingException extends RuntimeException {
- private static final long serialVersionUID = 1L;
-
- public JMSBindingException() {
- super();
- }
-
- public JMSBindingException(String arg0, Throwable arg1) {
- super(arg0, arg1);
- }
-
- public JMSBindingException(String arg0) {
- super(arg0);
- }
-
- public JMSBindingException(Throwable arg0) {
- super(arg0);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java b/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java
deleted file mode 100644
index 2fa7ea057b..0000000000
--- a/branches/sca-android/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java
+++ /dev/null
@@ -1,684 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jms.impl;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-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 org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-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.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * A processor to read the XML that describes the JMS binding...
- *
- * <binding.jms correlationScheme="string"?
- * initialContextFactory="xs:anyURI"?
- * jndiURL="xs:anyURI"?
- * requestConnection="QName"?
- * responseConnection="QName"?
- * operationProperties="QName"?
- * ...>
- *
- * <destination name="xs:anyURI" type="string"? create="string"?>
- * <property name="NMTOKEN" type="NMTOKEN">*
- * </destination>?
- *
- * <connectionFactory name="xs:anyURI" create="string"?>
- * <property name="NMTOKEN" type="NMTOKEN">*
- * </connectionFactory>?
- *
- * <activationSpec name="xs:anyURI" create="string"?>
- * <property name="NMTOKEN" type="NMTOKEN">*
- * </activationSpec>?
- *
- * <response>
- * <destination name="xs:anyURI" type="string"? create="string"?>
- * <property name="NMTOKEN" type="NMTOKEN">*
- * </destination>?
- *
- * <connectionFactory name="xs:anyURI" create="string"?>
- * <property name="NMTOKEN" type="NMTOKEN">*
- * </connectionFactory>?
- *
- * <activationSpec name="xs:anyURI" create="string"?>
- * <property name="NMTOKEN" type="NMTOKEN">*
- * </activationSpec>?
- * </response>?
- *
- * <complexType name="SubscriptionHeaders">
- * <attribute name="JMSSelector" type="string"/>
- * </complexType>
- *
- * <resourceAdapter name="NMTOKEN">?
- * <property name="NMTOKEN" type="NMTOKEN">*
- * </resourceAdapter>?
- *
- * <headers JMSType="string"?
- * JMSCorrelationId="string"?
- * JMSDeliveryMode="string"?
- * JMSTimeToLive="int"?
- * JMSPriority="string"?>
- * <property name="NMTOKEN" type="NMTOKEN">*
- * </headers>?
- *
- * <operationProperties name="string" nativeOperation="string"?>
- * <property name="NMTOKEN" type="NMTOKEN">*
- * <headers JMSType="string"?
- * JMSCorrelationId="string"?
- * JMSDeliveryMode="string"?
- * JMSTimeToLive="int"?
- * JMSPriority="string"?>
- * <property name="NMTOKEN" type="NMTOKEN">*
- * </headers>?
- * </operationProperties>*
- * </binding.jms>
- *
- * @version $Rev$ $Date$
- */
-
-public class JMSBindingProcessor implements StAXArtifactProcessor<JMSBinding> {
-
- private PolicyFactory policyFactory;
- private PolicyAttachPointProcessor policyProcessor;
- private Monitor monitor;
-
- public JMSBindingProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- this.monitor = monitor;
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void warning(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "binding-jms-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 = new ProblemImpl(this.getClass().getName(), "binding-jms-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return JMSBindingConstants.BINDING_JMS_QNAME;
- }
-
- public Class<JMSBinding> getModelType() {
- return JMSBinding.class;
- }
-
- public JMSBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- JMSBinding jmsBinding = new JMSBinding();
-
- // Read policies
- policyProcessor.readPolicies(jmsBinding, reader);
-
- // Read binding name
- String name = reader.getAttributeValue(null, "name");
- if (name != null) {
- jmsBinding.setName(name);
- }
-
- // Read binding URI
- String uri = reader.getAttributeValue(null, "uri");
- if (uri != null && uri.length() > 0) {
- parseURI(uri, jmsBinding);
- }
-
- // Read correlation scheme
- String correlationScheme = reader.getAttributeValue(null, "correlationScheme");
- if (correlationScheme != null && correlationScheme.length() > 0) {
- if (JMSBindingConstants.VALID_CORRELATION_SCHEMES.contains(correlationScheme.toLowerCase())) {
- jmsBinding.setCorrelationScheme(correlationScheme);
- } else {
- error("InvalidCorrelationScheme", reader, correlationScheme);
- }
- }
-
- // Read initial context factory
- String initialContextFactory = reader.getAttributeValue(null, "initialContextFactory");
- if (initialContextFactory != null && initialContextFactory.length() > 0) {
- jmsBinding.setInitialContextFactoryName(initialContextFactory);
- }
-
- // Read JNDI URL
- String jndiURL = reader.getAttributeValue(null, "jndiURL");
- if (jndiURL != null && jndiURL.length() > 0) {
- jmsBinding.setJndiURL(jndiURL);
- }
-
- // Read message processor class name
- String messageProcessorName = reader.getAttributeValue(null, "messageProcessor");
- if (messageProcessorName != null && messageProcessorName.length() > 0) {
- if ("XMLTextMessage".equalsIgnoreCase(messageProcessorName)) {
- messageProcessorName = JMSBindingConstants.XML_MP_CLASSNAME;
- } else if ("TextMessage".equalsIgnoreCase(messageProcessorName)) {
- messageProcessorName = JMSBindingConstants.TEXT_MP_CLASSNAME;
- } else if ("ObjectMessage".equalsIgnoreCase(messageProcessorName)) {
- messageProcessorName = JMSBindingConstants.OBJECT_MP_CLASSNAME;
- }
- jmsBinding.setRequestMessageProcessorName(messageProcessorName);
- jmsBinding.setResponseMessageProcessorName(messageProcessorName);
-
- }
-
- String requestConnectionName = reader.getAttributeValue(null, "requestConnection");
- if (requestConnectionName != null && requestConnectionName.length() > 0) {
- jmsBinding.setRequestConnectionName(requestConnectionName);
- }
- String responseConnectionName = reader.getAttributeValue(null, "responseConnection");
- if (responseConnectionName != null && responseConnectionName.length() > 0) {
- jmsBinding.setResponseConnectionName(responseConnectionName);
- }
-
- // Read sub-elements of binding.jms
- boolean endFound = false;
- while (!endFound) {
- int fg = reader.next();
- switch (fg) {
- case START_ELEMENT:
- String elementName = reader.getName().getLocalPart();
- if ("destination".equals(elementName)) {
- parseDestination(reader, jmsBinding);
- } else if ("connectionFactory".equals(elementName)) {
- parseConnectionFactory(reader, jmsBinding);
- } else if ("activationSpec".equals(elementName)) {
- parseActivationSpec(reader, jmsBinding);
- } else if ("response".equals(elementName)) {
- parseResponse(reader, jmsBinding);
- } else if ("resourceAdapter".equals(elementName)) {
- parseResourceAdapter(reader, jmsBinding);
- } else if ("headers".equals(elementName)) {
- parseHeaders(reader, jmsBinding);
- } else if ("operationProperties".equals(elementName)) {
- parseOperationProperties(reader, jmsBinding);
- } else if ("SubscriptionHeaders".equals(elementName)) {
- parseSubscriptionHeaders(reader, jmsBinding);
- }
- reader.next();
- break;
- case END_ELEMENT:
- QName x = reader.getName();
- if (x.equals(JMSBindingConstants.BINDING_JMS_QNAME)) {
- endFound = true;
- } else {
- error("UnexpectedElement", reader, x.toString());
- }
- }
- }
-
- validate();
-
- return jmsBinding;
- }
-
- protected void parseURI(String uri, JMSBinding jmsBinding) {
- if (!uri.startsWith("jms:")) {
- error("MustStartWithSchema", jmsBinding, uri);
- return;
- }
- int i = uri.indexOf('?');
- if (i >= 0) {
- StringTokenizer st = new StringTokenizer(uri.substring(i+1),"&");
- while (st.hasMoreTokens()) {
- String s = st.nextToken();
- if (s.startsWith("connectionFactoryName=")) {
- jmsBinding.setConnectionFactoryName(s.substring(22));
- } else {
- error("UnknownTokenInURI", jmsBinding, s, uri);
- //throw new JMSBindingException("unknown token '" + s + "' in uri: " + uri);
- return;
- }
- }
- jmsBinding.setDestinationName(uri.substring(4, i));
- } else {
- jmsBinding.setDestinationName(uri.substring(4));
- }
- }
-
- public void resolve(JMSBinding model, ModelResolver resolver) throws ContributionResolveException {
- if (model.getRequestConnectionName() != null) {
- model.setRequestConnectionBinding(getConnectionBinding(model.getRequestConnectionName(), resolver));
- }
- if (model.getResponseConnectionName() != null) {
- model.setResponseConnectionBinding(getConnectionBinding(model.getResponseConnectionName(), resolver));
- }
- }
-
- @SuppressWarnings("unchecked")
- private JMSBinding getConnectionBinding(String bindingName, ModelResolver resolver) {
- if (resolver instanceof ExtensibleModelResolver) {
- DefaultModelResolver dr = (DefaultModelResolver)((ExtensibleModelResolver) resolver).getDefaultModelResolver();
- Map models = dr.getModels();
- for (Object o : models.keySet()) {
- if (o instanceof JMSBinding) {
- JMSBinding binding = (JMSBinding) o;
- if (bindingName.equals(binding.getName())) {
- return binding;
- }
- }
- }
- }
- return null;
- }
-
- public void write(JMSBinding rmiBinding, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- // Write a <binding.jms>
- writer.writeStartElement(Constants.SCA10_NS, JMSBindingConstants.BINDING_JMS);
-
- // FIXME Implement
-
- writer.writeEndElement();
- }
-
- private void parseDestination(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
- String name = reader.getAttributeValue(null, "name");
- if (name != null && name.length() > 0) {
- jmsBinding.setDestinationName(name);
- }
-
- String type = reader.getAttributeValue(null, "type");
- if (type != null && type.length() > 0) {
- warning("DoesntProcessDestinationType", jmsBinding);
- if (JMSBindingConstants.DESTINATION_TYPE_QUEUE.equalsIgnoreCase(type)) {
- jmsBinding.setDestinationType(JMSBindingConstants.DESTINATION_TYPE_QUEUE);
- } else if (JMSBindingConstants.DESTINATION_TYPE_TOPIC.equalsIgnoreCase(type)) {
- jmsBinding.setDestinationType(JMSBindingConstants.DESTINATION_TYPE_TOPIC);
- } else {
- warning("InvalidDestinationType", reader, type);
- }
- }
-
- String create = reader.getAttributeValue(null, "create");
- if (create != null && create.length() > 0) {
- jmsBinding.setDestinationCreate(create);
- }
- }
-
- private void parseConnectionFactory(XMLStreamReader reader, JMSBinding jmsBinding) {
- String name = reader.getAttributeValue(null, "name");
- if (name != null && name.length() > 0) {
- jmsBinding.setConnectionFactoryName(name);
- } else {
- error("MissingConnectionFactoryName", reader);
- }
- }
-
- private void parseActivationSpec(XMLStreamReader reader, JMSBinding jmsBinding) {
- String name = reader.getAttributeValue(null, "name");
- if (name != null && name.length() > 0) {
- warning("DoesntProcessActivationSpec", jmsBinding);
- jmsBinding.setActivationSpecName(name);
- } else {
- warning("MissingActivationSpecName", reader);
- }
- }
-
- private void parseResponseDestination(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
- String name = reader.getAttributeValue(null, "name");
- if (name != null && name.length() > 0) {
- jmsBinding.setResponseDestinationName(name);
- }
-
- String type = reader.getAttributeValue(null, "type");
- if (type != null && type.length() > 0) {
- warning("DoesntProcessResponseDestinationType", jmsBinding);
- if (JMSBindingConstants.DESTINATION_TYPE_QUEUE.equalsIgnoreCase(type)) {
- jmsBinding.setResponseDestinationType(JMSBindingConstants.DESTINATION_TYPE_QUEUE);
- } else if (JMSBindingConstants.DESTINATION_TYPE_TOPIC.equalsIgnoreCase(type)) {
- jmsBinding.setResponseDestinationType(JMSBindingConstants.DESTINATION_TYPE_TOPIC);
- } else {
- warning("InvalidResponseDestinationType", reader, type);
- }
- }
-
- String create = reader.getAttributeValue(null, "create");
- if (create != null && create.length() > 0) {
- jmsBinding.setResponseDestinationCreate(create);
- }
- }
-
- private void parseResponseConnectionFactory(XMLStreamReader reader, JMSBinding jmsBinding) {
- String name = reader.getAttributeValue(null, "name");
- if (name != null && name.length() > 0) {
- warning("DoesntProcessResponseConnectionFactory", jmsBinding);
- jmsBinding.setResponseConnectionFactoryName(name);
- } else {
- warning("MissingResponseConnectionFactory", reader);
- }
- }
-
- private void parseResponseActivationSpec(XMLStreamReader reader, JMSBinding jmsBinding) {
- String name = reader.getAttributeValue(null, "name");
- if (name != null && name.length() > 0) {
- warning("DoesntProcessResponseActivationSpec", jmsBinding);
- jmsBinding.setResponseActivationSpecName(name);
- } else {
- warning("MissingResponseActivationSpec", reader);
- }
- }
-
- private void parseResponse(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
- // Read sub-elements of response
- while (true) {
- switch (reader.next()) {
- case START_ELEMENT:
- String elementName = reader.getName().getLocalPart();
- if ("destination".equals(elementName)) {
- parseResponseDestination(reader, jmsBinding);
- } else if ("connectionFactory".equals(elementName)) {
- parseResponseConnectionFactory(reader, jmsBinding);
- } else if ("activationSpec".equals(elementName)) {
- parseResponseActivationSpec(reader, jmsBinding);
- }
- reader.next();
- break;
- case END_ELEMENT:
- QName x = reader.getName();
- if (x.getLocalPart().equals("response")) {
- return;
- } else {
- error("UnexpectedResponseElement", reader, x.toString());
- }
- }
- }
- }
-
- private void parseResourceAdapter(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
- warning("DoesntProcessResourceAdapter", jmsBinding);
- }
-
- /**
- * <headers JMSType=”string”?
- * JMSCorrelationID=”string”?
- * JMSDeliveryMode=”PERSISTENT or NON_PERSISTENT”?
- * JMSTimeToLive=”long”?
- * JMSPriority=”0 .. 9”?>
- * <property name=”NMTOKEN” type=”NMTOKEN”?>*
- * </headers>?
- */
- private void parseHeaders(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
-
- String jmsType = reader.getAttributeValue(null, "JMSType");
- if (jmsType != null && jmsType.length() > 0) {
- jmsBinding.setJMSType(jmsType);
- }
-
- String jmsCorrelationId = reader.getAttributeValue(null, "JMSCorrelationID");
- if (jmsCorrelationId != null && jmsCorrelationId.length() > 0) {
- jmsBinding.setJMSCorrelationId(jmsCorrelationId);
- }
-
- String jmsDeliveryMode = reader.getAttributeValue(null, "JMSDeliveryMode");
- if (jmsDeliveryMode != null && jmsDeliveryMode.length() > 0) {
- if ("PERSISTENT".equalsIgnoreCase(jmsDeliveryMode)) {
- jmsBinding.setJMSDeliveryMode(true);
- } else if ("NON_PERSISTENT".equalsIgnoreCase(jmsDeliveryMode)) {
- jmsBinding.setJMSDeliveryMode(false);
- } else {
- warning("InvalidJMSDeliveryMode", jmsBinding, jmsDeliveryMode);
- }
- }
-
- String jmsTimeToLive = reader.getAttributeValue(null, "JMSTimeToLive");
- if (jmsTimeToLive != null && jmsTimeToLive.length() > 0) {
- jmsBinding.setJMSTimeToLive(Long.parseLong(jmsTimeToLive));
- }
-
- String jmsPriority = reader.getAttributeValue(null, "JMSPriority");
- if (jmsPriority != null && jmsPriority.length() > 0) {
- int p = Integer.parseInt(jmsPriority);
- if (p >= 0 && p <= 9) {
- jmsBinding.setJMSPriority(p);
- } else {
- warning("InvalidJMSPriority", jmsBinding, jmsPriority);
- }
- }
-
- while (true) {
- switch (reader.next()) {
- case START_ELEMENT:
- if (reader.getName().getLocalPart().equals("property")) {
- parseProperty(reader, jmsBinding);
- }
- break;
- case END_ELEMENT:
- QName x = reader.getName();
- if (x.getLocalPart().equals("headers")) {
- return;
- } else {
- error("UnexpectedResponseElement", reader, x.toString());
- }
- }
- }
- }
-
- private void parseProperty(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
- String name = reader.getAttributeValue(null, "name");
- String type = reader.getAttributeValue(null, "type");
- if (name != null && name.length() > 0) {
- Object value = reader.getElementText();
- if ("boolean".equalsIgnoreCase(type)) {
- value = Boolean.parseBoolean((String)value);
- } else if ("byte".equalsIgnoreCase(type)) {
- value = Byte.parseByte(((String)value));
- } else if ("short".equalsIgnoreCase(type)) {
- value = Short.parseShort((String)value);
- } else if ("int".equalsIgnoreCase(type)) {
- value = Integer.parseInt((String)value);
- } else if ("long".equalsIgnoreCase(type)) {
- value = Long.parseLong((String)value);
- } else if ("float".equalsIgnoreCase(type)) {
- value = Float.parseFloat((String)value);
- } else if ("double".equalsIgnoreCase(type)) {
- value = Double.parseDouble((String)value);
- } else if ("String".equalsIgnoreCase(type)) {
- // its already a string
- }
- jmsBinding.setProperty(name, value);
- }
- }
-
- /**
- * <operationProperties name=”string” nativeOperation=”string”?>
- * <property name=”NMTOKEN” type=”NMTOKEN”?>*
- * <headers JMSType=”string”?
- * JMSCorrelationId=”string”?
- * JMSDeliveryMode=”PERSISTENT or NON_PERSISTENT”?
- * JMSTimeToLive=”long”?
- * JMSPriority=”0 .. 9”?>
- * <property name=”NMTOKEN” type=”NMTOKEN”?>*
- * </headers>?
- * </operationProperties>*
- */
- private void parseOperationProperties(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
- String opName = reader.getAttributeValue(null, "name");
- if (opName == null || opName.length() < 1) {
- warning("MissingJMSOperationPropertyName", jmsBinding);
- return;
- }
- String nativeOpName = reader.getAttributeValue(null, "nativeOperation");
- if (nativeOpName != null && nativeOpName.length() > 0) {
- jmsBinding.setNativeOperationName(opName, nativeOpName);
- }
-
- while (true) {
- switch (reader.next()) {
- case START_ELEMENT:
- if (reader.getName().getLocalPart().equals("headers")) {
- parseOperationHeaders(reader, jmsBinding, opName);
- }
- break;
- case END_ELEMENT:
- QName x = reader.getName();
- if (x.getLocalPart().equals("operationProperties")) {
- return;
- } else {
- error("UnexpectedResponseElement", reader, x.toString());
- }
- }
- }
- }
-
- private void parseOperationHeaders(XMLStreamReader reader, JMSBinding jmsBinding, String opName) throws XMLStreamException {
- String jmsType = reader.getAttributeValue(null, "JMSType");
- if (jmsType != null && jmsType.length() > 0) {
- jmsBinding.setOperationJMSType(opName, jmsType);
- }
-
- String jmsCorrelationId = reader.getAttributeValue(null, "JMSCorrelationID");
- if (jmsCorrelationId != null && jmsCorrelationId.length() > 0) {
- jmsBinding.setOperationJMSCorrelationId(opName, jmsCorrelationId);
- }
-
- String jmsDeliveryMode = reader.getAttributeValue(null, "JMSDeliveryMode");
- if (jmsDeliveryMode != null && jmsDeliveryMode.length() > 0) {
- if ("PERSISTENT".equalsIgnoreCase(jmsDeliveryMode)) {
- jmsBinding.setJMSDeliveryMode(true);
- } else if ("NON_PERSISTENT".equalsIgnoreCase(jmsDeliveryMode)) {
- jmsBinding.setOperationJMSDeliveryMode(opName, false);
- } else {
- warning("InvalidOPJMSDeliveryMode", jmsBinding, jmsDeliveryMode);
- }
- }
-
- String jmsTimeToLive = reader.getAttributeValue(null, "JMSTimeToLive");
- if (jmsTimeToLive != null && jmsTimeToLive.length() > 0) {
- jmsBinding.setOperationJMSTimeToLive(opName, Long.parseLong(jmsTimeToLive));
- }
-
- String jmsPriority = reader.getAttributeValue(null, "JMSPriority");
- if (jmsPriority != null && jmsPriority.length() > 0) {
- int p = Integer.parseInt(jmsPriority);
- if (p >= 0 && p <= 9) {
- jmsBinding.setOperationJMSPriority(opName, p);
- } else {
- warning("InvalidOPJMSPriority", jmsBinding, jmsPriority);
- }
- }
-
- while (true) {
- switch (reader.next()) {
- case START_ELEMENT:
- if (reader.getName().getLocalPart().equals("property")) {
- parseOperationPropertyProperties(reader, jmsBinding, opName);
- }
- break;
- case END_ELEMENT:
- QName x = reader.getName();
- if (x.getLocalPart().equals("headers")) {
- return;
- } else {
- error("UnexpectedResponseElement", reader, x.toString());
- }
- }
- }
- }
-
- private void parseOperationPropertyProperties(XMLStreamReader reader, JMSBinding jmsBinding, String opName) throws XMLStreamException {
- String propName = reader.getAttributeValue(null, "name");
- String type = reader.getAttributeValue(null, "type");
- if (propName != null && propName.length() > 0) {
- Object value = reader.getElementText();
- if ("boolean".equalsIgnoreCase(type)) {
- value = Boolean.parseBoolean((String)value);
- } else if ("byte".equalsIgnoreCase(type)) {
- value = Byte.parseByte(((String)value));
- } else if ("short".equalsIgnoreCase(type)) {
- value = Short.parseShort((String)value);
- } else if ("int".equalsIgnoreCase(type)) {
- value = Integer.parseInt((String)value);
- } else if ("long".equalsIgnoreCase(type)) {
- value = Long.parseLong((String)value);
- } else if ("float".equalsIgnoreCase(type)) {
- value = Float.parseFloat((String)value);
- } else if ("double".equalsIgnoreCase(type)) {
- value = Double.parseDouble((String)value);
- } else if ("String".equalsIgnoreCase(type)) {
- // its already a string
- }
- jmsBinding.setOperationProperty(opName, propName, value);
- }
- }
-
- private void parseSubscriptionHeaders(XMLStreamReader reader, JMSBinding jmsBinding) {
- String jmsSelector = reader.getAttributeValue(null, "JMSSelector");
- if (jmsSelector != null && jmsSelector.length() > 0) {
- jmsBinding.setJMSSelector(jmsSelector);
- }
- }
-
- /**
- * The validation rules for the JMS model are relatively complicated to they all live together here
- */
- public void validate() throws JMSBindingException {
- /*
- * first fix up anything now the model has been read
- */
-
- /*
- * Now some cross field validation
- */
-
- // connection factory doesn't contradict destination type
- // connection factory and activation Specification are mutually exclusive
- // TODO check Specification for all validations
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index ac37a0f26b..0000000000
--- a/branches/sca-android/modules/binding-jms/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.jms.impl.JMSBindingProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#binding.jms,model=org.apache.tuscany.sca.binding.jms.impl.JMSBinding
diff --git a/branches/sca-android/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties b/branches/sca-android/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties
deleted file mode 100644
index 2f1048e601..0000000000
--- a/branches/sca-android/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties
+++ /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.
-#
-#
-DoesntProcessOperationProperties = JMS Binding doesn't process operationProperties yet
-DoesntProcessHeaders = JMS Binding doesn't process headers yet
-DoesntProcessResourceAdapter = JMS Binding doesn't process resourceAdapter yet
-DoesntProcessResponseConnectionFactory = JMS Binding doesn't process response connectionFactory yet
-DoesntProcessResponseActivationSpec = JMS Binding doesn't process response activationSpec yet
-DoesntProcessResponseDestinationType = JMS Binding doesn't process response destination type yet
-DoesntProcessActivationSpec = JMS Binding doesn't process activationSpec yet
-DoesntProcessDestinationType = JMS Binding doesn't process destination type yet
-MissingConnectionFactoryName = Missing ConnectionFactory Name
-MissingResponseConnectionFactory = Missing response connectionFactory name
-InvalidResponseDestinationType = Invalid response destination type: {0}
-InvalidDestinationType = Invalid destination type: {0}
-MissingActivationSpecName = Missing ActivationSpec Name
-MissingResponseActivationSpec = Missing response ActivationSpec name
-UnknownTokenInURI = Unknown token {0} in uri: {1}
-MustStartWithSchema = URI must start with the scheme 'jms:' for uri: {0}
-InvalidCorrelationScheme = Invalid correlationScheme: {0}
-UnexpectedElement = Incomplete binding.jms definition found unexpected element: {0}
-UnexpectedResponseElement = Incomplete binding.jms/response definition found unexpected element: {0}
-InvalidJMSDeliveryMode = Invalid JMSDeliveryMode: {0}
-InvalidJMSPriority = Invalid JMSPriority: {0}
-MissingJMSOperationPropertyName = Missing JMSOperationProperty Name
-InvalidOPJMSDeliveryMode = Invalid OPJMSDeliveryMode: {0}
-InvalidOPJMSPriority = Invalid OPJMSPriority: {0}
-
-
-
diff --git a/branches/sca-android/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java b/branches/sca-android/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java
deleted file mode 100644
index 7fe482c4f2..0000000000
--- a/branches/sca-android/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jms.impl;
-
-import java.io.StringReader;
-import java.util.Map;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.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.UtilityExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorFactoryImpl;
-
-/**
- * Tests for JMS binding xml
- */
-public class JMSBindingProcessorTestCase extends TestCase {
-
- private static final String COMPOSITE =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" targetNamespace=\"http://binding-jms\" name=\"binding-jms\">"
- + " <component name=\"HelloWorldComponent\">"
- + " <implementation.java class=\"services.HelloWorld\"/>"
- + " <service name=\"HelloWorldService\">"
- + " <binding.jms uri=\"jms:testQueue\" />"
- + " </service>"
- + " </component>"
- + "</composite>";
-
- private static final String HEADERS1 =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" targetNamespace=\"http://binding-jms\" name=\"binding-jms\">"
- + " <component name=\"HelloWorldComponent\">"
- + " <implementation.java class=\"services.HelloWorld\"/>"
- + " <service name=\"HelloWorldService\">"
- + " <binding.jms uri=\"jms:testQueue\" >"
- + " <headers JMSType=\"myType\" JMSCorrelationID=\"myCorrelId\" JMSDeliveryMode=\"PERSISTENT\" JMSTimeToLive=\"54321\" JMSPriority=\"5\" >"
- + " </headers>"
- + " </binding.jms>"
- + " </service>"
- + " </component>"
- + "</composite>";
-
- private static final String PROPERTIES1 =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" targetNamespace=\"http://binding-jms\" name=\"binding-jms\">"
- + " <component name=\"HelloWorldComponent\">"
- + " <implementation.java class=\"services.HelloWorld\"/>"
- + " <service name=\"HelloWorldService\">"
- + " <binding.jms uri=\"jms:testQueue\" >"
- + " <headers>"
- + " <property name=\"p1\">bla</property>"
- + " <property name=\"intProp\" type=\"int\">42</property>"
- + " </headers>"
- + " </binding.jms>"
- + " </service>"
- + " </component>"
- + "</composite>";
-
- private static final String OP_PROPERTIES1 =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" targetNamespace=\"http://binding-jms\" name=\"binding-jms\">"
- + " <component name=\"HelloWorldComponent\">"
- + " <implementation.java class=\"services.HelloWorld\"/>"
- + " <service name=\"HelloWorldService\">"
- + " <binding.jms uri=\"jms:testQueue\" >"
- + " <operationProperties name=\"op1\">"
- + " <headers JMSType=\"op1Type\" >"
- + " <property name=\"p1\">bla</property>"
- + " <property name=\"intProp\" type=\"int\">42</property>"
- + " </headers>"
- + " </operationProperties >"
- + " <operationProperties name=\"op2\" nativeOperation=\"nativeOp2\" >"
- + " <headers JMSType=\"op2Type\">"
- + " <property name=\"p2\">op2bla</property>"
- + " <property name=\"intProp\" type=\"int\">77</property>"
- + " </headers>"
- + " </operationProperties >"
- + " </binding.jms>"
- + " </service>"
- + " </component>"
- + "</composite>";
-
- private static final String SELECTOR =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" targetNamespace=\"http://binding-jms\" name=\"binding-jms\">"
- + " <component name=\"HelloWorldComponent\">"
- + " <implementation.java class=\"services.HelloWorld\"/>"
- + " <service name=\"HelloWorldService\">"
- + " <binding.jms uri=\"jms:testQueue\" >"
- + " <SubscriptionHeaders JMSSelector=\"prop1 = 2\" />"
- + " </binding.jms>"
- + " </service>"
- + " </component>"
- + "</composite>";
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private Monitor monitor;
-
- @Override
- protected void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();
- if (monitorFactory != null) {
- monitor = monitorFactory.createMonitor();
- utilities.addUtility(monitorFactory);
- }
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, monitor);
- }
-
- /**
- * Test parsing valid composite definition. Valid composite populated with correct values expected.
- * @throws Exception
- */
- public void testLoadValidComposite() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE));
-
- Composite composite = (Composite)staxProcessor.read(reader);
- JMSBinding binding = (JMSBinding) composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
-
- assertNotNull(binding);
- assertEquals("testQueue", binding.getDestinationName());
- }
-
- public void testHeaders1() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(HEADERS1));
-
- Composite composite = (Composite)staxProcessor.read(reader);
- JMSBinding binding = (JMSBinding) composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
-
- assertNotNull(binding);
- assertEquals("myType", binding.getJMSType());
- assertEquals("myCorrelId", binding.getJMSCorrelationId());
- assertTrue(binding.isdeliveryModePersistent());
- assertEquals(54321, binding.getJMSTimeToLive().longValue());
- assertEquals(5, binding.getJMSPriority().intValue());
- }
-
- public void testProperties1() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(PROPERTIES1));
-
- Composite composite = (Composite)staxProcessor.read(reader);
- JMSBinding binding = (JMSBinding) composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
-
- assertNotNull(binding);
- assertEquals("bla", binding.getProperty("p1"));
- assertEquals(42, ((Integer)binding.getProperty("intProp")).intValue());
- }
-
- public void testOpProperties1() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(OP_PROPERTIES1));
-
- Composite composite = (Composite)staxProcessor.read(reader);
- JMSBinding binding = (JMSBinding) composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
-
- assertNotNull(binding);
-
- Map<String, Object> op1Props = binding.getOperationProperties("op1");
- assertEquals("op1Type", binding.getOperationJMSType("op1"));
- assertEquals("bla", op1Props.get("p1"));
- assertEquals(42, ((Integer)op1Props.get("intProp")).intValue());
-
- assertEquals("op2Type", binding.getOperationJMSType("op2"));
- Map<String, Object> op2Props = binding.getOperationProperties("op2");
- assertEquals("op2bla", op2Props.get("p2"));
- assertEquals(77, ((Integer)op2Props.get("intProp")).intValue());
- }
-
- public void testSubscriptionHeaders () throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(SELECTOR));
-
- Composite composite = (Composite)staxProcessor.read(reader);
- JMSBinding binding = (JMSBinding) composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
-
- assertNotNull(binding);
-
- assertEquals("prop1 = 2", binding.getJMSSelector());
- }
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/LICENSE b/branches/sca-android/modules/binding-jsonrpc-runtime/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-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/branches/sca-android/modules/binding-jsonrpc-runtime/META-INF/README b/branches/sca-android/modules/binding-jsonrpc-runtime/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/NOTICE b/branches/sca-android/modules/binding-jsonrpc-runtime/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-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/branches/sca-android/modules/binding-jsonrpc-runtime/pom.xml b/branches/sca-android/modules/binding-jsonrpc-runtime/pom.xml
deleted file mode 100644
index 598f92f324..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
- <name>Apache Tuscany SCA JSON-RPC Binding Runtime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jsonrpc</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-json</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.metaparadigm</groupId>
- <artifactId>json-rpc</artifactId>
- <version>1.0</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>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>httpunit</groupId>
- <artifactId>httpunit</artifactId>
- <version>1.6.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Bundle-Version>${tuscany.version}</Bundle-Version>
- <Bundle-SymbolicName>org.apache.tuscany.sca.binding.jsonrpc.runtime</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>
- !org.apache.tuscany.sca.binding.jsonrpc,
- org.apache.tuscany.sca.binding.jsonrpc*
- </Export-Package>
- <Import-Package>
- org.apache.tuscany.sca.assembly.xml,
- org.apache.tuscany.sca.binding.jsonrpc,
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java
deleted file mode 100644
index a9fff462fa..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.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.jsonrpc.provider;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-/**
- * Invoker for the JSONRPC Binding
- *
- * @version $Rev$ $Date$
- */
-public class JSONRPCBindingInvoker implements Invoker {
- Operation operation;
- String uri;
-
- public JSONRPCBindingInvoker(Operation operation, String uri) {
- this.operation = operation;
- this.uri = uri;
- }
-
- public Message invoke(Message msg) {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingProviderFactory.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingProviderFactory.java
deleted file mode 100644
index eb85453bbb..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingProviderFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jsonrpc.provider;
-
-import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * JSON-RPC Provider Factory
- *
- * @version $Rev$ $Date$
- */
-public class JSONRPCBindingProviderFactory implements BindingProviderFactory<JSONRPCBinding> {
-
- private ServletHost servletHost;
-
- public JSONRPCBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- this.servletHost = servletHosts.getServletHosts().get(0);
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- JSONRPCBinding binding) {
-
- return new JSONRPCReferenceBindingProvider(component, reference, binding);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- JSONRPCBinding binding) {
- return new JSONRPCServiceBindingProvider(component, service, binding, servletHost);
- }
-
- public Class<JSONRPCBinding> getModelType() {
- return JSONRPCBinding.class;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java
deleted file mode 100644
index e2528f59e5..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.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.jsonrpc.provider;
-
-import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-
-/**
- * Implementation of the JSONRPC Binding Provider for References
- *
- * @version $Rev$ $Date$
- */
-public class JSONRPCReferenceBindingProvider implements ReferenceBindingProvider {
-
- private RuntimeComponentReference reference;
- private JSONRPCBinding binding;
-
- public JSONRPCReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- JSONRPCBinding binding) {
- this.reference = reference;
- this.binding = binding;
-
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- public Invoker createInvoker(Operation operation) {
- return new JSONRPCBindingInvoker(operation, binding.getURI());
- }
-
- public void start() {
- // TODO Auto-generated method stub
-
- }
-
- public void stop() {
- // TODO Auto-generated method stub
-
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java
deleted file mode 100644
index 8d9f8193e9..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.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.binding.jsonrpc.provider;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding;
-import org.apache.tuscany.sca.databinding.javabeans.SimpleJavaDataBinding;
-import org.apache.tuscany.sca.databinding.json.JSONDataBinding;
-import org.apache.tuscany.sca.host.http.ServletHost;
-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.JavaInterface;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Implementation of the JSONRPC Binding Provider for Services
- *
- * @version $Rev$ $Date$
- */
-public class JSONRPCServiceBindingProvider implements ServiceBindingProvider {
-
- // Path to the scaDomain.js script
- // Note: this is the same as the Ajax binding to keep the client code
- // the same for clients using either the ajax or jsonrpc binding
- private static final String SCA_DOMAIN_SCRIPT = "/SCADomain/scaDomain.js";
-
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private InterfaceContract serviceContract;
- private JSONRPCBinding binding;
- private ServletHost servletHost;
- private List<String> servletMappings = new ArrayList<String>();
- private String domainScriptMapping;
-
- public JSONRPCServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- JSONRPCBinding binding,
- ServletHost servletHost) {
- this.component = component;
- this.service = service;
- this.binding = binding;
- this.servletHost = servletHost;
-
- //clone the service contract to avoid databinding issues
- try {
- this.serviceContract = (InterfaceContract)service.getInterfaceContract().clone();
- } catch(CloneNotSupportedException e) {
- this.serviceContract = service.getInterfaceContract();
- }
-
- setDataBinding(serviceContract.getInterface());
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- // Set default databinding to json
- serviceContract.getInterface().resetDataBinding(JSONDataBinding.NAME);
-
- // Determine the service business interface
- Class<?> serviceInterface = getTargetJavaClass(serviceContract.getInterface());
-
- // Create a Java proxy to the target service
- Object proxy = component.getComponentContext().createSelfReference(serviceInterface, service).getService();
-
- // Create and register a Servlet for this service
- JSONRPCServiceServlet serviceServlet =
- new JSONRPCServiceServlet(binding, service, serviceContract, serviceInterface, proxy);
- String mapping = binding.getURI();
- if (!mapping.endsWith("/")) {
- mapping += "/";
- }
- if (!mapping.endsWith("*")) {
- mapping += "*";
- }
-
- servletHost.addServletMapping(mapping, serviceServlet);
- servletMappings.add(mapping);
- servletHost.addServletMapping(binding.getURI(), serviceServlet);
- servletMappings.add(binding.getURI());
-
- // Register service to scaDomain.js
- int port;
- URI uri = URI.create(servletHost.getURLMapping(binding.getURI()).toString());
- port = uri.getPort();
- if (port == -1) {
- port = servletHost.getDefaultPort();
- }
-
- // get the ScaDomainScriptServlet, if it doesn't yet exist create one
- // this uses removeServletMapping / addServletMapping as there is no getServletMapping facility
- domainScriptMapping = URI.create("http://localhost:" + port + SCA_DOMAIN_SCRIPT).toString();
- ScaDomainScriptServlet scaDomainServlet =
- (ScaDomainScriptServlet)servletHost.getServletMapping(domainScriptMapping);
- if (scaDomainServlet == null) {
- scaDomainServlet = new ScaDomainScriptServlet();
- servletHost.addServletMapping(domainScriptMapping, scaDomainServlet);
- }
-
- // Add this service to the SCA Domain Script Servlet
- scaDomainServlet.addService(binding.getName());
- }
-
- public void stop() {
-
- // Remove the Servlet mappings we've added
- for (String mapping: servletMappings) {
- servletHost.removeServletMapping(mapping);
- }
-
- // Unregister the service from the SCA Domain Script Servlet
- ScaDomainScriptServlet scaDomainServlet = (ScaDomainScriptServlet) servletHost.getServletMapping(domainScriptMapping);
- if (scaDomainServlet != null) {
- scaDomainServlet.removeService(binding.getName());
-
- // Remove the Servlet if there's no more registered services
- if (scaDomainServlet.getServiceNames().isEmpty()) {
- servletHost.removeServletMapping(domainScriptMapping);
- }
- }
-
- }
-
- private Class<?> getTargetJavaClass(Interface targetInterface) {
- // TODO: right now assume that the target is always a Java
- // Implementation. Need to figure out how to generate Java
- // Interface in cases where the target is not a Java Implementation
- return ((JavaInterface)targetInterface).getJavaClass();
- }
-
- private void setDataBinding(Interface interfaze) {
- List<Operation> operations = interfaze.getOperations();
- for (Operation operation : operations) {
- operation.setDataBinding(JSONDataBinding.NAME);
- DataType<List<DataType>> inputType = operation.getInputType();
- if (inputType != null) {
- List<DataType> logical = inputType.getLogical();
- for (DataType inArg : logical) {
- if (!SimpleJavaDataBinding.NAME.equals(inArg.getDataBinding())) {
- inArg.setDataBinding(JSONDataBinding.NAME);
- }
- }
- }
- DataType outputType = operation.getOutputType();
- if (outputType != null) {
- if (!SimpleJavaDataBinding.NAME.equals(outputType.getDataBinding())) {
- outputType.setDataBinding(JSONDataBinding.NAME);
- }
- }
- }
- }
-
-
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java
deleted file mode 100644
index c0d0415f91..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.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.binding.jsonrpc.provider;
-
-import java.io.BufferedReader;
-import java.io.CharArrayWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.osoa.sca.ServiceRuntimeException;
-
-import com.metaparadigm.jsonrpc.JSONRPCBridge;
-import com.metaparadigm.jsonrpc.JSONRPCResult;
-import com.metaparadigm.jsonrpc.JSONRPCServlet;
-
-/**
- * Servlet that handles JSON-RPC requests invoking SCA services.
- *
- * There is an instance of this Servlet for each <binding.jsonrpc>
- *
- * @version $Rev$ $Date$
- */
-public class JSONRPCServiceServlet extends JSONRPCServlet {
- private static final long serialVersionUID = 1L;
-
- transient Binding binding;
- transient String serviceName;
- transient Object serviceInstance;
- transient RuntimeComponentService componentService;
- transient InterfaceContract serviceContract;
- transient Class<?> serviceInterface;
-
- public JSONRPCServiceServlet(Binding binding,
- RuntimeComponentService componentService,
- InterfaceContract serviceContract,
- Class<?> serviceInterface,
- Object serviceInstance) {
- this.binding = binding;
- this.serviceName = binding.getName();
- this.componentService = componentService;
- this.serviceContract = serviceContract;
- this.serviceInterface = serviceInterface;
- this.serviceInstance = serviceInstance;
- }
-
- /**
- * Override to do nothing as the JSONRPCServlet is setup by the
- * service method in this class.
- */
- @Override
- public void init(ServletConfig config) {
- }
-
- @Override
- public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
- if ("smd".equals(request.getQueryString())) {
- handleSMDRequest(request, response);
- } else {
- try {
- handleServiceRequest(request, response);
- } finally {
- HttpSession session = request.getSession(false);
- if (session != null) {
- session.removeAttribute("JSONRPCBridge");
- }
- }
- }
- }
-
- private void handleServiceRequest(HttpServletRequest request, HttpServletResponse response)
- throws IOException {
- // Encode using UTF-8, although We are actually ASCII clean as
- // all unicode data is JSON escaped using backslash u. This is
- // less data efficient for foreign character sets but it is
- // needed to support naughty browsers such as Konqueror and Safari
- // which do not honour the charset set in the response
- response.setContentType("text/plain;charset=utf-8");
- OutputStream out = response.getOutputStream();
-
- // Decode using the charset in the request if it exists otherwise
- // use UTF-8 as this is what all browser implementations use.
- // The JSON-RPC-Java JavaScript client is ASCII clean so it
- // although here we can correctly handle data from other clients
- // that do not escape non ASCII data
- String charset = request.getCharacterEncoding();
- if (charset == null) {
- charset = "UTF-8";
- }
- BufferedReader in = new BufferedReader(new InputStreamReader(request.getInputStream(), charset));
-
- // Read the request
- CharArrayWriter data = new CharArrayWriter();
- char[] buf = new char[4096];
- int ret;
- while ((ret = in.read(buf, 0, 4096)) != -1) {
- data.write(buf, 0, ret);
- }
-
- JSONObject jsonReq = null;
- String method = null;
- try {
- jsonReq = new JSONObject(data.toString());
- method = jsonReq.getString("method");
- } catch (Exception e) {
- //FIXME Exceptions are not handled correctly here
- // They should be reported to the client JavaScript as proper
- // JavaScript exceptions.
- throw new RuntimeException("Unable to parse request", e);
- }
-
-
- // check if it's a system request
- // or a method invocation
- byte[] bout;
- if (method.startsWith("system.")) {
- bout = handleJSONRPCSystemInvocation(request, response, data.toString());
- } else {
- bout = handleJSONRPCMethodInvocation(request, response, jsonReq);
- }
-
- // Send response to client
- out.write(bout);
- out.flush();
- out.close();
- }
-
- /**
- * handles requests for the SMD descriptor for a service
- */
- protected void handleSMDRequest(HttpServletRequest request, HttpServletResponse response) throws IOException,
- UnsupportedEncodingException {
- String serviceUrl = request.getRequestURL().toString();
- String smd = JavaToSmd.interfaceToSmd(serviceInterface, serviceUrl);
-
- response.setContentType("text/plain;charset=utf-8");
- OutputStream out = response.getOutputStream();
- byte[] bout = smd.getBytes("UTF-8");
- out.write(bout);
- out.flush();
- out.close();
- }
-
- protected byte[] handleJSONRPCSystemInvocation(HttpServletRequest request, HttpServletResponse response, String requestData) throws IOException,
- UnsupportedEncodingException {
- /*
- * Create a new bridge for every request to avoid all the problems with
- * JSON-RPC-Java storing the bridge in the session
- */
- HttpSession session = request.getSession();
-
- JSONRPCBridge jsonrpcBridge = new JSONRPCBridge();
- jsonrpcBridge.registerObject("Service", serviceInstance, serviceInterface);
- session.setAttribute("JSONRPCBridge", jsonrpcBridge);
-
- org.json.JSONObject jsonReq = null;
- com.metaparadigm.jsonrpc.JSONRPCResult jsonResp = null;
- try {
- jsonReq = new org.json.JSONObject(requestData);
- } catch (java.text.ParseException e) {
- throw new RuntimeException("Unable to parse request", e);
- }
-
- String method = jsonReq.getString("method");
- if ((method != null) && (method.indexOf('.') < 0)) {
- jsonReq.putOpt("method", "Service" + "." + method);
- }
-
- // invoke the request
- jsonResp = jsonrpcBridge.call(new Object[] {request}, jsonReq);
-
- return jsonResp.toString().getBytes("UTF-8");
- }
-
- protected byte[] handleJSONRPCMethodInvocation(HttpServletRequest request, HttpServletResponse response, JSONObject jsonReq) throws IOException,
- UnsupportedEncodingException {
-
- String method = null;
- Object[] args = null;
- Object id = null;
- try {
- // Extract the method
- method = jsonReq.getString("method");
- if ((method != null) && (method.indexOf('.') < 0)) {
- jsonReq.putOpt("method", "Service" + "." + method);
- }
-
- // Extract the arguments
- JSONArray array = jsonReq.getJSONArray("params");
- args = new Object[array.length()];
- for (int i = 0; i < args.length; i++) {
- args[i] = array.get(i);
- }
- id = jsonReq.get("id");
-
- } catch (Exception e) {
- throw new RuntimeException("Unable to find json method name", e);
- }
-
- // invoke the request
- RuntimeWire wire = componentService.getRuntimeWire(binding, serviceContract);
- Operation jsonOperation = findOperation(method);
- Object result = null;
-
- try {
- JSONObject jsonResponse = new JSONObject();
- result = wire.invoke(jsonOperation, args);
-
- try {
- jsonResponse.put("result", result);
- jsonResponse.putOpt("id", id);
- //get response to send to client
- return jsonResponse.toString().getBytes("UTF-8");
- } catch (Exception e) {
- throw new ServiceRuntimeException("Unable to create JSON response", e);
- }
- } catch (InvocationTargetException e) {
- JSONRPCResult errorResult = new JSONRPCResult(JSONRPCResult.CODE_REMOTE_EXCEPTION, id, e.getCause() );
- return errorResult.toString().getBytes("UTF-8");
- } catch(RuntimeException e) {
- JSONRPCResult errorResult = new JSONRPCResult(JSONRPCResult.CODE_REMOTE_EXCEPTION, id, e.getCause());
- return errorResult.toString().getBytes("UTF-8");
- }
- }
-
- /**
- * Find the operation from the component service contract
- * @param componentService
- * @param method
- * @return
- */
- private Operation findOperation(String method) {
- if (method.contains(".")) {
- method = method.substring(method.lastIndexOf(".") + 1);
- }
-
- List<Operation> operations = serviceContract.getInterface().getOperations();
- //componentService.getBindingProvider(binding).getBindingInterfaceContract().getInterface().getOperations();
-
-
- Operation result = null;
- for (Operation o : operations) {
- if (o.getName().equalsIgnoreCase(method)) {
- result = o;
- break;
- }
- }
-
- return result;
- }
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JavaToSmd.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JavaToSmd.java
deleted file mode 100644
index 64339fda7b..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JavaToSmd.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.jsonrpc.provider;
-
-import java.lang.reflect.Method;
-
-/**
- * Utility class to create a Simple Method Description (SMD) descriptor
- * from a Java class. See http://dojo.jot.com/SMD.
- *
- * TODO: Change to work from the Tuscany Interface instead of a Java class
- *
- * @version $Rev$ $Date$
- */
-class JavaToSmd {
-
- static String interfaceToSmd(Class<?> klazz, String serviceUrl) {
- String name = klazz.getSimpleName();
- Method[] methods = klazz.getMethods();
-
- StringBuffer smdSb = new StringBuffer();
- smdSb.append("{\"SMDVersion\":\".1\",\"objectName\":\"" + name + "\",\"serviceType\":\"JSON-RPC\",\"serviceURL\":\""+ serviceUrl + "\",\"methods\":[");
- for (int i = 0; i < methods.length; i++) {
- if (i != 0) smdSb.append(",");
- Class<?>[] params = methods[i].getParameterTypes();
- smdSb.append("{\"name\":\""+methods[i].getName() + "\",\"parameters\":[");
- for (int j = 0; j < params.length; j++) {
- if (j != 0) smdSb.append(",");
- // right now Dojo doesn't look at the type value, so we'll default it to STRING
- // also, since we can't introspect the method parameter names we'll just create an incrementing parameter name
- smdSb.append("{\"name\":\"param" + j + "\",\"type\":\"STRING\"}");
- }
- smdSb.append("]}");
- }
- smdSb.append("]}");
-
- return smdSb.toString();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/ScaDomainScriptServlet.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/ScaDomainScriptServlet.java
deleted file mode 100644
index 999588abf1..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/ScaDomainScriptServlet.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.binding.jsonrpc.provider;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Servlet to handle requests for the scaDomain.js script.
- *
- * This script wrappers the JSON-RPC-Java jsonrpc.js script
- * adding in at the bottom the JavaScript to create and initialize
- * the variables representing the SCA services.
- *
- * @version $Rev$ $Date$
- */
-public class ScaDomainScriptServlet extends HttpServlet {
- private static final long serialVersionUID = 1L;
-
- protected transient List<String> serviceNames;
-
- public ScaDomainScriptServlet() {
- serviceNames = new ArrayList<String>();
- }
-
- @Override
- public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
-
- ServletOutputStream os = response.getOutputStream();
-
- os.println();
- os.println("/* Apache Tuscany scaDomain.js Header */");
- os.println();
-
- writeJSONRPCJavaScript(os);
- writeScaDomainCode(os, request.getServletPath());
- }
-
- /**
- * Creates a JavaScript variable within the scaDomain script for each SCA service and
- * initializes its value with the JSON-RPC client to invoke the serverside service.
- */
- protected void writeScaDomainCode(ServletOutputStream out, String path) throws IOException {
- out.println();
- out.println("/* Apache Tuscany scaDomain.js Footer */");
- out.println();
- out.println("function scaDomain() {}");
-
- // remove the leading slash '/' character
- path = path.substring(1);
-
- for (String serviceName : serviceNames) {
- out.println();
-
- // A slight hack to make the service function available with a variable named 'serviceName'
- // to do that the JSONRpcClient is added to the scaDomain and then the service function is got from that
- out.println("scaDomain." + serviceName + " = " + "new JSONRpcClient(\"" + serviceName + "\");");
- out.println(serviceName + " = scaDomain." + serviceName + ".Service;");
- }
-
- out.println();
- out.println("/** End of Apache Tuscany scaDomain.js */");
- out.println();
- }
-
- /**
- * Reads the jsonrpc.js script from the classpath and adds its contents to the output stream.
- */
- protected void writeJSONRPCJavaScript(ServletOutputStream os) throws IOException {
- URL url = getClass().getResource("jsonrpc.js");
- InputStream is = url.openStream();
- int i;
- while ((i = is.read()) != -1) {
- os.write(i);
- }
- }
-
- public void addService(String serviceName) {
- serviceNames.add(serviceName);
- }
-
- public void removeService(String serviceName) {
- serviceNames.remove(serviceName);
- }
-
- public List<String> getServiceNames() {
- return serviceNames;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index 4767358e7a..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-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.jsonrpc.provider.JSONRPCBindingProviderFactory;model=org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/resources/org/apache/tuscany/sca/binding/jsonrpc/provider/jsonrpc.js b/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/resources/org/apache/tuscany/sca/binding/jsonrpc/provider/jsonrpc.js
deleted file mode 100644
index d837bab91c..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/main/resources/org/apache/tuscany/sca/binding/jsonrpc/provider/jsonrpc.js
+++ /dev/null
@@ -1,493 +0,0 @@
-/*
- * JSON-RPC JavaScript client
- *
- * $Id: jsonrpc.js,v 1.36.2.3 2006/03/08 15:09:37 mclark Exp $
- *
- * Copyright (c) 2003-2004 Jan-Klaas Kollhof
- * Copyright (c) 2005 Michael Clark, Metaparadigm Pte Ltd
- *
- * This code is based on Jan-Klaas' JavaScript o lait library (jsolait).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/*
- * Modifications for Apache Tuscany:
- * - JSONRpcClient_createMethod changed so callback is last arg
- */
-
-/* escape a character */
-
-escapeJSONChar =
-function escapeJSONChar(c)
-{
- if(c == "\"" || c == "\\") return "\\" + c;
- else if (c == "\b") return "\\b";
- else if (c == "\f") return "\\f";
- else if (c == "\n") return "\\n";
- else if (c == "\r") return "\\r";
- else if (c == "\t") return "\\t";
- var hex = c.charCodeAt(0).toString(16);
- if(hex.length == 1) return "\\u000" + hex;
- else if(hex.length == 2) return "\\u00" + hex;
- else if(hex.length == 3) return "\\u0" + hex;
- else return "\\u" + hex;
-};
-
-
-/* encode a string into JSON format */
-
-escapeJSONString =
-function escapeJSONString(s)
-{
- /* The following should suffice but Safari's regex is b0rken
- (doesn't support callback substitutions)
- return "\"" + s.replace(/([^\u0020-\u007f]|[\\\"])/g,
- escapeJSONChar) + "\"";
- */
-
- /* Rather inefficient way to do it */
- var parts = s.split("");
- for(var i=0; i < parts.length; i++) {
- var c =parts[i];
- if(c == '"' ||
- c == '\\' ||
- c.charCodeAt(0) < 32 ||
- c.charCodeAt(0) >= 128)
- parts[i] = escapeJSONChar(parts[i]);
- }
- return "\"" + parts.join("") + "\"";
-};
-
-
-/* Marshall objects to JSON format */
-
-toJSON = function toJSON(o)
-{
- if(o == null) {
- return "null";
- } else if(o.constructor == String) {
- return escapeJSONString(o);
- } else if(o.constructor == Number) {
- return o.toString();
- } else if(o.constructor == Boolean) {
- return o.toString();
- } else if(o.constructor == Date) {
- return '{javaClass: "java.util.Date", time: ' + o.valueOf() +'}';
- } else if(o.constructor == Array) {
- var v = [];
- for(var i = 0; i < o.length; i++) v.push(toJSON(o[i]));
- return "[" + v.join(", ") + "]";
- } else {
- var v = [];
- for(attr in o) {
- if(o[attr] == null) v.push("\"" + attr + "\": null");
- else if(typeof o[attr] == "function"); /* skip */
- else v.push(escapeJSONString(attr) + ": " + toJSON(o[attr]));
- }
- return "{" + v.join(", ") + "}";
- }
-};
-
-
-/* JSONRpcClient constructor */
-
-JSONRpcClient =
-function JSONRpcClient_ctor(serverURL, user, pass, objectID)
-{
- this.serverURL = serverURL;
- this.user = user;
- this.pass = pass;
- this.objectID = objectID;
-
- /* Add standard methods */
- if(this.objectID) {
- this._addMethods(["listMethods"]);
- var req = this._makeRequest("listMethods", []);
- } else {
- this._addMethods(["system.listMethods"]);
- var req = this._makeRequest("system.listMethods", []);
- }
- var m = this._sendRequest(req);
- this._addMethods(m);
-};
-
-
-/* JSONRpcCLient.Exception */
-
-JSONRpcClient.Exception =
-function JSONRpcClient_Exception_ctor(code, message, javaStack)
-{
- this.code = code;
- var name;
- if(javaStack) {
- this.javaStack = javaStack;
- var m = javaStack.match(/^([^:]*)/);
- if(m) name = m[0];
- }
- if(name) this.name = name;
- else this.name = "JSONRpcClientException";
- this.message = message;
-};
-
-JSONRpcClient.Exception.CODE_REMOTE_EXCEPTION = 490;
-JSONRpcClient.Exception.CODE_ERR_CLIENT = 550;
-JSONRpcClient.Exception.CODE_ERR_PARSE = 590;
-JSONRpcClient.Exception.CODE_ERR_NOMETHOD = 591;
-JSONRpcClient.Exception.CODE_ERR_UNMARSHALL = 592;
-JSONRpcClient.Exception.CODE_ERR_MARSHALL = 593;
-
-JSONRpcClient.Exception.prototype = new Error();
-
-JSONRpcClient.Exception.prototype.toString =
-function JSONRpcClient_Exception_toString(code, msg)
-{
- return this.name + ": " + this.message;
-};
-
-
-/* Default top level exception handler */
-
-JSONRpcClient.default_ex_handler =
-function JSONRpcClient_default_ex_handler(e) { alert(e); };
-
-
-/* Client settable variables */
-
-JSONRpcClient.toplevel_ex_handler = JSONRpcClient.default_ex_handler;
-JSONRpcClient.profile_async = false;
-JSONRpcClient.max_req_active = 1;
-JSONRpcClient.requestId = 1;
-
-
-/* JSONRpcClient implementation */
-
-JSONRpcClient.prototype._createMethod =
-function JSONRpcClient_createMethod(methodName)
-{
- var fn=function()
- {
- var args = [];
- var callback = null;
- for(var i=0;i<arguments.length;i++) args.push(arguments[i]);
-
-/* TUSCANY change callback to be last arg instead of first to match binding.ajax
- if(typeof args[0] == "function") callback = args.shift();
-*/
- if(typeof args[arguments.length-1] == "function") callback = args.pop();
-
- var req = fn.client._makeRequest.call(fn.client, fn.methodName,
- args, callback);
- if(callback == null) {
- return fn.client._sendRequest.call(fn.client, req);
- } else {
- JSONRpcClient.async_requests.push(req);
- JSONRpcClient.kick_async();
- return req.requestId;
- }
- };
- fn.client = this;
- fn.methodName = methodName;
- return fn;
-};
-
-JSONRpcClient.prototype._addMethods =
-function JSONRpcClient_addMethods(methodNames)
-{
- for(var i=0; i<methodNames.length; i++) {
- var obj = this;
- var names = methodNames[i].split(".");
- for(var n=0; n<names.length-1; n++) {
- var name = names[n];
- if(obj[name]) {
- obj = obj[name];
- } else {
- obj[name] = new Object();
- obj = obj[name];
- }
- }
- var name = names[names.length-1];
- if(!obj[name]) {
- var method = this._createMethod(methodNames[i]);
- obj[name] = method;
- }
- }
-};
-
-JSONRpcClient._getCharsetFromHeaders =
-function JSONRpcClient_getCharsetFromHeaders(http)
-{
- try {
- var contentType = http.getResponseHeader("Content-type");
- var parts = contentType.split(/\s*;\s*/);
- for(var i =0; i < parts.length; i++) {
- if(parts[i].substring(0, 8) == "charset=")
- return parts[i].substring(8, parts[i].length);
- }
- } catch (e) {}
- return "UTF-8"; /* default */
-};
-
-/* Async queue globals */
-JSONRpcClient.async_requests = [];
-JSONRpcClient.async_inflight = {};
-JSONRpcClient.async_responses = [];
-JSONRpcClient.async_timeout = null;
-JSONRpcClient.num_req_active = 0;
-
-JSONRpcClient._async_handler =
-function JSONRpcClient_async_handler()
-{
- JSONRpcClient.async_timeout = null;
-
- while(JSONRpcClient.async_responses.length > 0) {
- var res = JSONRpcClient.async_responses.shift();
- if(res.canceled) continue;
- if(res.profile) res.profile.dispatch = new Date();
- try {
- res.cb(res.result, res.ex, res.profile);
- } catch(e) {
- JSONRpcClient.toplevel_ex_handler(e);
- }
- }
-
- while(JSONRpcClient.async_requests.length > 0 &&
- JSONRpcClient.num_req_active < JSONRpcClient.max_req_active) {
- var req = JSONRpcClient.async_requests.shift();
- if(req.canceled) continue;
- req.client._sendRequest.call(req.client, req);
- }
-};
-
-JSONRpcClient.kick_async =
-function JSONRpcClient_kick_async()
-{
- if(JSONRpcClient.async_timeout == null)
- JSONRpcClient.async_timeout =
- setTimeout(JSONRpcClient._async_handler, 0);
-};
-
-JSONRpcClient.cancelRequest =
-function JSONRpcClient_cancelRequest(requestId)
-{
- /* If it is in flight then mark it as canceled in the inflight map
- and the XMLHttpRequest callback will discard the reply. */
- if(JSONRpcClient.async_inflight[requestId]) {
- JSONRpcClient.async_inflight[requestId].canceled = true;
- return true;
- }
-
- /* If its not in flight yet then we can just mark it as canceled in
- the the request queue and it will get discarded before being sent. */
- for(var i in JSONRpcClient.async_requests) {
- if(JSONRpcClient.async_requests[i].requestId == requestId) {
- JSONRpcClient.async_requests[i].canceled = true;
- return true;
- }
- }
-
- /* It may have returned from the network and be waiting for its callback
- to be dispatched, so mark it as canceled in the response queue
- and the response will get discarded before calling the callback. */
- for(var i in JSONRpcClient.async_responses) {
- if(JSONRpcClient.async_responses[i].requestId == requestId) {
- JSONRpcClient.async_responses[i].canceled = true;
- return true;
- }
- }
-
- return false;
-};
-
-JSONRpcClient.prototype._makeRequest =
-function JSONRpcClient_makeRequest(methodName, args, cb)
-{
- var req = {};
- req.client = this;
- req.requestId = JSONRpcClient.requestId++;
-
- var obj = {};
- obj.id = req.requestId;
- if (this.objectID)
- obj.method = ".obj#" + this.objectID + "." + methodName;
- else
- obj.method = methodName;
- obj.params = args;
-
- if (cb) req.cb = cb;
- if (JSONRpcClient.profile_async)
- req.profile = { "submit": new Date() };
- req.data = toJSON(obj);
-
- return req;
-};
-
-JSONRpcClient.prototype._sendRequest =
-function JSONRpcClient_sendRequest(req)
-{
- if(req.profile) req.profile.start = new Date();
-
- /* Get free http object from the pool */
- var http = JSONRpcClient.poolGetHTTPRequest();
- JSONRpcClient.num_req_active++;
-
- /* Send the request */
- if (typeof(this.user) == "undefined") {
- http.open("POST", this.serverURL, (req.cb != null));
- } else {
- http.open("POST", this.serverURL, (req.cb != null), this.user, this.pass);
- }
-
- /* setRequestHeader is missing in Opera 8 Beta */
- try { http.setRequestHeader("Content-type", "text/plain"); } catch(e) {}
-
- /* Construct call back if we have one */
- if(req.cb) {
- var self = this;
- http.onreadystatechange = function() {
- if(http.readyState == 4) {
- http.onreadystatechange = function () {};
- var res = { "cb": req.cb, "result": null, "ex": null};
- if (req.profile) {
- res.profile = req.profile;
- res.profile.end = new Date();
- }
- try { res.result = self._handleResponse(http); }
- catch(e) { res.ex = e; }
- if(!JSONRpcClient.async_inflight[req.requestId].canceled)
- JSONRpcClient.async_responses.push(res);
- delete JSONRpcClient.async_inflight[req.requestId];
- JSONRpcClient.kick_async();
- }
- };
- } else {
- http.onreadystatechange = function() {};
- }
-
- JSONRpcClient.async_inflight[req.requestId] = req;
-
- try {
- http.send(req.data);
- } catch(e) {
- JSONRpcClient.poolReturnHTTPRequest(http);
- JSONRpcClient.num_req_active--;
- throw new JSONRpcClient.Exception
- (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed");
- }
-
- if(!req.cb) return this._handleResponse(http);
-};
-
-JSONRpcClient.prototype._handleResponse =
-function JSONRpcClient_handleResponse(http)
-{
- /* Get the charset */
- if(!this.charset) {
- this.charset = JSONRpcClient._getCharsetFromHeaders(http);
- }
-
- /* Get request results */
- var status, statusText, data;
- try {
- status = http.status;
- statusText = http.statusText;
- data = http.responseText;
- } catch(e) {
- JSONRpcClient.poolReturnHTTPRequest(http);
- JSONRpcClient.num_req_active--;
- JSONRpcClient.kick_async();
- throw new JSONRpcClient.Exception
- (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed");
- }
-
- /* Return http object to the pool; */
- JSONRpcClient.poolReturnHTTPRequest(http);
- JSONRpcClient.num_req_active--;
-
- /* Unmarshall the response */
- if(status != 200) {
- throw new JSONRpcClient.Exception(status, statusText);
- }
- var obj;
- try {
- eval("obj = " + data);
- } catch(e) {
- throw new JSONRpcClient.Exception(550, "error parsing result");
- }
- if(obj.error)
- throw new JSONRpcClient.Exception(obj.error.code, obj.error.msg,
- obj.error.trace);
- var res = obj.result;
-
- /* Handle CallableProxy */
- if(res && res.objectID && res.JSONRPCType == "CallableReference")
- return new JSONRpcClient(this.serverURL, this.user,
- this.pass, res.objectID);
-
- return res;
-};
-
-
-/* XMLHttpRequest wrapper code */
-
-/* XMLHttpRequest pool globals */
-JSONRpcClient.http_spare = [];
-JSONRpcClient.http_max_spare = 8;
-
-JSONRpcClient.poolGetHTTPRequest =
-function JSONRpcClient_pool_getHTTPRequest()
-{
- if(JSONRpcClient.http_spare.length > 0) {
- return JSONRpcClient.http_spare.pop();
- }
- return JSONRpcClient.getHTTPRequest();
-};
-
-JSONRpcClient.poolReturnHTTPRequest =
-function JSONRpcClient_poolReturnHTTPRequest(http)
-{
- if(JSONRpcClient.http_spare.length >= JSONRpcClient.http_max_spare)
- delete http;
- else
- JSONRpcClient.http_spare.push(http);
-};
-
-JSONRpcClient.msxmlNames = [ "MSXML2.XMLHTTP.5.0",
- "MSXML2.XMLHTTP.4.0",
- "MSXML2.XMLHTTP.3.0",
- "MSXML2.XMLHTTP",
- "Microsoft.XMLHTTP" ];
-
-JSONRpcClient.getHTTPRequest =
-function JSONRpcClient_getHTTPRequest()
-{
- /* Mozilla XMLHttpRequest */
- try {
- JSONRpcClient.httpObjectName = "XMLHttpRequest";
- return new XMLHttpRequest();
- } catch(e) {}
-
- /* Microsoft MSXML ActiveX */
- for (var i=0;i < JSONRpcClient.msxmlNames.length; i++) {
- try {
- JSONRpcClient.httpObjectName = JSONRpcClient.msxmlNames[i];
- return new ActiveXObject(JSONRpcClient.msxmlNames[i]);
- } catch (e) {}
- }
-
- /* None found */
- JSONRpcClient.httpObjectName = null;
- throw new JSONRpcClient.Exception(0, "Can't create XMLHttpRequest object");
-};
-
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/bean/TestBean.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/bean/TestBean.java
deleted file mode 100644
index 4b159fb563..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/bean/TestBean.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 bean;
-
-public class TestBean {
- private String testString;
- private String[] testStringArray;
- private int testInt;
-
-
- public String getTestString() {
- return testString;
- }
-
- public void setTestString(String testString) {
- this.testString = testString;
- }
-
- public String[] getTestStringArray() {
- return testStringArray;
- }
-
- public void setStringArray(String[] stringArray) {
- this.testStringArray = stringArray;
- }
-
- public int getTestInt() {
- return testInt;
- }
-
- public void setTestInt(int testInt) {
- this.testInt = testInt;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/Echo.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/Echo.java
deleted file mode 100644
index ba87f22cf6..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/Echo.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 echo;
-
-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 org.osoa.sca.annotations.Remotable;
-
-import bean.TestBean;
-
-/**
- * Interface of our sample JSONRPC service.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface Echo {
-
- String echo(String msg);
-
- void echoRuntimeException() throws RuntimeException;
-
- void echoBusinessException() throws EchoBusinessException;
-
- int echoInt(int param);
-
- boolean echoBoolean(boolean param);
-
- Map echoMap(HashMap map);
-
- TestBean echoBean(TestBean testBean);
-
- List echoList(ArrayList list);
-
- String [] echoArrayString(String[] stringArray);
-
- int [] echoArrayInt(int[] intArray);
-
- Set echoSet(HashSet set);
-
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoBusinessException.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoBusinessException.java
deleted file mode 100644
index bf8c7d2c8a..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoBusinessException.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 echo;
-
-public class EchoBusinessException extends Exception {
- private static final long serialVersionUID = 7234119326657905710L;
-
- public EchoBusinessException(String message)
- {
- super(message);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoComponentImpl.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoComponentImpl.java
deleted file mode 100644
index 3e7b848221..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoComponentImpl.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 echo;
-
-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 bean.TestBean;
-
-/**
- * A simple client component that uses a reference with an JSONRPC binding.
- *
- * @version $Rev$ $Date$
- */
-public class EchoComponentImpl implements Echo {
-
- public String echo(String msg) {
- System.out.println("Echo: "+ msg);
- return "echo: " + msg;
- }
-
- public void echoBusinessException() throws EchoBusinessException {
- throw new EchoBusinessException("Business Exception");
-
- }
-
- public void echoRuntimeException() throws RuntimeException {
- throw new RuntimeException("Runtime Exception");
- }
-
- public int echoInt(int param) {
- int value = param;
- return value;
- }
-
- public boolean echoBoolean(boolean param) {
- boolean value = param;
- return value;
- }
-
- public Map echoMap(HashMap param) {
- Map map = new HashMap();
- map = param;
- return map;
- }
-
- public TestBean echoBean(TestBean testBean1) {
- TestBean testBean = new TestBean();
- testBean.setTestString(testBean1.getTestString());
- testBean.setTestInt(testBean1.getTestInt());
- return testBean;
- }
-
- public List echoList(ArrayList param){
- List list = new ArrayList();
- for(Iterator itr = param.iterator();itr.hasNext();)
- {
- list.add(itr.next());
- }
- return list;
- }
-
- public String[] echoArrayString(String[] stringArray) {
- return stringArray;
- }
-
- public int[] echoArrayInt(int[] intArray) {
- return intArray;
- }
-
- public Set echoSet(HashSet param){
- Set set = new HashSet();
- set = param;
- return set;
-
- }
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java
deleted file mode 100644
index 6d156fcdf5..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.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.binding.jsonrpc;
-
-import java.io.ByteArrayInputStream;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.json.JSONObject;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import com.meterware.httpunit.PostMethodWebRequest;
-import com.meterware.httpunit.WebConversation;
-import com.meterware.httpunit.WebRequest;
-import com.meterware.httpunit.WebResponse;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JSONRPCDataTypeTestCase {
-
- private static final String SERVICE_PATH = "/EchoService";
- private static final String SERVICE_URL = "http://localhost:8085/SCADomain" + SERVICE_PATH;
- private SCADomain domain;
-
- @Before
- public void setUp() throws Exception {
- domain = SCADomain.newInstance("JSONRPCBinding.composite");
- }
-
- @After
- public void tearDown() throws Exception {
- domain.close();
- }
-
- @Test
- public void testInt() throws Exception {
- JSONObject jsonRequest = new JSONObject(
- "{ \"method\": \"echoInt\", \"params\": [12345], \"id\": 4}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest(SERVICE_URL,
- new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")), "application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonResp = new JSONObject(response.getText());
-
- Assert.assertEquals(12345, jsonResp.getInt("result"));
- }
-
- @Test
- public void testBoolean() throws Exception {
- JSONObject jsonRequest = new JSONObject(
- "{ \"method\": \"echoBoolean\", \"params\": [true], \"id\": 5}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest(SERVICE_URL,
- new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")), "application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonResp = new JSONObject(response.getText());
-
- Assert.assertEquals(true, jsonResp.getBoolean("result"));
- }
-
- @Test
- public void testMap() throws Exception {
- JSONObject jsonRequest = new JSONObject(
- "{ \"method\": \"echoMap\", \"params\": [ {\"javaClass\": \"java.util.HashMap\", \"map\": { \"Binding\": \"JSON-RPC\"}}], \"id\": 6}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest(SERVICE_URL,
- new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")), "application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonResp = new JSONObject(response.getText());
-
- Assert.assertEquals("JSON-RPC", jsonResp.getJSONObject("result").getJSONObject("map").getString("Binding"));
- }
-
- @Test
- public void testBean() throws Exception {
- JSONObject jsonRequest = new JSONObject(
- "{ \"method\": \"echoBean\", \"params\": [ {\"javaClass\": \"bean.TestBean\", \"testString\": \"JSON-RPC\", \"testInt\":1234}], \"id\": 7}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest(SERVICE_URL,
- new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")), "application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonResp = new JSONObject(response.getText());
-
- Assert.assertEquals("JSON-RPC", jsonResp.getJSONObject("result").getString("testString"));
- }
-
- @Test
- public void testList() throws Exception {
- JSONObject jsonRequest = new JSONObject(
- "{ \"method\": \"echoList\", \"params\": [ {\"javaClass\": \"java.util.ArrayList\", \"list\": [0,1,2,3,4]}], \"id\": 8}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest(SERVICE_URL,
- new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")), "application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonResp = new JSONObject(response.getText());
-
- Assert.assertEquals(0, jsonResp.getJSONObject("result").getJSONArray("list").get(0));
- }
-
- @Test
- public void testArrayString() throws Exception {
- JSONObject jsonRequest = new JSONObject(
- "{\"params\":[[\"1\",\"2\"]],\"method\":\"echoArrayString\",\"id\":9}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest(SERVICE_URL,
- new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")), "application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonResp = new JSONObject(response.getText());
-
- Assert.assertEquals(1, jsonResp.getJSONArray("result").getInt(0));
- }
-
-
- @Test
- public void testArrayInt() throws Exception {
- JSONObject jsonRequest = new JSONObject(
- "{\"params\":[[1,2]],\"method\":\"echoArrayInt\",\"id\":10}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest(SERVICE_URL,
- new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")), "application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonResp = new JSONObject(response.getText());
-
- Assert.assertEquals(1, jsonResp.getJSONArray("result").getInt(0));
- }
-
-
- @Test
- public void testSet() throws Exception {
- JSONObject jsonRequest = new JSONObject(
- "{ \"method\": \"echoSet\", \"params\": [ {\"javaClass\": \"java.util.HashSet\", \"set\": {\"1\": \"red\", \"2\": \"blue\"}}],\"id\": 11}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest(SERVICE_URL,
- new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")), "application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonResp = new JSONObject(response.getText());
-
- Assert.assertEquals("red", jsonResp.getJSONObject("result").getJSONObject("set").getString("red"));
- }
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCExceptionTestCase.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCExceptionTestCase.java
deleted file mode 100644
index 52518e1bbc..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCExceptionTestCase.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.jsonrpc;
-
-import java.io.ByteArrayInputStream;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.json.JSONObject;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.meterware.httpunit.PostMethodWebRequest;
-import com.meterware.httpunit.WebConversation;
-import com.meterware.httpunit.WebRequest;
-import com.meterware.httpunit.WebResponse;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JSONRPCExceptionTestCase{
-
- private static final String SERVICE_PATH = "/EchoService";
-
- private static final String SERVICE_URL = "http://localhost:8085/SCADomain" + SERVICE_PATH;
-
- private SCADomain domain;
-
- @Before
- public void setUp() throws Exception {
- domain = SCADomain.newInstance("JSONRPCBinding.composite");
- }
-
- @After
- public void tearDown() throws Exception {
- domain.close();
- }
-
- @Test
- public void testRuntimeException() throws Exception{
- JSONObject jsonRequest = new JSONObject("{ \"method\": \"echoRuntimeException\", \"params\": [], \"id\": 2}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest( SERVICE_URL, new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")),"application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonErr = new JSONObject(response.getText()).getJSONObject("error");
-
- Assert.assertEquals("Runtime Exception", jsonErr.getString("msg"));
- }
-
- @Test
- public void testBusinessException() throws Exception{
- JSONObject jsonRequest = new JSONObject("{ \"method\": \"echoBusinessException\", \"params\": [], \"id\": 3}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest( SERVICE_URL, new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")),"application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonErr = new JSONObject(response.getText()).getJSONObject("error");
-
- Assert.assertEquals("Business Exception", jsonErr.getString("msg"));
- }
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java b/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java
deleted file mode 100644
index 67d3eda6b2..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.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.jsonrpc;
-
-import java.io.ByteArrayInputStream;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.json.JSONObject;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.meterware.httpunit.PostMethodWebRequest;
-import com.meterware.httpunit.WebConversation;
-import com.meterware.httpunit.WebRequest;
-import com.meterware.httpunit.WebResponse;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JSONRPCServiceTestCase{
-
- private static final String SERVICE_PATH = "/EchoService";
-
- private static final String SERVICE_URL = "http://localhost:8085/SCADomain" + SERVICE_PATH;
-
- private SCADomain domain;
-
- @Before
- public void setUp() throws Exception {
- domain = SCADomain.newInstance("JSONRPCBinding.composite");
- }
-
- @After
- public void tearDown() throws Exception {
- domain.close();
- }
-
- @Test
- public void testJSONRPCBinding() throws Exception {
- JSONObject jsonRequest = new JSONObject("{ \"method\": \"echo\", \"params\": [\"Hello JSON-RPC\"], \"id\": 1}");
-
- WebConversation wc = new WebConversation();
- WebRequest request = new PostMethodWebRequest( SERVICE_URL, new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")),"application/json");
- WebResponse response = wc.getResource(request);
-
- Assert.assertEquals(200, response.getResponseCode());
-
- JSONObject jsonResp = new JSONObject(response.getText());
- Assert.assertEquals("echo: Hello JSON-RPC", jsonResp.getString("result"));
- }
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/resources/JSONRPCBinding.composite b/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/resources/JSONRPCBinding.composite
deleted file mode 100644
index 978fdcfa7f..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc-runtime/src/test/resources/JSONRPCBinding.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"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://jsonrpc"
- xmlns:jsonrpc="http://jsonrpc"
- name="JSONRPCBinding">
-
- <service name="EchoService" promote="EchoComponent">
- <interface.java interface="echo.Echo"/>
- <tuscany:binding.jsonrpc uri="http://localhost:8085/SCADomain/EchoService"/>
- </service>
-
- <component name="EchoComponent">
- <implementation.java class="echo.EchoComponentImpl"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-jsonrpc/LICENSE b/branches/sca-android/modules/binding-jsonrpc/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-jsonrpc/META-INF/README b/branches/sca-android/modules/binding-jsonrpc/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-jsonrpc/NOTICE b/branches/sca-android/modules/binding-jsonrpc/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc/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/branches/sca-android/modules/binding-jsonrpc/pom.xml b/branches/sca-android/modules/binding-jsonrpc/pom.xml
deleted file mode 100644
index e3198d3726..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc/pom.xml
+++ /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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-jsonrpc</artifactId>
- <name>Apache Tuscany SCA JSON-RPC Binding Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.jsonrpc</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.jsonrpc*</Export-Package>
- <Import-Package>org.apache.tuscany.sca.assembly.xml,*</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBinding.java b/branches/sca-android/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBinding.java
deleted file mode 100644
index 4160213e8c..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBinding.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jsonrpc;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-/**
- * A model for the JSONRPC binding.
- *
- * @version $Rev$ $Date$
- */
-public class JSONRPCBinding implements Binding {
- private String name;
- private String uri;
-
- public String getName() {
- return name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public boolean isUnresolved() {
- // The binding is always resolved
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- // The binding is always resolved
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- // TODO Auto-generated method stub
- return super.clone();
- }
-}
diff --git a/branches/sca-android/modules/binding-jsonrpc/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/binding-jsonrpc/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 3adbec0f97..0000000000
--- a/branches/sca-android/modules/binding-jsonrpc/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.jsonrpc,model=org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding
diff --git a/branches/sca-android/modules/binding-rmi/LICENSE b/branches/sca-android/modules/binding-rmi/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-rmi/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-rmi/META-INF/README b/branches/sca-android/modules/binding-rmi/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-rmi/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-rmi/NOTICE b/branches/sca-android/modules/binding-rmi/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-rmi/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/branches/sca-android/modules/binding-rmi/pom.xml b/branches/sca-android/modules/binding-rmi/pom.xml
deleted file mode 100644
index 44b4ded5b4..0000000000
--- a/branches/sca-android/modules/binding-rmi/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-rmi</artifactId>
- <name>Apache Tuscany SCA RMI Binding Extension</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extension-helper</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-rmi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- <version>2.1_3</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</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.rmi</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.rmi*</Export-Package>
- <DynamicImport-Package>*</DynamicImport-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java b/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java
deleted file mode 100644
index 906e0df652..0000000000
--- a/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.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.binding.rmi;
-
-import org.apache.tuscany.sca.extension.helper.utils.AbstractBinding;
-
-/**
- * Represents a binding to an RMI service.
- *
- * @version $Rev$ $Date$
- */
-public class RMIBinding extends AbstractBinding {
-
- 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;
- }
-}
diff --git a/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingActivator.java b/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingActivator.java
deleted file mode 100644
index 1be70f57f7..0000000000
--- a/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingActivator.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.rmi;
-
-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.rmi.ExtensibleRMIHost;
-import org.apache.tuscany.sca.host.rmi.RMIHost;
-import org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Binding Activator for the RMI Binding.
- *
- * @version $Rev$ $Date$
- */
-public class RMIBindingActivator implements BindingActivator<RMIBinding> {
-
- private RMIHost rmiHost;
-
- public RMIBindingActivator(RMIHostExtensionPoint rmiHosts) {
- this.rmiHost = new ExtensibleRMIHost(rmiHosts);
- }
-
- public Class<RMIBinding> getBindingClass() {
- return RMIBinding.class;
- }
-
- public InvokerFactory createInvokerFactory(RuntimeComponent rc, RuntimeComponentReference rcr, Binding b, RMIBinding binding) {
- return new RMIReferenceInvokerFactory(rc, rcr, binding, rmiHost);
- }
-
- public ComponentLifecycle createService(RuntimeComponent rc, RuntimeComponentService rcs, Binding b, RMIBinding binding) {
- return new RMIService(rc, rcs, binding, rmiHost);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvoker.java b/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvoker.java
deleted file mode 100644
index 069ed4a070..0000000000
--- a/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvoker.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.binding.rmi;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.rmi.Remote;
-
-import org.apache.tuscany.sca.host.rmi.RMIHost;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-
-/**
- * Invoker for RMI References.
- *
- * @version $Rev$ $Date$
- */
-public class RMIReferenceInvoker implements Invoker, DataExchangeSemantics {
-
- private RMIHost rmiHost;
- private String host;
- private String port;
- private String svcName;
- private Method remoteMethod;
- private Remote proxy;
-
- public RMIReferenceInvoker(RMIHost rmiHost, String host, String port, String svcName, Method remoteMethod) {
- this.rmiHost = rmiHost;
- this.remoteMethod = remoteMethod;
- this.host = host;
- this.port = port;
- this.svcName = svcName;
- }
-
- public Message invoke(Message msg) {
- try {
-
- Object[] args = msg.getBody();
- Object resp = invokeTarget(args);
- msg.setBody(resp);
-
- } catch (InvocationTargetException e) {
- msg.setFaultBody(e.getCause());
- } catch (Throwable e) {
- msg.setFaultBody(e);
- }
-
- return msg;
- }
-
- public Object invokeTarget(final Object payload) throws InvocationTargetException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException {
- if (proxy == null) {
- proxy = rmiHost.findService(host, port, svcName);
- // proxy = Naming.lookup(serviceURI);
- }
-
- remoteMethod = proxy.getClass().getMethod(remoteMethod.getName(), remoteMethod.getParameterTypes());
-
- if (payload != null && !payload.getClass().isArray()) {
- return remoteMethod.invoke(proxy, payload);
- } else {
- return remoteMethod.invoke(proxy, (Object[])payload);
- }
- }
-
- public boolean allowsPassByReference() {
- // RMI always pass by value
- return true;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvokerFactory.java b/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvokerFactory.java
deleted file mode 100644
index c67bd910ba..0000000000
--- a/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvokerFactory.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;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.extension.helper.InvokerFactory;
-import org.apache.tuscany.sca.host.rmi.RMIHost;
-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.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * InvokerFactory that creates RMIReferenceInvoker instances for the
- * RMIBinding.
- *
- * @version $Rev$ $Date$
- */
-public class RMIReferenceInvokerFactory implements InvokerFactory {
-
- RuntimeComponentReference reference;
- RMIHost rmiHost;
- RMIBinding binding;
-
- public RMIReferenceInvokerFactory(RuntimeComponent rc, RuntimeComponentReference rcr, RMIBinding binding, RMIHost rmiHost) {
- this.reference = rcr;
- this.rmiHost = rmiHost;
- this.binding = binding;
- }
-
- public Invoker createInvoker(Operation operation) {
- try {
-
- Class<?> iface = ((JavaInterface)reference.getInterfaceContract().getInterface()).getJavaClass();
- Method remoteMethod = JavaInterfaceUtil.findMethod(iface, operation);
-
- return new RMIReferenceInvoker(rmiHost, binding.getHost(), binding.getPort(), binding.getServiceName(), remoteMethod);
-
- } catch (NoSuchMethodException e) {
- throw new ServiceRuntimeException(operation.toString(), e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java b/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java
deleted file mode 100644
index 25beb58820..0000000000
--- a/branches/sca-android/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.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.binding.rmi;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.rmi.Remote;
-import java.rmi.server.UnicastRemoteObject;
-import java.security.AccessController;
-import java.security.PrivilegedExceptionAction;
-
-import net.sf.cglib.asm.ClassWriter;
-import net.sf.cglib.asm.Constants;
-import net.sf.cglib.asm.Type;
-import net.sf.cglib.proxy.Enhancer;
-import net.sf.cglib.proxy.MethodInterceptor;
-import net.sf.cglib.proxy.MethodProxy;
-
-import org.apache.tuscany.sca.extension.helper.ComponentLifecycle;
-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.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;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * Implementation of a Service for the RMIBinding.
- *
- * @version $Rev$ $Date$
- */
-public class RMIService implements ComponentLifecycle {
-
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private RMIBinding binding;
- private RMIHost rmiHost;
- private RuntimeWire wire;
-
- public RMIService(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();
-
- Remote rmiProxy = createRmiService(serviceInterface);
-
- try {
-
- rmiHost.registerService(binding.getServiceName(), getPort(binding.getPort()), rmiProxy);
-
- } catch (RMIHostException e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public void stop() {
- }
-
- protected int getPort(String port) {
- int portNumber = RMIHost.RMI_DEFAULT_PORT;
- if (port != null && port.length() > 0) {
- portNumber = Integer.decode(port);
- }
- return portNumber;
- }
-
- protected 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);
- if (!Remote.class.isAssignableFrom(targetJavaInterface)) {
- RMIServiceClassLoader classloader = new RMIServiceClassLoader(getClass().getClassLoader());
- final byte[] byteCode = generateRemoteInterface(targetJavaInterface);
- targetJavaInterface = classloader.defineClass(byteCode);
- enhancer.setClassLoader(classloader);
- }
- enhancer.setInterfaces(new Class[] {targetJavaInterface});
- return (Remote)enhancer.create();
- }
-
- protected Object invokeTarget(Operation op, Object[] args) throws InvocationTargetException {
- return wire.invoke(op, args);
- }
-
- /**
- * 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.
- */
- protected byte[] generateRemoteInterface(Class serviceInterface) {
- String interfazeName = serviceInterface.getCanonicalName();
- ClassWriter cw = new ClassWriter(false);
-
- String simpleName = serviceInterface.getSimpleName();
- cw.visit(Constants.V1_5, Constants.ACC_PUBLIC + Constants.ACC_ABSTRACT + Constants.ACC_INTERFACE, interfazeName
- .replace('.', '/'), "java/lang/Object", new String[] {"java/rmi/Remote"}, simpleName + ".java");
-
- StringBuffer argsAndReturn = null;
- Method[] methods = serviceInterface.getMethods();
- for (Method method : methods) {
- argsAndReturn = new StringBuffer("(");
- Class[] paramTypes = method.getParameterTypes();
- Class returnType = method.getReturnType();
-
- for (Class paramType : paramTypes) {
- argsAndReturn.append(Type.getType(paramType));
- }
- argsAndReturn.append(")");
- argsAndReturn.append(Type.getType(returnType));
-
- cw.visitMethod(Constants.ACC_PUBLIC + Constants.ACC_ABSTRACT,
- method.getName(),
- argsAndReturn.toString(),
- new String[] {"java/rmi/RemoteException"},
- null);
- }
- cw.visitEnd();
- return cw.toByteArray();
- }
-
- protected 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();
- }
-
- protected class RMIServiceClassLoader extends ClassLoader {
- public RMIServiceClassLoader(ClassLoader parent) {
- super(parent);
- }
-
- public Class defineClass(byte[] byteArray) {
- return defineClass(null, byteArray, 0, byteArray.length);
- }
- }
-}
diff --git a/branches/sca-android/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator b/branches/sca-android/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator
deleted file mode 100644
index 582f321be9..0000000000
--- a/branches/sca-android/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# Implementation class for the ExtensionActivator
-org.apache.tuscany.sca.binding.rmi.RMIBindingActivator
diff --git a/branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloException.java b/branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloException.java
deleted file mode 100644
index cbc860ecc6..0000000000
--- a/branches/sca-android/modules/binding-rmi/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/branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldImpl.java b/branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldImpl.java
deleted file mode 100644
index 0a1f4283db..0000000000
--- a/branches/sca-android/modules/binding-rmi/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.osoa.sca.annotations.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/branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiImpl.java b/branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiImpl.java
deleted file mode 100644
index 5b20d17c83..0000000000
--- a/branches/sca-android/modules/binding-rmi/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.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.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/branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiService.java b/branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiService.java
deleted file mode 100644
index 461c176e1e..0000000000
--- a/branches/sca-android/modules/binding-rmi/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/branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldService.java b/branches/sca-android/modules/binding-rmi/src/test/java/helloworld/HelloWorldService.java
deleted file mode 100644
index 3b705d2c97..0000000000
--- a/branches/sca-android/modules/binding-rmi/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/branches/sca-android/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java b/branches/sca-android/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
deleted file mode 100644
index c7838e284b..0000000000
--- a/branches/sca-android/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.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.rmi;
-
-import helloworld.HelloException;
-import helloworld.HelloWorldRmiService;
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests for the RMIBinding.
- *
- * @version $Rev$ $Date$
- */
-public class BindingTestCase {
- private static HelloWorldRmiService helloWorldRmiService;
- private static SCADomain domain;
-
- @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 {
- domain = SCADomain.newInstance("RMIBindingTest.composite");
- helloWorldRmiService = domain.getService(HelloWorldRmiService.class, "HelloWorldRmiServiceComponent");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-rmi/src/test/resources/HelloWorldImpl.componentType b/branches/sca-android/modules/binding-rmi/src/test/resources/HelloWorldImpl.componentType
deleted file mode 100644
index 224a68f88d..0000000000
--- a/branches/sca-android/modules/binding-rmi/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/branches/sca-android/modules/binding-rmi/src/test/resources/HelloWorldRmiImpl.componentType b/branches/sca-android/modules/binding-rmi/src/test/resources/HelloWorldRmiImpl.componentType
deleted file mode 100644
index a83e7e6d1d..0000000000
--- a/branches/sca-android/modules/binding-rmi/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/branches/sca-android/modules/binding-rmi/src/test/resources/RMIBindingTest.composite b/branches/sca-android/modules/binding-rmi/src/test/resources/RMIBindingTest.composite
deleted file mode 100644
index d29fe85586..0000000000
--- a/branches/sca-android/modules/binding-rmi/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 host="localhost" port="8099" serviceName="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 host="localhost" port="8099" serviceName="HelloWorldRemoteService" />
- </reference>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-rss-rome/LICENSE b/branches/sca-android/modules/binding-rss-rome/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-rss-rome/META-INF/README b/branches/sca-android/modules/binding-rss-rome/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-rss-rome/NOTICE b/branches/sca-android/modules/binding-rss-rome/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/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/branches/sca-android/modules/binding-rss-rome/pom.xml b/branches/sca-android/modules/binding-rss-rome/pom.xml
deleted file mode 100644
index d0027caef6..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/pom.xml
+++ /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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-rss-rome</artifactId>
- <name>Apache Tuscany SCA RSS Feed Binding Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rss</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>rome</groupId>
- <artifactId>rome</artifactId>
- <version>0.9</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- </exclusions>
- </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.rss.rome</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.rss*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java b/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java
deleted file mode 100644
index bb8dab391b..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.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.rss.collection;
-
-import org.osoa.sca.annotations.Remotable;
-
-import com.sun.syndication.feed.synd.SyndFeed;
-
-
-/**
- * Provides access to a collection of resources using RSS.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface Collection {
-
- /**
- * Get an RSS feed for a collection of resources.
- *
- * @return the RSS feed
- */
- SyndFeed getFeed();
-
- /**
- * Get an RSS feed for a collection of resources resulting from a query.
- *
- * @param queryString the query string
- * @return the RSS feed
- */
- SyndFeed query(String queryString);
-
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.java b/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.java
deleted file mode 100644
index 2213b50b53..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.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.binding.rss.collection;
-
-import java.io.InputStream;
-
-import org.osoa.sca.annotations.Remotable;
-
-import com.sun.syndication.feed.atom.Entry;
-
-/**
- * Provides access to a collection of resources using Atom.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface MediaCollection extends Collection {
-
- /**
- * Creates a new media entry
- *
- * @param title
- * @param slug
- * @param contentType
- * @param media
- */
- Entry postMedia(String title, String slug, String contentType, InputStream media);
-
- /**
- * Update a media entry.
- *
- * @param id
- * @param contentType
- * @param media
- * @return
- */
- void putMedia(String id, String contentType, InputStream media) throws NotFoundException;
-
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/NotFoundException.java b/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/NotFoundException.java
deleted file mode 100644
index 0912878938..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/NotFoundException.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.rss.collection;
-
-/**
- * Indicates that a resource could not be found.
- *
- * @version $Rev$ $Date$
- */
-public class NotFoundException extends Exception {
- private static final long serialVersionUID = -5046027674128627383L;
-
- public NotFoundException() {
- }
-
- public NotFoundException(String message) {
- super(message);
- }
-
- public NotFoundException(Throwable cause) {
- super(cause);
- }
-
- public NotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingInvoker.java b/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingInvoker.java
deleted file mode 100644
index e3a177198c..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingInvoker.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.binding.rss.provider;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-import com.sun.syndication.feed.synd.SyndFeed;
-import com.sun.syndication.io.FeedException;
-import com.sun.syndication.io.SyndFeedInput;
-import com.sun.syndication.io.XmlReader;
-
-/**
- * Invoker for the RSS binding.
- *
- * @version $Rev$ $Date$
- */
-class RSSBindingInvoker implements Invoker , DataExchangeSemantics {
- private static final Logger logger = Logger.getLogger(RSSBindingInvoker.class.getName());
-
- private String uri;
-
- RSSBindingInvoker(String uri, String feedType) {
- this.uri = uri;
- }
-
- public Message invoke(Message msg) {
- try {
- logger.fine("invoke " + uri);
-
- // Read an RSS feed into a Synd feed
- SyndFeedInput input = new SyndFeedInput();
- SyndFeed feed = input.build(new XmlReader(new URL(uri)));
-
- //FIXME Support conversion to data-api entries
-
- msg.setBody(feed);
-
- } catch (MalformedURLException e) {
- msg.setFaultBody(e);
- } catch (IllegalArgumentException e) {
- msg.setFaultBody(e);
- } catch (FeedException e) {
- msg.setFaultBody(e);
- } catch (IOException e) {
- msg.setFaultBody(e);
- }
- return msg;
- }
-
- public boolean allowsPassByReference() {
- return true;
- }
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java b/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java
deleted file mode 100644
index 7eb5aeb3df..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.rss.provider;
-
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.logging.Logger;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.databinding.Mediator;
-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.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-import com.sun.syndication.feed.synd.SyndContent;
-import com.sun.syndication.feed.synd.SyndContentImpl;
-import com.sun.syndication.feed.synd.SyndEntry;
-import com.sun.syndication.feed.synd.SyndEntryImpl;
-import com.sun.syndication.feed.synd.SyndFeed;
-import com.sun.syndication.feed.synd.SyndFeedImpl;
-import com.sun.syndication.feed.synd.SyndLink;
-import com.sun.syndication.feed.synd.SyndLinkImpl;
-import com.sun.syndication.io.FeedException;
-import com.sun.syndication.io.SyndFeedOutput;
-
-/**
- * An RSS binding listener, implemented as a Servlet and
- * registered in a Servlet host provided by the SCA hosting runtime.
- *
- * @version $Rev$ $Date$
- */
-class RSSBindingListenerServlet extends HttpServlet {
- private static final Logger logger = Logger.getLogger(RSSBindingListenerServlet.class.getName());
- private static final long serialVersionUID = 1L;
-
- private RuntimeWire wire;
- private Invoker getFeedInvoker;
- private Invoker getAllInvoker;
- private Invoker queryInvoker;
- private MessageFactory messageFactory;
- private Mediator mediator;
- private DataType<?> itemClassType;
- private DataType<?> itemXMLType;
- private boolean supportsFeedEntries;
-
- /**
- * Constructs a new binding listener.
- *
- * @param wire
- * @param messageFactory
- */
- RSSBindingListenerServlet(RuntimeWire wire, MessageFactory messageFactory, Mediator mediator) {
- this.wire = wire;
- this.messageFactory = messageFactory;
- this.mediator = mediator;
-
- // Get the invokers for the supported operations
- Operation getOperation = null;
- for (InvocationChain invocationChain : this.wire.getInvocationChains()) {
- invocationChain.setAllowsPassByReference(true);
- Operation operation = invocationChain.getTargetOperation();
- String operationName = operation.getName();
- if (operationName.equals("getFeed")) {
- getFeedInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("getAll")) {
- getAllInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("query")) {
- queryInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("get")) {
- getOperation = operation;
- }
- }
-
- // Determine the collection item type
- itemXMLType = new DataTypeImpl<Class<?>>(String.class.getName(), String.class, String.class);
- Class<?> itemClass = getOperation.getOutputType().getPhysical();
- if (itemClass == SyndEntry.class) {
- supportsFeedEntries = true;
- }
- DataType<XMLType> outputType = getOperation.getOutputType();
- QName qname = outputType.getLogical().getElementName();
- qname = new QName(qname.getNamespaceURI(), itemClass.getSimpleName());
- itemClassType = new DataTypeImpl<XMLType>("java:complexType", itemClass, new XMLType(qname, null));
-
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // No authentication required for a get request
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
-
- logger.fine("get " + request.getRequestURI());
-
- // Handle an RSS request
- if (path == null || path.length() == 0 || path.equals("/")) {
-
- // Return an RSS feed containing the entries in the collection
- SyndFeed feed = null;
- if (supportsFeedEntries) {
-
- // The service implementation supports feed entries, invoke its getFeed operation
- Message requestMessage = messageFactory.createMessage();
- Message responseMessage = getFeedInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- feed = (SyndFeed)responseMessage.getBody();
-
- } else {
-
- // The service implementation does not support feed entries, invoke its
- // getAll operation to get the data item collection. then create feed entries
- // from the data items
- Message requestMessage = messageFactory.createMessage();
- Message responseMessage;
- if (request.getQueryString() != null) {
- requestMessage.setBody(new Object[] {request.getQueryString()});
- responseMessage = queryInvoker.invoke(requestMessage);
- } else {
- responseMessage = getAllInvoker.invoke(requestMessage);
- }
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- org.apache.tuscany.sca.data.collection.Entry<Object, Object>[] collection =
- (org.apache.tuscany.sca.data.collection.Entry<Object, Object>[])responseMessage.getBody();
- if (collection != null) {
- // Create the feed
- feed = new SyndFeedImpl();
- feed.setTitle("Feed");
-
- for (org.apache.tuscany.sca.data.collection.Entry<Object, Object> entry: collection) {
- SyndEntry feedEntry = createFeedEntry(entry);
- feed.getEntries().add(feedEntry);
- }
- }
- }
-
- // Convert to an RSS feed
- if (feed != null) {
- response.setContentType("application/rss+xml; charset=utf-8");
- feed.setFeedType("rss_2.0");
- feed.setLink(path);
- SyndFeedOutput syndOutput = new SyndFeedOutput();
- try {
- syndOutput.output(feed, getWriter(response));
- } catch (FeedException e) {
- throw new ServletException(e);
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- }
-
- /**
- * Create an Atom entry from a data collection entry.
- * @param entry
- * @return
- */
- private SyndEntry createFeedEntry(org.apache.tuscany.sca.data.collection.Entry<Object, Object> entry) {
- Object key = entry.getKey();
- Object data = entry.getData();
- if (data instanceof Item) {
- Item item = (Item)data;
-
- SyndEntry feedEntry = new SyndEntryImpl();
- feedEntry.setUri(key.toString());
- feedEntry.setTitle(item.getTitle());
-
- String value = item.getContents();
- if (value != null) {
- SyndContent content = new SyndContentImpl();
- content.setType("text/xml");
- content.setValue(value);
- List<SyndContent> contents = new ArrayList<SyndContent>();
- contents.add(content);
- feedEntry.setContents(contents);
- }
-
- String href = item.getLink();
- if (href == null) {
- href = key.toString();
- }
- SyndLink link = new SyndLinkImpl();
- link.setRel("edit");
- link.setHref(href);
- feedEntry.getLinks().add(link);
- link = new SyndLinkImpl();
- link.setRel("alternate");
- link.setHref(href);
- feedEntry.getLinks().add(link);
-
- Date date = item.getDate();
- if (date == null) {
- date = new Date();
- }
- feedEntry.setPublishedDate(date);
- return feedEntry;
-
- } else if (data != null) {
- SyndEntry feedEntry = new SyndEntryImpl();
- feedEntry.setUri(key.toString());
- feedEntry.setTitle("item");
-
- // Convert the item to XML
- String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
-
- SyndContent content = new SyndContentImpl();
- content.setType("text/xml");
- content.setValue(value);
- List<SyndContent> contents = new ArrayList<SyndContent>();
- contents.add(content);
- feedEntry.setContents(contents);
-
- SyndLink link = new SyndLinkImpl();
- link.setRel("edit");
- link.setHref(key.toString());
- feedEntry.getLinks().add(link);
- link = new SyndLinkImpl();
- link.setRel("alternate");
- link.setHref(key.toString());
- feedEntry.getLinks().add(link);
-
- feedEntry.setPublishedDate(new Date());
- return feedEntry;
- } else {
- return null;
- }
- }
-
- /**
- * Create a data collection entry from an RSS entry.
- * @param feedEntry
- * @return
- */
- private org.apache.tuscany.sca.data.collection.Entry<Object, Object> createEntry(SyndEntry feedEntry) {
- if (feedEntry != null) {
- if (itemClassType.getPhysical() == Item.class) {
- String key = feedEntry.getUri();
-
- Item item = new Item();
- item.setTitle(feedEntry.getTitle());
-
- List<?> contents = feedEntry.getContents();
- if (!contents.isEmpty()) {
- SyndContent content = (SyndContent)contents.get(0);
- String value = content.getValue();
- item.setContents(value);
- }
-
- for (Object l : feedEntry.getLinks()) {
- SyndLink link = (SyndLink)l;
- if (link.getRel() == null || "edit".equals(link.getRel())) {
- String href = link.getHref();
- if (href.startsWith("null/")) {
- href = href.substring(5);
- }
- item.setLink(href);
- break;
- }
- }
-
- item.setDate(feedEntry.getPublishedDate());
-
- return new org.apache.tuscany.sca.data.collection.Entry<Object, Object>(key, item);
-
- } else {
- String key = feedEntry.getUri();
-
- // Create the item from XML
- List<?> contents = feedEntry.getContents();
- if (contents.isEmpty()) {
- return null;
- }
- SyndContent content = (SyndContent)contents.get(0);
- String value = content.getValue();
- Object data = mediator.mediate(value, itemXMLType, itemClassType, null);
-
- return new org.apache.tuscany.sca.data.collection.Entry<Object, Object>(key, data);
- }
- } else {
- return null;
- }
- }
-
-
- private Writer getWriter(HttpServletResponse response) throws UnsupportedEncodingException, IOException {
- Writer writer = new OutputStreamWriter(response.getOutputStream(), "UTF-8");
- return writer;
- }
-
- /**
- * Process the authorization header
- *
- * @param request
- * @return
- * @throws ServletException
- */
- private String processAuthorizationHeader(HttpServletRequest request) throws ServletException {
- try {
- String authorization = request.getHeader("Authorization");
- if (authorization != null) {
- StringTokenizer tokens = new StringTokenizer(authorization);
- if (tokens.hasMoreTokens()) {
- String basic = tokens.nextToken();
- if (basic.equalsIgnoreCase("Basic")) {
- String credentials = tokens.nextToken();
- String userAndPassword = new String(Base64.decodeBase64(credentials.getBytes()));
- int colon = userAndPassword.indexOf(":");
- if (colon != -1) {
- String user = userAndPassword.substring(0, colon);
- String password = userAndPassword.substring(colon + 1);
-
- // Authenticate the User.
- if (authenticate(user, password)) {
- return user;
- }
- }
- }
- }
- }
- } catch (Exception e) {
- throw new ServletException(e);
- }
- return null;
- }
-
- /**
- * Authenticate a user.
- *
- * @param user
- * @param password
- * @return
- */
- private boolean authenticate(String user, String password) {
-
- // TODO Handle this using SCA security policies
- //FIXME Why are we using endsWith instead of equals here??
- return ("admin".endsWith(user) && "admin".equals(password));
- }
-
- /**
- * Reject an unauthorized request.
- *
- * @param response
- */
- private void unauthorized(HttpServletResponse response) throws IOException {
- response.setHeader("WWW-Authenticate", "BASIC realm=\"Tuscany\"");
- response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
- }
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.java b/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.java
deleted file mode 100644
index b9cababcab..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.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.rss.provider;
-
-import org.apache.tuscany.sca.binding.rss.RSSBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.impl.MediatorImpl;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Implementation of the RSS binding provider factory.
- *
- * @version $Rev$ $Date$
- */
-public class RSSBindingProviderFactory implements BindingProviderFactory<RSSBinding> {
-
- private MessageFactory messageFactory;
- private Mediator mediator;
- private ServletHost servletHost;
-
- public RSSBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- this.servletHost = servletHosts.getServletHosts().get(0);
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- this.messageFactory = modelFactories.getFactory(MessageFactory.class);
- this.mediator = new MediatorImpl(extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class),
- extensionPoints.getExtensionPoint(TransformerExtensionPoint.class));
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- RSSBinding binding) {
- return new RSSReferenceBindingProvider(component, reference, binding);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- RSSBinding binding) {
- return new RSSServiceBindingProvider(component, service, binding, servletHost, messageFactory, mediator);
- }
-
- public Class<RSSBinding> getModelType() {
- return RSSBinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.java b/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.java
deleted file mode 100644
index 8a30e9d3fb..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.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.rss.provider;
-
-import org.apache.tuscany.sca.binding.rss.RSSBinding;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-
-/**
- * Implementation of the RSS binding provider.
- *
- * @version $Rev$ $Date$
- */
-class RSSReferenceBindingProvider implements ReferenceBindingProvider {
-
- private RuntimeComponentReference reference;
- private RSSBinding binding;
-
- RSSReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- RSSBinding binding) {
- this.reference = reference;
- this.binding = binding;
- }
-
- public Invoker createInvoker(Operation operation) {
- return new RSSBindingInvoker(binding.getURI(), "rss_2.0");
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.java b/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.java
deleted file mode 100644
index 4e5429ac83..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.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.binding.rss.provider;
-
-import org.apache.tuscany.sca.binding.rss.RSSBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-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.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Implementation of the RSS binding provider.
- *
- * @version $Rev$ $Date$
- */
-class RSSServiceBindingProvider implements ServiceBindingProvider {
-
- private RuntimeComponentService service;
- private RSSBinding binding;
- private ServletHost servletHost;
- private MessageFactory messageFactory;
- private String servletMapping;
- private Mediator mediator;
-
- RSSServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- RSSBinding binding,
- ServletHost servletHost,
- MessageFactory messageFactory,
- Mediator mediator) {
- this.service = service;
- this.binding = binding;
- this.servletHost = servletHost;
- this.messageFactory = messageFactory;
- this.mediator = mediator;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- RuntimeComponentService componentService = (RuntimeComponentService)service;
- RuntimeWire wire = componentService.getRuntimeWire(binding);
-
- RSSBindingListenerServlet servlet =
- new RSSBindingListenerServlet(wire, messageFactory, mediator);
-
- servletMapping = binding.getURI();
- servletHost.addServletMapping(servletMapping, servlet);
-
- // Save the actual binding URI in the binding
- binding.setURI(servletHost.getURLMapping(binding.getURI()).toString());
- }
-
- public void stop() {
- servletHost.removeServletMapping(servletMapping);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-rss-rome/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index e60dc2855a..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/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.rss.provider.RSSBindingProviderFactory;model=org.apache.tuscany.sca.binding.rss.RSSBinding
diff --git a/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java b/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java
deleted file mode 100644
index 19370285f5..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.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.rss;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class Consumer {
-
- public static void main(String[] args) throws Exception {
-
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/feed/Consumer.composite");
-
- CustomerClient testService = scaDomain.getService(CustomerClient.class, "CustomerClient");
- testService.testCustomerCollection();
-
- scaDomain.close();
- }
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClient.java b/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClient.java
deleted file mode 100644
index af87155f45..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClient.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.binding.rss;
-
-public interface CustomerClient {
-
- void testCustomerCollection() throws Exception;
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java b/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java
deleted file mode 100644
index e71156c379..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.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.rss;
-
-import org.apache.tuscany.sca.binding.rss.collection.Collection;
-import org.osoa.sca.annotations.Reference;
-
-import com.sun.syndication.feed.synd.SyndEntry;
-import com.sun.syndication.feed.synd.SyndFeed;
-
-
-public class CustomerClientImpl implements CustomerClient {
-
- @Reference
- public Collection resourceCollection;
-
- public void testCustomerCollection() throws Exception {
-
- System.out.println(">>> get collection");
- SyndFeed feed = resourceCollection.getFeed();
- System.out.println("<<< get collection");
- for (Object o : feed.getEntries()) {
- SyndEntry e = (SyndEntry)o;
- System.out.println("id = " + e.getUri() + " entry = " + e.getTitle());
- }
- }
-
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java b/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java
deleted file mode 100644
index d45be65e20..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.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.rss;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.tuscany.sca.binding.rss.collection.Collection;
-import org.osoa.sca.annotations.Scope;
-
-import com.sun.syndication.feed.atom.Content;
-import com.sun.syndication.feed.synd.SyndContent;
-import com.sun.syndication.feed.synd.SyndContentImpl;
-import com.sun.syndication.feed.synd.SyndEntry;
-import com.sun.syndication.feed.synd.SyndEntryImpl;
-import com.sun.syndication.feed.synd.SyndFeed;
-import com.sun.syndication.feed.synd.SyndFeedImpl;
-import com.sun.syndication.feed.synd.SyndLink;
-import com.sun.syndication.feed.synd.SyndLinkImpl;
-
-@Scope("COMPOSITE")
-public class CustomerCollectionImpl implements Collection {
-
- private Map<String, SyndEntry> entries = new HashMap<String, SyndEntry>();
-
- public CustomerCollectionImpl() {
-
- for (int i = 0; i < 4; i++) {
- String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
-
- SyndEntry entry = new SyndEntryImpl();
- entry.setTitle("customer " + "Jane Doe_" + String.valueOf(i));
- entry.setUri(id);
-
- SyndContent content = new SyndContentImpl();
- content.setValue("Jane Doe_" + String.valueOf(i));
- content.setType(Content.TEXT);
- entry.setContents(Collections.singletonList(content));
-
- List<SyndLink> links = new ArrayList<SyndLink>();
- SyndLink link = new SyndLinkImpl();
- link.setRel("edit");
- link.setHref("" + id);
- links.add(link);
- entry.setLinks(links);
-
- links = new ArrayList<SyndLink>();
- link = new SyndLinkImpl();
- link.setRel("alternate");
- link.setHref("" + id);
- links.add(link);
- entry.setLinks(links);
-
- entry.setPublishedDate(new Date());
-
- entries.put(id, entry);
- System.out.println(">>> id=" + id);
- }
- }
-
- public SyndFeed getFeed() {
- System.out.println(">>> CustomerCollectionImpl.getFeed");
-
- SyndFeed feed = new SyndFeedImpl();
- feed.setTitle("customers");
- feed.setDescription("This is a sample feed");
- feed.getEntries().addAll(entries.values());
- return feed;
- }
-
- public SyndFeed query(String queryString) {
- System.out.println(">>> CustomerCollectionImpl.query");
-
- SyndFeed feed = new SyndFeedImpl();
- feed.setTitle("customers");
- feed.setDescription("This is a sample feed");
- feed.getEntries().addAll(entries.values());
- return feed;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java b/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java
deleted file mode 100644
index ae7b72834e..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.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.rss;
-
-import java.io.IOException;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class Provider {
-
- public static void main(String[] args) {
-
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/feed/Provider.composite");
- System.out.println("Provider.composite ready...");
-
- try {
- System.in.read();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- scaDomain.close();
- }
-}
diff --git a/branches/sca-android/modules/binding-rss-rome/src/test/resources/org/apache/tuscany/sca/binding/feed/Consumer.composite b/branches/sca-android/modules/binding-rss-rome/src/test/resources/org/apache/tuscany/sca/binding/feed/Consumer.composite
deleted file mode 100644
index 43cd5e00b9..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/test/resources/org/apache/tuscany/sca/binding/feed/Consumer.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://customer"
- name="Consumer">
-
- <component name="CustomerClient">
- <implementation.java class="org.apache.tuscany.sca.binding.feed.CustomerClientImpl"/>
- <reference name="resourceCollection">
- <tuscany:binding.rss uri="http://localhost:8084/customer"/>
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-rss-rome/src/test/resources/org/apache/tuscany/sca/binding/feed/Provider.composite b/branches/sca-android/modules/binding-rss-rome/src/test/resources/org/apache/tuscany/sca/binding/feed/Provider.composite
deleted file mode 100644
index 5ffcb50eb8..0000000000
--- a/branches/sca-android/modules/binding-rss-rome/src/test/resources/org/apache/tuscany/sca/binding/feed/Provider.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace = "http://customer"
- name="Provider">
-
- <service name="customer" promote="CustomerCollection">
- <tuscany:binding.rss uri = "http://localhost:8084/customer"/>
- </service>
-
- <component name="CustomerCollection">
- <implementation.java class="org.apache.tuscany.sca.binding.feed.CustomerCollectionImpl"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-rss/LICENSE b/branches/sca-android/modules/binding-rss/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/binding-rss/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-rss/META-INF/README b/branches/sca-android/modules/binding-rss/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-rss/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-rss/NOTICE b/branches/sca-android/modules/binding-rss/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/binding-rss/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/branches/sca-android/modules/binding-rss/pom.xml b/branches/sca-android/modules/binding-rss/pom.xml
deleted file mode 100644
index aeed176e8a..0000000000
--- a/branches/sca-android/modules/binding-rss/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-rss</artifactId>
- <name>Apache Tuscany SCA RSS Feed Binding Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.rss</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.rss*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBinding.java b/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBinding.java
deleted file mode 100644
index 2b4989264c..0000000000
--- a/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBinding.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.rss;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-/**
- * RSS Feed binding model.
- */
-public interface RSSBinding extends Binding {
-}
diff --git a/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBindingFactory.java b/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBindingFactory.java
deleted file mode 100644
index 3e691e636e..0000000000
--- a/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBindingFactory.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.rss;
-
-/**
- * Factory for the RSS binding
- *
- * @version $Rev$ $Date$
- */
-public interface RSSBindingFactory {
-
- /**
- * Creates a new RSS binding.
- * @return the new RSS binding
- */
- RSSBinding createRSSBinding();
-
-}
diff --git a/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingFactoryImpl.java b/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingFactoryImpl.java
deleted file mode 100644
index a4e6a8283d..0000000000
--- a/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingFactoryImpl.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.rss.impl;
-
-import org.apache.tuscany.sca.binding.rss.RSSBinding;
-import org.apache.tuscany.sca.binding.rss.RSSBindingFactory;
-
-/**
- * Factory for the RSS binding model.
- *
- * @version $Rev$ $Date$
- */
-public class RSSBindingFactoryImpl implements RSSBindingFactory {
-
- public RSSBinding createRSSBinding() {
- return new RSSBindingImpl();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingImpl.java b/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingImpl.java
deleted file mode 100644
index 6158752e7c..0000000000
--- a/branches/sca-android/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingImpl.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.rss.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.rss.RSSBinding;
-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;
-
-/**
- * Implementation of the RSS Feed binding model.
- */
-class RSSBindingImpl implements RSSBinding, PolicySetAttachPoint {
-
- private String name;
- private String uri;
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private IntentAttachPointType intentAttachPointType;
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- 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 false;
- }
-
- public void setUnresolved(boolean unresolved) {
- // The binding is always resolved
- }
-
- 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 void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-}
diff --git a/branches/sca-android/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rss.RSSBindingFactory b/branches/sca-android/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rss.RSSBindingFactory
deleted file mode 100644
index 73c47a3f41..0000000000
--- a/branches/sca-android/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rss.RSSBindingFactory
+++ /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.rss.impl.RSSBindingFactoryImpl \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 2d0597ff01..0000000000
--- a/branches/sca-android/modules/binding-rss/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.rss,model=org.apache.tuscany.sca.binding.rss.RSSBinding,factory=org.apache.tuscany.sca.binding.rss.RSSBindingFactory
diff --git a/branches/sca-android/modules/binding-sca-axis2/LICENSE b/branches/sca-android/modules/binding-sca-axis2/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-sca-axis2/META-INF/README b/branches/sca-android/modules/binding-sca-axis2/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-sca-axis2/NOTICE b/branches/sca-android/modules/binding-sca-axis2/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/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/branches/sca-android/modules/binding-sca-axis2/pom.xml b/branches/sca-android/modules/binding-sca-axis2/pom.xml
deleted file mode 100644
index 2314c139c8..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/pom.xml
+++ /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.
--->
-<project>
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-sca-axis2</artifactId>
- <name>Apache Tuscany SCA Axis2-based Default Binding Extension</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>1.4-SNAPSHOT</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>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint</artifactId>
- <version>1.4-SNAPSHOT</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.sca.axis2</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.sca.axis2*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingInvoker.java b/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingInvoker.java
deleted file mode 100644
index e4bb708a01..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingInvoker.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.sca.axis2.impl;
-
-import java.util.logging.Logger;
-
-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.osoa.sca.ServiceUnavailableException;
-
-
-/**
- * A wrapper for the Axis2BindingInvoker that ensures that the URL of the target
- * service is correct by looking it up in the service registry if it is not provided
- *
- * @version $Rev: 563772 $ $Date: 2007-08-08 07:50:49 +0100 (Wed, 08 Aug 2007) $
- */
-public class Axis2SCABindingInvoker implements Interceptor {
-
- private static final Logger logger = Logger.getLogger(Axis2SCABindingInvoker.class.getName());
-
- private Invoker axis2Invoker;
- private Axis2SCAReferenceBindingProvider provider;
-
- public Axis2SCABindingInvoker(Axis2SCAReferenceBindingProvider provider, Invoker axis2Invoker) {
- this.axis2Invoker = axis2Invoker;
- this.provider = provider;
- }
-
- public void setNext(Invoker next) {
- }
-
- public Invoker getNext() {
- return null;
- }
-
- /**
- * Fix up the URL for the message. The "to" EndPoint comes from the wire
- * target and needs to be replaced with the endpoint from the registry.
- * The default URL for an Endpoint URI where there is no
- * target component or service information, as in the case of a
- * wire crossing a node boundary, is "/"
- */
- public Message invoke(Message msg) {
-
- // make sure that the epr of the target service is set in the TO
- // field of the message
- EndpointReference to = msg.getTo();
-
- // check to see if we either don't have an endpoint set or if the URI
- // is dynamic or the target service is marked as unresolved
- if ((to == null) || (to.getURI().equals("/") || (to.getContract() == null) || (to.getContract().isUnresolved()))) {
-
- EndpointReference eprTo = provider.getServiceEndpoint();
-
- if ( (eprTo == null) || (eprTo.getURI() == null)) {
- throw new ServiceUnavailableException("Endpoint for service: " + provider.getSCABinding().getURI()
- + " can't be found for component: "
- + provider.getComponent().getName()
- + " reference: "
- + provider.getComponentReference().getName());
- }
- msg.setTo(eprTo);
- }
-
- // make sure that the epr of the callback service (if there is one) is set
- // in the callbackReference field of the message.
- EndpointReference callbackEPR = msg.getFrom().getReferenceParameters().getCallbackReference();
-
- if ((callbackEPR == null) || (callbackEPR.getURI().equals("/"))) {
-
- callbackEPR = provider.getCallbackEndpoint();
-
- if (callbackEPR != null) {
- msg.getFrom().getReferenceParameters().setCallbackReference(callbackEPR);
- }
- }
-
- // do the axis2 stuff
- return axis2Invoker.invoke(msg);
- }
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingProviderFactory.java b/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingProviderFactory.java
deleted file mode 100644
index b105696b5d..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingProviderFactory.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.sca.axis2.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.sca.DistributedSCABinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-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;
-
-/**
- * The factory for the Axis2 based implementation of the distributed sca binding
- *
- * @version $Rev: 563772 $ $Date: 2007-08-08 07:50:49 +0100 (Wed, 08 Aug 2007) $
- */
-public class Axis2SCABindingProviderFactory implements BindingProviderFactory<DistributedSCABinding> {
-
- private ExtensionPointRegistry extensionPoints;
- private List<PolicyHandlerTuple> policyHandlerClassnames = null;
-
- public Axis2SCABindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
- policyHandlerClassnames = PolicyHandlerDefinitionsLoader.loadPolicyHandlerClassnames();
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- DistributedSCABinding binding) {
- return new Axis2SCAReferenceBindingProvider(component, reference, binding,
- extensionPoints, policyHandlerClassnames);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- DistributedSCABinding binding) {
- return new Axis2SCAServiceBindingProvider(component, service, binding,
- extensionPoints, policyHandlerClassnames);
- }
-
- public Class<DistributedSCABinding> getModelType() {
- return DistributedSCABinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAReferenceBindingProvider.java b/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAReferenceBindingProvider.java
deleted file mode 100644
index 48d65cb735..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAReferenceBindingProvider.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.binding.sca.axis2.impl;
-
-import java.net.URI;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.binding.sca.DistributedSCABinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
-import org.apache.tuscany.sca.binding.ws.axis2.Axis2ReferenceBindingProvider;
-import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.assembly.EndpointReferenceImpl;
-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.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-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;
-
-/**
- * The reference binding provider for the remote sca binding implementation. Relies on the
- * binding-ws-axis implementation for sending messages to remote services to this provider
- * just uses the ws-axis provider.
- *
- * @version $Rev: 563772 $ $Date: 2007-08-08 07:50:49 +0100 (Wed, 08 Aug 2007) $
- */
-public class Axis2SCAReferenceBindingProvider implements ReferenceBindingProvider {
-
- private static final Logger logger = Logger.getLogger(Axis2SCAReferenceBindingProvider.class.getName());
-
- private RuntimeComponent component;
- private RuntimeComponentReference reference;
- private SCABinding binding;
- private Axis2ReferenceBindingProvider axisReferenceBindingProvider;
- private WebServiceBinding wsBinding;
-
- private EndpointReference serviceEPR = null;
- private EndpointReference callbackEPR = null;
-
- public Axis2SCAReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- DistributedSCABinding binding,
- ExtensionPointRegistry extensionPoints,
- List<PolicyHandlerTuple> policyHandlerClassnames) {
-
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- ServletHost servletHost = servletHosts.getServletHosts().get(0);
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- DataBindingExtensionPoint dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class);
-
- this.component = component;
- this.reference = reference;
- this.binding = binding.getSCABinding();
- wsBinding = modelFactories.getFactory(WebServiceBindingFactory.class).createWebServiceBinding();
- wsBinding.setName(this.binding.getName());
-
- // Turn the java interface contract into a WSDL interface contract
- BindingWSDLGenerator.generateWSDL(component, reference, wsBinding, extensionPoints, null);
-
- // Set to use the Axiom data binding
- InterfaceContract contract = wsBinding.getBindingInterfaceContract();
- contract.getInterface().resetDataBinding(OMElement.class.getName());
-
- axisReferenceBindingProvider = new Axis2ReferenceBindingProvider(component,
- reference,
- wsBinding,
- modelFactories,
- policyHandlerClassnames,
- dataBindings);
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return wsBinding.getBindingInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public Invoker createInvoker(Operation operation) {
- return new Axis2SCABindingInvoker(this, axisReferenceBindingProvider.createInvoker(operation));
- }
-
- /**
- * Uses the distributed domain service discovery feature to locate remote
- * service endpoints
- *
- * @return An EPR for the target service that this reference refers to
- */
- public EndpointReference getServiceEndpoint(){
-
- if (serviceEPR == null){
- String endpointURL = null;
-
- if (binding.getURI() != null) {
- // check if the binding URI is already resolved if it is use is if not
- try {
- URI uri = new URI(binding.getURI());
- if (uri.isAbsolute()) {
- endpointURL = binding.getURI();
- }
- } catch(Exception ex) {
- // do nothing
- }
- }
-
- serviceEPR = new EndpointReferenceImpl(endpointURL);
- }
-
- return serviceEPR;
- }
-
-
- /**
- * Retrieves the URI of the callback service (that this reference has created)
- * returns null if there is no callback service for the sca binding
- *
- * @return the callback endpoint
- */
- public EndpointReference getCallbackEndpoint(){
- if (callbackEPR == null) {
- if (reference.getCallbackService() != null) {
- for (Binding callbackBinding : reference.getCallbackService().getBindings()) {
- if (callbackBinding instanceof SCABinding) {
- callbackEPR = new EndpointReferenceImpl(reference.getName() + "/" + callbackBinding.getName());
- continue;
- }
- }
- }
- }
- return callbackEPR;
- }
-
-
- public SCABinding getSCABinding () {
- return binding;
- }
-
- public RuntimeComponent getComponent () {
- return component;
- }
-
- public RuntimeComponentReference getComponentReference () {
- return reference;
- }
-
- public void start() {
- axisReferenceBindingProvider.start();
- }
-
- public void stop() {
- axisReferenceBindingProvider.stop();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceBindingProvider.java b/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceBindingProvider.java
deleted file mode 100644
index 58a50d46dc..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceBindingProvider.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.binding.sca.axis2.impl;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.binding.sca.DistributedSCABinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
-import org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider;
-import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-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.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;
-
-/**
- * The service binding provider for the remote sca binding implementation. Relies on the
- * binding-ws-axis implementation for providing a remote message endpoint for this service
- *
- * @version $Rev: 563772 $ $Date: 2007-08-08 07:50:49 +0100 (Wed, 08 Aug 2007) $
- */
-public class Axis2SCAServiceBindingProvider implements ServiceBindingProvider {
-
- private static final Logger logger = Logger.getLogger(Axis2SCAServiceBindingProvider.class.getName());
-
- private SCABinding binding;
- private Axis2ServiceProvider axisProvider;
- private WebServiceBinding wsBinding;
-
- private boolean started = false;
-
-
- public Axis2SCAServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- DistributedSCABinding binding,
- ExtensionPointRegistry extensionPoints,
- List<PolicyHandlerTuple> policyHandlerClassnames) {
-
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- ServletHost servletHost = servletHosts.getServletHosts().get(0);
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- MessageFactory messageFactory = modelFactories.getFactory(MessageFactory.class);
- DataBindingExtensionPoint dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class);
-
- this.binding = binding.getSCABinding();
- wsBinding = modelFactories.getFactory(WebServiceBindingFactory.class).createWebServiceBinding();
- wsBinding.setName(this.binding.getName());
- wsBinding.setURI(this.binding.getURI());
-
- // Turn the java interface contract into a WSDL interface contract
- BindingWSDLGenerator.generateWSDL(component, service, wsBinding, extensionPoints, null);
-
- // Set to use the Axiom data binding
- InterfaceContract contract = wsBinding.getBindingInterfaceContract();
- contract.getInterface().resetDataBinding(OMElement.class.getName());
-
- axisProvider = new Axis2SCAServiceProvider(component,
- service,
- this.binding,
- wsBinding,
- servletHost,
- messageFactory,
- policyHandlerClassnames);
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return wsBinding.getBindingInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- if (started) {
- return;
- } else {
- started = true;
- }
-
- axisProvider.start();
- }
-
- public void stop() {
- if (!started) {
- return;
- } else {
- started = false;
- }
-
- axisProvider.stop();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceProvider.java b/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceProvider.java
deleted file mode 100644
index cf13d821f7..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceProvider.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.sca.axis2.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * A specialization of the Axis2BindingProvider that just switches in the SCABinding model
- * element when it is required. The SCABinding is required as the service binding provider
- * finds the service wire based in the binding
- *
- * @version $Rev: 563772 $ $Date: 2007-08-08 07:50:49 +0100 (Wed, 08 Aug 2007) $
- */
-public class Axis2SCAServiceProvider extends Axis2ServiceProvider {
-
- private SCABinding binding;
-
- /**
- * Switch in the fake ws binding
- *
- * @param component
- * @param service
- * @param binding
- * @param wsBinding
- * @param servletHost
- * @param messageFactory
- */
- public Axis2SCAServiceProvider(RuntimeComponent component,
- RuntimeComponentService service,
- SCABinding binding,
- WebServiceBinding wsBinding,
- ServletHost servletHost,
- MessageFactory messageFactory,
- List<PolicyHandlerTuple> policyHandlerClassnames) {
-
- super(component,
- service,
- wsBinding,
- servletHost,
- messageFactory,
- policyHandlerClassnames);
-
- this.binding = binding;
- }
-
- /**
- * Return the sca binding as wires will be registered against this rather
- * than against the wsBinding that the Axis2SCAServiceProvider is
- * expecting
- *
- * @return the binding
- */
- @Override
- protected Binding getBinding(){
- return binding;
- }
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-sca-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index 1b369cde06..0000000000
--- a/branches/sca-android/modules/binding-sca-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.sca.axis2.impl.Axis2SCABindingProviderFactory;model=org.apache.tuscany.sca.binding.sca.DistributedSCABinding
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
deleted file mode 100644
index 40d64be9b1..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.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.axis2;
-
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class AsynchTestCase {
-
- public static TestNode nodeA;
- public static TestNode nodeB;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println("Setting up nodes");
-
- try {
- // create and start domains
- nodeA = new TestNode("nodeG");
- nodeB = new TestNode("nodeH");
-
- nodeA.start();
- nodeB.start();
-
- } catch (Exception ex) {
- System.err.println("Exception when creating domain " + ex.getMessage());
- ex.printStackTrace(System.err);
- throw ex;
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- nodeA.stop();
- nodeB.stop();
- }
-
- @Test
- public void testHelloWorldAsynch() throws Exception {
- HelloWorldClient helloWorldClientB;
- helloWorldClientB = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote");
- helloWorldClientB.getGreetings("fred");
- System.out.println("Sleeping ...");
- Thread.sleep(2000);
- System.out.println("... Done");
- Assert.assertEquals("callback fred", HelloWorldClientCallbackOnewayRemoteImpl.result );
-
- }
-
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BindingScaEndpointResolverFactoryImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BindingScaEndpointResolverFactoryImpl.java
deleted file mode 100644
index b345e563e3..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BindingScaEndpointResolverFactoryImpl.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.sca.axis2;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.SCABinding;
-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 BindingScaEndpointResolverFactoryImpl implements EndpointResolverFactory<SCABinding> {
-
- private ExtensionPointRegistry extensionPoints;
-
- public BindingScaEndpointResolverFactoryImpl(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
- }
-
- public EndpointResolver createEndpointResolver(Endpoint endpoint, Binding binding) {
-
- return new BindingScaEndpointResolverImpl(extensionPoints, endpoint, binding);
- }
-
- public Class<SCABinding> getModelType() {
- return SCABinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BindingScaEndpointResolverImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BindingScaEndpointResolverImpl.java
deleted file mode 100644
index 472e85116e..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BindingScaEndpointResolverImpl.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.sca.axis2;
-
-
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolver;
-
-/**
- * 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 BindingScaEndpointResolverImpl implements EndpointResolver {
-
- private final static Logger logger = Logger.getLogger(BindingScaEndpointResolverImpl.class.getName());
-
- private Endpoint endpoint;
- private SCABinding binding;
-
- public BindingScaEndpointResolverImpl(ExtensionPointRegistry extensionPoints,
- Endpoint endpoint,
- Binding binding) {
- this.endpoint = endpoint;
- this.binding = (SCABinding)binding;
- }
-
- public void start(){
- // do nothing
- }
-
- public void resolve() {
- if (endpoint.isUnresolved()){
- // pretend to resolve the endpoint. In this test case to what we know
- // it should be
- logger.info("Fixing up endpoint soure binding");
- endpoint.setSourceBinding(endpoint.getCandidateBindings().get(0));
- endpoint.getSourceBinding().setURI("http://localhost:8085/BHelloWorldServiceRemote");
- }
- }
-
- public void stop(){
- // do nothing
- }
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java
deleted file mode 100644
index 76dbc5a5c7..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.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.binding.sca.axis2;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class CallbackTestCase {
-
- public static TestNode nodeA;
- public static TestNode nodeB;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println("Setting up nodes");
-
- try {
- // create and start domains
- nodeA = new TestNode("nodeE");
- nodeB = new TestNode("nodeF");
-
- nodeA.start();
- nodeB.start();
-
- } catch (Exception ex) {
- System.err.println("Exception when creating domain " + ex.getMessage());
- ex.printStackTrace(System.err);
- throw ex;
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- nodeA.stop();
- nodeB.stop();
- }
-
- //@Test
- public void testKeepServerRunning() throws Exception {
- System.out.println("press enter to continue");
- System.in.read();
- }
-
- @Test
- public void testHelloWorldCallbackLocal() throws Exception {
- HelloWorldClient helloWorldClientB;
- helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientCallbackLocal");
- Assert.assertEquals("Hello callback fred", helloWorldClientB.getGreetings("fred"));
- }
-
- @Test
- public void testHelloWorldCallbackRemote() throws Exception {
- HelloWorldClient helloWorldClientA;
- helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote");
- Assert.assertEquals("Hello callback fred", helloWorldClientA.getGreetings("fred"));
- }
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java
deleted file mode 100644
index 2deb62e6c4..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.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.sca.axis2;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class PromotionTestCase {
-
- public static TestNode nodeA;
- public static TestNode nodeB;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println("Setting up nodes");
-
- try {
- // create and start domains
- nodeA = new TestNode("nodeC");
- nodeB = new TestNode("nodeD");
-
- nodeA.start();
- nodeB.start();
-
- } catch (Exception ex) {
- System.err.println("Exception when creating domain " + ex.getMessage());
- ex.printStackTrace(System.err);
- throw ex;
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- nodeA.stop();
- nodeB.stop();
- }
-
- @Test
- public void testHelloWorldPromotion() throws Exception {
- HelloWorldClient helloWorldClientA;
- helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemotePromotion");
- Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
deleted file mode 100644
index 2d2a23d7df..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.sca.axis2;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.osoa.sca.ServiceUnavailableException;
-
-public class SimpleTestCase {
-
- public static TestNode nodeA;
- public static TestNode nodeB;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println("Setting up nodes");
-
- try {
- // create and start domains
- nodeA = new TestNode("nodeA");
- nodeB = new TestNode("nodeB");
-
- nodeA.start();
- nodeB.start();
-
- } catch (Exception ex) {
- System.err.println("Exception when creating domain " + ex.getMessage());
- ex.printStackTrace(System.err);
- throw ex;
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- nodeA.stop();
- nodeB.stop();
- }
-
- @Test
- public void testHelloWorldLocal() throws Exception {
- HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientLocal");
- Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
-
- }
-
- @Test
- public void testHelloWorldRemote() throws Exception {
-
- HelloWorldClient helloWorldClientA;
- helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemote");
-
- try {
- helloWorldClientA.getGreetings("fred");
- } catch (ServiceUnavailableException ex){
- Assert.fail();
- }
- }
-
- @Test
- public void testHelloWorldLocalAndRemote() throws Exception {
- HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientLocalAndRemote");
- HelloWorldClient helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientLocalAndRemote");
- Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
- Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred");
- }
-
- @Test
- public void testHelloWorldMultipleServices() throws Exception {
- HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices");
- HelloWorldClient helloWorldClientA2 = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices2");
- HelloWorldClient helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientMultipleServices");
- Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
- Assert.assertEquals(helloWorldClientA2.getGreetings("fred"), "Hello fred");
- Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred");
- }
-
- @Test
- public void testHelloWorldMultipleBindings() throws Exception {
- HelloWorldClient helloWorldClientA;
- helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleBindings");
- Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestNode.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestNode.java
deleted file mode 100644
index e788526069..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestNode.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.binding.sca.axis2;
-
-import java.net.URL;
-import java.util.logging.Logger;
-
-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.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeService;
-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.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.service.ContributionService;
-import org.apache.tuscany.sca.core.context.ServiceReferenceImpl;
-import org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentContext;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.osoa.sca.ServiceReference;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * The very minimum node implementation to get these tests going without creating a dependency on
- * any runtime/hosting implementation
- *
- * @version $Rev: 552343 $ $Date: 2007-09-20 14:53:40 +0100 (Thu, 20 Sep 2007) $
- */
-public class TestNode {
-
- private static final Logger logger = Logger.getLogger(TestNode.class.getName());
-
- private String nodeName;
- private ReallySmallRuntime nodeRuntime;
-
- private ClassLoader cl = TestNode.class.getClassLoader();
-
- private Composite nodeComposite = null;
- private Composite appComposite = null;
-
- public TestNode(String nodeName)
- throws Exception {
- this.nodeName = nodeName;
-
- try {
-
- // create and start domainA
- nodeRuntime = new ReallySmallRuntime(cl);
- nodeRuntime.start();
-
- // Create an in-memory domain level composite
- AssemblyFactory assemblyFactory = nodeRuntime.getAssemblyFactory();
- nodeComposite = assemblyFactory.createComposite();
- nodeComposite.setName(new QName(Constants.SCA10_NS, "domain"));
- nodeComposite.setURI("http://localhost");
-
- // add the top level composite into the composite activator
- nodeRuntime.getCompositeActivator().setDomainComposite(nodeComposite);
-
- // add a contribution to the domain
- ContributionService contributionService = nodeRuntime.getContributionService();
-
- // find the current directory as a URL. This is where our contribution
- // will come from
- URL contributionURL = Thread.currentThread().getContextClassLoader().getResource(nodeName + "/");
-
- // Contribute the SCA application
- Contribution contribution = contributionService.contribute("http://calculator", contributionURL, null, false);
- appComposite = contribution.getDeployables().get(0);
-
- // Add the deployable composite to the domain
- nodeComposite.getIncludes().add(appComposite);
- nodeRuntime.buildComposite(appComposite);
- nodeRuntime.getCompositeActivator().activate(appComposite);
-
-
- } catch (Exception ex) {
- System.err.println("Exception when creating node " + ex.getMessage());
- ex.printStackTrace(System.err);
- throw ex;
- }
- }
-
- public void start() {
-
- try {
- nodeRuntime.getCompositeActivator().start(appComposite);
- } catch (Exception ex) {
- System.err.println("Exception when creating domain " + ex.getMessage());
- ex.printStackTrace(System.err);
- }
-
- }
-
- public void stop() {
- try {
- nodeRuntime.stop();
- } catch (Exception ex) {
- System.err.println("Exception when creating domain " + ex.getMessage());
- ex.printStackTrace(System.err);
- }
- }
-
- 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();
- }
-
- private <B> ServiceReference<B> createServiceReference(Class<B> businessInterface, String targetURI) {
- try {
- AssemblyFactory assemblyFactory = nodeRuntime.getAssemblyFactory();
- Composite composite = assemblyFactory.createComposite();
- composite.setName(new QName(Constants.SCA10_TUSCANY_NS, "default"));
- RuntimeComponent component = (RuntimeComponent)assemblyFactory.createComponent();
- component.setName("default");
- component.setURI("default");
- nodeRuntime.getCompositeActivator().configureComponentContext(component);
- composite.getComponents().add(component);
- RuntimeComponentReference reference = (RuntimeComponentReference)assemblyFactory.createComponentReference();
- reference.setName("default");
- ModelFactoryExtensionPoint factories =
- nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
- JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
- InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(businessInterface));
- reference.setInterfaceContract(interfaceContract);
- component.getReferences().add(reference);
- reference.setComponent(component);
- SCABindingFactory scaBindingFactory = factories.getFactory(SCABindingFactory.class);
- SCABinding binding = scaBindingFactory.createSCABinding();
- binding.setURI(targetURI);
- reference.getBindings().add(binding);
- return new ServiceReferenceImpl<B>(businessInterface, component, reference, binding, nodeRuntime
- .getProxyFactory(), nodeRuntime.getCompositeActivator());
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- 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 in the domain
-
- Component component = null;
-
- for (Composite composite: nodeComposite.getIncludes()) {
- for (Component componentLoop: composite.getComponents()) {
- if (componentLoop.getName().equals(componentName)) {
- component = componentLoop;
- break;
- }
- }
- }
- if (component == null) {
- // The component is not local in the partition, try to create a remote service ref
- return createServiceReference(businessInterface, name);
- }
- 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 is 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);
- }
- }
- }
-
-}
-
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java
deleted file mode 100644
index 1a2788ac74..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.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.sca.axis2.helloworld;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface HelloWorldCallbackRemote {
-
- String getGreetingsCallbackRemote(String s);
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java
deleted file mode 100644
index e4d36ac78b..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.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.sca.axis2.helloworld;
-
-
-public interface HelloWorldClient {
-
- String getGreetings(String s);
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
deleted file mode 100644
index a83fcb3069..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.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.sca.axis2.helloworld;
-
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.OneWay;
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-@Callback(HelloWorldCallbackRemote.class)
-public interface HelloWorldServiceCallbackOnewayRemote {
-
- @OneWay
- void getGreetingsRemote(String s);
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java
deleted file mode 100644
index c41548ec51..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.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.sca.axis2.helloworld;
-
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-@Callback(HelloWorldCallbackRemote.class)
-public interface HelloWorldServiceCallbackRemote {
-
- String getGreetingsRemote(String s);
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java
deleted file mode 100644
index 7b8e00eb2a..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.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.sca.axis2.helloworld;
-
-
-public interface HelloWorldServiceLocal {
-
- String getGreetingsLocal(String s);
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java
deleted file mode 100644
index 62d61e4fff..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.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.sca.axis2.helloworld;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface HelloWorldServiceRemote {
-
- String getGreetingsRemote(String s);
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java
deleted file mode 100644
index 2dcc8cc64b..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.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.sca.axis2.helloworld;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface HelloWorldServiceRemote2 {
-
- String getGreetingsRemote2(String s);
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
deleted file mode 100644
index 8e7d2f8023..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.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.axis2.helloworld.impl;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackOnewayRemote;
-import org.osoa.sca.annotations.Reference;
-
-public class HelloWorldClientCallbackOnewayRemoteImpl implements HelloWorldClient {
-
- public static String result;
-
- @Reference
- public HelloWorldServiceCallbackOnewayRemote helloWorldService;
-
- public String getGreetings(String s) {
- helloWorldService.getGreetingsRemote(s);
- return null;
- }
-
- public String getGreetingsCallbackRemote(String s) {
- result = "callback " + s;
- return result;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
deleted file mode 100644
index 7d07c4ff43..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.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.sca.axis2.helloworld.impl;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackRemote;
-import org.osoa.sca.annotations.Reference;
-
-public class HelloWorldClientCallbackRemoteImpl implements HelloWorldClient {
-
- public static String result;
-
- @Reference
- public HelloWorldServiceCallbackRemote helloWorldService;
-
- public String getGreetings(String s) {
- return helloWorldService.getGreetingsRemote(s);
- }
-
- public String getGreetingsCallbackRemote(String s) {
- result = "callback " + s;
- return result;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java
deleted file mode 100644
index 7098f10622..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.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.sca.axis2.helloworld.impl;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal;
-import org.osoa.sca.annotations.Reference;
-
-public class HelloWorldClientLocalImpl implements HelloWorldClient {
-
- @Reference
- public HelloWorldServiceLocal helloWorldService;
-
- public String getGreetings(String s) {
- return helloWorldService.getGreetingsLocal(s);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java
deleted file mode 100644
index 07ae00bd31..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.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.sca.axis2.helloworld.impl;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote2;
-import org.osoa.sca.annotations.Reference;
-
-public class HelloWorldClientRemote2Impl implements HelloWorldClient {
-
- @Reference
- public HelloWorldServiceRemote2 helloWorldService;
-
- public String getGreetings(String s) {
- return helloWorldService.getGreetingsRemote2(s);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java
deleted file mode 100644
index 36854cb7b8..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.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.sca.axis2.helloworld.impl;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote;
-import org.osoa.sca.annotations.Reference;
-
-public class HelloWorldClientRemoteImpl implements HelloWorldClient {
-
- @Reference
- public HelloWorldServiceRemote helloWorldService;
-
- public String getGreetings(String s) {
- return helloWorldService.getGreetingsRemote(s);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
deleted file mode 100644
index fd3e3a1158..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.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.sca.axis2.helloworld.impl;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldCallbackRemote;
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackOnewayRemote;
-import org.osoa.sca.annotations.Callback;
-
-
-public class HelloWorldServiceCallbackOnewayRemoteImpl implements HelloWorldServiceCallbackOnewayRemote {
-
- @Callback
- protected HelloWorldCallbackRemote theCallback;
-
- public void getGreetingsRemote(String s) {
- theCallback.getGreetingsCallbackRemote(s);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
deleted file mode 100644
index 3400e97447..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.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.sca.axis2.helloworld.impl;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldCallbackRemote;
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackRemote;
-import org.osoa.sca.annotations.Callback;
-
-public class HelloWorldServiceCallbackRemoteImpl implements HelloWorldServiceCallbackRemote {
-
- @Callback
- protected HelloWorldCallbackRemote theCallback;
-
- public String getGreetingsRemote(String s) {
- return "Hello " + theCallback.getGreetingsCallbackRemote(s);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java
deleted file mode 100644
index 20dd97b74a..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.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.sca.axis2.helloworld.impl;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal;
-
-public class HelloWorldServiceLocalImpl implements HelloWorldServiceLocal {
-
- public String getGreetingsLocal(String s) {
- return "Hello " + s;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
deleted file mode 100644
index 5f8ccf9466..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.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.sca.axis2.helloworld.impl;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal;
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote;
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote2;
-import org.osoa.sca.annotations.Service;
-
-@Service(interfaces={HelloWorldServiceRemote.class, HelloWorldServiceRemote2.class, HelloWorldServiceLocal.class} )
-public class HelloWorldServiceMultipleServicesImpl implements HelloWorldServiceLocal, HelloWorldServiceRemote, HelloWorldServiceRemote2 {
-
- public String getGreetingsLocal(String s) {
- return "Hello " + s;
- }
-
- public String getGreetingsRemote(String s) {
- return "Hello " + s;
- }
-
- public String getGreetingsRemote2(String s) {
- return "Hello " + s;
- }
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java b/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java
deleted file mode 100644
index b25aebd9df..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.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.sca.axis2.helloworld.impl;
-
-import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote;
-
-public class HelloWorldServiceRemoteImpl implements HelloWorldServiceRemote {
-
- public String getGreetingsRemote(String s) {
- return "Hello " + s;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory
deleted file mode 100644
index 5e4fd566c3..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/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.binding.sca.axis2.BindingScaEndpointResolverFactoryImpl;model=org.apache.tuscany.sca.assembly.SCABinding
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeA/HelloWorld.composite b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeA/HelloWorld.composite
deleted file mode 100644
index 093258051e..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeA/HelloWorld.composite
+++ /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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="HelloWorld">
-
-
- <!-- local only wire -->
- <component name="AHelloWorldClientLocal">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientLocalImpl"/>
- <reference name="helloWorldService" target="AHelloWorldServiceLocal" />
- </component>
-
- <component name="AHelloWorldServiceLocal">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceLocalImpl" />
- </component>
-
- <!-- unresolved remote wire -->
- <component name="AHelloWorldClientRemote">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" />
- <reference name="helloWorldService" target="BHelloWorldServiceRemote" />
- </component>
-
- <!-- local and remote wires -->
- <component name="AHelloWorldClientLocalAndRemote">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" />
- <reference name="helloWorldService">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceLocalAndRemote"/>
- </reference>
- </component>
-
- <!-- multiple services -->
- <component name="AHelloWorldClientMultipleServices">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" />
- <reference name="helloWorldService">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/>
- </reference>
- </component>
-
- <component name="AHelloWorldClientMultipleServices2">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemote2Impl" />
- <reference name="helloWorldService">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/>
- </reference>
- </component>
-
- <!-- multiple bindings -->
- <component name="AHelloWorldClientMultipleBindings">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" />
- <reference name="helloWorldService" >
- <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote" />
- <binding.sca uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-scabinding"/>
- <binding.ws/>
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeA/META-INF/sca-contribution.xml b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeA/META-INF/sca-contribution.xml
deleted file mode 100644
index d6b9e82250..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeA/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample">
- <deployable composite="sample:HelloWorld"/>
-</contribution> \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeB/HelloWorld.composite b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeB/HelloWorld.composite
deleted file mode 100644
index 8cf7230ed5..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeB/HelloWorld.composite
+++ /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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="HelloWorld">
-
-
- <!-- local only wire -->
-
-
- <!-- unresolved remote wire -->
- <component name="BHelloWorldServiceRemote">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" />
- <service name="HelloWorldServiceRemote">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemote"/>
- </service>
- </component>
-
- <!-- local and remote wires -->
- <component name="BHelloWorldServiceLocalAndRemote">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" />
- <service name="HelloWorldServiceRemote">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceLocalAndRemote"/>
- </service>
- </component>
-
- <component name="BHelloWorldClientLocalAndRemote">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" />
- <reference name="helloWorldService" target="BHelloWorldServiceLocalAndRemote" />
- </component>
-
- <!-- multiple services -->
- <component name="BHelloWorldServiceMultipleServices">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceMultipleServicesImpl" />
- <service name="HelloWorldServiceLocal">
- </service>
- <service name="HelloWorldServiceRemote">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/>
- </service>
- <service name="HelloWorldServiceRemote2">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/>
- </service>
- </component>
-
- <component name="BHelloWorldClientMultipleServices">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientLocalImpl" />
- <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceLocal" />
- </component>
-
- <!-- multiple bindings -->
- <component name="BHelloWorldMultipleBindings">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" />
- <service name="HelloWorldServiceRemote">
- <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote" />
- <binding.ws uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-wsbinding"/>
- <binding.sca uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-scabinding"/>
- </service>
- </component>
-
-
- <!-- Dynamic interfaces -->
- <!--component name="BHelloWorldServiceScript">
- <implementation.script script="calculator/AddServiceImpl.js"/>
- </component-->
-
-</composite>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeB/META-INF/sca-contribution.xml b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeB/META-INF/sca-contribution.xml
deleted file mode 100644
index d6b9e82250..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeB/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample">
- <deployable composite="sample:HelloWorld"/>
-</contribution> \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorld.composite b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorld.composite
deleted file mode 100644
index 066727f76d..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorld.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://sample"
- xmlns:sample="http://sample"
- name="HelloWorld">
-
-
- <!-- composite hierarchy -->
- <component name="AHelloWorldClientRemotePromotion">
- <implementation.composite name="sample:HelloWorldComponent" />
- <reference name="AHelloWorldClientRemoteReference">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemotePromotion"/>
- </reference>
- </component>
-
-
-</composite>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorldComponent.composite b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorldComponent.composite
deleted file mode 100644
index 485e0815d2..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorldComponent.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://sample"
- xmlns:sample="http://sample"
- name="HelloWorldComponent">
-
- <service name="AHelloWorldClientRemoteService" promote="AHelloWorldClientRemoteComponent">
- <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient"/>
- </service>
-
- <reference name="AHelloWorldClientRemoteReference" promote="AHelloWorldClientRemoteComponent/helloWorldService">
- <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote"/>
- </reference>
-
- <component name="AHelloWorldClientRemoteComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/META-INF/sca-contribution.xml b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/META-INF/sca-contribution.xml
deleted file mode 100644
index d6b9e82250..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeC/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample">
- <deployable composite="sample:HelloWorld"/>
-</contribution> \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorld.composite b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorld.composite
deleted file mode 100644
index a5a4f04cb5..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorld.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://sample"
- xmlns:sample="http://sample"
- name="HelloWorld">
-
-
- <!-- composite hierarchy -->
- <component name="BHelloWorldServiceRemotePromotion">
- <implementation.composite name="sample:HelloWorldComponent" />
- <service name="BHelloWorldServiceRemoteService">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemotePromotion"/>
- </service>
- </component>
-
-
-</composite>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorldComponent.composite b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorldComponent.composite
deleted file mode 100644
index bf30bdf42d..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorldComponent.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://sample"
- xmlns:sample="http://sample"
- name="HelloWorldComponent">
-
- <service name="BHelloWorldServiceRemoteService"
- promote="BHelloWorldServiceRemoteComponent/HelloWorldServiceRemote"/>
-
- <component name="BHelloWorldServiceRemoteComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl"/>
- </component>
-
- <component name="BHelloWorldServiceLocalAndRemoteNested">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" />
- </component>
-
-
-</composite>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/META-INF/sca-contribution.xml b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/META-INF/sca-contribution.xml
deleted file mode 100644
index d6b9e82250..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeD/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample">
- <deployable composite="sample:HelloWorld"/>
-</contribution> \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeE/HelloWorld.composite b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeE/HelloWorld.composite
deleted file mode 100644
index b519793290..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeE/HelloWorld.composite
+++ /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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="HelloWorld">
-
- <!-- callback remote wire -->
- <component name="AHelloWorldClientCallbackRemote">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackRemoteImpl" />
- <reference name="helloWorldService" >
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
- <callback>
- <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
- </callback>
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeE/META-INF/sca-contribution.xml b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeE/META-INF/sca-contribution.xml
deleted file mode 100644
index d6b9e82250..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeE/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample">
- <deployable composite="sample:HelloWorld"/>
-</contribution> \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeF/HelloWorld.composite b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeF/HelloWorld.composite
deleted file mode 100644
index 20a6c54e6e..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeF/HelloWorld.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://sample"
- xmlns:sample="http://sample"
- name="HelloWorld">
-
-
- <!-- callback remote wire -->
- <component name="BHelloWorldServiceCallbackRemote">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceCallbackRemoteImpl" />
- <service name="HelloWorldServiceCallbackRemote">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
- <callback>
- <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
- </callback>
- </service>
- </component>
-
- <!-- callback local wire -->
- <component name="BHelloWorldClientCallbackLocal">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackRemoteImpl" />
- <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote" />
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeF/META-INF/sca-contribution.xml b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeF/META-INF/sca-contribution.xml
deleted file mode 100644
index d6b9e82250..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeF/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample">
- <deployable composite="sample:HelloWorld"/>
-</contribution> \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite
deleted file mode 100644
index a76008d0c5..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite
+++ /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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="HelloWorld">
-
- <!-- callback remote wire -->
- <component name="AHelloWorldClientCallbackRemote">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl" />
- <reference name="helloWorldService" >
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
- <callback>
- <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
- </callback>
- </reference>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeG/META-INF/sca-contribution.xml b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeG/META-INF/sca-contribution.xml
deleted file mode 100644
index d6b9e82250..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeG/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample">
- <deployable composite="sample:HelloWorld"/>
-</contribution> \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.composite b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.composite
deleted file mode 100644
index 0c22af22ab..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.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://sample"
- xmlns:sample="http://sample"
- name="HelloWorld">
-
-
- <!-- callback remote wire -->
- <component name="BHelloWorldServiceCallbackRemote">
- <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceCallbackOnewayRemoteImpl" />
- <service name="HelloWorldServiceCallbackOnewayRemote">
- <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
- <callback>
- <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
- </callback>
- </service>
- </component>
-
-
-</composite>
diff --git a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeH/META-INF/sca-contribution.xml b/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeH/META-INF/sca-contribution.xml
deleted file mode 100644
index d6b9e82250..0000000000
--- a/branches/sca-android/modules/binding-sca-axis2/src/test/resources/nodeH/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample">
- <deployable composite="sample:HelloWorld"/>
-</contribution> \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-sca-corba/LICENSE b/branches/sca-android/modules/binding-sca-corba/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-sca-corba/META-INF/README b/branches/sca-android/modules/binding-sca-corba/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-sca-corba/NOTICE b/branches/sca-android/modules/binding-sca-corba/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/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/branches/sca-android/modules/binding-sca-corba/pom.xml b/branches/sca-android/modules/binding-sca-corba/pom.xml
deleted file mode 100644
index 52b41e9e45..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/pom.xml
+++ /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.
--->
-<project>
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-sca-corba</artifactId>
- <name>
- Apache Tuscany SCA CORBA-based Default Binding Extension
- </name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-corba</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-corba-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba-jse</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-axiom</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.sca.corba
- </Bundle-SymbolicName>
- <Bundle-Description>
- ${pom.name}
- </Bundle-Description>
- <Export-Package>
- org.apache.tuscany.sca.binding.sca.corba*
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCABindingProviderFactory.java b/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCABindingProviderFactory.java
deleted file mode 100644
index 2eee714de6..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCABindingProviderFactory.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.sca.corba.impl;
-
-import org.apache.tuscany.sca.binding.sca.DistributedSCABinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.corba.CorbaHost;
-import org.apache.tuscany.sca.host.corba.CorbaHostExtensionPoint;
-import org.apache.tuscany.sca.host.corba.ExtensibleCorbaHost;
-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;
-
-/**
- * Binding provider factory for SCA default binding over CORBA binding
- */
-public class CorbaSCABindingProviderFactory implements BindingProviderFactory<DistributedSCABinding> {
-
- private CorbaHostExtensionPoint chep;
- private CorbaHost host;
- private ExtensionPointRegistry extensions;
-
- public CorbaSCABindingProviderFactory(ExtensionPointRegistry extensions) {
- this.extensions = extensions;
- chep = extensions.getExtensionPoint(CorbaHostExtensionPoint.class);
- host = new ExtensibleCorbaHost(chep);
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- DistributedSCABinding binding) {
- return new CorbaSCAReferenceBindingProvider(binding.getSCABinding(), host, component, reference, extensions);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- DistributedSCABinding binding) {
- return new CorbaSCAServiceBindingProvider(binding.getSCABinding(), host, component, service, extensions);
- }
-
- public Class<DistributedSCABinding> getModelType() {
- return DistributedSCABinding.class;
- }
-}
diff --git a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java b/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java
deleted file mode 100644
index 40f55ddb71..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.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.sca.corba.impl;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
-import org.apache.tuscany.sca.binding.corba.impl.service.InvocationException;
-import org.apache.tuscany.sca.binding.corba.impl.service.InvocationProxy;
-import org.apache.tuscany.sca.binding.corba.impl.service.OperationTypes;
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTree;
-import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeCreator;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.FaultException;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Invocation proxy for SCA default binding over CORBA binding
- */
-public class CorbaSCAInvocationProxy implements InvocationProxy {
-
- private static final Logger logger = Logger.getLogger(CorbaSCAInvocationProxy.class.getName());
- private RuntimeWire wire;
- private Interface componentInterface;
- private OperationTypes types = new OperationTypes();
- private MessageFactory messageFactory;
-
- public CorbaSCAInvocationProxy(RuntimeWire wire, Interface componentInterface, MessageFactory messageFactory) {
- this.wire = wire;
- this.componentInterface = componentInterface;
- this.messageFactory = messageFactory;
- try {
- List<TypeTree> inputType = new ArrayList<TypeTree>();
- inputType.add(TypeTreeCreator.createTypeTree(String.class, null));
- types.setInputType(inputType);
- types.setOutputType(TypeTreeCreator.createTypeTree(String.class, null));
- } catch (RequestConfigurationException e) {
- // ignore - string type should not cause this exception
- }
- }
-
- public Object invoke(String operationName, List<Object> arguments) throws InvocationException {
- try {
- OMElement omContent = AXIOMUtil.stringToOM((String)arguments.get(0));
- String componentOperationName = omContent.getQName().getLocalPart();
- Operation componentOperation = null;
- for (Operation operation : componentInterface.getOperations()) {
- if (operation.getName().equals(componentOperationName)) {
- componentOperation = operation;
- break;
- }
- }
- if (componentOperation != null) {
- Message msg = messageFactory.createMessage();
- msg.setOperation(componentOperation);
- Object[] args = new Object[1];
- args[0] = omContent;
- msg.setBody(args);
- OMElement omResult = (OMElement)wire.invoke(componentOperation, msg);
- return omResult.toStringWithConsume();
- }
- } catch (XMLStreamException e) {
- logger.log(Level.WARNING, "XMLStreamException during handling invocation target exception", e);
- } catch (InvocationTargetException e) {
- OMElement omException = (OMElement)((FaultException)e.getCause()).getFaultInfo();
- try {
- WrappedSCAException wrappedException = new WrappedSCAException(omException.toStringWithConsume());
- InvocationException exception = new InvocationException(wrappedException);
- throw exception;
- } catch (XMLStreamException xmle) {
- logger.log(Level.WARNING, "XMLStreamException during handling invocation target exception", xmle);
- }
-
- }
-
- return null;
- }
-
- public OperationTypes getOperationTypes(String operationName) {
- // ignoring operationName - only one operation for this proxy is allowed
- return types;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvoker.java b/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvoker.java
deleted file mode 100644
index f2ab5e94a0..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvoker.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.binding.sca.corba.impl;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-import org.apache.axis2.AxisFault;
-import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
-import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaRequest;
-import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaResponse;
-import org.apache.tuscany.sca.interfacedef.util.FaultException;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.omg.CORBA.Object;
-import org.osoa.sca.ServiceRuntimeException;
-
-public class CorbaSCAInvoker implements Invoker {
-
- private Object remoteObject;
- private Class<?> referenceClass;
-
- public CorbaSCAInvoker(Object remoteObject,
- Class<?> referenceClass,
- Map<Method, String> operationsMap,
- boolean scaBindingRules) {
- this.remoteObject = remoteObject;
- this.referenceClass = referenceClass;
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Invoker#invoke(org.apache.tuscany.sca.invocation.Message)
- */
- public Message invoke(Message msg) {
- try {
- DynaCorbaRequest request = new DynaCorbaRequest(remoteObject, "scaService");
- request.setReferenceClass(referenceClass);
- request.setOutputType(String.class);
- request.addExceptionType(WrappedSCAException.class);
- java.lang.Object[] args = msg.getBody();
- OMElement omElement = (OMElement)args[0];
- String arg = omElement.toStringWithConsume();
- request.addArgument(arg);
- DynaCorbaResponse response = request.invoke();
- OMElement responseOM = AXIOMUtil.stringToOM((String)response.getContent());
- msg.setBody(responseOM);
- } catch (WrappedSCAException e) {
- try {
- OMElement exceptionOM = AXIOMUtil.stringToOM(e.getFault());
- AxisFault axisFault = new AxisFault("");
- axisFault.setDetail(exceptionOM);
- FaultException f = new FaultException(axisFault.getMessage(), axisFault.getDetail(), axisFault);
- f.setFaultName(axisFault.getDetail().getQName());
- msg.setFaultBody(f);
- } catch (XMLStreamException e1) {
- }
- } catch (RequestConfigurationException e) {
- throw new ServiceRuntimeException(e);
- } catch (Exception e) {
- msg.setFaultBody(e);
- }
- return msg;
- }
-}
diff --git a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAReferenceBindingProvider.java b/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAReferenceBindingProvider.java
deleted file mode 100644
index c578f8bdf4..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAReferenceBindingProvider.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.binding.sca.corba.impl;
-
-import java.util.logging.Logger;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
-import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.corba.CorbaHost;
-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;
-import org.omg.CORBA.Object;
-
-/**
- * Reference binding provider for SCA default binding over CORBA binding
- */
-public class CorbaSCAReferenceBindingProvider implements ReferenceBindingProvider {
-
- private static final Logger logger = Logger.getLogger(CorbaSCAReferenceBindingProvider.class.getName());
-
- private SCABinding binding;
- private CorbaHost host;
- private Object remoteObject;
- private Class<?> referenceClass;
- private InterfaceContract wsdlInterfaceContract;
-
- public CorbaSCAReferenceBindingProvider(SCABinding binding,
- CorbaHost host,
- RuntimeComponent component,
- RuntimeComponentReference reference,
- ExtensionPointRegistry extensions) {
- this.binding = binding;
- this.host = host;
-
- WebServiceBindingFactory wsFactory = extensions.getExtensionPoint(WebServiceBindingFactory.class);
- WebServiceBinding wsBinding = wsFactory.createWebServiceBinding();
- BindingWSDLGenerator.generateWSDL(component, reference, wsBinding, extensions, null);
- wsdlInterfaceContract = wsBinding.getBindingInterfaceContract();
- wsdlInterfaceContract.getInterface().resetDataBinding(OMElement.class.getName());
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return wsdlInterfaceContract;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public Invoker createInvoker(Operation operation) {
- try {
- if (remoteObject == null) {
- remoteObject = host.lookup(binding.getURI());
- }
- return new CorbaSCAInvoker(remoteObject, referenceClass, null, true);
- } catch (Exception e) {
- logger.warning(e.getMessage());
- }
- return null;
- }
-
- public void start() {
-
- }
-
- public void stop() {
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAServiceBindingProvider.java b/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAServiceBindingProvider.java
deleted file mode 100644
index 6e74686b61..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAServiceBindingProvider.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.binding.sca.corba.impl;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.binding.corba.impl.service.DynaCorbaServant;
-import org.apache.tuscany.sca.binding.corba.impl.service.InvocationProxy;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
-import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.corba.CorbaHost;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * Service binding provider for SCA default binding over CORBA binding
- */
-public class CorbaSCAServiceBindingProvider implements ServiceBindingProvider {
-
- private SCABinding binding;
- private CorbaHost host;
- private RuntimeComponentService service;
- private DynaCorbaServant servant;
- private MessageFactory messageFactory;
- private InterfaceContract wsdlInterfaceContract;
-
- public CorbaSCAServiceBindingProvider(SCABinding binding,
- CorbaHost host,
- RuntimeComponent component,
- RuntimeComponentService service,
- ExtensionPointRegistry extensions) {
- this.binding = binding;
- this.host = host;
- this.service = service;
-
- messageFactory = extensions.getExtensionPoint(MessageFactory.class);
-
- WebServiceBindingFactory wsFactory = extensions.getExtensionPoint(WebServiceBindingFactory.class);
- WebServiceBinding wsBinding = wsFactory.createWebServiceBinding();
- BindingWSDLGenerator.generateWSDL(component, service, wsBinding, extensions, null);
- wsdlInterfaceContract = wsBinding.getBindingInterfaceContract();
- wsdlInterfaceContract.getInterface().resetDataBinding(OMElement.class.getName());
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return wsdlInterfaceContract;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- try {
- InvocationProxy proxy =
- new CorbaSCAInvocationProxy(service.getRuntimeWire(binding), service.getInterfaceContract()
- .getInterface(), messageFactory);
- servant = new DynaCorbaServant(proxy, "IDL:org/apache/tuscany/sca/binding/sca/corba/Service:1.0");
- host.registerServant(binding.getURI(), servant);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public void stop() {
- try {
- host.unregisterServant(binding.getURI());
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/WrappedSCAException.java b/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/WrappedSCAException.java
deleted file mode 100644
index 128d5ef159..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/WrappedSCAException.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.sca.corba.impl;
-
-/**
- * Exception holder for SCA default binding over CORBA. Holds fault message in
- * XML
- */
-public class WrappedSCAException extends Exception {
-
- private static final long serialVersionUID = 1L;
- public String fault;
-
- /**
- * Creates exception holder with null fault message. This no argument
- * constructor is needed by CORBA binding.
- */
- public WrappedSCAException() {
-
- }
-
- /**
- * Creates exception holder with fault message
- *
- * @param fault XML fault message
- */
- public WrappedSCAException(String fault) {
- this.fault = fault;
- }
-
- public String getFault() {
- return fault;
- }
-
- public void setFault(String fault) {
- this.fault = fault;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-sca-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-sca-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index e07a7cbb95..0000000000
--- a/branches/sca-android/modules/binding-sca-corba/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.corba.impl.CorbaSCABindingProviderFactory;model=org.apache.tuscany.sca.binding.sca.DistributedSCABinding
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/LICENSE b/branches/sca-android/modules/binding-ws-axis2-policy/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2-policy/META-INF/README b/branches/sca-android/modules/binding-ws-axis2-policy/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/NOTICE b/branches/sca-android/modules/binding-ws-axis2-policy/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/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/branches/sca-android/modules/binding-ws-axis2-policy/pom.xml b/branches/sca-android/modules/binding-ws-axis2-policy/pom.xml
deleted file mode 100644
index a98e5519f7..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/pom.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-ws-axis2-policy</artifactId>
- <name>Apache Tuscany Policy Model for Axis2 WS binding</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security</artifactId>
- <version>1.4-SNAPSHOT</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.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-kernel</artifactId>
- <version>1.3</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.0</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.neethi</groupId>
- <artifactId>neethi</artifactId>
- <version>2.0.2</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.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</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.policy.security.ws</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.policy.security.ws*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicy.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicy.java
deleted file mode 100644
index 2b7d753023..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicy.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.ws.axis2.policy.authentication.basic;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * Implementation for policies that could be injected as parameter
- * into the axis2config.
- *
- * @version $Rev$ $Date$
- */
-public class Axis2BasicAuthenticationPolicy implements Policy {
- public static final QName AXIS2_BASIC_AUTHENTICATION_POLICY_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "axis2BasicAuthentication");
- public static final String AXIS2_BASIC_AUTHENTICATION_USERNAME = "username";
- public static final String AXIS2_BASIC_AUTHENTICATION_PASSWORD = "password";
- public static final String AXIS2_BASIC_AUTHENTICATION_HTTP_HEADER = "httpheader";
-
- 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 AXIS2_BASIC_AUTHENTICATION_POLICY_QNAME;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProcessor.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProcessor.java
deleted file mode 100644
index 019d59b80b..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProcessor.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.binding.ws.axis2.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.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Axis2BasicAuthenticationPolicyProcessor implements StAXArtifactProcessor<Axis2BasicAuthenticationPolicy> {
-
- public QName getArtifactType() {
- return Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_POLICY_QNAME;
- }
-
- public Axis2BasicAuthenticationPolicyProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- }
-
-
- public Axis2BasicAuthenticationPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- Axis2BasicAuthenticationPolicy policy = new Axis2BasicAuthenticationPolicy();
- 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 ( Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_USERNAME.equals(name.getLocalPart()) ) {
- policy.setUserName(reader.getElementText());
- } else if ( Axis2BasicAuthenticationPolicy.AXIS2_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(Axis2BasicAuthenticationPolicy policy, XMLStreamWriter writer)
- throws ContributionWriteException, XMLStreamException {
- String prefix = "tuscany";
- writer.writeStartElement(prefix,
- getArtifactType().getLocalPart(),
- getArtifactType().getNamespaceURI());
- writer.writeNamespace("tuscany", Constants.SCA10_TUSCANY_NS);
-
- if ( policy.getUserName() != null ) {
- writer.writeStartElement(prefix,
- Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_USERNAME,
- getArtifactType().getNamespaceURI());
- writer.writeCharacters(policy.getUserName());
- writer.writeEndElement();
- }
-
- if ( policy.getPassword() != null ) {
- writer.writeStartElement(prefix,
- Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_PASSWORD,
- getArtifactType().getNamespaceURI());
- writer.writeCharacters(policy.getPassword());
- writer.writeEndElement();
- }
-
- writer.writeEndElement();
- }
-
- public Class<Axis2BasicAuthenticationPolicy> getModelType() {
- return Axis2BasicAuthenticationPolicy.class;
- }
-
- public void resolve(Axis2BasicAuthenticationPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProviderFactory.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProviderFactory.java
deleted file mode 100644
index 5ec4cf9baa..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProviderFactory.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.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 Axis2BasicAuthenticationPolicyProviderFactory implements PolicyProviderFactory<Axis2BasicAuthenticationPolicy> {
- private ExtensionPointRegistry registry;
-
- public Axis2BasicAuthenticationPolicyProviderFactory(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 WSBasicAuthenticationImplementationPolicyProvider(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 Axis2BasicAuthenticationReferencePolicyProvider(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 Axis2BasicAuthenticationServicePolicyProvider(component, service, binding);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class getModelType() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyInterceptor.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyInterceptor.java
deleted file mode 100644
index 6bd1eed1bd..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyInterceptor.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.basic;
-
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-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.Policy;
-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 Axis2BasicAuthenticationReferencePolicyInterceptor implements Interceptor {
- public static final QName policySetQName = new QName(Constants.SCA10_TUSCANY_NS, "wsBasicAuthentication");
-
- private Invoker next;
- private Operation operation;
- private PolicySet policySet = null;
- private String context;
- private Axis2BasicAuthenticationPolicy policy;
-
- public Axis2BasicAuthenticationReferencePolicyInterceptor(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 Axis2BasicAuthenticationPolicy){
- policy = (Axis2BasicAuthenticationPolicy)policyObject;
- break;
- }
- }
- }
- }
-
- public Message invoke(Message msg) {
- // TODO - We might use interceptors to do the Axis2 config
- // if we can change the infrastructure split the
- // invoker up
- return getNext().invoke(msg);
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyProvider.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyProvider.java
deleted file mode 100644
index 530d99c01e..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyProvider.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.binding.ws.axis2.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.policy.util.PolicyHandler;
-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 Axis2BasicAuthenticationReferencePolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private RuntimeComponentReference reference;
- private Binding binding;
-
- public Axis2BasicAuthenticationReferencePolicyProvider(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 (Axis2BasicAuthenticationPolicy.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 Axis2BasicAuthenticationReferencePolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.REFERENCE_POLICY;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyInterceptor.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyInterceptor.java
deleted file mode 100644
index f2964650ef..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyInterceptor.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.policy.authentication.basic;
-
-import java.util.Map;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.util.Base64;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-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.Policy;
-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 Axis2BasicAuthenticationServicePolicyInterceptor implements Interceptor {
- public static final QName policySetQName = new QName(Constants.SCA10_TUSCANY_NS, "wsBasicAuthentication");
-
- private Invoker next;
- private Operation operation;
- private PolicySet policySet = null;
- private String context;
- private Axis2BasicAuthenticationPolicy policy;
-
- public Axis2BasicAuthenticationServicePolicyInterceptor(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 Axis2BasicAuthenticationPolicy){
- policy = (Axis2BasicAuthenticationPolicy)policyObject;
- break;
- }
- }
- }
- }
-
- public Message invoke(Message msg) {
- // TODO - We might use interceptors to do the Axis2 config
- // if we can change the infrastructure split the
- // invoker up
- return getNext().invoke(msg);
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyProvider.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyProvider.java
deleted file mode 100644
index 9c1a9704d3..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyProvider.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.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.policy.util.PolicyHandler;
-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 Axis2BasicAuthenticationServicePolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private Binding binding;
-
- public Axis2BasicAuthenticationServicePolicyProvider(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 (Axis2BasicAuthenticationPolicy.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 Axis2BasicAuthenticationReferencePolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.SERVICE_POLICY;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java
deleted file mode 100644
index 8d08a3f78e..0000000000
--- a/branches/sca-android/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.assembly.xml.Constants;
-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 {
- public static final QName NAME = new QName(Constants.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/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java
deleted file mode 100644
index 6478fbedad..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.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.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.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.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(ModelFactoryExtensionPoint 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, Constants.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/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProviderFactory.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProviderFactory.java
deleted file mode 100644
index 21261359cb..0000000000
--- a/branches/sca-android/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.osoa.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/branches/sca-android/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 7a223848fa..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/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.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.basic.Axis2BasicAuthenticationPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#axis2BasicAuthentication,model=org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic.Axis2BasicAuthenticationPolicy
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory b/branches/sca-android/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
deleted file mode 100644
index 7d7f4299f4..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
+++ /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 policy extension
-org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic.Axis2BasicAuthenticationPolicyProviderFactory;model=org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic.Axis2BasicAuthenticationPolicy \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java b/branches/sca-android/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java
deleted file mode 100644
index cf14e54b5f..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;
-
-
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicy;
-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 junit.framework.TestCase;
-
-/**
- *
- * 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/branches/sca-android/modules/binding-ws-axis2-policy/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/mock_policies.xml b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/LICENSE b/branches/sca-android/modules/binding-ws-axis2/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-ws-axis2/META-INF/README b/branches/sca-android/modules/binding-ws-axis2/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-ws-axis2/NOTICE b/branches/sca-android/modules/binding-ws-axis2/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/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/branches/sca-android/modules/binding-ws-axis2/pom.xml b/branches/sca-android/modules/binding-ws-axis2/pom.xml
deleted file mode 100644
index c0a5fe8465..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/pom.xml
+++ /dev/null
@@ -1,580 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-axiom</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb-axiom</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml-ws</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <!-- dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2-policy</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency-->
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-kernel</artifactId>
- <version>1.3</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>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-java2wsdl</artifactId>
- <version>1.3</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>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-adb</artifactId>
- <version>1.3</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-codegen</artifactId>
- <version>1.3</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <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>
- <version>1.2.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.5</version>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
- <version>1.0-incubating-M7b</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version><!-- to keep compatible with older servlet containers -->
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.neethi</groupId>
- <artifactId>neethi</artifactId>
- <version>2.0.2</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.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- <version>1.3.2</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>1.4</version>
- </dependency>
-
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- <version>2.2</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-mtompolicy</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.santuario</groupId>
- <artifactId>xmlsec</artifactId>
- <version>1.4.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.security</groupId>
- <artifactId>wss4j</artifactId>
- <version>1.5.3</version>
- </dependency>
- <!-- xalan is required by wss4j -->
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.0</version>
- <scope>optional</scope>
- <exclusions>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rampart-core</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-xmlbeans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <!-- Exclude XmlSchema 1.3.1 -->
- <exclusion>
- <groupId>org.apache.ws.commons.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- </exclusion>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rampart-policy</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-xmlbeans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- </exclusion>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- <!-- Exclude XmlSchema 1.3.1 -->
- <exclusion>
- <groupId>org.apache.ws.commons.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- </exclusion>
-
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
-
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rampart-trust</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-xmlbeans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>wsdl4j</groupId>
- <artifactId>wsdl4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- </exclusion>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
-
-
- <!-- Exclude XmlSchema 1.3.1 -->
- <exclusion>
- <groupId>org.apache.ws.commons.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</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.0</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.12</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version> <!-- to keep compatible with older servlet containers -->
- <scope>provided</scope>
- </dependency>
-
-<!-- xerces, xalan, and xml-apis are required for running in websphere -->
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.8.1</version>
- </dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.0</version>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.3.03</version>
- </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.ws.axis2</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.ws.axis2*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java
deleted file mode 100644
index 81db43c701..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.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.binding.ws.axis2;
-
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-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.axis2.wsdl.WSDLConstants;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic.Axis2BasicAuthenticationReferenceBindingConfigurator;
-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 {
-
- 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(Constants.SCA10_TUSCANY_NS, "CallbackID", TUSCANY_PREFIX);
- public static final QName CONVERSATION_ID_REFPARM_QN =
- new QName(Constants.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;
-
- 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 {
- // 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(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
- requestMC.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
- requestMC.getOptions().setTimeOutInMilliSeconds(240000L);
-
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.beforeInvoke(msg, requestMC, operationClient);
- }
-
- if (basicAuthenticationPolicy != null) {
- Axis2BasicAuthenticationReferenceBindingConfigurator.setOperationOptions(operationClient, msg, basicAuthenticationPolicy);
- }
-
- // 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(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-
- 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);
- }
-
- // 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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java
deleted file mode 100644
index c7eb2b7794..0000000000
--- a/branches/sca-android/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.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-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.osoa.sca.ServiceRuntimeException;
-
-/**
- * Axis2BindingProviderFactory
- *
- * @version $Rev$ $Date$
- */
-
-public class Axis2BindingProviderFactory implements BindingProviderFactory<WebServiceBinding> {
-
- private ModelFactoryExtensionPoint 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(ModelFactoryExtensionPoint.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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java
deleted file mode 100644
index f8d0cf55b0..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.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.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.axis2.wsdl.WSDLConstants;
-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(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
- //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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java
deleted file mode 100644
index 958d4aa41d..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.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;
-
-import java.util.List;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.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.osoa.sca.ServiceRuntimeException;
-
-public class Axis2ReferenceBindingProvider implements ReferenceBindingProvider {
-
- private WebServiceBinding wsBinding;
- private Axis2ServiceClient axisClient;
-
- public Axis2ReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- WebServiceBinding wsBinding,
- ModelFactoryExtensionPoint 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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java
deleted file mode 100644
index 5b26290732..0000000000
--- a/branches/sca-android/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.contribution.ModelFactoryExtensionPoint;
-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.osoa.sca.ServiceRuntimeException;
-
-public class Axis2ServiceBindingProvider implements ServiceBindingProvider {
-
- private WebServiceBinding wsBinding;
- private Axis2ServiceProvider axisProvider;
-
- public Axis2ServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- WebServiceBinding wsBinding,
- ServletHost servletHost,
- ModelFactoryExtensionPoint 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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
deleted file mode 100644
index 438e989d85..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.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.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.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.security.ws.Axis2ConfigParamPolicy;
-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.provider.PolicyProvider;
-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.xsd.xml.XMLDocumentHelper;
-import org.apache.ws.commons.schema.resolver.URIResolver;
-import org.osoa.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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java
deleted file mode 100644
index a0cfab9154..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java
deleted file mode 100644
index d467e0b3c8..0000000000
--- a/branches/sca-android/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.osoa.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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
deleted file mode 100644
index 01eddb89d1..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
+++ /dev/null
@@ -1,796 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, 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.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.axis2.wsdl.WSDLConstants;
-import org.apache.tuscany.sca.assembly.AbstractContract;
-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.basic.Axis2BasicAuthenticationServiceBindingConfigurator;
-import org.apache.tuscany.sca.core.assembly.EndpointReferenceImpl;
-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.security.ws.Axis2ConfigParamPolicy;
-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.provider.PolicyProvider;
-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.osoa.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;
-
- 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());
-
- // 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 {
- // 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);
- }
- }
-
- 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("/")) {
- 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(WSDLConstants.WSDL_4_J_DEFINITION, 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;
-
- //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();
- }
- }
- }
- }
-
- // create a message object and set the args as its body
- Message msg = messageFactory.createMessage();
- msg.setBody(args);
- msg.setOperation(op);
-
- //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 = new EndpointReferenceImpl(null);
- parameters = from.getReferenceParameters();
- msg.setFrom(from);
- }
-
- // set the reference parameters into the "From" EPR
- if (callbackAddress != null) {
- parameters.setCallbackReference(new EndpointReferenceImpl(callbackAddress));
- }
- if (callbackID != null) {
- parameters.setCallbackID(callbackID);
- }
- if (conversationID != null) {
- parameters.setConversationID(conversationID);
- }
-
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.beforeInvoke(msg, inMC);
- }
-
- if (basicAuthenticationPolicy != null) {
- Axis2BasicAuthenticationServiceBindingConfigurator.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.getQoSContext().put(Message.QOS_CTX_SECURITY_PRINCIPAL, securityResult.get("principal"));
- }
- }
- }
- }
- }
-
- }
- }
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceServlet.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceServlet.java
deleted file mode 100644
index 746b850ff0..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java
deleted file mode 100644
index 1f389b422f..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java
deleted file mode 100644
index 42441f3598..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, 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 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;
-import org.apache.axis2.util.Loader;
-
-/**
- * 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.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 *********************************************************************/
- 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.3.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;
- }
-
- /* 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 =
- Loader.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(org.apache.axis2.util.Utils.getModuleName("rampart-1.3"));
- module.setVersion(org.apache.axis2.util.Utils.getModuleVersion("rampart-1.3"));
- }
- 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();
- }
-
- org.apache.axis2.util.Utils.
- calculateDefaultModuleVersion(axisConfig.getModules(), axisConfig);
- axisConfig.validateSystemPredefinedPhases();
- } catch (IOException e) {
- throw new DeploymentException(e);
- }
- }
-
- 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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java
deleted file mode 100644
index 34899a4af0..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.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.axis2.util.JavaUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * A Tuscany specific Axis2 Dispatcher that enables using services
- * exposed at the SCA defined service URI instead of /services/<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 = JavaUtils.split(path, '/');
- String serviceName = "";
- for (int i=parts.length-1; i>=0; i--) {
- serviceName = parts[i] + serviceName;
- if (services.containsKey(serviceName)) {
- return serviceName;
- }
- serviceName = "/" + serviceName;
- if (services.containsKey(serviceName)) {
- return serviceName;
- }
- }
-
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
deleted file mode 100644
index 21fef3e5d8..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.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.binding.ws.axis2;
-
-import java.io.IOException;
-import java.io.InputStream;
-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 java.util.List;
-import java.util.Map;
-
-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 javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap12.SOAP12Address;
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.axiom.attachments.utils.IOUtils;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.deployment.DeploymentConstants;
-import org.apache.axis2.description.AxisDescription;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.description.PolicyInclude;
-import org.apache.axis2.transport.http.ListingAgent;
-import org.apache.axis2.transport.http.server.HttpUtils;
-import org.apache.axis2.util.ExternalPolicySerializer;
-import org.apache.axis2.util.JavaUtils;
-import org.apache.axis2.wsdl.WSDLConstants;
-import org.apache.neethi.Policy;
-import org.apache.neethi.PolicyRegistry;
-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(WSDLConstants.WSDL_4_J_DEFINITION);
- 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 = JavaUtils.split(path, '/');
- String serviceName = "";
- for (int i=parts.length-1; i>=0; i--) {
- serviceName = parts[i] + serviceName;
- if (services.containsKey(serviceName)) {
- return serviceName;
- }
- serviceName = "/" + serviceName;
- if (services.containsKey(serviceName)) {
- return serviceName;
- }
- }
-
- return null;
- }
-
- /**
- * 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/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/WSBindingDefinitionsProvider.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/WSBindingDefinitionsProvider.java
deleted file mode 100644
index 5254a5716c..0000000000
--- a/branches/sca-android/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.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.definitions.SCADefinitions;
-import org.apache.tuscany.sca.provider.SCADefinitionsProvider;
-import org.apache.tuscany.sca.provider.SCADefinitionsProviderException;
-
-/**
- * Provider for Policy Intents and PolicySet definitions related to security
- *
- * @version $Rev$ $Date$
- */
-public class WSBindingDefinitionsProvider implements SCADefinitionsProvider {
- 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(SCADefinitions.class);
- }
-
- public SCADefinitions getSCADefinition() throws SCADefinitionsProviderException {
- final URL definitionsFileUrl = getClass().getClassLoader().getResource(definitionsFile);
- SCADefinitions 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<SCADefinitions>() {
- public SCADefinitions run() throws ContributionReadException {
- return (SCADefinitions)urlArtifactProcessor.read(null, uri, definitionsFileUrl);
- }
- });
- } catch (Exception e) {
- throw new SCADefinitionsProviderException(e);
- }
- return scaDefn;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferenceBindingConfigurator.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferenceBindingConfigurator.java
deleted file mode 100644
index 2bc6bff3c7..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferenceBindingConfigurator.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.policy.authentication.basic;
-
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.client.OperationClient;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.Parameter;
-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.Policy;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicy;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * Policy handler to handle PolicySet that contain Axis2ConfigParamPolicy instances
- *
- * @version $Rev$ $Date$
- */
-public class Axis2BasicAuthenticationReferenceBindingConfigurator {
-
-
- public static void setOperationOptions(OperationClient operationClient, Message msg, BasicAuthenticationPolicy policy) {
-
- // get security context
- String securityPrincipal = (String)msg.getQoSContext().get(Message.QOS_CTX_SECURITY_PRINCIPAL);
- String username = null;
- String password = null;
-
- // could use the security principal to look up basic auth credentials
- if ( securityPrincipal != null ) {
- // look up usename and password based on security principal
- } else {
- // take the message username and password
- username = (String)msg.getQoSContext().get(BasicAuthenticationPolicy.BASIC_AUTHENTICATION_USERNAME);
- password = (String)msg.getQoSContext().get(BasicAuthenticationPolicy.BASIC_AUTHENTICATION_PASSWORD);
-
- if (username == null){
- username = policy.getUserName();
- password = policy.getPassword();
- }
- }
-
- if (username == null || password == null ){
- throw new ServiceRuntimeException("Basic authenication 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);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServiceBindingConfigurator.java b/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServiceBindingConfigurator.java
deleted file mode 100644
index 6d311faec5..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServiceBindingConfigurator.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.policy.authentication.basic;
-
-import java.security.Principal;
-import java.util.Map;
-
-import org.apache.axiom.om.util.Base64;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.client.OperationClient;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.Parameter;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicy;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-
-/**
- * Deal with basic authentication configuration at the service
- *
- * @version $Rev$ $Date$
- */
-public class Axis2BasicAuthenticationServiceBindingConfigurator {
-
- 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);
- }
- }
-
- // set the security context.
- msg.getQoSContext().put(BasicAuthenticationPolicy.BASIC_AUTHENTICATION_USERNAME,
- username);
- msg.getQoSContext().put(BasicAuthenticationPolicy.BASIC_AUTHENTICATION_PASSWORD,
- password);
-
- // Set the http headers
- // This is just an experiment, looking at the alternatives to extracting
- // username and password in the binding. With HTTP headers in the message it
- // could be deferred to the interceptor. Asymetric though when compared with the
- // reference support.
- // how to defined the scheme for message headers?
- msg.getHeader().put("httpheaders", httpHeaderProperties);
- }
-
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/branches/sca-android/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index a48ff54c77..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider b/branches/sca-android/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider
deleted file mode 100644
index 370b83f87b..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider
+++ /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/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml b/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml
deleted file mode 100644
index b11059df15..0000000000
--- a/branches/sca-android/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" 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/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml b/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml
deleted file mode 100644
index 4d7a34d73d..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml
+++ /dev/null
@@ -1,503 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT 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"/>
- </phaseOrder>
-</axisconfig>
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/modules.list b/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/modules.list
deleted file mode 100644
index 1641457d28..0000000000
--- a/branches/sca-android/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.3.mar \ No newline at end of file
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.3.mar b/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.3.mar
deleted file mode 100644
index af3c45aa93..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.3.mar
+++ /dev/null
Binary files differ
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/services/services.list b/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/services/services.list
+++ /dev/null
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java
deleted file mode 100644
index 2ce23bf2c4..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java
deleted file mode 100644
index d4d20414e5..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java
deleted file mode 100644
index 767f59646f..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java
deleted file mode 100644
index e5e76af0b7..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java
deleted file mode 100644
index 4e7c1b0539..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Bar.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java
deleted file mode 100644
index 6fccbcfd00..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface Echo {
-
- Foo echoFoo(Foo foo);
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java
deleted file mode 100644
index 5e1a4cf259..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.Reference;
-
-public class EchoComponent implements Echo {
-
- @Reference
- public Echo echoWS;
-
- public Foo echoFoo(Foo foo) {
- return echoWS.echoFoo(foo);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoImpl.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Foo.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java
deleted file mode 100644
index f474c12af3..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface HelloWorld {
-
- String getGreetings(String s);
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java
deleted file mode 100644
index 88705c1a95..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.Reference;
-
-public class HelloWorldComponent implements HelloWorld {
-
- @Reference
- public HelloWorld helloWorldWS;
-
- public String getGreetings(String s) {
- return helloWorldWS.getGreetings(s);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldMultiService.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java
deleted file mode 100644
index 7ee48d4451..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.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.binding.ws.axis2.itests ;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class HelloWorldNoWSDLTestCase extends TestCase {
-
- private SCADomain domain;
-
- public void testHelloWorld() throws Exception {
- HelloWorld helloWorld = domain.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 = domain.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 {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java
deleted file mode 100644
index 274f6c8d28..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface HelloWorldOM {
-
- OMElement getGreetings(OMElement parmE);
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java
deleted file mode 100644
index bf371430a1..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface HelloWorldOM2 {
-
- OMElement getGreetings2(OMElement parmE);
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java
deleted file mode 100644
index d1cbfb88fd..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.Reference;
-
-public class HelloWorldOMComponent implements HelloWorldOM {
-
- @Reference
- public HelloWorldOM helloWorldWS;
-
- public OMElement getGreetings(OMElement om) {
- return helloWorldWS.getGreetings(om);
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMService.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java
deleted file mode 100644
index e7511027c2..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.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 junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMText;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class HelloWorldOMTestCase extends TestCase {
-
- private SCADomain domain;
- private HelloWorldOM helloWorld;
-
- public void 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 {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite");
- helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldService.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java
deleted file mode 100644
index a3a43d032f..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.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.axis2.itests;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class HelloWorldTestCase extends TestCase {
-
- private SCADomain domain;
- private HelloWorld helloWorld;
-
- public void testCalculator() throws Exception {
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
-
- @Override
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite");
- helloWorld = domain.getService(HelloWorld.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java
deleted file mode 100644
index 8e17b89f33..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.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 junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMText;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class HelloWorldWSDLMergedTestCase extends TestCase {
-
- private SCADomain domain;
- 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 {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite");
- helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldWSDLMergedComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java
deleted file mode 100644
index b276d8210f..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.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.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.host.embedded.SCADomain;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev$ $Date$
- */
-public class QuestionMarkWSDLImportTestCase extends TestCase {
-
- private SCADomain domain;
-
- /**
- * 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 {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java
deleted file mode 100644
index 59eb6164fa..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.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.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.host.embedded.SCADomain;
-
-/**
- * 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 SCADomain domain;
-
- /**
- * 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 {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java
deleted file mode 100644
index 0508f28e11..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.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.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.host.embedded.SCADomain;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev$ $Date$
- */
-public class QuestionMarkWSDLTestCase extends TestCase {
-
- private SCADomain domain;
-
- /**
- * 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 {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl.composite");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/UriPrecedenceTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/UriPrecedenceTestCase.java
deleted file mode 100644
index 5efbedba4c..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/UriPrecedenceTestCase.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.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.host.embedded.SCADomain;
-import org.osoa.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 SCADomain domain;
- 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 {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite");
- helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
deleted file mode 100644
index 56d0537a44..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.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.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.host.embedded.SCADomain;
-
-public abstract class AbstractHelloWorldOMTestCase extends TestCase {
-
- private SCADomain domain;
- private HelloWorldOM helloWorld;
-
- public void testCalculator() throws Exception {
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
- OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
- requestOM.addChild(parmE);
- parmE.addChild(fac.createOMText("petra"));
- OMElement responseOM = helloWorld.getGreetings(requestOM);
- OMElement child = (OMElement)responseOM.getFirstElement();
- Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
- }
-
- @Override
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance(getCompositeName());
- helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
- protected String getCompositeName() {
- String className = this.getClass().getName();
- return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiServiceTestCase.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleServiceTestCase.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURITestCase.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURITestCase.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java
deleted file mode 100644
index f5d87cdcee..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.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.axis2.itests.epr;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorld;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class HelloWorldTestCase extends TestCase {
-
- private SCADomain domain;
- private HelloWorld helloWorld;
-
- public void testCalculator() throws Exception {
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
-
- @Override
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite");
- helloWorld = domain.getService(HelloWorld.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCase.java
deleted file mode 100644
index 6cdb12c221..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCase.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.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.host.embedded.SCADomain;
-
-public abstract class AbstractHelloWorldOMTestCase extends TestCase {
-
- private SCADomain domain;
- 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 {
- domain = SCADomain.newInstance(getCompositeName());
- helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
- protected String getCompositeName() {
- String className = this.getClass().getName();
- return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java
deleted file mode 100644
index 18a713a243..0000000000
--- a/branches/sca-android/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 AbstractHelloWorldOMTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
deleted file mode 100644
index 1fd1b8d48e..0000000000
--- a/branches/sca-android/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 AbstractHelloWorldOMTestCase {
-
- /**
- * @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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCase.java
deleted file mode 100644
index 824132161c..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCase.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 WSSecurityIntegrityTestCase extends AbstractHelloWorldOMTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/AbstractHelloWorldOMTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/AbstractHelloWorldOMTestCase.java
deleted file mode 100644
index 395cfe28d6..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/AbstractHelloWorldOMTestCase.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.policy.mixed;
-
-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.host.embedded.SCADomain;
-
-public abstract class AbstractHelloWorldOMTestCase extends TestCase {
-
- private SCADomain domain;
- 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 {
- domain = SCADomain.newInstance(getCompositeName());
- helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
- protected String getCompositeName() {
- String className = this.getClass().getName();
- return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ClientPWCBHandler.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/IntegrityPWCBHandler.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ServerPWCBHandler.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixedTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixedTestCase.java
deleted file mode 100644
index db5b88f9ac..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixedTestCase.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.mixed;
-
-public class WSSecurityMixedTestCase extends AbstractHelloWorldOMTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCase.java
deleted file mode 100644
index 04de589fb1..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCase.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.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.host.embedded.SCADomain;
-
-public abstract class AbstractHelloWorldOMTestCase extends TestCase {
-
- private SCADomain domain;
- 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 {
- domain = SCADomain.newInstance(getCompositeName());
- helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
- protected String getCompositeName() {
- String className = this.getClass().getName();
- return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCase.java
deleted file mode 100644
index a439ff4c8f..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCase.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.wspolicy;
-
-public class WSSecurityAuthenticationTestCase extends AbstractHelloWorldOMTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
deleted file mode 100644
index f37a8deeb7..0000000000
--- a/branches/sca-android/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 AbstractHelloWorldOMTestCase {
-
- /**
- * @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/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCase.java
deleted file mode 100644
index 18bbf98628..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCase.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.wspolicy;
-
-public class WSSecurityIntegrityTestCase extends AbstractHelloWorldOMTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCase.java
deleted file mode 100644
index b2ccd7f97d..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCase.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.soap12 ;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorld;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class HelloWorldSOAP12TestCase extends TestCase {
-
- private SCADomain domain;
-
- public void testHelloWorld() throws Exception {
- HelloWorld helloWorld = domain.getService(HelloWorld.class, "HelloWorldClient");
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
- public void testHelloWorldSOAP() throws Exception {
- HelloWorld helloWorld = domain.getService(HelloWorld.class, "HelloWorldClientSOAP");
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
- public void testHelloWorldSOAP11() throws Exception {
- HelloWorld helloWorld = domain.getService(HelloWorld.class, "HelloWorldClientSOAP11");
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
- public void testHelloWorldSOAP12() throws Exception {
- HelloWorld helloWorld = domain.getService(HelloWorld.class, "HelloWorldClientSOAP12");
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
-
- @Override
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.composite");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCase.java b/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCase.java
deleted file mode 100644
index 8d378565d4..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCase.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.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.host.embedded.SCADomain;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev$ $Date$
- */
-public class QuestionMarkWSDLTestCase extends TestCase {
-
- private static boolean newGenerator = true;
- private SCADomain domain;
-
- /**
- * 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 {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/questionmark-wsdl.composite");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite
deleted file mode 100644
index 5cea469e3d..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.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"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite
deleted file mode 100644
index b11c50b00c..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.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"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite
deleted file mode 100644
index 394bf05506..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.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"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite
deleted file mode 100644
index c7081b9a72..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.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"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite
deleted file mode 100644
index 7d3e1d1327..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.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"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite
deleted file mode 100644
index c2cd598508..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.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"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/helloworld-om-relative-uri.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite
deleted file mode 100644
index 38a7c045be..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.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"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-binding.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite
deleted file mode 100644
index dee0effd99..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.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:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-uri.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite
deleted file mode 100644
index 8fcbdef33d..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.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"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite
deleted file mode 100644
index c506b09bb2..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.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.
--->
-
-<!-- $Rev$ $Date$ -->
-
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthentication.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthentication.composite
deleted file mode 100644
index da5bab45e8..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthentication.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentiality.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentiality.composite
deleted file mode 100644
index 13e002be1b..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentiality.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"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrity.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrity.composite
deleted file mode 100644
index 2f6fab0d07..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrity.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"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties
deleted file mode 100644
index db221a4bea..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixed.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixed.composite
deleted file mode 100644
index 12b2b18e55..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixed.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/definitions.xml b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties
deleted file mode 100644
index 8f9158a0f8..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthentication.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthentication.composite
deleted file mode 100644
index 2a22a0905d..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthentication.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentiality.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentiality.composite
deleted file mode 100644
index e6f999aad7..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentiality.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"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrity.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrity.composite
deleted file mode 100644
index d9e889768b..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrity.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-include.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite
deleted file mode 100644
index 008d42d03d..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.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="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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite
deleted file mode 100644
index 7fff56377b..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.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="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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl.composite
deleted file mode 100644
index c042ae5675..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl.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:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.composite
deleted file mode 100644
index fbd4c66c45..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/questionmark-wsdl.composite b/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/questionmark-wsdl.composite
deleted file mode 100644
index 033a77eea6..0000000000
--- a/branches/sca-android/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/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"
- 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/branches/sca-android/modules/binding-ws-wsdlgen/LICENSE b/branches/sca-android/modules/binding-ws-wsdlgen/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-wsdlgen/META-INF/README b/branches/sca-android/modules/binding-ws-wsdlgen/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-ws-wsdlgen/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-ws-wsdlgen/NOTICE b/branches/sca-android/modules/binding-ws-wsdlgen/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-ws-wsdlgen/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/branches/sca-android/modules/binding-ws-wsdlgen/pom.xml b/branches/sca-android/modules/binding-ws-wsdlgen/pom.xml
deleted file mode 100644
index a06039d1b4..0000000000
--- a/branches/sca-android/modules/binding-ws-wsdlgen/pom.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- <name>Apache Tuscany SCA Web Service binding WSDL Generator</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-jaxws</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security-ws</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <version>1.4-SNAPSHOT</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.ws.wsdlgen</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.ws.wsdlgen*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java
deleted file mode 100644
index de1cab15d8..0000000000
--- a/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.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.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.assembly.builder.BindingBuilderExtension;
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.databinding.DataBindingExtensionPoint;
-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.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.interfacedef.wsdl.impl.InvalidWSDLException;
-import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLInterfaceIntrospectorImpl;
-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 = new ProblemImpl(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 = new ProblemImpl(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 = new ProblemImpl(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 = new ProblemImpl(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 = new ProblemImpl(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) {
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.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 {
- for (Operation op : iface.getOperations()) {
- javax.wsdl.Operation wsdlOp = portType.getOperation(op.getName(), null, null);
- wsdlInterface.getOperations().add(WSDLInterfaceIntrospectorImpl.getOperation(
- wsdlOp, wsdlDefinition, resolver, xsdFactory));
- }
- } catch (InvalidWSDLException e) {
- throw new WSDLGenerationException(e);
- }
-
- return wsdlContract;
- }
-
-}
diff --git a/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
deleted file mode 100644
index c84e2e3ebe..0000000000
--- a/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, 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.assembly.builder.impl.ProblemImpl;
-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 = new ProblemImpl(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 = new ProblemImpl(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 (targetNS.equals(nsURI)) {
- xsElement.setAttribute("type", typeName.getLocalPart());
- } 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) {
- prefix = "ns" + i++;
- prefixMap.put(nsURI, prefix);
- schema.setAttributeNS(XMLNS_NS, "xmlns:" + prefix, nsURI);
- addSchemaImport(schema, nsURI, schemaDoc);
- }
- 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/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
deleted file mode 100644
index d0b79f9b0e..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLGenerationException.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLGenerationException.java
deleted file mode 100644
index bf9e22f645..0000000000
--- a/branches/sca-android/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.osoa.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/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java
deleted file mode 100644
index ebfbdc509a..0000000000
--- a/branches/sca-android/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, 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.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-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.List;
-import java.util.Iterator;
-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.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.soap.SOAPOperation;
-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 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.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.interfacedef.Interface;
-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.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;
-import org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicy;
-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.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 = new ProblemImpl(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 = new ProblemImpl(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/branches/sca-android/modules/binding-ws-wsdlgen/src/main/resources/wsdlgen-validation-messages.properties b/branches/sca-android/modules/binding-ws-wsdlgen/src/main/resources/wsdlgen-validation-messages.properties
deleted file mode 100644
index 4bfbdd2901..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/Other.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/Other.java
deleted file mode 100644
index 7e6a1de546..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/package-info.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/package-info.java
deleted file mode 100644
index 5056760366..0000000000
--- a/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/package-info.java
+++ /dev/null
@@ -1,3 +0,0 @@
-@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/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java
deleted file mode 100644
index e474c7a318..0000000000
--- a/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.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.wsdlgen;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Operation;
-import javax.wsdl.PortType;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint;
-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.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.osoa.sca.annotations.Remotable;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class BindingWSDLGeneratorTestCase extends TestCase {
-
- public void testCreateWSDLInterfaceContract() throws InvalidInterfaceException {
- DefaultModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint();
- WSDLFactory wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
- XSDFactory xsdFactory = modelFactories.getFactory(XSDFactory.class);
- DefaultJavaInterfaceFactory 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/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java
deleted file mode 100644
index f1e12f8ce0..0000000000
--- a/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.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.wsdlgen;
-
-import java.io.StringWriter;
-
-import javax.wsdl.Definition;
-import javax.wsdl.xml.WSDLWriter;
-
-import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint;
-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.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.xsd.DefaultXSDFactory;
-import org.apache.tuscany.sca.xsd.xml.XSDModelResolver;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class Interface2WSDLGeneratorTestCase {
-
- @Test
- public void testGenerate() throws Exception {
- DefaultJavaInterfaceFactory 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);
- DefaultModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint();
- WSDLDefinition wsdlDefinition = new DefaultWSDLFactory(modelFactories).createWSDLDefinition();
- DefaultXSDFactory 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/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestException.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestException.java
deleted file mode 100644
index 1e4f802e01..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFault.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFault.java
deleted file mode 100644
index da2c285bac..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFaultBean.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFaultBean.java
deleted file mode 100644
index 64cce0e49d..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaClass.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaClass.java
deleted file mode 100644
index 3fd7361ae1..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaInterface.java b/branches/sca-android/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaInterface.java
deleted file mode 100644
index 9635d65f99..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.OneWay;
-import org.osoa.sca.annotations.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/branches/sca-android/modules/binding-ws-xml/LICENSE b/branches/sca-android/modules/binding-ws-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-ws-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-ws-xml/META-INF/README b/branches/sca-android/modules/binding-ws-xml/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-ws-xml/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-ws-xml/NOTICE b/branches/sca-android/modules/binding-ws-xml/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-ws-xml/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/branches/sca-android/modules/binding-ws-xml/pom.xml b/branches/sca-android/modules/binding-ws-xml/pom.xml
deleted file mode 100644
index 6a3151cd04..0000000000
--- a/branches/sca-android/modules/binding-ws-xml/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-modules</artifactId>
- <version>1.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.ws.xml</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.ws.xml*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java b/branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java
deleted file mode 100644
index f2376231ab..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/EndPointReferenceHelper.java b/branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/EndPointReferenceHelper.java
deleted file mode 100644
index ad2540e5fe..0000000000
--- a/branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/EndPointReferenceHelper.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.binding.ws.xml;
-
-import static javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
-
-import java.io.StringWriter;
-
-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.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-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;
-
-/**
- * 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/branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java b/branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
deleted file mode 100644
index 15b58e499c..0000000000
--- a/branches/sca-android/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.builder.impl.ProblemImpl;
-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.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-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;
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.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 = new ProblemImpl(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 = new ProblemImpl(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/branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java b/branches/sca-android/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java
deleted file mode 100644
index 03c84a6b41..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties b/branches/sca-android/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties
deleted file mode 100644
index 2dfa5e6133..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java b/branches/sca-android/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java
deleted file mode 100644
index ef955254c1..0000000000
--- a/branches/sca-android/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.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.binding.ws.xml;
-
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-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.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-
-/**
- * Test reading WSDL interfaces.
- *
- * @version $Rev$ $Date$
- */
-public class ReadTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private CompositeBuilder compositeBuilder;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
-
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
-
- IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, mapper, null);
- }
-
- @Override
- public void tearDown() throws Exception {
- }
-
- public void testReadComponentType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- ComponentType componentType = (ComponentType)staxProcessor.read(reader);
- assertNotNull(componentType);
- }
-
- 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);
- }
-
- 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);
-
- 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.
- */
- 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/branches/sca-android/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java b/branches/sca-android/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java
deleted file mode 100644
index 0e519af9d3..0000000000
--- a/branches/sca-android/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.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.binding.ws.xml;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.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;
-
-/**
- * Test reading/write WSDL interfaces.
- *
- * @version $Rev$ $Date$
- */
-public class WriteTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- }
-/*
- public void 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));
- }
-*/
-
- 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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite
deleted file mode 100644
index f7460813cd..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType
deleted file mode 100644
index 959802af43..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite
deleted file mode 100644
index 37c80aa910..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl
deleted file mode 100644
index 5e8e5dad0d..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl
deleted file mode 100644
index ad81fc7867..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd
deleted file mode 100644
index 241ec15d36..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl
deleted file mode 100644
index 39cd5547d9..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl
deleted file mode 100644
index 8e26f7b4b5..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd
deleted file mode 100644
index c2210f4a94..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl
deleted file mode 100644
index 529b395fd5..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl b/branches/sca-android/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl
deleted file mode 100644
index 666a7e4069..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws/LICENSE b/branches/sca-android/modules/binding-ws/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/binding-ws/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/binding-ws/META-INF/README b/branches/sca-android/modules/binding-ws/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/binding-ws/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/binding-ws/NOTICE b/branches/sca-android/modules/binding-ws/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/binding-ws/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/branches/sca-android/modules/binding-ws/pom.xml b/branches/sca-android/modules/binding-ws/pom.xml
deleted file mode 100644
index 8a6ade06eb..0000000000
--- a/branches/sca-android/modules/binding-ws/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>1.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>1.4-SNAPSHOT</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>
-
-
- <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.ws</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.ws*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java b/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java
deleted file mode 100644
index 2ccaa5dc58..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java b/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java
deleted file mode 100644
index 0d07a55a14..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java b/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java
deleted file mode 100644
index 1ad38c69e4..0000000000
--- a/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws;
-
-/**
- * Factory for the Web Service binding model.
- *
- * @version $Rev$ $Date$
- */
-public interface WebServiceBindingFactory {
-
- /**
- * Creates a new WebService binding.
- *
- * @return a new WebService binding
- */
- WebServiceBinding createWebServiceBinding();
-
-}
diff --git a/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/addressing/EndPointReference.java b/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/addressing/EndPointReference.java
deleted file mode 100644
index a13584a3c2..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java b/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java
deleted file mode 100644
index 055e2012dc..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java b/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java
deleted file mode 100644
index d816c2c9c6..0000000000
--- a/branches/sca-android/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.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.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.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<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 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/branches/sca-android/modules/binding-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory b/branches/sca-android/modules/binding-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory
deleted file mode 100644
index 6d50a24b93..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/LICENSE b/branches/sca-android/modules/contribution-namespace/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/META-INF/README b/branches/sca-android/modules/contribution-namespace/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/contribution-namespace/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/contribution-namespace/NOTICE b/branches/sca-android/modules/contribution-namespace/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/contribution-namespace/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/branches/sca-android/modules/contribution-namespace/pom.xml b/branches/sca-android/modules/contribution-namespace/pom.xml
deleted file mode 100644
index 39e011dbe2..0000000000
--- a/branches/sca-android/modules/contribution-namespace/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <name>Apache Tuscany SCA Namespace Import/Export Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.1</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </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.contribution.namespace</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.contribution.namespace*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/DefaultNamespaceImportExportFactory.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/DefaultNamespaceImportExportFactory.java
deleted file mode 100644
index a71fa61a54..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceExport.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceExport.java
deleted file mode 100644
index c68aee8521..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImport.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImport.java
deleted file mode 100644
index 8af36d7da0..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImportExportFactory.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImportExportFactory.java
deleted file mode 100644
index cfbac8bb1f..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportImpl.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportImpl.java
deleted file mode 100644
index 8991585d32..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportModelResolver.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportModelResolver.java
deleted file mode 100644
index 5c5ae22f77..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java
deleted file mode 100644
index 64862301c1..0000000000
--- a/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.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.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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceExport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.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(ModelFactoryExtensionPoint 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 = new ProblemImpl(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, XMLStreamException {
- NamespaceExport namespaceExport = this.factory.createNamespaceExport();
- QName element = null;
-
- 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();
- }
- }
-
- 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/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportFactoryImpl.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportFactoryImpl.java
deleted file mode 100644
index 1146e593a9..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportListener.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportListener.java
deleted file mode 100644
index 7ea09a47c7..0000000000
--- a/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportListener.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace.impl;
-
-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.namespace.NamespaceExport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.resolver.DefaultImportAllModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionListener;
-import org.apache.tuscany.sca.contribution.service.ContributionRepository;
-
-/**
- * Namespace Import/Export contribution listener
- * The listener would process all import/export from a given contribution
- * and initialize the model resolvers properly
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceImportExportListener implements ContributionListener {
-
- /**
- * Initialize the import/export model resolvers
- * Export model resolvers are same as Contribution model resolver
- * Import model resolvers are matched to a specific contribution if a location URI is specified,
- * otherwise it try to resolve against all the other contributions
- * Also set the exporting contributions used by contribution ClassLoaders to
- * match import/export for class loading.
- */
- public void contributionAdded(ContributionRepository repository, Contribution contribution) {
- // Initialize the contribution exports
- for (Export export: contribution.getExports()) {
- export.setModelResolver(contribution.getModelResolver());
- }
-
- // Initialize the contribution imports
- for (Import import_: contribution.getImports()) {
- boolean initialized = false;
-
- if (import_ instanceof NamespaceImport) {
- NamespaceImport namespaceImport = (NamespaceImport)import_;
-
- // Find a matching contribution
- if (namespaceImport.getLocation() != null) {
- Contribution targetContribution = repository.getContribution(namespaceImport.getLocation());
- if (targetContribution != null) {
-
- // Find a matching contribution export
- for (Export export: targetContribution.getExports()) {
- if (export instanceof NamespaceExport) {
- NamespaceExport namespaceExport = (NamespaceExport)export;
- if (namespaceImport.getNamespace().equals(namespaceExport.getNamespace())) {
- namespaceImport.setModelResolver(namespaceExport.getModelResolver());
- initialized = true;
- break;
- }
- }
- }
- }
- }
-
- //if no location was specified, try to resolve with any contribution
- if( !initialized ) {
- // Use a resolver that will consider all contributions
- import_.setModelResolver(new DefaultImportAllModelResolver(import_, repository.getContributions()));
- }
- }
- }
-
- }
-
- public void contributionRemoved(ContributionRepository repository, Contribution contribution) {
-
- }
-
- public void contributionUpdated(ContributionRepository repository, Contribution oldContribution, Contribution contribution) {
-
- }
-
-}
diff --git a/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportImpl.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportImpl.java
deleted file mode 100644
index 6d2a31f702..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java b/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java
deleted file mode 100644
index 829e5fa43f..0000000000
--- a/branches/sca-android/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.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.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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.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(ModelFactoryExtensionPoint 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 = new ProblemImpl(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, XMLStreamException {
- NamespaceImport namespaceImport = this.factory.createNamespaceImport();
- QName element;
-
- 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();
- }
- }
-
- 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/branches/sca-android/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory b/branches/sca-android/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory
deleted file mode 100644
index 095866fb6f..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 86f199368b..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener b/branches/sca-android/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener
deleted file mode 100644
index cdf16a383f..0000000000
--- a/branches/sca-android/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener
+++ /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.NamespaceImportExportListener
diff --git a/branches/sca-android/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties b/branches/sca-android/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties
deleted file mode 100644
index c7ddba3c3d..0000000000
--- a/branches/sca-android/modules/contribution-namespace/src/main/resources/contribution-namespace-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.
-#
-#
-AttributeNameSpaceMissing = Attribute 'namespace' is missing
-
diff --git a/branches/sca-android/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java b/branches/sca-android/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
deleted file mode 100644
index 1f508d6a4a..0000000000
--- a/branches/sca-android/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.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.namespace.impl;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-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.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorFactoryImpl;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
-
-/**
- * Test NamespaceExportProcessorTestCase
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceExportProcessorTestCase extends TestCase {
-
- 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 XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private Monitor monitor;
-
- @Override
- protected void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();
- 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
- */
- 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
- */
- 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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
- assertNotNull(problem);
- assertEquals("AttributeNameSpaceMissing", problem.getMessageId());
- }
-}
diff --git a/branches/sca-android/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java b/branches/sca-android/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java
deleted file mode 100644
index 71ac33bf68..0000000000
--- a/branches/sca-android/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.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.namespace.impl;
-
-
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-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.contribution.service.ContributionReadException;
-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.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorFactoryImpl;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
-
-/**
- * Test NamespaceImportProcessorTestCase
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceImportProcessorTestCase extends TestCase {
-
- 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 XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private Monitor monitor;
-
- @Override
- protected void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();
- 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
- */
- 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
- */
- 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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
- assertNotNull(problem);
- assertEquals("AttributeNameSpaceMissing", problem.getMessageId());
- }
-}
diff --git a/branches/sca-android/modules/contribution-osgi/LICENSE b/branches/sca-android/modules/contribution-osgi/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/contribution-osgi/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/contribution-osgi/META-INF/README b/branches/sca-android/modules/contribution-osgi/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/contribution-osgi/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/contribution-osgi/NOTICE b/branches/sca-android/modules/contribution-osgi/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/contribution-osgi/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/branches/sca-android/modules/contribution-osgi/pom.xml b/branches/sca-android/modules/contribution-osgi/pom.xml
deleted file mode 100644
index 5622978bd9..0000000000
--- a/branches/sca-android/modules/contribution-osgi/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-contribution-osgi</artifactId>
- <name>Apache Tuscany SCA Contribution Service OSGi </name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-osgi-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.main</artifactId>
- <version>1.0.4</version>
- </dependency>
-
-
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.1</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </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.contribution.osgi</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.contribution.osgi*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/BundleReference.java b/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/BundleReference.java
deleted file mode 100644
index 0bbb8b707a..0000000000
--- a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/BundleReference.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.osgi;
-
-
-/**
- * A weak reference to a class, which should be used to register classes
- * with an ArtifactResolver and resolve these classes later.
- *
- * @version $Rev$ $Date$
- */
-public class BundleReference {
-
- /**
- * The bundle.
- */
- private Object bundle;
-
- /**
- * The bundle name.
- */
- private String bundleName;
-
- /**
- * The bundle version.
- */
- private String bundleVersion;
-
- /**
- * The bundle name and version.
- */
- private String bundleUniqueName;
-
- /**
- * The bundle relative path.
- */
- private String bundleRelativePath;
-
- /**
- * Constructs a new BundleReference.
- *
- * @param bundle The bundle reference
- * @param bundleName The bundle name
- * @param bundleVersion The bundle version
- * @param bundleRelativePath The relative path for the bundle
- */
- public BundleReference(Object bundle, String bundleName, String bundleVersion, String bundleRelativePath) {
- this.bundle = bundle;
- this.bundleName = bundleName;
- this.bundleVersion = bundleVersion;
- this.bundleRelativePath = bundleRelativePath;
- this.bundleUniqueName = bundleName + "(" + (bundleVersion == null?"0.0.0":bundleVersion) + ")";
- }
-
- /**
- * Constructs a new BundleReference.
- *
- * @param bundleName The bundle name
- * @param bundleVersion The bundle version
- */
- public BundleReference(String bundleName, String bundleVersion) {
- this.bundleName = bundleName;
- this.bundleVersion = bundleVersion;
- this.bundleUniqueName = bundleName + "(" + (bundleVersion == null?"0.0.0":bundleVersion) + ")";
- }
-
- /**
- * Get the referenced bundle.
- *
- * @return The referenced bundle
- */
- public Object getBundle() {
- return bundle;
- }
-
- /**
- * Get the referenced bundle name.
- *
- * @return The bundle name
- */
- public String getBundleName() {
- return bundleName;
- }
-
- /**
- * Get the referenced bundle version.
- *
- * @return The bundle version
- */
- public String getBundleVersion() {
- return bundleVersion;
- }
-
- /**
- * Get the referenced bundle name and version.
- *
- * @return The bundle name
- */
- public String getBundleUniqueName() {
- return bundleUniqueName;
- }
-
- /**
- * Get the relative location of the bundle inside its contribution.
- *
- * @return The bundle path
- */
- public String getBundleRelativePath() {
- return bundleRelativePath;
- }
-
-
-
- /**
- * Returns true if the bundle reference is unresolved.
- *
- * @return Whether or not the bundle has been resolved
- */
- public boolean isUnresolved() {
- return bundle == null;
- }
-
- @Override
- public int hashCode() {
- return bundleUniqueName.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else {
- if (obj instanceof BundleReference) {
- BundleReference ref = (BundleReference)obj;
- return bundleName.equals(ref.bundleName) &&
- (bundleVersion == null || ref.bundleVersion == null ||
- bundleVersion.equals(ref.bundleVersion));
- } else {
- return false;
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionProcessor.java b/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionProcessor.java
deleted file mode 100644
index 5033d7eefc..0000000000
--- a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionProcessor.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.osgi.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-
-import org.apache.tuscany.sca.contribution.PackageType;
-import org.apache.tuscany.sca.contribution.processor.PackageProcessor;
-import org.apache.tuscany.sca.contribution.service.ContributionException;
-import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
-import org.osgi.framework.Bundle;
-
-/**
- * Bundle Contribution package processor.
- *
- * @version $Rev$ $Date$
- */
-public class OSGiBundleContributionProcessor implements PackageProcessor {
-
- public OSGiBundleContributionProcessor() {
- }
-
- public String getPackageType() {
- return PackageType.BUNDLE;
- }
-
- public URL getArtifactURL(URL sourceURL, URI artifact) throws MalformedURLException {
- Bundle bundle = null;
- try {
- bundle = OSGiRuntime.findInstalledBundle(sourceURL);
- if (bundle != null) {
- URL url = bundle.getResource(artifact.getPath());
- if (url == null)
- System.out.println("Could not load resource " + artifact);
- return url;
- }
- } catch (Exception e) {
- }
- return null;
- }
-
- public List<URI> getJarArtifacts(URL packageSourceURL, InputStream inputStream) throws ContributionException,
- IOException {
- if (packageSourceURL == null) {
- throw new IllegalArgumentException("Invalid null package source URL.");
- }
-
- if (inputStream == null) {
- throw new IllegalArgumentException("Invalid null source inputstream.");
- }
-
- // Assume the root is a jar file
- JarInputStream jar = new JarInputStream(inputStream);
- try {
- Set<String> names = new HashSet<String>();
- while (true) {
- JarEntry entry = jar.getNextJarEntry();
- if (entry == null) {
- // EOF
- break;
- }
-
- // FIXME: Maybe we should externalize the filter as a property
- String name = entry.getName();
- if (!name.startsWith(".") && !entry.isDirectory()) {
-
- // Trim trailing /
- if (name.endsWith("/")) {
- name = name.substring(0, name.length() - 1);
- }
-
- // Add the entry name
- if (!names.contains(name) && name.length() > 0) {
- names.add(name);
-
- }
- }
- }
-
- // Return list of URIs
- List<URI> artifacts = new ArrayList<URI>();
- for (String name: names) {
- artifacts.add(URI.create(name));
- }
- return artifacts;
-
- } finally {
- jar.close();
- }
-}
-
- public List<URI> getArtifacts(URL packageSourceURL, InputStream inputStream) throws ContributionException,
- IOException {
-
- Bundle bundle = null;
- try {
- bundle = OSGiRuntime.findInstalledBundle(packageSourceURL);
- } catch (Exception e) {
- }
-
- if (bundle == null) {
- throw new IllegalArgumentException("Could not find OSGi bundle " + packageSourceURL);
- }
-
- if (packageSourceURL == null) {
- throw new IllegalArgumentException("Invalid null package source URL.");
- }
-
- List<URI> artifacts = new ArrayList<URI>();
-
- try {
- Enumeration entries = bundle.findEntries("/", "*", true);
- while (entries.hasMoreElements()) {
- URL entry = (URL)entries.nextElement();
- String entryName = entry.getPath();
- if (entryName.startsWith("/"))
- entryName = entryName.substring(1);
- artifacts.add(new URI(entryName));
-
- if (entryName.endsWith(".jar")) {
-
- URL jarResource = bundle.getResource(entryName);
- artifacts.addAll(getJarArtifacts(jarResource, jarResource.openStream()));
- }
-
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- return artifacts;
- }
-}
diff --git a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleProcessor.java b/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleProcessor.java
deleted file mode 100644
index b3c2302f60..0000000000
--- a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleProcessor.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.contribution.osgi.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.List;
-import java.util.jar.Attributes;
-import java.util.jar.JarInputStream;
-import java.util.jar.Manifest;
-
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.osgi.BundleReference;
-import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
-
-/**
- * OSGi bundle processor
- *
- * @version $Rev$ $Date$
- */
-public class OSGiBundleProcessor {
-
- private boolean initializedOSGi;
- private OSGiRuntime osgiRuntime;
-
- public OSGiBundleProcessor() {
- }
-
- public Object installContributionBundle(Contribution contribution) {
-
- JarInputStream jar = null;
- Object bundle = null;
-
- try {
-
- URL contribURL = new URL(contribution.getLocation());
- jar = new JarInputStream(contribURL.openStream());
-
- Manifest manifest = jar.getManifest();
- if (manifest != null && manifest.getMainAttributes()
- .containsKey(new Attributes.Name("Bundle-SymbolicName"))) {
-
- initialize();
- if (osgiRuntime != null)
- bundle = osgiRuntime.installBundle(contribURL.toString(), null);
- }
- } catch (Exception e) {
- // If OSGi cannot process the jar, treat the bundle as a plain jar file.
- } finally {
-
- try {
- if (jar != null)
- jar.close();
- } catch (IOException e) {
- }
- }
-
- return bundle;
- }
-
- public BundleReference installNestedBundle(Contribution contribution,
- String bundleSymbolicName,
- String bundleVersion) {
-
- BundleReference bundleReference = null;
-
- initialize();
- if (osgiRuntime == null)
- return null;
-
- List<Artifact> artifacts = contribution.getArtifacts();
- for (Artifact a : artifacts) {
- if (a.getURI().endsWith(".jar")) {
-
- InputStream stream;
- JarInputStream jar = null;
- Object name;
- Object version;
- try {
-
- URL artifactURL = new URL(a.getLocation());
- stream = artifactURL.openStream();
- jar = new JarInputStream(artifactURL.openStream());
- Manifest manifest = jar.getManifest();
- name = manifest.getMainAttributes().get(new Attributes.Name("Bundle-SymbolicName"));
- version = manifest.getMainAttributes().get(new Attributes.Name("Bundle-Version"));
-
- if (bundleSymbolicName.equals(name) && (bundleVersion == null || version == null || bundleVersion
- .equals(version))) {
-
- Object bundle = osgiRuntime.installBundle(a.getLocation(), stream);
-
- bundleReference = new BundleReference(bundle, bundleSymbolicName, bundleVersion, a.getURI());
-
- break;
- }
-
- } catch (Exception e) {
-
- // If OSGi cannot process the jar, treat the bundle as a plain jar file.
- } finally {
- try {
- if (jar != null)
- jar.close();
- } catch (IOException e) {
- }
- }
- }
- }
- return bundleReference;
- }
-
- private void initialize() {
- try {
- if (!initializedOSGi) {
- initializedOSGi = true;
- osgiRuntime = OSGiRuntime.getRuntime();
- }
- } catch (Exception e) {
- }
- }
-}
diff --git a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleReferenceModelResolver.java b/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleReferenceModelResolver.java
deleted file mode 100644
index 07e80f66f3..0000000000
--- a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleReferenceModelResolver.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.contribution.osgi.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.osgi.BundleReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
-import org.osgi.framework.Bundle;
-
-/**
- * A Model Resolver for BundleReferences.
- *
- * @version $Rev$ $Date$
- */
-public class OSGiBundleReferenceModelResolver implements ModelResolver {
- private Contribution contribution;
- private Map<String, BundleReference> map = new HashMap<String, BundleReference>();
-
- OSGiRuntime osgiRuntime;
- private OSGiBundleProcessor bundleProcessor;
-
- public OSGiBundleReferenceModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- this.bundleProcessor = new OSGiBundleProcessor();
- }
-
- public void addModel(Object resolved) {
- BundleReference bundleRef = (BundleReference)resolved;
- map.put(bundleRef.getBundleUniqueName(), bundleRef);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(((BundleReference)resolved).getBundleUniqueName());
- }
-
- /**
- * Handle artifact resolution when the specific class reference is imported from another contribution
- * @param unresolved
- * @return
- */
- private BundleReference resolveImportedModel(BundleReference unresolved) {
- BundleReference resolved = unresolved;
-
- if( this.contribution != null) {
- for (Import import_ : this.contribution.getImports()) {
-
- resolved = import_.getModelResolver().resolveModel(BundleReference.class, unresolved);
- if (resolved != unresolved)
- break;
- }
-
- }
- return resolved;
- }
-
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- Object resolved = map.get(unresolved);
-
- if (resolved != null ){
- return modelClass.cast(resolved);
- }
-
- try {
- if (osgiRuntime == null)
- osgiRuntime = OSGiRuntime.getRuntime();
- } catch (Exception e) {
- }
- if (osgiRuntime == null)
- return unresolved;
-
- //Load a class on demand
- Object bundle = null;
- String bundleName = ((BundleReference)unresolved).getBundleName();
- String bundleVersion = ((BundleReference)unresolved).getBundleVersion();
-
- bundle = osgiRuntime.findBundle(bundleName, bundleVersion);
- BundleReference bundleReference;
-
- if (bundle == null)
- bundleReference = bundleProcessor.installNestedBundle(contribution, bundleName, bundleVersion);
- else {
- bundleReference = new BundleReference(bundle,
- ((BundleReference)unresolved).getBundleName(),
- bundleVersion,
- getBundleFileName(bundle)
- );
- }
-
-
- if (bundleReference != null) {
- //if we load the class
-
- map.put(((BundleReference)unresolved).getBundleUniqueName(), bundleReference);
-
- // Return the resolved BundleReference
- return modelClass.cast(bundleReference);
- } else {
- //delegate resolution of the class
- resolved = this.resolveImportedModel((BundleReference)unresolved);
- return modelClass.cast(resolved);
- }
-
-
- }
-
-
- private String getBundleFileName(Object bundle) {
- if (bundle instanceof Bundle) {
- String path = ((Bundle)bundle).getLocation();
- if (path.endsWith("/"))
- path = path.substring(0, path.length()-1);
- if (path.startsWith(contribution.getLocation())) {
- if (path.equals(contribution.getLocation())) {
- int index = path.lastIndexOf('/');
- if (index > 0 && index < path.length()-1)
- path = path.substring(index+1);
- } else {
- path = path.substring(contribution.getLocation().length());
- if (path.startsWith("/"))
- path = path.substring(1);
- }
- } else if (path.lastIndexOf('/') >= 0)
- path = path.substring(path.lastIndexOf('/')+1);
- return path;
- }
- return null;
-
- }
-
-}
diff --git a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiClassReferenceModelResolver.java b/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiClassReferenceModelResolver.java
deleted file mode 100644
index 528a287328..0000000000
--- a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiClassReferenceModelResolver.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.contribution.osgi.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
-import org.osgi.framework.Bundle;
-
-/**
- * A Model Resolver for ClassReferences.
- *
- * @version $Rev$ $Date$
- */
-public class OSGiClassReferenceModelResolver implements ModelResolver {
- private Contribution contribution;
- private Map<String, ClassReference> map = new HashMap<String, ClassReference>();
- private Bundle bundle;
- private boolean initialized;
- private boolean useOSGi;
-
- public OSGiClassReferenceModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- }
-
- 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());
- }
-
- /**
- * Handle artifact resolution when the specific class reference is imported from another contribution
- * @param unresolved
- * @return
- */
- private ClassReference resolveImportedModel(ClassReference unresolved) {
- ClassReference resolved = unresolved;
-
- if (this.contribution != null) {
- for (Import import_ : this.contribution.getImports()) {
-
- if (resolved == unresolved && bundle != null) {
- resolved = import_.getModelResolver().resolveModel(ClassReference.class, unresolved);
- if (resolved != unresolved)
- break;
- }
- }
-
- }
- return resolved;
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- Object resolved = map.get(unresolved);
-
- if (resolved != null) {
- return modelClass.cast(resolved);
- }
- initialize();
- if (!useOSGi)
- return unresolved;
-
- //Load a class on demand
- Class clazz = null;
- if (bundle != null) {
- try {
- clazz = bundle.loadClass(((ClassReference)unresolved).getClassName());
- } catch (Exception e) {
- // we will later try to delegate to imported model resolvers
- }
- }
-
- if (clazz != null) {
- //if we load the class
- // Store a new ClassReference wrapping the loaded class
- ClassReference classReference = new ClassReference(clazz);
- map.put(getPackageName(classReference), classReference);
-
- // Return the resolved ClassReference
- return modelClass.cast(classReference);
- } else {
- //delegate resolution of the class
- resolved = this.resolveImportedModel((ClassReference)unresolved);
- return modelClass.cast(resolved);
- }
-
- }
-
- /***************
- * Helper methods
- ***************/
-
- private String getPackageName(ClassReference clazz) {
- int pos = clazz.getClassName().lastIndexOf(".");
- return clazz.getClassName().substring(0, pos - 1);
- }
-
- private void initialize() {
- if (initialized)
- return;
-
- initialized = true;
- try {
- bundle = OSGiRuntime.findInstalledBundle(contribution.getLocation());
- useOSGi = bundle != null;
- } catch (Throwable e) {
- // Ignore errors, default to ClassReferenceModelResolver
- }
- }
-}
diff --git a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiImportExportListener.java b/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiImportExportListener.java
deleted file mode 100644
index 15ad0bd948..0000000000
--- a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiImportExportListener.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.contribution.osgi.impl;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashSet;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-
-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.JavaExport;
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-import org.apache.tuscany.sca.contribution.service.ContributionListener;
-import org.apache.tuscany.sca.contribution.service.ContributionRepository;
-import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
-
-/**
- * Namespace Import/Export contribution listener
- * The listener would process all import/export from a given contribution
- * and initialize the model resolvers properly
- *
- * @version $Rev$ $Date$
- */
-public class OSGiImportExportListener implements ContributionListener {
-
- private OSGiBundleProcessor bundleProcessor;
-
- public OSGiImportExportListener() {
- bundleProcessor = new OSGiBundleProcessor();
- }
-
- /**
- * Initialize the import/export model resolvers
- * Export model resolvers are same as Contribution model resolver
- * Import model resolvers are matched to a specific contribution if a location URI is specified,
- * otherwise it try to resolve against all the other contributions
- */
- public void contributionAdded(ContributionRepository repository, Contribution contribution) {
-
- OSGiRuntime osgiRuntime = null;
- try {
- if (bundleProcessor.installContributionBundle(contribution) == null) {
- return;
- } else {
- osgiRuntime = OSGiRuntime.getRuntime();
- }
- } catch (Exception e) {
- return;
- }
-
- HashSet<Contribution> bundlesToInstall = new HashSet<Contribution>();
- // Initialize the contribution imports
- for (Import import_ : contribution.getImports()) {
- boolean initialized = false;
-
- if (import_ instanceof JavaImport) {
- JavaImport javaImport = (JavaImport)import_;
- String packageName = javaImport.getPackage();
-
- //Find a matching contribution
- if (javaImport.getLocation() != null) {
- Contribution targetContribution = repository.getContribution(javaImport.getLocation());
- if (targetContribution != null) {
-
- // Find a matching contribution export
- for (Export export : targetContribution.getExports()) {
- if (export instanceof JavaExport) {
- JavaExport javaExport = (JavaExport)export;
- if (packageName.equals(javaExport.getPackage())) {
-
- if (osgiRuntime.findBundle(targetContribution.getLocation()) == null)
- bundlesToInstall.add(targetContribution);
-
- initialized = true;
-
- }
- }
- if (initialized)
- break;
- }
- }
- }
- }
- if (!initialized) {
- for (Contribution c : repository.getContributions()) {
-
- // Go over all exports in the contribution
- for (Export export : c.getExports()) {
- // If the export matches our namespace, try to the resolve the model object
- if (import_.match(export) && osgiRuntime.findBundle(c.getLocation()) == null) {
- bundlesToInstall.add(c);
- }
- }
- }
- }
- }
- for (Contribution c : bundlesToInstall) {
- try {
- installDummyBundle(osgiRuntime, c);
- } catch (Exception e) {
- }
- }
-
- }
-
- public void contributionRemoved(ContributionRepository repository, Contribution contribution) {
-
- }
-
- public void contributionUpdated(ContributionRepository repository,
- Contribution oldContribution,
- Contribution contribution) {
-
- }
-
- private void installDummyBundle(OSGiRuntime osgiRuntime, Contribution contribution) throws Exception {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
-
- String EOL = System.getProperty("line.separator");
-
- String bundleName = contribution.getURI();
- URL contribURL = new URL(contribution.getLocation());
- String contribName = contribURL.getPath();
- if (contribName.endsWith("/"))
- contribName = contribName.substring(0, contribName.length()-1);
- if (contribName.lastIndexOf("/") >= 0)
- contribName = contribName.substring(contribName.lastIndexOf("/")+1);
-
- StringBuffer exportPackageNames = new StringBuffer();
- for (Export export : contribution.getExports()) {
- if (export instanceof JavaExport) {
- if (exportPackageNames.length() > 0)
- exportPackageNames.append(",");
- exportPackageNames.append(((JavaExport)export).getPackage());
- }
- }
- StringBuffer importPackageNames = new StringBuffer();
- for (Import import_ : contribution.getImports()) {
- if (import_ instanceof JavaImport) {
- if (importPackageNames.length() > 0)
- importPackageNames.append(",");
- importPackageNames.append(((JavaImport)import_).getPackage());
- }
- }
-
- String manifestStr =
- "Manifest-Version: 1.0" + EOL
- + "Bundle-ManifestVersion: 2"
- + EOL
- + "Bundle-Name: "
- + bundleName
- + EOL
- + "Bundle-SymbolicName: "
- + bundleName
- + EOL
- + "Bundle-Version: "
- + "1.0.0"
- + EOL
- + "Bundle-Localization: plugin"
- + EOL;
-
- StringBuilder manifestBuf = new StringBuilder();
- manifestBuf.append(manifestStr);
- manifestBuf.append("Export-Package: " + exportPackageNames + EOL);
- manifestBuf.append("Import-Package: " + importPackageNames + EOL);
- manifestBuf.append("Bundle-ClassPath: .," + contribName + EOL);
-
- ByteArrayInputStream manifestStream = new ByteArrayInputStream(manifestBuf.toString().getBytes());
- Manifest manifest = new Manifest();
- manifest.read(manifestStream);
-
- JarOutputStream jarOut = new JarOutputStream(out, manifest);
-
- ZipEntry ze = new ZipEntry(contribName);
- jarOut.putNextEntry(ze);
- InputStream stream = contribURL.openStream();
-
- byte[] bytes = new byte[stream.available()];
- stream.read(bytes);
- jarOut.write(bytes);
- stream.close();
-
- jarOut.close();
- out.close();
-
- ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
-
- osgiRuntime.installBundle("file://" + bundleName + ".jar", in);
-
- }
-
-}
diff --git a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiModelResolverImpl.java b/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiModelResolverImpl.java
deleted file mode 100644
index e624b1d3b5..0000000000
--- a/branches/sca-android/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiModelResolverImpl.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.contribution.osgi.impl;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.osgi.BundleReference;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.osgi.framework.Bundle;
-
-/**
- * An implementation of an artifact resolver for OSGi bundles.
- *
- * @version $Rev$ $Date$
- */
-public class OSGiModelResolverImpl implements ModelResolver {
- private static final long serialVersionUID = -7826976465762296634L;
-
- private Map<Object, Object> map = new HashMap<Object, Object>();
-
- private Hashtable<String, Bundle> bundles;
- public OSGiModelResolverImpl(Hashtable<String, Bundle> bundles) {
- this.bundles = bundles;
- }
-
-
- 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 = null;
- for (Bundle bundle : bundles.values()) {
- try {
- clazz = bundle.loadClass(classReference.getClassName());
- } catch (ClassNotFoundException e) {
- continue;
- }
- break;
- }
- if (clazz == null) {
-
- // 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 if (unresolved instanceof BundleReference) {
- for (String bundlePath: bundles.keySet()) {
- Bundle bundle = bundles.get(bundlePath);
- BundleReference bundleRef = (BundleReference)unresolved;
- String bundleVersion = (String)bundle.getHeaders().get("Bundle-Version");
- if (bundle.getSymbolicName().equals(bundleRef.getBundleName())&&
- (bundleVersion == null || bundleRef.getBundleVersion() == null ||
- bundleVersion.equals(bundleRef.getBundleVersion()))) {
-
- resolved = new BundleReference(bundle,
- bundle.getSymbolicName(),
- bundleVersion,
- bundlePath);
- map.put(resolved, resolved);
-
- // Return the resolved BundleReference
- 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);
- }
-
- public Collection<Object> getModels() {
- return map.values();
- }
-
-}
diff --git a/branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.PackageProcessor b/branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.PackageProcessor
deleted file mode 100644
index 632d135cb5..0000000000
--- a/branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.PackageProcessor
+++ /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.osgi.impl.OSGiBundleContributionProcessor;type=application/osgi.bundle
diff --git a/branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
deleted file mode 100644
index 02e8b411eb..0000000000
--- a/branches/sca-android/modules/contribution-osgi/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.osgi.impl.OSGiBundleReferenceModelResolver;model=org.apache.tuscany.sca.contribution.osgi.BundleReference
diff --git a/branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener b/branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener
deleted file mode 100644
index 8dec190930..0000000000
--- a/branches/sca-android/modules/contribution-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener
+++ /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.osgi.impl.OSGiImportExportListener
diff --git a/branches/sca-android/modules/contribution-resource/META-INF/README b/branches/sca-android/modules/contribution-resource/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/contribution-resource/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/contribution-resource/pom.xml b/branches/sca-android/modules/contribution-resource/pom.xml
deleted file mode 100644
index da19a5249c..0000000000
--- a/branches/sca-android/modules/contribution-resource/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-contribution-resource</artifactId>
- <name>Apache Tuscany SCA Resource Import/Export Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.1</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </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.contribution.resource</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.contribution.resource*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceExport.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceExport.java
deleted file mode 100644
index 0bd30c19dd..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceExport.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.resource;
-
-import org.apache.tuscany.sca.contribution.Export;
-
-
-/**
- * The representation of an resource export.
- *
- * @version $Rev$ $Date$
- */
-public interface ResourceExport extends Export {
-
- /**
- * Get Resource URI that identifies the export.
- *
- * @return The exported resource URI
- */
- String getURI();
-
- /**
- * Set Resource URI that identifies the export.
- *
- * @param uri The exported resource URI
- */
- void setURI(String uri);
-
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImport.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImport.java
deleted file mode 100644
index 07eac9d843..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImport.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.resource;
-
-import org.apache.tuscany.sca.contribution.Import;
-
-/**
- * The representation of an resource import.
- *
- * @version $Rev$ $Date$
- */
-public interface ResourceImport 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 URI that identifies the resource import
- *
- * @return The URI
- */
- String getURI();
-
- /**
- * Set URI that identifies the resource import
- *
- * @param uri The resource URI
- */
- void setURI(String uri);
-
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImportExportFactory.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImportExportFactory.java
deleted file mode 100644
index 4119c344ce..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImportExportFactory.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.resource;
-
-/**
- * Base Resource import/export model factory
- *
- * @version $Rev$ $Date$
- */
-public interface ResourceImportExportFactory {
-
- /**
- * Create a resource import model object
- *
- * @return The new ResourceImport model object
- */
- ResourceImport createResourceImport();
-
- /**
- * Create a resource export model object
- *
- * @return The new ResourceExport model object
- */
- ResourceExport createResourceExport();
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ArtifactModelResolver.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ArtifactModelResolver.java
deleted file mode 100644
index e614b47fc7..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ArtifactModelResolver.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.resource.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resource.ResourceImport;
-
-/**
- * A Model Resolver for contribution artifacts.
- *
- * @version $Rev$ $Date$
- */
-public class ArtifactModelResolver implements ModelResolver {
- private Contribution contribution;
- private Map<String, Artifact> map = new HashMap<String, Artifact>();
-
- public ArtifactModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- }
-
- public void addModel(Object resolved) {
- Artifact artifact = (Artifact)resolved;
- map.put(artifact.getURI(), artifact);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(((Artifact)resolved).getURI());
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
-
- // Get the artifact URI
- String uri = ((Artifact)unresolved).getURI();
- if (uri == null) {
- return (T)unresolved;
- }
-
- // Lookup the artifact
- Artifact resolved = (Artifact) 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 resource imports)
- for (Import import_ : this.contribution.getImports()) {
- if (import_ instanceof ResourceImport) {
- ResourceImport resourceImport = (ResourceImport)import_;
- //check the import location against the computed package name from the componentType URI
- if (resourceImport.getURI().equals(uri)) {
- // Delegate the resolution to the import resolver
- resolved = resourceImport.getModelResolver().resolveModel(Artifact.class, (Artifact)unresolved);
- if (!resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- }
- }
-
- return (T)unresolved;
- }
-
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportImpl.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportImpl.java
deleted file mode 100644
index c2d525dfef..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportImpl.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.resource.impl;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resource.ResourceExport;
-
-/**
- * The representation of an export for the contribution
- *
- * @version $Rev$ $Date$
- */
-public class ResourceExportImpl implements ResourceExport {
- /**
- * The resource URI to be exported
- */
- private String uri;
-
- private ModelResolver modelResolver;
-
- protected ResourceExportImpl() {
- super();
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportModelResolver.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportModelResolver.java
deleted file mode 100644
index fd568e533d..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportModelResolver.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.contribution.resource.impl;
-
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resource.ResourceExport;
-
-/**
- * A model resolver for resource exports.
- *
- * @version $Rev$ $Date$
- */
-public class ResourceExportModelResolver implements ModelResolver {
-
- private ResourceExport export;
- private ModelResolver resolver;
-
- public ResourceExportModelResolver(ResourceExport 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) {
-
- // Filter based on the artifact URI
- Artifact artifact = (Artifact)unresolved;
- if (export.getURI().equals(artifact.getURI())) {
-
- // The artifact URI matches the exported URI, delegate to the
- // contribution's resolver
- return resolver.resolveModel(modelClass, unresolved);
- } else {
-
- // The artifact URI is not exported, return the unresolved object
- return unresolved;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java
deleted file mode 100644
index 68d5d4761e..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.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.contribution.resource.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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resource.ResourceExport;
-import org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Artifact processor for Resource export
- *
- * @version $Rev$ $Date$
- */
-public class ResourceExportProcessor implements StAXArtifactProcessor<ResourceExport> {
-
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- private static final QName EXPORT_RESOURCE = new QName(SCA10_NS, "export.resource");
- private static final String URI = "uri";
-
- private final ResourceImportExportFactory factory;
- private final Monitor monitor;
-
- public ResourceExportProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.factory = modelFactories.getFactory(ResourceImportExportFactory.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 = new ProblemImpl(this.getClass().getName(), "contribution-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return EXPORT_RESOURCE;
- }
-
- public Class<ResourceExport> getModelType() {
- return ResourceExport.class;
- }
-
- /**
- * Process <export.resource uri=""/>
- */
- public ResourceExport read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- ResourceExport resourceExport = this.factory.createResourceExport();
- QName element = null;
-
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- element = reader.getName();
-
- // Read <export.resource>
- if (EXPORT_RESOURCE.equals(element)) {
- String uri = reader.getAttributeValue(null, URI);
- if (uri == null) {
- error("AttributeURIMissing", reader);
- //throw new ContributionReadException("Attribute 'uri' is missing");
- } else
- resourceExport.setURI(uri);
- }
-
- break;
- case XMLStreamConstants.END_ELEMENT:
- if (EXPORT_RESOURCE.equals(reader.getName())) {
- return resourceExport;
- }
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
-
- return resourceExport;
- }
-
- public void write(ResourceExport resourceExport, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <export.resource>
- writer.writeStartElement(EXPORT_RESOURCE.getNamespaceURI(), EXPORT_RESOURCE.getLocalPart());
-
- if (resourceExport.getURI() != null) {
- writer.writeAttribute(URI, resourceExport.getURI());
- }
-
- writer.writeEndElement();
- }
-
- public void resolve(ResourceExport resourceExport, ModelResolver resolver) throws ContributionResolveException {
-
- if (resourceExport.getURI() != null)
- // Initialize the export's model resolver
- resourceExport.setModelResolver(new ResourceExportModelResolver(resourceExport, resolver));
- }
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportFactoryImpl.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportFactoryImpl.java
deleted file mode 100644
index 880f5f5786..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportFactoryImpl.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.resource.impl;
-
-import org.apache.tuscany.sca.contribution.resource.ResourceExport;
-import org.apache.tuscany.sca.contribution.resource.ResourceImport;
-import org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory;
-
-/**
- * Resource Import/Export model factory implementation
- *
- * @version $Rev$ $Date$
- */
-public class ResourceImportExportFactoryImpl implements ResourceImportExportFactory {
-
- public ResourceImport createResourceImport() {
- return new ResourceImportImpl();
- }
-
- public ResourceExport createResourceExport() {
- return new ResourceExportImpl();
- }
-
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportListener.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportListener.java
deleted file mode 100644
index e7aecad786..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportListener.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resource.impl;
-
-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.DefaultImportAllModelResolver;
-import org.apache.tuscany.sca.contribution.resource.ResourceExport;
-import org.apache.tuscany.sca.contribution.resource.ResourceImport;
-import org.apache.tuscany.sca.contribution.service.ContributionListener;
-import org.apache.tuscany.sca.contribution.service.ContributionRepository;
-
-/**
- * Resource Import/Export contribution listener
- * The listener would process all import/export from a given contribution
- * and initialize the model resolvers properly
- *
- * @version $Rev$ $Date$
- */
-public class ResourceImportExportListener implements ContributionListener {
-
- /**
- * Initialize the import/export model resolvers
- * Export model resolvers are same as Contribution model resolver
- * Import model resolvers are matched to a specific contribution if a location URI is specified,
- * otherwise it try to resolve against all the other contributions
- * Also set the exporting contributions used by contribution ClassLoaders to
- * match import/export for class loading.
- */
- public void contributionAdded(ContributionRepository repository, Contribution contribution) {
- // Initialize the contribution exports
- for (Export export: contribution.getExports()) {
- export.setModelResolver(contribution.getModelResolver());
- }
-
- // Initialize the contribution imports
- for (Import import_: contribution.getImports()) {
- boolean initialized = false;
-
- if (import_ instanceof ResourceImport) {
- ResourceImport resourceImport = (ResourceImport)import_;
-
- // Find a matching contribution
- if (resourceImport.getLocation() != null) {
- Contribution targetContribution = repository.getContribution(resourceImport.getLocation());
- if (targetContribution != null) {
-
- // Find a matching contribution export
- for (Export export: targetContribution.getExports()) {
- if (export instanceof ResourceExport) {
- ResourceExport resourceExport = (ResourceExport)export;
- if (resourceImport.getURI().equals(resourceExport.getURI())) {
- resourceImport.setModelResolver(resourceExport.getModelResolver());
- initialized = true;
- break;
- }
- }
- }
- }
- }
-
- //if no location was specified, try to resolve with any contribution
- if( !initialized ) {
- // Use a resolver that will consider all contributions
- import_.setModelResolver(new DefaultImportAllModelResolver(import_, repository.getContributions()));
- }
- }
- }
- }
-
- public void contributionRemoved(ContributionRepository repository, Contribution contribution) {
-
- }
-
- public void contributionUpdated(ContributionRepository repository, Contribution oldContribution, Contribution contribution) {
-
- }
-
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportImpl.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportImpl.java
deleted file mode 100644
index cd33f1290f..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportImpl.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.resource.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.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resource.ResourceExport;
-import org.apache.tuscany.sca.contribution.resource.ResourceImport;
-
-/**
- * The representation of an import for the contribution
- *
- * @version $Rev$ $Date$
- */
-public class ResourceImportImpl implements ResourceImport {
- /**
- * The resource URI to be imported
- */
- private String uri;
-
- private ModelResolver modelResolver;
- private List<Contribution> exportContributions;
-
- /**
- * Optional location URI pointing to a Contribution that exports the resource
- */
- private String location;
-
-
- protected ResourceImportImpl() {
- super();
- }
-
- 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 ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
- public List<Contribution> getExportContributions() {
- return exportContributions;
- }
-
- public void setExportContributions(List<Contribution> contributions) {
- this.exportContributions = contributions;
- }
-
- /**
- * Match a ResourceImport to a given ResourceExport based on :
- * location is not provided
- * import and export resource URI match
- */
- public boolean match(Export export) {
- if (export instanceof ResourceExport) {
- if (this.getLocation() == null || this.getLocation().length() == 0) {
- if (this.getURI().equals(((ResourceExport)export).getURI())) {
- return true;
- }
- }
-
- }
- return false;
- }
-
- @Override
- public String toString() {
- return String.valueOf(uri);
- }
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java b/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java
deleted file mode 100644
index 8b2fc44a1c..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.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.resource.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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resource.ResourceImport;
-import org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.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 ResourceImportProcessor implements StAXArtifactProcessor<ResourceImport> {
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
-
- private static final QName IMPORT_RESOURCE = new QName(SCA10_NS, "import.resource");
-
- private static final String URI = "uri";
- private static final String LOCATION = "location";
-
- private final ResourceImportExportFactory factory;
- private final Monitor monitor;
-
- public ResourceImportProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.factory = modelFactories.getFactory(ResourceImportExportFactory.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 = new ProblemImpl(this.getClass().getName(), "contribution-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return IMPORT_RESOURCE;
- }
-
- public Class<ResourceImport> getModelType() {
- return ResourceImport.class;
- }
-
- /**
- * Process <import.resource uri="" location=""/>
- */
- public ResourceImport read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- ResourceImport resourceImport = this.factory.createResourceImport();
- QName element;
-
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- element = reader.getName();
-
- // Read <import>
- if (IMPORT_RESOURCE.equals(element)) {
- String uri = reader.getAttributeValue(null, URI);
- if (uri == null) {
- error("AttributeURIMissing", reader);
- //throw new ContributionReadException("Attribute 'uri' is missing");
- } else
- resourceImport.setURI(uri);
-
- String location = reader.getAttributeValue(null, LOCATION);
- if (location != null) {
- resourceImport.setLocation(location);
- }
- }
- break;
- case XMLStreamConstants.END_ELEMENT:
- if (IMPORT_RESOURCE.equals(reader.getName())) {
- return resourceImport;
- }
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
-
- return resourceImport;
- }
-
- public void write(ResourceImport resourceImport, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <import>
- writer.writeStartElement(IMPORT_RESOURCE.getNamespaceURI(), IMPORT_RESOURCE.getLocalPart());
-
- if (resourceImport.getURI() != null) {
- writer.writeAttribute(URI, resourceImport.getURI());
- }
- if (resourceImport.getLocation() != null) {
- writer.writeAttribute(LOCATION, resourceImport.getLocation());
- }
-
- writer.writeEndElement();
- }
-
-
- public void resolve(ResourceImport model, ModelResolver resolver) throws ContributionResolveException {
- }
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 14eb81546d..0000000000
--- a/branches/sca-android/modules/contribution-resource/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.resource.impl.ResourceImportProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#import.resource,model=org.apache.tuscany.sca.contribution.resource.ResourceImport
-org.apache.tuscany.sca.contribution.resource.impl.ResourceExportProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#export.resource,model=org.apache.tuscany.sca.contribution.resource.ResourceExport
diff --git a/branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
deleted file mode 100644
index 08d2b1c338..0000000000
--- a/branches/sca-android/modules/contribution-resource/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.resource.impl.ArtifactModelResolver;model=org.apache.tuscany.sca.contribution.Artifact \ No newline at end of file
diff --git a/branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory b/branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory
deleted file mode 100644
index d39a5065c2..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory
+++ /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.resource.impl.ResourceImportExportFactoryImpl
diff --git a/branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener b/branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener
deleted file mode 100644
index f4751db9aa..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener
+++ /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.resource.impl.ResourceImportExportListener
diff --git a/branches/sca-android/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties b/branches/sca-android/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties
deleted file mode 100644
index 58ee8153f8..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/main/resources/contribution-resource-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.
-#
-#
-AttributeURIMissing = Attribute 'uri' is missing
-
diff --git a/branches/sca-android/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java b/branches/sca-android/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java
deleted file mode 100644
index ea44cb506b..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resource.impl;
-
-
-import java.io.StringReader;
-
-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.contribution.resource.ResourceExport;
-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.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorFactoryImpl;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
-
-/**
- * Test NamespaceExportProcessorTestCase
- *
- * @version $Rev$ $Date$
- */
-public class ResourceExportProcessorTestCase extends TestCase {
-
- private static final String VALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<export.resource xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\" uri=\"helloworld/HelloWorldService.componentType\"/>";
-
- private static final String INVALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<export.resource xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\"/>";
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private Monitor monitor;
-
- @Override
- protected void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();
- 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
- */
- public void testLoad() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
- ResourceExport resourceExport = (ResourceExport)staxProcessor.read(reader);
- assertEquals("helloworld/HelloWorldService.componentType", resourceExport.getURI());
- }
-
- /**
- * Test loading an INVALID export element from a contribution metadata stream
- * @throws Exception
- */
- 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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
- assertNotNull(problem);
- assertEquals("AttributeURIMissing", problem.getMessageId());
- }
-}
diff --git a/branches/sca-android/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java b/branches/sca-android/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java
deleted file mode 100644
index 1ff931c162..0000000000
--- a/branches/sca-android/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.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.resource.impl;
-
-
-
-import java.io.StringReader;
-
-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.contribution.resource.ResourceImport;
-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.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorFactoryImpl;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
-
-/**
- * Test NamespaceImportProcessorTestCase
- *
- * @version $Rev$ $Date$
- */
-public class ResourceImportProcessorTestCase extends TestCase {
-
- private static final String VALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<import.resource xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\" uri=\"helloworld/HelloWorldService.componentType\" location=\"sca://contributions/001\"/>";
-
- private static final String INVALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<import.resource xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\" location=\"sca://contributions/001\"/>";
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private Monitor monitor;
-
- @Override
- protected void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();
- 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
- */
- public void testLoad() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
- ResourceImport namespaceImport = (ResourceImport)staxProcessor.read(reader);
- assertEquals("helloworld/HelloWorldService.componentType", namespaceImport.getURI());
- assertEquals("sca://contributions/001", namespaceImport.getLocation());
- }
-
- /**
- * Test loading a INVALID import element from a contribution metadata stream
- * @throws Exception
- */
- 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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
- assertNotNull(problem);
- assertEquals("AttributeURIMissing", problem.getMessageId());
- }
-}
diff --git a/branches/sca-android/modules/data-api/LICENSE b/branches/sca-android/modules/data-api/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/data-api/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/data-api/META-INF/README b/branches/sca-android/modules/data-api/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/data-api/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/data-api/NOTICE b/branches/sca-android/modules/data-api/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/data-api/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/branches/sca-android/modules/data-api/pom.xml b/branches/sca-android/modules/data-api/pom.xml
deleted file mode 100644
index 04b259a69a..0000000000
--- a/branches/sca-android/modules/data-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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-data-api</artifactId>
- <name>Apache Tuscany SCA Data API</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.data.api</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.data*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Collection.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Collection.java
deleted file mode 100644
index f559d5d914..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Collection.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.data.collection;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Provides access to a collection of data items.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface Collection <K, D> {
-
- /**
- * Get the whole collection.
- *
- * @return the whole collection.
- */
- Entry<K, D>[] getAll();
-
- /**
- * Returns a collection resulting from a query.
- *
- * @return the collection.
- */
- Entry<K, D>[] query(String queryString);
-
- /**
- * Creates a new item.
- *
- * @param key
- * @param item
- * @return
- */
- K post(K key, D item);
-
- /**
- * Retrieves an item.
- *
- * @param key
- * @return
- */
- D get(K key) throws NotFoundException;
-
- /**
- * Updates an item.
- *
- * @param key
- * @param item
- * @return
- */
- void put(K key, D item) throws NotFoundException;
-
- /**
- * Delete an item.
- *
- * @param key
- */
- void delete(K key) throws NotFoundException;
-
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Entry.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Entry.java
deleted file mode 100644
index 5903fd95a4..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Entry.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.data.collection;
-
-
-/**
- * Represents a key/data pair in a data collection.
- *
- * @version $Rev$ $Date$
- */
-public class Entry <K, D> {
-
- private K key;
- private D data;
-
- /**
- * Constructs a new entry.
- */
- public Entry() {
- }
-
- /**
- * Constructs a new entry.
- * @param key the entry key
- * @param data the entry data
- */
- public Entry(K key, D data) {
- this.key = key;
- this.data = data;
- }
-
- /**
- * Returns the entry key.
- * @return the key
- */
- public K getKey() {
- return key;
- }
-
- /**
- * Sets the entry key.
- * @param key the key
- */
- public void setKey(K key) {
- this.key = key;
- }
-
- /**
- * Returns the entry data.
- * @return the entry data
- */
- public D getData() {
- return data;
- }
-
- /**
- * Sets the entry data
- * @param data the entry data
- */
- public void setData(D data) {
- this.data = data;
- }
-
- //FIXME Temporary methods to make JAXB register the Item
- // class when the Entry class is registered in a JAXB context
- public void setDummy(Item item) {}
- public Item getDummy() { return null; }
-
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Item.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Item.java
deleted file mode 100644
index 37042c0895..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/Item.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.data.collection;
-
-import java.util.Date;
-
-
-/**
- * Represents a data item.
- *
- * @version $Rev$ $Date$
- */
-public class Item {
-
- private String title;
- private String contents;
- private String link;
- private String related;
- private String alternate;
- private Date date;
-
- /**
- * Constructs a new item.
- */
- public Item() {
- }
-
- /**
- * Constructs a new item.
- * @param title the item title
- * @param contents the item contents
- * @param link the item link to a web resource
- * @param related the item link to a related web resource
- * @param date the item date
- */
- public Item(String title, String contents, String link, String related, Date date) {
- this.title = title;
- this.contents = contents;
- this.link = link;
- this.related = related;
- this.date = date;
- }
-
- /**
- * Returns the item title.
- * @return the item title
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * Sets the item title.
- * @param title the item title
- */
- public void setTitle(String title) {
- this.title = title;
- }
-
- /**
- * Returns the item contents
- * @return the item contents
- */
- public String getContents() {
- return contents;
- }
-
- /**
- * Sets the item contents
- * @param contents the item contents
- */
- public void setContents(String contents) {
- this.contents = contents;
- }
-
- /**
- * Returns the item link to a web resource
- * @return the item link to a web resource
- */
- public String getLink() {
- return link;
- }
-
- /**
- * Sets the item link to a web resource
- * @param link the item link to a web resource
- */
- public void setLink(String link) {
- this.link = link;
- }
-
- /**
- * Returns the item link to a related web resource
- * @return the item link to a related web resource
- */
- public String getRelated() {
- return related;
- }
-
- /**
- * Sets the item link to a related web resource.
- *
- * @param related the item link to a related web resource
- */
- public void setRelated(String related) {
- this.related = related;
- }
-
- /**
- * Returns the item link to an alternate web resource
- * @return the item link to an alternate web resource
- */
- public String getAlternate() {
- return alternate;
- }
-
- /**
- * Sets the item link to an alternate web resource.
- *
- * @param alternate the item link to an alternate web resource
- */
- public void setAlternate(String alternate) {
- this.alternate = alternate;
- }
-
- /**
- * Returns the item date
- * @return the item date
- */
- public Date getDate() {
- return date;
- }
-
- /**
- * Sets the item date
- * @param date the item date
- */
- public void setDate(Date date) {
- this.date = date;
- }
-
-
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/ItemCollection.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/ItemCollection.java
deleted file mode 100644
index c30bbc771a..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/ItemCollection.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.data.collection;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Provides access to a collection of data items.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface ItemCollection extends Collection<String, Item> {
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/LocalItemCollection.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/LocalItemCollection.java
deleted file mode 100644
index 69512058b7..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/LocalItemCollection.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.data.collection;
-
-
-/**
- * Provides access to a collection of data items.
- *
- * @version $Rev$ $Date$
- */
-public interface LocalItemCollection extends Collection<String, Item> {
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/NotFoundException.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/NotFoundException.java
deleted file mode 100644
index 7f13db5228..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/data/collection/NotFoundException.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.data.collection;
-
-/**
- * Indicates that an item could not be found in a collection.
- *
- * @version $Rev$ $Date$
- */
-public class NotFoundException extends Exception {
- private static final long serialVersionUID = 6792367409396084646L;
-
- public NotFoundException() {
- }
-
- public NotFoundException(String message) {
- super(message);
- }
-
- public NotFoundException(Throwable cause) {
- super(cause);
- }
-
- public NotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.java
deleted file mode 100644
index c2332ae2c9..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.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.implementation.data.collection;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Provides access to a collection of data items.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-@Deprecated
-public interface Collection <K, D> extends org.apache.tuscany.sca.data.collection.Collection<K, D> {
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Entry.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Entry.java
deleted file mode 100644
index a0d232a201..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Entry.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.implementation.data.collection;
-
-
-/**
- * Represents a key/data pair in a data collection.
- *
- * @version $Rev$ $Date$
- */
-@Deprecated
-public class Entry <K, D> extends org.apache.tuscany.sca.data.collection.Entry<K, D> {
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Item.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Item.java
deleted file mode 100644
index 77d8173521..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Item.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.implementation.data.collection;
-
-
-
-/**
- * Represents a data item.
- *
- * @version $Rev$ $Date$
- */
-@Deprecated
-public class Item extends org.apache.tuscany.sca.data.collection.Item {
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/ItemCollection.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/ItemCollection.java
deleted file mode 100644
index 757152725d..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/ItemCollection.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.implementation.data.collection;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Provides access to a collection of data items.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-@Deprecated
-public interface ItemCollection extends Collection<String, Item> {
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/LocalItemCollection.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/LocalItemCollection.java
deleted file mode 100644
index 047ab8829e..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/LocalItemCollection.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.implementation.data.collection;
-
-
-/**
- * Provides access to a collection of data items.
- *
- * @version $Rev$ $Date$
- */
-@Deprecated
-public interface LocalItemCollection extends Collection<String, Item> {
-}
diff --git a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.java b/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.java
deleted file mode 100644
index ed71471d9e..0000000000
--- a/branches/sca-android/modules/data-api/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.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.implementation.data.collection;
-
-/**
- * Indicates that an item could not be found in a collection.
- *
- * @version $Rev$ $Date$
- */
-@Deprecated
-public class NotFoundException extends org.apache.tuscany.sca.data.collection.NotFoundException {
- private static final long serialVersionUID = 2812975065056330240L;
-}
diff --git a/branches/sca-android/modules/data-engine-helper/LICENSE b/branches/sca-android/modules/data-engine-helper/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/data-engine-helper/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/data-engine-helper/META-INF/README b/branches/sca-android/modules/data-engine-helper/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/data-engine-helper/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/data-engine-helper/NOTICE b/branches/sca-android/modules/data-engine-helper/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/data-engine-helper/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/branches/sca-android/modules/data-engine-helper/pom.xml b/branches/sca-android/modules/data-engine-helper/pom.xml
deleted file mode 100644
index c8a4689650..0000000000
--- a/branches/sca-android/modules/data-engine-helper/pom.xml
+++ /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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-data-engine-helper</artifactId>
- <name>Apache Tuscany SCA Data Engine Helper</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.das</groupId>
- <artifactId>tuscany-das-rdb</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.3.1.4</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
- <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.data.engine.helper</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.data.engine*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/ConnectionInfoArtifactProcessor.java b/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/ConnectionInfoArtifactProcessor.java
deleted file mode 100644
index 99709857b8..0000000000
--- a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/ConnectionInfoArtifactProcessor.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.data.engine;
-
-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.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-import org.apache.tuscany.sca.data.engine.config.ConnectionProperties;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Implements a StAX artifact processor for ConnectionInfo.
- * This processor is shared between implementation.das and implementation.data component type implementations,
- * and can be used for other applications that require database connectivity information.
- *
- * The artifact processor is responsible for processing <ConnectionInfo>
- * elements in SCA assembly XML composite files.
- *
- * @version $Rev$ $Date$
- */
-public class ConnectionInfoArtifactProcessor implements StAXArtifactProcessor<ConnectionInfo> {
- public static final QName CONNECTION_INFO = new QName(Constants.SCA10_TUSCANY_NS, "connectionInfo");
- private static final QName CONNECTION_PROPERTIES = new QName(Constants.SCA10_TUSCANY_NS, "connectionProperties");
-
- private Monitor monitor;
- public ConnectionInfoArtifactProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.monitor = monitor;
- }
-
- public QName getArtifactType() {
- // Returns the QName of the XML element processed by this processor
- return CONNECTION_INFO;
- }
-
- /**
- * Report a exception.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "dataengine-helper-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- public Class<ConnectionInfo> getModelType() {
- // Returns the type of model processed by this processor
- return ConnectionInfo.class;
- }
-
- /*
- * <component name="CompanyDataComponent">
- * <implementation.data table="company">
- *
- * <connectionInfo>
- * <connectionProperties
- * driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- * databaseURL="jdbc:derby:target/test-classes/dastest; create = true"
- * loginTimeout="600000"/>
- * </connectionInfo>
- *
- * </implementation.data>
- * </component>
- */
- public ConnectionInfo read(XMLStreamReader reader) throws ContributionReadException {
- assert CONNECTION_INFO.equals(reader.getName());
-
- // Create a ConnectionInfo from the component type model
- ConnectionInfo connectionInfo = new ConnectionInfo();
-
- /*
- * <connectionInfo dataSource="jdbc:derby:target/test-classes/dastest; create = true"/>
- */
- String dataSource = reader.getAttributeValue(null, "datasource"); // exclusive with connection properties
- if (dataSource != null && dataSource.length() > 0) {
- connectionInfo.setDataSource(dataSource);
- } else {
- try {
- int event = reader.next();
- while (event == XMLStreamConstants.CHARACTERS) {
- event = reader.next();
- }
- } catch (XMLStreamException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", reader, ce);
- throw ce;
- }
-
- QName element = reader.getName();
-
- assert CONNECTION_PROPERTIES.equals(element);
-
- /*
- * <connectionProperties
- * driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- * databaseURL="jdbc:derby:target/test-classes/dastest; create = true"
- * username=""
- * password=""
- * loginTimeout="600000"/>
- */
-
- String driverClass = reader.getAttributeValue(null, "driverClass");
- String databaseURL = reader.getAttributeValue(null, "databaseURL");
- String username = reader.getAttributeValue(null, "username");
- String password = reader.getAttributeValue(null, "password");
- String loginTimeout = reader.getAttributeValue(null, "loginTimeout");
-
- // FIXME: validation sending info to monitor....
- ConnectionProperties connectionProperties = new ConnectionProperties();
- connectionProperties.setDriverClass(driverClass);
- connectionProperties.setDatabaseURL(databaseURL);
- connectionProperties.setUsername(username);
- connectionProperties.setPassword(password);
- if (loginTimeout != null) {
- connectionProperties.setLoginTimeout(Integer.parseInt(loginTimeout));
- }
-
- connectionInfo.setConnectionProperties(connectionProperties);
- }
-
- return connectionInfo;
- }
-
- public void resolve(ConnectionInfo impl, ModelResolver resolver) throws ContributionResolveException {
-
- }
-
- public void write(ConnectionInfo connectionInfo, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- writer.writeStartElement(CONNECTION_INFO.getNamespaceURI(), CONNECTION_INFO.getLocalPart());
-
- if (connectionInfo.getDataSource() != null) {
- writer.writeAttribute("dataSource", connectionInfo.getDataSource());
- }
-
- ConnectionProperties connectionProperties = connectionInfo.getConnectionProperties();
- if (connectionProperties != null) {
- writer.writeStartElement(CONNECTION_PROPERTIES.getNamespaceURI(), CONNECTION_PROPERTIES.getLocalPart());
-
- if (connectionProperties.getDriverClass() != null) {
- writer.writeAttribute("driverClass", connectionProperties.getDriverClass());
- }
- if (connectionProperties.getDatabaseURL() != null) {
- writer.writeAttribute("databaseURL", connectionProperties.getDatabaseURL());
- }
- if (connectionProperties.getUsername() != null) {
- writer.writeAttribute("username", connectionProperties.getUsername());
- }
- if (connectionProperties.getPassword() != null) {
- writer.writeAttribute("password", connectionProperties.getPassword());
- }
- if (connectionProperties.getLoginTimeout() != null) {
- writer.writeAttribute("loginTimeout", String.valueOf(connectionProperties.getLoginTimeout()));
- }
-
- writer.writeEndElement();
- }
-
-
- writer.writeEndElement();
-
- }
-}
diff --git a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/DataAccessEngine.java b/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/DataAccessEngine.java
deleted file mode 100644
index aef9ac3261..0000000000
--- a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/DataAccessEngine.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.data.engine;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.das.rdb.Command;
-import org.apache.tuscany.das.rdb.DAS;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Property;
-
-/**
- * Facade to hide DAS implementation details of handling commands
- *
- * @version $Rev$ $Date$
- */
-public class DataAccessEngine {
- private final DAS das;
-
- public DataAccessEngine(DAS das) {
- this.das = das;
- }
-
- public DataObject executeGet(ArrayList keyVals, String table, String key) {//TODO need to consider compound keys
- try {
- String sqlQuery = "select * from " + table.toUpperCase();
- List<String> keys = null;
-
- if(key == null) {
- if(keyVals != null && keyVals.size() == 1) {
- sqlQuery += " where ID = " + keyVals.get(0);
- }
- } else {//can be other than ID , can be compound keys
- keys = getKeys(key);
- if(keyVals.size() != keys.size()) {
- throw new RuntimeException("One or more PK values missing");
- }
-
- sqlQuery += " where ";
-
- for(int i=0; i<keys.size(); i++) {
- sqlQuery += keys.get(i)+" = ? AND ";
- }
-
- sqlQuery = sqlQuery.substring(0, sqlQuery.lastIndexOf(" AND "));
- }
-
- Command command = this.das.createCommand(sqlQuery);
-
- if(key != null) {
- for(int i=1; i<=keyVals.size(); i++) {
- command.setParameter(i, keyVals.get(i-1));
- }
- }
-
- DataObject returnDO = command.executeQuery();
- return returnDO;
- } catch (Exception e) {
- //e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
-
- /**
- *
- * @param table table'e Type name - should be same as table name
- * @param key column's Property name - should be same as column name
- * @return
- */
- public Map<Object, DataObject> executeGetAll(String table, String key) {
- try {
- String sqlQuery = "select * from " + table.toUpperCase();
- Command command = this.das.createCommand(sqlQuery);
- DataObject result = command.executeQuery();
- List<String> keys = getKeys(key);
- List<DataObject> resultDataObjects = result.getList(table);
-
- return getMappedDataObjects(resultDataObjects, keys);
- } catch (Exception e) {
- //e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
-
- public Map<Object, DataObject> executeQuery(String queryString, String table, String key) {
- try {
- Command command = this.das.createCommand(queryString);
- DataObject result = command.executeQuery();
- List<String> keys = getKeys(key);
- List<DataObject> resultDataObjects = result.getList(table);
-
- return getMappedDataObjects(resultDataObjects, keys);
- } catch (Exception e) {
- //e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
-
- //origDataObject should be with change summary. table, pk is already known to DAS, so no need to have these here
- public void executePut(DataObject origDataObject) {
- this.das.applyChanges(origDataObject);
- return;
- }
-
- //return PK/s
- public ArrayList executePost(DataObject origDataObject, String table, String key){
- //TODO check that PKs are present before insert - this is not correct for auto incr PKs, so let it be upto user whether to send PK or not
- /*List<String> keys = getKeys(key);
- for(int i=0; i<keys.size(); i++) {
- String currentKey = keys.get(i);
- Object currentKeyValue = origDataObject.get(currentKey);
- if(currentKeyValue == null) {
- throw new RuntimeException("PK missing during INSERT");
- }
- }*/
-
- String sqlString = "insert into "+table+" (";
- List props = origDataObject.getType().getProperties();
- if(props.size() != 0) {
- for(int i=0; i<props.size(); i++) {
- String currPropName = ((Property)props.get(i)).getName();
- if(origDataObject.get(currPropName) != null) {
- sqlString += currPropName+",";
- }
- }
- sqlString = sqlString.substring(0, sqlString.length()-1);
- sqlString += ") values (";
- for(int i=0; i<props.size(); i++) {
- String currPropName = ((Property)props.get(i)).getName();
- if(origDataObject.get(currPropName) != null) {
- sqlString += "?,";
- }
- }
-
- sqlString = sqlString.substring(0, sqlString.length()-1);
- sqlString += ")";
-
- Command insertCommand = this.das.createCommand(sqlString);
- int paramIdx = 1;
- for(int i=1; i<=props.size(); i++) {
- String currPropName = ((Property)props.get(i-1)).getName();
- if(origDataObject.get(currPropName) != null) {
- insertCommand.setParameter(paramIdx, origDataObject.get(currPropName));
- paramIdx++;
- }
- }
-
- insertCommand.execute();
-
- //there can be different possibilities
- //1- there is autogen key - insertCommand.getGeneratedKey() will return value and not exception
- //2- there is no autogen key - insertCommand.getGeneratedKey() will return exception and value needs to be taken from origDataObject
- //for 2 it is straight forward to know the column name same as property name
- //for 1 it is possible for only 1 column so no question of compound PK
-
- //now get the PK/s to be returned
- ArrayList pks = new ArrayList();
-
- try {
- int newId = insertCommand.getGeneratedKey();
- pks.add(newId);
- return pks;
- } catch(Exception e) {
- List<String> keys = getKeys(key);
- for(int i=0; i<keys.size(); i++) {
- String currentKey = keys.get(i);
- Object currentKeyValue = origDataObject.get(currentKey);
- if(currentKeyValue == null) {
- throw new RuntimeException("PK missing during INSERT");
- }
- pks.add(currentKeyValue);
- }
- return pks;
- }
-
- }
- return null;
- }
-
- //when keyVal is null can be used as deleteAll
- public void executeDelete(ArrayList keyVals, String table, String key) {
- try {
- String sqlQuery = "select * from " + table.toUpperCase();
- List<String> keys = null;
-
- if(key == null) {
- if(keyVals != null && keyVals.size() == 1) {
- sqlQuery += " where ID = " + keyVals.get(0);
- }
- } else {//can be other than ID , can be compound keys
- keys = getKeys(key);
- if(keyVals.size() != keys.size()) {
- throw new RuntimeException("One or more PK values missing");
- }
-
- sqlQuery += " where ";
-
- for(int i=0; i<keys.size(); i++) {
- sqlQuery += keys.get(i)+" = ? AND ";
- }
-
- sqlQuery = sqlQuery.substring(0, sqlQuery.lastIndexOf(" AND "));
- }
-
- Command command = this.das.createCommand(sqlQuery);
-
- if(key != null) {
- for(int i=1; i<=keyVals.size(); i++) {
- command.setParameter(i, keyVals.get(i-1));
- }
- }
-
- DataObject result = command.executeQuery();
- List<DataObject> resultDOs = result.getList(table);
- if(resultDOs != null) {
- for(int i=0; i<resultDOs.size(); i++) {
- ((DataObject)resultDOs.get(i)).delete();
- }
- }
- this.das.applyChanges(result);
- } catch (Exception e) {
- //e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
-
- public Map<Object, DataObject> getMappedDataObjects(List<DataObject> resultDataObjects, List<String> keys) {
- Map<Object, DataObject> resultMap = new HashMap<Object, DataObject>();
- ArrayList<Object> keyCols = null;
- for(int j=0; j<resultDataObjects.size(); j++) {
- DataObject currentDO = resultDataObjects.get(j);
-
- keyCols = new ArrayList<Object>();
- for(int i=0; i<keys.size(); i++) {
- String currentKey = keys.get(i);
- Object currentKeyValue = currentDO.get(currentKey);
- keyCols.add(currentKeyValue);
- }
-
- resultMap.put(keyCols, currentDO);
- }
- return resultMap;
- }
-
- public static List<String> getKeys(String key) {
- String[] keys = key.split(",");
- return Arrays.asList(keys);
- }
-
- public DataObject executeCommand(String commandName) {
- try {
- Command command = this.das.getCommand(commandName);
- return command.executeQuery();
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- }
-
- public DataObject executeCommand(String commandName, String xPath) {
- DataObject root = executeCommand(commandName);
- return root.getDataObject(xPath);
- }
-}
diff --git a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/DataAccessEngineManager.java b/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/DataAccessEngineManager.java
deleted file mode 100644
index 572c190037..0000000000
--- a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/DataAccessEngineManager.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.data.engine;
-
-import java.io.InputStream;
-import java.util.List;
-
-import org.apache.tuscany.das.rdb.ConfigHelper;
-import org.apache.tuscany.das.rdb.DAS;
-import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-
-/**
- * The DataAccessEngineManager acts like a registry and factory for DAS instances
- * It holds DAS by it's config file name, reusing the same DAS for all components
- * using the same config file.
- *
- * @version $Rev$ $Date$
- */
-public class DataAccessEngineManager {
- //private final Map<String, DAS> registry = new HashMap<String, DAS>();
-
- public DataAccessEngineManager() {
- super();
- }
-
- protected DAS initializeDAS(String config, ConnectionInfo connectionInfo, String table, String pkColumns) throws MissingConfigFileException {
- //load the config file
- //System.out.println("Initializing DAS");
-
- ConfigHelper configHelper;
-
- if(config == null) {
- //no config information
- configHelper = new ConfigHelper();
- } else {
- //initialize the config helper by loading config file
- configHelper = new ConfigHelper(this.getConfigStream(config));
- }
-
- //add additional connectionInfo if provided in the SCA Composite file
- if( connectionInfo != null) {
- String dataSource = connectionInfo.getDataSource();
- if(dataSource != null && dataSource.length() > 0) {
- configHelper.addConnectionInfo(dataSource);
- } else {
- String driverClass = connectionInfo.getConnectionProperties().getDriverClass();
- String connectionURL = connectionInfo.getConnectionProperties().getDatabaseURL();
- String userName = connectionInfo.getConnectionProperties().getUsername();
- String password = connectionInfo.getConnectionProperties().getPassword();
- int loginTimeout = connectionInfo.getConnectionProperties().getLoginTimeout();
-
- configHelper.addConnectionInfo(driverClass, connectionURL, userName, password, loginTimeout);
- }
-
- }
-
- if(table != null && pkColumns != null) {
- MappingWrapper configWrapper = new MappingWrapper(configHelper.getConfig());
- List<String> pkColsList = DataAccessEngine.getKeys(pkColumns);
- for(int i=0; i<pkColsList.size(); i++) {
- configWrapper.addPrimaryKey(table+"."+pkColsList.get(i), pkColsList.get(i));
- }
- }
-
- DAS das = DAS.FACTORY.createDAS(configHelper.getConfig());
-
- return das;
- }
-
-/*
- public DAS getDAS(String config) throws MissingConfigFileException {
- //DAS das = registry.get(config);
- //if ( das == null) {
- // das = this.initializeDAS(config);
- // this.registry.put(config, das);
- //}
- return initializeDAS(config, null);
- }
-
- public DAS getDAS(ConnectionInfo connectionInfo) {
- assert connectionInfo != null;
-
- //FIXME: cache the das, we need to define the keys to use (datasource and databaseurl + hashed(username + password))
- DAS das = null;
- try {
- das = initializeDAS(null, connectionInfo);
- }catch (MissingConfigFileException e) {
- //this should never happen, as configFile == null
- }
-
- return das;
- }
-*/
- public DAS getDAS(String config, ConnectionInfo connectionInfo) throws MissingConfigFileException {
- assert connectionInfo != null;
-
- //FIXME: cache the das, we need to define the keys to use (datasource and databaseurl + hashed(username + password))
-
- return initializeDAS(config, connectionInfo, null, null);
- }
-
- public DAS getDAS(String config, ConnectionInfo connectionInfo, String table, String pkColumns) throws MissingConfigFileException {
- assert connectionInfo != null;
-
- //FIXME: cache the das, we need to define the keys to use (datasource and databaseurl + hashed(username + password))
-
- return initializeDAS(config, connectionInfo, table, pkColumns);
- }
-
- protected InputStream getConfigStream(String config) throws MissingConfigFileException{
- InputStream configStream = null;
-
- try {
- configStream = this.getClass().getClassLoader().getResourceAsStream(config);
- } catch (Exception e) {
- throw new MissingConfigFileException(config);
- }
-
- return configStream;
- }
-
-
-}
diff --git a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/MissingConfigFileException.java b/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/MissingConfigFileException.java
deleted file mode 100644
index a010e089e9..0000000000
--- a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/MissingConfigFileException.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.data.engine;
-
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-
-
-/**
- * Exception to be used when DAS configuration side file is not available
- *
- * @version $Rev$ $Date$
- */
-public class MissingConfigFileException extends ContributionReadException {
-
- private static final long serialVersionUID = -2616590185174691724L;
-
- public MissingConfigFileException(String message) {
- super(message);
- }
-
- public MissingConfigFileException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public MissingConfigFileException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/config/ConnectionInfo.java b/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/config/ConnectionInfo.java
deleted file mode 100644
index c72308f733..0000000000
--- a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/config/ConnectionInfo.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.data.engine.config;
-
-/**
- * Database connection information to be used for implementation.data
- *
- * @version $Rev$ $Date$
- */
-public class ConnectionInfo {
- private ConnectionProperties connectionProperties;
-
- private String dataSource;
-
- public String getDataSource() {
- return this.dataSource;
- }
-
- public void setDataSource(String dataSource) {
- this.dataSource = dataSource;
- }
-
- public ConnectionProperties getConnectionProperties() {
- return this.connectionProperties;
- }
-
- public void setConnectionProperties(ConnectionProperties connectionProperties) {
- this.connectionProperties = connectionProperties;
- }
-
-}
diff --git a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/config/ConnectionProperties.java b/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/config/ConnectionProperties.java
deleted file mode 100644
index df08a970b3..0000000000
--- a/branches/sca-android/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/config/ConnectionProperties.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.data.engine.config;
-
-/**
- * Database connection properties to be used for implementation.data
- *
- * @version $Rev$ $Date$
- */
-public class ConnectionProperties {
-
- private String driverClass;
-
- private String databaseURL;
-
- private String userName;
-
- private String password;
-
- private Integer loginTimeOut;
-
- public String getDriverClass() {
- return this.driverClass;
- }
-
- public void setDriverClass(String driverClass) {
- this.driverClass = driverClass;
- }
-
- public String getDatabaseURL() {
- return this.databaseURL;
- }
-
- public void setDatabaseURL(String databaseURL) {
- this.databaseURL = databaseURL;
- }
-
- public String getUsername() {
- return this.userName;
- }
-
- public void setUsername(String userName) {
- this.userName = userName;
- }
-
- public String getPassword() {
- return this.password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public Integer getLoginTimeout() {
- return this.loginTimeOut;
- }
-
- public void setLoginTimeout(Integer loginTimeOut) {
- this.loginTimeOut = loginTimeOut;
- }
-
-}
diff --git a/branches/sca-android/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.properties b/branches/sca-android/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.properties
deleted file mode 100644
index b040d69cc5..0000000000
--- a/branches/sca-android/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.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.
-#
-#
-ContributionReadException = ContributionReadException occured due to : \ No newline at end of file
diff --git a/branches/sca-android/modules/databinding-axiom/LICENSE b/branches/sca-android/modules/databinding-axiom/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/databinding-axiom/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/databinding-axiom/META-INF/README b/branches/sca-android/modules/databinding-axiom/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/databinding-axiom/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/databinding-axiom/NOTICE b/branches/sca-android/modules/databinding-axiom/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/databinding-axiom/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/branches/sca-android/modules/databinding-axiom/pom.xml b/branches/sca-android/modules/databinding-axiom/pom.xml
deleted file mode 100644
index f602ad3519..0000000000
--- a/branches/sca-android/modules/databinding-axiom/pom.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0-2</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.5</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.5</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</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.1</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </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.databinding.axiom</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.databinding.axiom*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java
deleted file mode 100644
index e59038bfa1..0000000000
--- a/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.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 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 static final String[] ALIASES = new String[] {"axiom"};
-
- public AxiomDataBinding() {
- super(NAME, ALIASES, OMElement.class);
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseDataBinding#getWrapperHandler()
- */
- @Override
- public WrapperHandler getWrapperHandler() {
- return new OMElementWrapperHandler();
- }
-
- @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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java
deleted file mode 100644
index cd820ab4b4..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java
deleted file mode 100644
index 429a6dbe5d..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java
deleted file mode 100644
index e23d89327c..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java
deleted file mode 100644
index 3dc73c89cb..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java
deleted file mode 100644
index ef7359fbcd..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java
deleted file mode 100644
index ea40e61746..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java
deleted file mode 100644
index b2c004324c..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java
deleted file mode 100644
index 01e7003b20..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java
deleted file mode 100644
index 9084f09dc0..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java
deleted file mode 100644
index 88d6b462c1..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java
deleted file mode 100644
index 9eccd52d74..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java b/branches/sca-android/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java
deleted file mode 100644
index 761185c297..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding b/branches/sca-android/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
deleted file mode 100644
index 2e94116177..0000000000
--- a/branches/sca-android/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;type=org.apache.axiom.om.OMElement,name=axiom
-
diff --git a/branches/sca-android/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/branches/sca-android/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index a1f18f9638..0000000000
--- a/branches/sca-android/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.osoa.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.osoa.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/branches/sca-android/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java b/branches/sca-android/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java
deleted file mode 100644
index 7453cb787a..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/test/resources/ipo.xml b/branches/sca-android/modules/databinding-axiom/src/test/resources/ipo.xml
deleted file mode 100644
index df901d183d..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/test/resources/ipo.xsd b/branches/sca-android/modules/databinding-axiom/src/test/resources/ipo.xsd
deleted file mode 100755
index af1e73172d..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-axiom/src/test/resources/order.wsdl b/branches/sca-android/modules/databinding-axiom/src/test/resources/order.wsdl
deleted file mode 100644
index a5ead60382..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-fastinfoset/LICENSE b/branches/sca-android/modules/databinding-fastinfoset/LICENSE
deleted file mode 100644
index d645695673..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/branches/sca-android/modules/databinding-fastinfoset/META-INF/README b/branches/sca-android/modules/databinding-fastinfoset/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/databinding-fastinfoset/NOTICE b/branches/sca-android/modules/databinding-fastinfoset/NOTICE
deleted file mode 100644
index d83ebbe236..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/NOTICE
+++ /dev/null
@@ -1,14 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2006 The Apache Software Foundation
-
-Apache Tuscany is an effort undergoing incubation at The Apache Software
-Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
-required of all newly accepted projects until a further review indicates that
-the infrastructure, communications, and decision making process have stabilized
-in a manner consistent with other successful ASF projects. While incubation
-status is not necessarily a reflection of the completeness or stability of the
-code, it does indicate that the project has yet to be fully endorsed by the ASF.
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/branches/sca-android/modules/databinding-fastinfoset/pom.xml b/branches/sca-android/modules/databinding-fastinfoset/pom.xml
deleted file mode 100644
index 3c060bf213..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding-fastinfoset</artifactId>
- <name>Apache Tuscany Data Binding for FastInfoset</name>
- <description>Tuscany FastInfoset Data Binding</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>com.sun.xml.fastinfoset</groupId>
- <artifactId>FastInfoset</artifactId>
- <version>1.2.2</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.1</version>
- </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>
-
- <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.databinding.fastinfoset</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.databinding.fastinfoset*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2Node.java b/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2Node.java
deleted file mode 100644
index 2e0aa629f3..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2Node.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.fastinfoset;
-
-import java.io.InputStream;
-
-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 com.sun.xml.fastinfoset.dom.DOMDocumentParser;
-
-/**
- * @version $Rev$ $Date$
- */
-public class FastInfoset2Node extends BaseTransformer<InputStream, Node> implements
- PullTransformer<InputStream, Node> {
-
- @Override
- protected Class<InputStream> getSourceType() {
- return InputStream.class;
- }
-
- @Override
- protected Class<Node> getTargetType() {
- return Node.class;
- }
-
- public Node transform(InputStream source, TransformationContext context) {
- try {
- DOMDocumentParser parser = new DOMDocumentParser();
- Document doc = DOMHelper.newDocument();
- parser.parse(doc, source);
- return doc.getDocumentElement();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 20;
- }
-
- @Override
- public String getSourceDataBinding() {
- return "xml:fastinfoset:java.io.InputStream";
- }
-}
diff --git a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2SAX.java b/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2SAX.java
deleted file mode 100644
index 77f6b77636..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2SAX.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.fastinfoset;
-
-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 com.sun.xml.fastinfoset.sax.SAXDocumentParser;
-
-/**
- * @version $Rev$ $Date$
- */
-public class FastInfoset2SAX extends BaseTransformer<InputStream, ContentHandler> implements
- PushTransformer<InputStream, ContentHandler> {
-
- @Override
- protected Class<InputStream> getSourceType() {
- return InputStream.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(InputStream source, ContentHandler target, TransformationContext context) {
- try {
- SAXDocumentParser parser = new SAXDocumentParser();
- parser.setContentHandler(target);
- parser.parse(source);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 20;
- }
-
- @Override
- public String getSourceDataBinding() {
- return "xml:fastinfoset:java.io.InputStream";
- }
-}
diff --git a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2XMLStreamReader.java b/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2XMLStreamReader.java
deleted file mode 100644
index 73d549f4f8..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2XMLStreamReader.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.fastinfoset;
-
-import java.io.InputStream;
-
-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 com.sun.xml.fastinfoset.stax.StAXDocumentParser;
-
-/**
- * @version $Rev$ $Date$
- */
-public class FastInfoset2XMLStreamReader extends BaseTransformer<InputStream, XMLStreamReader> implements
- PullTransformer<InputStream, XMLStreamReader> {
-
- @Override
- protected Class<InputStream> getSourceType() {
- return InputStream.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- public XMLStreamReader transform(InputStream source, TransformationContext context) {
- try {
- StAXDocumentParser parser = new StAXDocumentParser(source);
- return parser;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 20;
- }
-
- @Override
- public String getSourceDataBinding() {
- return "xml:fastinfoset:java.io.InputStream";
- }
-}
diff --git a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/Node2FastInfoset.java b/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/Node2FastInfoset.java
deleted file mode 100644
index 1c12a5dcad..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/Node2FastInfoset.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.fastinfoset;
-
-import java.io.OutputStream;
-
-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;
-
-import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
-
-/**
- * @version $Rev$ $Date$
- */
-public class Node2FastInfoset extends BaseTransformer<Node, OutputStream> implements
- PushTransformer<Node, OutputStream> {
-
- @Override
- protected Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- protected Class<OutputStream> getTargetType() {
- return OutputStream.class;
- }
-
-
- /**
- * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext)
- */
- public void transform(Node source, OutputStream target, TransformationContext context) {
- try {
- DOMDocumentSerializer serializer = new DOMDocumentSerializer();
- serializer.setOutputStream(target);
- serializer.serialize(source);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 20;
- }
-
- @Override
- public String getTargetDataBinding() {
- return "xml:fastinfoset:java.io.OutputStream";
- }
-}
diff --git a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLInputStream2FastInfoset.java b/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLInputStream2FastInfoset.java
deleted file mode 100644
index b0d56b3bb6..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLInputStream2FastInfoset.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.fastinfoset;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-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 com.sun.xml.fastinfoset.sax.SAXDocumentSerializer;
-
-/**
- * @version $Rev$ $Date$
- */
-public class XMLInputStream2FastInfoset extends BaseTransformer<InputStream, OutputStream> implements
- PushTransformer<InputStream, OutputStream> {
-
- @Override
- protected Class<InputStream> getSourceType() {
- return InputStream.class;
- }
-
- @Override
- protected Class<OutputStream> getTargetType() {
- return OutputStream.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext)
- */
- public void transform(InputStream source, OutputStream target, TransformationContext context) {
- try {
-
- // Create Fast Infoset SAX serializer
- SAXDocumentSerializer saxDocumentSerializer = new SAXDocumentSerializer();
- // Set the output stream
- saxDocumentSerializer.setOutputStream(target);
-
- // Instantiate JAXP SAX parser factory
- SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
- /* Set parser to be namespace aware
- * Very important to do otherwise invalid FI documents will be
- * created by the SAXDocumentSerializer
- */
- saxParserFactory.setNamespaceAware(true);
- // Instantiate the JAXP SAX parser
- SAXParser saxParser = saxParserFactory.newSAXParser();
- // Set the lexical handler
- saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", saxDocumentSerializer);
- // Parse the XML document and convert to a fast infoset document
- saxParser.parse(source, saxDocumentSerializer);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 20;
- }
-
- @Override
- public String getTargetDataBinding() {
- return "xml:fastinfoset:java.io.OutputStream";
- }
-}
diff --git a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLStreamReader2FastInfoset.java b/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLStreamReader2FastInfoset.java
deleted file mode 100644
index d18206600c..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLStreamReader2FastInfoset.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.fastinfoset;
-
-import java.io.OutputStream;
-
-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.apache.tuscany.sca.databinding.xml.XMLStreamSerializer;
-
-import com.sun.xml.fastinfoset.stax.StAXDocumentSerializer;
-
-/**
- * @version $Rev$ $Date$
- */
-public class XMLStreamReader2FastInfoset extends BaseTransformer<XMLStreamReader, OutputStream> implements
- PushTransformer<XMLStreamReader, OutputStream> {
-
- @Override
- protected Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- @Override
- protected Class<OutputStream> getTargetType() {
- return OutputStream.class;
- }
-
-
- /**
- * @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, OutputStream target, TransformationContext context) {
- try {
- StAXDocumentSerializer serializer = new StAXDocumentSerializer(target);
- XMLStreamSerializer streamSerializer = new XMLStreamSerializer();
- streamSerializer.serialize(source, serializer);
- serializer.flush();
- source.close();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 20;
- }
-
- @Override
- public String getTargetDataBinding() {
- return "xml:fastinfoset:java.io.OutputStream";
- }
-}
diff --git a/branches/sca-android/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/branches/sca-android/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index ea47ee7191..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
+++ /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.
-
-# Implementation classes for the transformers
-org.apache.tuscany.sca.databinding.fastinfoset.FastInfoset2Node;source=xml:fastinfoset:java.io.InputStream,target=org.w3c.dom.Node,weight=100
-org.apache.tuscany.sca.databinding.fastinfoset.FastInfoset2XMLStreamReader;source=xml:fastinfoset:java.io.InputStream,target=javax.xml.stream.XMLStreamReader,weight=80
-
-
diff --git a/branches/sca-android/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer b/branches/sca-android/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer
deleted file mode 100644
index 1610b4f54d..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer
+++ /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.
-
-# Implementation classes for the transformers
-org.apache.tuscany.sca.databinding.fastinfoset.FastInfoset2SAX;source=xml:fastinfoset:java.io.InputStream,target=org.xml.sax.ContentHandler ,weight=80
-org.apache.tuscany.sca.databinding.fastinfoset.Node2FastInfoset;source=org.w3c.dom.Node,target=xml:fastinfoset:java.io.OutputStream,weight=100
-org.apache.tuscany.sca.databinding.fastinfoset.XMLInputStream2FastInfoset;source=java.io.InputStream,target=xml:fastinfoset:java.io.OutputStream,weight=120
-org.apache.tuscany.sca.databinding.fastinfoset.XMLStreamReader2FastInfoset;source=javax.xml.stream.XMLStreamReader,target=xml:fastinfoset:java.io.OutputStream,weight=70
diff --git a/branches/sca-android/modules/databinding-fastinfoset/src/test/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfosetTransformerTestCase.java b/branches/sca-android/modules/databinding-fastinfoset/src/test/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfosetTransformerTestCase.java
deleted file mode 100644
index bb8adf39be..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/src/test/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfosetTransformerTestCase.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.databinding.fastinfoset;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.xml.InputStream2Node;
-import org.apache.tuscany.sca.databinding.xml.Node2OutputStream;
-import org.apache.tuscany.sca.databinding.xml.Node2String;
-import org.w3c.dom.Node;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class FastInfosetTransformerTestCase 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 void testXML2FastInfoset() throws Exception {
- XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(IPO_XML));
- XMLStreamReader2FastInfoset t1 = new XMLStreamReader2FastInfoset();
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
-
- t1.transform(reader, bos, null);
- // System.out.println(bos.toString());
-
- ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
- FastInfoset2Node t2 = new FastInfoset2Node();
- Node node = t2.transform(bis, null);
- String xml = new Node2String().transform(node, null);
-
- // System.out.println(xml);
-
- }
-
- public void testPerf() throws Exception {
- byte[] str = IPO_XML.getBytes();
- ByteArrayInputStream bis = new ByteArrayInputStream(str);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- XMLInputStream2FastInfoset t = new XMLInputStream2FastInfoset();
- t.transform(bis, bos, null);
- byte[] fast = bos.toByteArray();
- System.out.println(str.length + ".vs." + fast.length);
-
- long d1 = 0L;
- long d2 = 0L;
- for (int i = 0; i < 100; i++) {
- InputStream2Node t1 = new InputStream2Node();
- FastInfoset2Node t2 = new FastInfoset2Node();
- InputStream is1 = new ByteArrayInputStream(str);
- InputStream is2 = new ByteArrayInputStream(fast);
- long s1 = System.currentTimeMillis();
- Node n1 = t1.transform(is1, null);
- long s2 = System.currentTimeMillis();
- Node n2 = t2.transform(is2, null);
- long s3 = System.currentTimeMillis();
- d1 += s2 - s1; // from plain xml
- d2 += s3 - s2; // from fastinfoset
- Node2OutputStream t3 = new Node2OutputStream();
- Node2FastInfoset t4 = new Node2FastInfoset();
- ByteArrayOutputStream os1 = new ByteArrayOutputStream();
- ByteArrayOutputStream os2 = new ByteArrayOutputStream();
- long s4 = System.currentTimeMillis();
- t3.transform(n1, os1, null);
- long s5 = System.currentTimeMillis();
- t4.transform(n2, os2, null);
- long s6 = System.currentTimeMillis();
- d1 += s5 - s4; // to plain xml
- d2 += s6 - s5; // to fastinfoset
- }
- System.out.println("POX " + d1 + ".vs. FIS " + d2);
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-fastinfoset/src/test/resources/ipo.xsd b/branches/sca-android/modules/databinding-fastinfoset/src/test/resources/ipo.xsd
deleted file mode 100644
index 5a493e1746..0000000000
--- a/branches/sca-android/modules/databinding-fastinfoset/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/branches/sca-android/modules/databinding-jaxb-axiom/LICENSE b/branches/sca-android/modules/databinding-jaxb-axiom/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb-axiom/META-INF/README b/branches/sca-android/modules/databinding-jaxb-axiom/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/databinding-jaxb-axiom/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/databinding-jaxb-axiom/NOTICE b/branches/sca-android/modules/databinding-jaxb-axiom/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/databinding-jaxb-axiom/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/branches/sca-android/modules/databinding-jaxb-axiom/pom.xml b/branches/sca-android/modules/databinding-jaxb-axiom/pom.xml
deleted file mode 100644
index 12150abb7e..0000000000
--- a/branches/sca-android/modules/databinding-jaxb-axiom/pom.xml
+++ /dev/null
@@ -1,189 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.5</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.5</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>
-
- <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.databinding.jaxb.axiom</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.databinding.jaxb.axiom*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java
deleted file mode 100644
index 93277e77bf..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java
deleted file mode 100644
index c4726ad8fa..0000000000
--- a/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.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.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;
- }
-
- @SuppressWarnings("unchecked")
- 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/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXBDataSource.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXBDataSource.java
deleted file mode 100644
index dd9fbfbfd0..0000000000
--- a/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXBDataSource.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.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;
-
-/**
- *
- * @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);
- marshaller = context.createMarshaller();
- }
- return 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 {
- Marshaller marshaller = getMarshaller();
- // Set the FRAGEMENT property to avoid duplicate XML declaration
- marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
- marshaller.marshal(element, xmlWriter);
- marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.FALSE);
- 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 {
- Marshaller marshaller = getMarshaller();
- marshaller.marshal(element, output);
- 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 {
- Marshaller marshaller = getMarshaller();
- marshaller.marshal(element, writer);
- return null;
- }
- });
- } catch (PrivilegedActionException e) {
- throw new XMLStreamException(e.getException());
- }
- }
-
- public Object getObject() {
- return element;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java
deleted file mode 100644
index 00e99aaacd..0000000000
--- a/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.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 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();
- }
-
- @SuppressWarnings("unchecked")
- public Object transform(final OMElement source, final TransformationContext context) throws TransformationException {
- try {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws JAXBException, XMLStreamException {
- // 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);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- XMLStreamReader reader = source.getXMLStreamReaderWithoutCaching();
- Object result =
- unmarshaller.unmarshal(reader, JAXBContextHelper.getJavaType(context.getTargetDataType()));
- reader.close();
- 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/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java
deleted file mode 100644
index b7a395a623..0000000000
--- a/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.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.jaxb.axiom.ext;
-
-
-/**
- * JAXBCustomBuilder creates an OMSourcedElement backed by a JAXBDataSource
- * for the specified namespace and localPart.
- */
-public class JAXBCustomBuilder
-//FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
-// implements CustomBuilder
-{
-
- private JAXBDSContext jdsContext;
-
- /**
- * Create a JAXBCustomBuilder
- * @param context JAXBDSContext
- */
- public JAXBCustomBuilder(JAXBDSContext context) {
- super();
- this.jdsContext = context;
- }
-
- // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
- /*
- 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/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java
deleted file mode 100644
index 6fd65d4752..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java
deleted file mode 100644
index 7702d099b4..0000000000
--- a/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.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.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.OMException;
-import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
-import org.apache.axiom.om.util.StAXUtils;
-
-/**
- * OMDataSource backed by a jaxb object
- */
-public class JAXBDataSourceExt
-
-//FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
-// 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() {
- }
-
- // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
- // 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/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java
deleted file mode 100644
index 758a82f72f..0000000000
--- a/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.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.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.OMException;
-import org.apache.axiom.om.util.StAXUtils;
-
-/**
- * OMDataSource backed by a source
- */
-public class SourceDataSource
-// FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
-// extends OMDataSourceExtBase
-{
- private Source data;
-
- public SourceDataSource(Source data) {
- super();
- this.data = data;
- }
-
- public void close() {
- }
-
- // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
- // 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/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStreamWriterWithOS.java b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java
deleted file mode 100644
index a2a68c8eb0..0000000000
--- a/branches/sca-android/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.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.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.OMOutputFormat;
-import org.apache.axiom.om.util.StAXUtils;
-
-/**
- * OMDataSource backed by a string containing xml data
- */
-// FIXME: To be refectored into databinding-axiom
-public class XMLStringDataSource
-
-//FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
-// extends OMDataSourceExtBase
-{
- private String data;
-
- public XMLStringDataSource(String data) {
- super();
- this.data = data;
- }
-
- public void close() {
- }
-
- // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
- // 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/branches/sca-android/modules/databinding-jaxb-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/branches/sca-android/modules/databinding-jaxb-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index b48e629927..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/JAXB2OMTestCase.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/JAXB2OMTestCase.java
deleted file mode 100644
index 543a76594f..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/OMElement2JAXBTestCase.java b/branches/sca-android/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/OMElement2JAXBTestCase.java
deleted file mode 100644
index 3c00307941..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb-axiom/src/test/resources/ipo.xsd b/branches/sca-android/modules/databinding-jaxb-axiom/src/test/resources/ipo.xsd
deleted file mode 100644
index 241ec15d36..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/LICENSE b/branches/sca-android/modules/databinding-jaxb/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/databinding-jaxb/META-INF/README b/branches/sca-android/modules/databinding-jaxb/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/databinding-jaxb/NOTICE b/branches/sca-android/modules/databinding-jaxb/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/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/branches/sca-android/modules/databinding-jaxb/pom.xml b/branches/sca-android/modules/databinding-jaxb/pom.xml
deleted file mode 100644
index 8b819e06d3..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/pom.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <name>Apache Tuscany SCA Data Binding for JAXB</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>1.4-SNAPSHOT</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>
- </dependency>
-
- <dependency>
- <groupId>org.jvnet.jaxb.reflection</groupId>
- <artifactId>jaxb2-reflection</artifactId>
- <version>2.1.4</version>
- <scope>test</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>
-
- <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.databinding.jaxb</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.databinding.jaxb*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DataConverter.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DataConverter.java
deleted file mode 100644
index 003b4fb992..0000000000
--- a/branches/sca-android/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.osoa.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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DefaultXMLAdapterExtensionPoint.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DefaultXMLAdapterExtensionPoint.java
deleted file mode 100644
index 062da48206..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java
deleted file mode 100644
index 3e262c7d12..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2SAX.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2SAX.java
deleted file mode 100644
index eee5c77285..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2String.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2String.java
deleted file mode 100644
index 29951a5e16..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java
deleted file mode 100644
index 296c39c50f..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.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.databinding.jaxb;
-
-import java.awt.Image;
-import java.net.URI;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.UUID;
-
-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 LRUCache<JAXBContext, Unmarshaller> upool;
- protected LRUCache<JAXBContext, Marshaller> mpool;
-
- // 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);
- upool = new LRUCache<JAXBContext, Unmarshaller>(unmarshallerSize);
- mpool = new LRUCache<JAXBContext, Marshaller>(marshallerSize);
- 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 {
- synchronized (mpool) {
- Marshaller marshaller = mpool.get(context);
- if (marshaller == null) {
- marshaller = context.createMarshaller();
- mpool.put(context, marshaller);
- }
- return marshaller;
- }
- }
-
- public Unmarshaller getUnmarshaller(JAXBContext context) throws JAXBException {
- synchronized (upool) {
- Unmarshaller unmarshaller = upool.get(context);
- if (unmarshaller == null) {
- unmarshaller = context.createUnmarshaller();
- upool.put(context, unmarshaller);
- }
- return 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();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java
deleted file mode 100644
index 6d66f10a8e..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.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.sca.databinding.jaxb;
-
-import java.beans.Introspector;
-import java.io.IOException;
-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.SchemaOutputResolver;
-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 javax.xml.transform.Result;
-import javax.xml.transform.dom.DOMResult;
-
-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;
-import org.w3c.dom.Node;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-// FIXME: [rfeng] We probably should turn this into a pluggable system service
-public 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 grantularity 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 Marshaller getMarshaller(JAXBContext context) throws JAXBException {
- return cache.getMarshaller(context);
- }
-
- @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 = Introspector.decapitalize(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 = Introspector.decapitalize(javaType.getSimpleName());
- }
- typeQName = new QName(typeNamespace, typeName);
- } else {
- XmlEnum xmlEnum = javaType.getAnnotation(XmlEnum.class);
- if (xmlEnum != null) {
- name = Introspector.decapitalize(javaType.getSimpleName());
- typeQName = new QName(namespace, name);
- }
- }
- if (elementQName == null && typeQName == null) {
- return null;
- }
- return new XMLType(elementQName, typeQName);
- }
-
- public static Node generateSchema(JAXBContext context) throws Exception {
- SchemaOutputResolverImpl resolver = new SchemaOutputResolverImpl();
- context.generateSchema(resolver);
- return resolver.getSchema();
- }
-
- public static class SchemaOutputResolverImpl extends SchemaOutputResolver {
- private DOMResult result = new DOMResult();
-
- @Override
- public Result createOutput(String ns, String file) throws IOException {
- result.setSystemId("sca:dom");
- return result;
- }
-
- public Node getSchema() {
- return result != null ? result.getNode() : null;
- }
-
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java
deleted file mode 100644
index eebb4b2e37..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.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.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[] ALIASES = new String[] {"jaxb"};
-
- public static final String ROOT_NAMESPACE = "http://tuscany.apache.org/xmlns/sca/databinding/jaxb/1.0";
- public static final QName ROOT_ELEMENT = new QName(ROOT_NAMESPACE, "root");
-
- private JAXBWrapperHandler wrapperHandler;
- private JAXBTypeHelper xmlTypeHelper;
-
- public JAXBDataBinding() {
- super(NAME, ALIASES, 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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBPropertyDescriptor.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBPropertyDescriptor.java
deleted file mode 100644
index 8805d72627..0000000000
--- a/branches/sca-android/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.osoa.sca.ServiceRuntimeException;
-
-/**
- * A PropertyDescriptor provides acesss 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 semantis.
- * <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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTypeHelper.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTypeHelper.java
deleted file mode 100644
index 573e636884..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTypeHelper.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, 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.StringReader;
-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.apache.ws.commons.schema.resolver.URIResolver;
-import org.osoa.sca.ServiceRuntimeException;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-
-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(jaxbRIDecapitalize(javaType.getSimpleName()));
- }
- return new TypeInfo(xmlType, false, null);
- }
- }
-
- /**
- * The JAXB RI doesn't implement the decapitalization algorithm in the
- * JAXB spec. See Sun bug 6505643 for details. This means that we need
- * to mimic the incorrect algorithm for references from wrapper schemas.
- */
- private String jaxbRIDecapitalize(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);
- }
-
- /*
- 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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperException.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperException.java
deleted file mode 100644
index f83c7f09d9..0000000000
--- a/branches/sca-android/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.osoa.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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java
deleted file mode 100644
index a1f4c12c8f..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHelper.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHelper.java
deleted file mode 100644
index 5f90aa4d7a..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java
deleted file mode 100644
index e375a9b85e..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java
deleted file mode 100644
index 840edfd234..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/String2JAXB.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/String2JAXB.java
deleted file mode 100644
index 5559690de8..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLAdapterExtensionPoint.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLAdapterExtensionPoint.java
deleted file mode 100644
index 5fa98b5ed1..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLRootElementUtil.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLRootElementUtil.java
deleted file mode 100644
index ad4bd04084..0000000000
--- a/branches/sca-android/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 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
- */
- static private 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 requrested 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/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java b/branches/sca-android/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java
deleted file mode 100644
index af3fa3fb66..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding b/branches/sca-android/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
deleted file mode 100644
index 58d6123373..0000000000
--- a/branches/sca-android/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;type=javax.xml.bind.JAXBElement,name=jaxb
diff --git a/branches/sca-android/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/branches/sca-android/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index 4e062e4c22..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint b/branches/sca-android/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint
deleted file mode 100644
index d1f6d9f1e3..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/test/java/com/example/stock/StockQuoteOffer.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/com/example/stock/StockQuoteOffer.java
deleted file mode 100644
index 5c5c892f33..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/BeanXMLStreamReaderImpl.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/BeanXMLStreamReaderImpl.java
deleted file mode 100644
index 602bc66569..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/BeanXMLStreamReaderImpl.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, 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.Array;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-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 java.util.Map.Entry;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.databinding.xml.SimpleXmlNodeImpl;
-import org.apache.tuscany.sca.databinding.xml.XmlNode;
-import org.apache.tuscany.sca.databinding.xml.XmlTreeStreamReaderImpl;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.jvnet.jaxb.reflection.model.annotation.RuntimeInlineAnnotationReader;
-import org.jvnet.jaxb.reflection.model.core.Ref;
-import org.jvnet.jaxb.reflection.model.impl.RuntimeModelBuilder;
-import org.jvnet.jaxb.reflection.model.runtime.RuntimeClassInfo;
-import org.jvnet.jaxb.reflection.model.runtime.RuntimePropertyInfo;
-import org.jvnet.jaxb.reflection.model.runtime.RuntimeTypeInfoSet;
-import org.jvnet.jaxb.reflection.runtime.IllegalAnnotationsException;
-import org.jvnet.jaxb.reflection.runtime.JAXBContextImpl;
-
-
-
-/**
- * @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());
- }
- };
-
- private static final String XSI_PREFIX = "xsi";
- private static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance";
-
- private static XmlNode getXSIType(QName realType) {
- QName xsiType = new QName(XSI_NS, "type", XSI_PREFIX);
- String prefix = realType.getPrefix();
- String typeName = realType.getLocalPart();
- if (prefix != null && !prefix.equals("")) {
- typeName = prefix + ":" + realType.getLocalPart();
- }
- return new SimpleXmlNodeImpl(xsiType, XmlNode.Type.ATTRIBUTE);
- }
-
- /**
- * Represent a Map.Entry XML node
- * @version $Rev$ $Date$
- */
- public static class MapEntryXmlNodeImpl extends SimpleXmlNodeImpl implements XmlNode {
- private Map.Entry entry;
-
- public MapEntryXmlNodeImpl(Entry entry) {
- super(new QName("", "entry"), entry);
- this.entry = entry;
- }
-
- @Override
- public Iterator<XmlNode> children() {
- List<XmlNode> nodes = new ArrayList<XmlNode>();
- XmlNode key = new BeanXmlNodeImpl(new QName("", "key"), entry.getKey());
- XmlNode value = new BeanXmlNodeImpl(new QName("", "value"), entry.getValue());
- nodes.add(key);
- nodes.add(value);
- return nodes.iterator();
- }
- }
-
- 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>();
- Map map = (Map)value;
- if (map != null) {
- for (Object e : map.entrySet()) {
- Map.Entry entry = (Map.Entry)e;
- entries.add(new MapEntryXmlNodeImpl(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 RuntimeTypeInfoSet create(Class... classes) throws Exception {
- IllegalAnnotationsException.Builder errorListener = new IllegalAnnotationsException.Builder();
- RuntimeInlineAnnotationReader reader = new RuntimeInlineAnnotationReader();
- JAXBContextImpl context =
- new JAXBContextImpl(classes, null, Collections.<Class, Class> emptyMap(), null, false, reader, false, false);
- RuntimeModelBuilder builder =
- new RuntimeModelBuilder(context, reader, Collections.<Class, Class> emptyMap(), null);
- builder.setErrorHandler(errorListener);
- for (Class c : classes)
- builder.getTypeInfo(new Ref<Type, Class>(c));
-
- RuntimeTypeInfoSet r = builder.link();
- errorListener.check();
- return r;
- }
-
- private static class JAXBAccessor implements Accessor {
- private Object target;
- private RuntimePropertyInfo prop;
-
- public JAXBAccessor(Object target, RuntimePropertyInfo field) {
- super();
- this.target = target;
- this.prop = field;
- }
-
- public String getName() {
- return prop.getName();
- }
-
- public Object getValue() throws Exception {
- return prop.getAccessor().get(target);
- }
-
- public void setValue(Object value) throws Exception {
- prop.getAccessor().set(target, value);
- }
-
- public Class<?> getType() {
- Type type = prop.getRawType();
- if (type instanceof Class) {
- return (Class<?>)type;
- } else if (type instanceof ParameterizedType) {
- ParameterizedType pType = (ParameterizedType)type;
- type = pType.getRawType();
- if (type instanceof Class) {
- return (Class<?>)type;
- }
- }
- return Object.class;
- }
-
- }
-
- 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();
- RuntimeTypeInfoSet set = create(type);
- RuntimeClassInfo clsInfo = (RuntimeClassInfo)set.getTypeInfo(type);
- for (RuntimePropertyInfo f : clsInfo.getProperties()) {
- map.put(f.getName(), new JAXBAccessor(target, f));
- }
- return map;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2XMLStreamReader.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2XMLStreamReader.java
deleted file mode 100644
index e2151e23a1..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2XMLStreamReader.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;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-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 JAXB2XMLStreamReader extends BaseTransformer<Object, XMLStreamReader> implements
- PullTransformer<Object, XMLStreamReader> {
-
- public JAXB2XMLStreamReader() {
- super();
- }
-
- public XMLStreamReader transform(Object source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- QName name = null;
- Object bean = null;
- if (source instanceof JAXBElement) {
- bean = ((JAXBElement)source).getValue();
- name = ((JAXBElement)source).getName();
- } else {
- JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context, true);
- Object element = JAXBContextHelper.createJAXBElement(jaxbContext, context.getSourceDataType(), source);
- name = jaxbContext.createJAXBIntrospector().getElementName(element);
- bean = source;
- }
- BeanXMLStreamReaderImpl reader = new BeanXMLStreamReaderImpl(name, bean);
- return reader;
- } 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 10;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JAXBDataBinding.NAME;
- }
-}
diff --git a/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java
deleted file mode 100644
index 761414e92b..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.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 junit.framework.Assert;
-
-import org.apache.tuscany.sca.databinding.jaxb.JAXBContextCache;
-import org.apache.tuscany.sca.databinding.util.LRUCache;
-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/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBindingTestCase.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBindingTestCase.java
deleted file mode 100644
index 5452175c54..0000000000
--- a/branches/sca-android/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 javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import com.example.ipo.jaxb.ObjectFactory;
-import com.example.ipo.jaxb.PurchaseOrderType;
-import com.example.ipo.jaxb.USAddress;
-import com.example.ipo.jaxb.USState;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JAXBDataBindingTestCase extends TestCase {
- private JAXBDataBinding binding;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- binding = new JAXBDataBinding();
- }
-
- /**
- * Test method for
- * {@link org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding#introspect(java.lang.Class, Operation)}.
- */
- 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")
- 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());
- }
-
- @SuppressWarnings("unchecked")
- 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());
- }
-
- @SuppressWarnings("unchecked")
- 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/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBReflectionTestCase.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBReflectionTestCase.java
deleted file mode 100644
index cbc32d4353..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBReflectionTestCase.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.jaxb;
-
-import java.lang.reflect.Type;
-import java.util.Collections;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper;
-import org.apache.tuscany.sca.databinding.xml.Node2String;
-import org.jvnet.jaxb.reflection.model.annotation.RuntimeInlineAnnotationReader;
-import org.jvnet.jaxb.reflection.model.core.Ref;
-import org.jvnet.jaxb.reflection.model.impl.RuntimeModelBuilder;
-import org.jvnet.jaxb.reflection.model.runtime.RuntimeClassInfo;
-import org.jvnet.jaxb.reflection.model.runtime.RuntimePropertyInfo;
-import org.jvnet.jaxb.reflection.model.runtime.RuntimeTypeInfoSet;
-import org.jvnet.jaxb.reflection.runtime.IllegalAnnotationsException;
-import org.jvnet.jaxb.reflection.runtime.JAXBContextImpl;
-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 JAXBReflectionTestCase extends TestCase {
-
- public void testGenerateSchema() throws Exception {
- JAXBContext context = JAXBContext.newInstance("com.example.ipo.jaxb");
- Node schema = JAXBContextHelper.generateSchema(context);
- System.out.println(new Node2String().transform(schema, null));
- }
-
- /**
- * This is a workaround for the NPE bug in jaxb-reflection
- * @param classes
- * @return
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- private static RuntimeTypeInfoSet create(Class... classes) throws Exception {
- IllegalAnnotationsException.Builder errorListener = new IllegalAnnotationsException.Builder();
- RuntimeInlineAnnotationReader reader = new RuntimeInlineAnnotationReader();
- JAXBContextImpl context =
- new JAXBContextImpl(classes, null, Collections.<Class, Class> emptyMap(), null, false, reader, false, false);
- RuntimeModelBuilder builder =
- new RuntimeModelBuilder(context, reader, Collections.<Class, Class> emptyMap(), null);
- builder.setErrorHandler(errorListener);
- for (Class c : classes)
- builder.getTypeInfo(new Ref<Type, Class>(c));
-
- RuntimeTypeInfoSet r = builder.link();
- errorListener.check();
- return r;
- }
-
- public void testReflection() throws Exception {
- org.jvnet.jaxb.reflection.model.runtime.RuntimeTypeInfoSet model = create(PurchaseOrderType.class);
- RuntimeClassInfo type = (RuntimeClassInfo)model.getTypeInfo(PurchaseOrderType.class);
- Assert.assertEquals(new QName("http://www.example.com/IPO", "PurchaseOrderType"), type.getTypeName());
- type = (RuntimeClassInfo)model.getTypeInfo(USAddress.class);
- Assert.assertEquals(new QName("http://www.example.com/IPO", "USAddress"), type.getTypeName());
- RuntimePropertyInfo prop = type.getProperty("state");
- Assert.assertNotNull(prop);
- USAddress address = new ObjectFactory().createUSAddress();
- prop.getAccessor().set(address, USState.CA);
- Assert.assertEquals(USState.CA, address.getState());
- }
-}
diff --git a/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java
deleted file mode 100644
index 53779a1af6..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.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.databinding.jaxb;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-
-import java.io.StringReader;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.jaxb.JAXB2Node;
-import org.apache.tuscany.sca.databinding.jaxb.Node2JAXB;
-import org.apache.tuscany.sca.databinding.jaxb.Reader2JAXB;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.w3c.dom.Node;
-
-import com.example.ipo.jaxb.ObjectFactory;
-import com.example.ipo.jaxb.PurchaseOrderType;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JAXBTestCase 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>";
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- public void testTransform() throws Exception {
- Reader2JAXB t0 = new Reader2JAXB();
-
- DataType targetDataType = new DataTypeImpl<Class>(PurchaseOrderType.class, null);
-
- TransformationContext tContext = createMock(TransformationContext.class);
- expect(tContext.getTargetDataType()).andReturn(targetDataType).anyTimes();
- expect(tContext.getTargetOperation()).andReturn(null).anyTimes();
- replay(tContext);
-
- Object object1 = t0.transform(new StringReader(IPO_XML), tContext);
-
- DataType sourceDataType = new DataTypeImpl<Class>(PurchaseOrderType.class, null);
-
- TransformationContext tContext1 = createMock(TransformationContext.class);
- expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes();
- expect(tContext1.getTargetDataType()).andReturn(null).anyTimes();
- expect(tContext1.getSourceOperation()).andReturn(null).anyTimes();
- expect(tContext1.getTargetOperation()).andReturn(null).anyTimes();
- replay(tContext1);
-
- JAXB2Node t1 = new JAXB2Node();
- Node node = t1.transform(object1, tContext1);
-
- Assert.assertNotNull(node);
-
- Node2JAXB t2 = new Node2JAXB();
- Object object2 = t2.transform(node, tContext);
- Assert.assertNotNull(object2);
-
- }
-
- public void testTransform2() throws Exception {
- Reader2JAXB t0 = new Reader2JAXB();
-
- QName root = new QName("http://www.example.com/IPO", "purchaseOrder");
- DataType targetDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, new XMLType(root, null));
- // targetDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath);
-
- TransformationContext tContext = createMock(TransformationContext.class);
- expect(tContext.getTargetDataType()).andReturn(targetDataType).anyTimes();
- expect(tContext.getTargetOperation()).andReturn(null).anyTimes();
- replay(tContext);
-
- 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 = createMock(TransformationContext.class);
- expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes();
- expect(tContext1.getTargetDataType()).andReturn(null).anyTimes();
- expect(tContext1.getSourceOperation()).andReturn(null).anyTimes();
- expect(tContext1.getTargetOperation()).andReturn(null).anyTimes();
- replay(tContext1);
-
- JAXB2Node t1 = new JAXB2Node();
- Node node = t1.transform(object1, tContext1);
-
- Assert.assertNotNull(node);
-
- Node2JAXB t2 = new Node2JAXB();
- Object object2 = t2.transform(node, tContext);
- Assert.assertNotNull(object2);
-
- }
-
- public void testTransform3() throws Exception {
-
- DataType sourceDataType = new DataTypeImpl<Class>(PurchaseOrderType.class, null);
-
- TransformationContext tContext1 = createMock(TransformationContext.class);
- expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes();
- expect(tContext1.getTargetDataType()).andReturn(null).anyTimes();
- expect(tContext1.getSourceOperation()).andReturn(null).anyTimes();
- expect(tContext1.getTargetOperation()).andReturn(null).anyTimes();
- replay(tContext1);
-
- JAXB2Node t1 = new JAXB2Node();
- PurchaseOrderType po = new ObjectFactory().createPurchaseOrderType();
- Node node = t1.transform(po, tContext1);
-
- Assert.assertNotNull(node);
-
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java
deleted file mode 100644
index c10a5227ce..0000000000
--- a/branches/sca-android/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 java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding;
-import org.apache.tuscany.sca.databinding.jaxb.JAXBWrapperHandler;
-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 com.example.stock.StockQuoteOffer;
-
-/**
- * Test case for JAXBExceptionHandler
- *
- * @version $Rev$ $Date$
- */
-public class JAXBWrapperHandlerTestCase extends TestCase {
- private static final QName ELEMENT = new QName("http://www.example.com/stock", "stockQuoteOffer");
- private static final QName INPUT = new QName("", "input");
- private JAXBWrapperHandler handler;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.handler = new JAXBWrapperHandler();
- }
-
- 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);
- }
-
- public void testSetChild() {
- StockQuoteOffer wrapper = new StockQuoteOffer();
- handler.setChild(wrapper, 0, new ElementInfo(INPUT, null), "IBM");
- Assert.assertEquals("IBM", wrapper.getInput());
- }
-
- 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/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyBean.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyBean.java
deleted file mode 100644
index 9bdfb108fe..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterface.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterface.java
deleted file mode 100644
index b8e9ee7f7d..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterfaceImpl.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterfaceImpl.java
deleted file mode 100644
index 5c511e6ccb..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MySubBean.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MySubBean.java
deleted file mode 100644
index 62dfa6f73c..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/POJOTestCase.java b/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/POJOTestCase.java
deleted file mode 100644
index 0a3d64a705..0000000000
--- a/branches/sca-android/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/POJOTestCase.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.databinding.jaxb;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.lang.reflect.Type;
-import java.util.Collection;
-import java.util.Collections;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.stream.StreamSource;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.databinding.jaxb.JAXB2XMLStreamReader;
-
-import com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader;
-import com.sun.xml.bind.v2.model.core.Ref;
-import com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder;
-import com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo;
-import com.sun.xml.bind.v2.model.runtime.RuntimePropertyInfo;
-import com.sun.xml.bind.v2.model.runtime.RuntimeTypeInfoSet;
-import com.sun.xml.bind.v2.runtime.IllegalAnnotationsException;
-import com.sun.xml.bind.v2.runtime.JAXBContextImpl;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class POJOTestCase extends TestCase {
- 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);
- }
-
- public void testPOJOArray() throws Exception {
- JAXBContext context = JAXBContext.newInstance(MyBean[].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];
- assertFalse(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);
- }
-
- 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());
- }
-
- 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());
- }
-
- 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[]);
- }
-
- 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[]);
- }
-
- 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);
- }
- */
-
- private static RuntimeTypeInfoSet create(Class... classes) throws Exception {
- IllegalAnnotationsException.Builder errorListener = new IllegalAnnotationsException.Builder();
- RuntimeInlineAnnotationReader reader = new RuntimeInlineAnnotationReader();
- JAXBContextImpl context =
- new JAXBContextImpl(classes, null, Collections.<Class, Class> emptyMap(), null, false, reader, false, false);
- RuntimeModelBuilder builder =
- new RuntimeModelBuilder(context, reader, Collections.<Class, Class> emptyMap(), null);
- builder.setErrorHandler(errorListener);
- for (Class c : classes)
- builder.getTypeInfo(new Ref<Type, Class>(c));
-
- RuntimeTypeInfoSet r = builder.link();
- errorListener.check();
- return r;
- }
-
- public void testReflection() throws Exception {
- MyBean bean = new MyBean();
- RuntimeTypeInfoSet model = create(MyBean.class);
- RuntimeClassInfo clsInfo = (RuntimeClassInfo)model.getTypeInfo(MyBean.class);
- for (RuntimePropertyInfo p : clsInfo.getProperties()) {
- // System.out.print(p.getName());
- // System.out.println(" " + p.isCollection());
- if (p.getName().equals("notes")) {
- Collection c = (Collection)p.getAccessor().get(bean);
- c.add("123");
- }
- }
-
- }
-}
diff --git a/branches/sca-android/modules/databinding-jaxb/src/test/resources/ipo.xsd b/branches/sca-android/modules/databinding-jaxb/src/test/resources/ipo.xsd
deleted file mode 100755
index 241ec15d36..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/databinding-json/LICENSE b/branches/sca-android/modules/databinding-json/LICENSE
deleted file mode 100644
index d645695673..0000000000
--- a/branches/sca-android/modules/databinding-json/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/branches/sca-android/modules/databinding-json/META-INF/README b/branches/sca-android/modules/databinding-json/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/databinding-json/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/databinding-json/NOTICE b/branches/sca-android/modules/databinding-json/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/databinding-json/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/branches/sca-android/modules/databinding-json/pom.xml b/branches/sca-android/modules/databinding-json/pom.xml
deleted file mode 100644
index bc4a149b91..0000000000
--- a/branches/sca-android/modules/databinding-json/pom.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding-json</artifactId>
- <name>Apache Tuscany SCA Data Binding for JSON</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>com.metaparadigm</groupId>
- <artifactId>json-rpc</artifactId>
- <version>1.0</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.jettison</groupId>
- <artifactId>jettison</artifactId>
- <version>1.0.1</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.5</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>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.5</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </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.databinding.json</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.databinding.json*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2JavaBean.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2JavaBean.java
deleted file mode 100644
index b1813c9eab..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2JavaBean.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.json;
-
-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.javabeans.JavaBeansDataBinding;
-
-import com.metaparadigm.jsonrpc.JSONSerializer;
-import com.metaparadigm.jsonrpc.SerializerState;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JSON2JavaBean implements PullTransformer<Object, Object> {
- private JSONSerializer serializer;
-
- public JSON2JavaBean() {
- super();
- serializer = new JSONSerializer();
- try {
- serializer.registerDefaultSerializers();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- serializer.setMarshallClassHints(true);
- serializer.setMarshallNullAttributes(true);
- }
-
- public Object transform(Object source, TransformationContext context) {
- if (source == null) {
- return null;
- }
-
- try {
- SerializerState state = new SerializerState();
- return serializer.unmarshall(state, context.getTargetDataType().getPhysical(), source);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
-
- }
-
- public String getSourceDataBinding() {
- return JSONDataBinding.NAME;
- }
-
- public String getTargetDataBinding() {
- return JavaBeansDataBinding.NAME;
- }
-
- public int getWeight() {
- return 5000;
- }
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2String.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2String.java
deleted file mode 100644
index 4e08384f09..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2String.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.json;
-
-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 JSON2String extends BaseTransformer<Object, String> implements
- PullTransformer<Object, String> {
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- protected Class<String> getTargetType() {
- return String.class;
- }
-
- public String transform(Object source, TransformationContext context) {
- try {
- return source.toString();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 500;
- }
-
- @Override
- public String getSourceDataBinding() {
- return JSONDataBinding.NAME;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2XMLStreamReader.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2XMLStreamReader.java
deleted file mode 100644
index b70f772696..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2XMLStreamReader.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.json;
-
-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.codehaus.jettison.badgerfish.BadgerFishXMLStreamReader;
-import org.codehaus.jettison.json.JSONObject;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JSON2XMLStreamReader extends BaseTransformer<Object, XMLStreamReader> implements
- PullTransformer<Object, XMLStreamReader> {
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- public XMLStreamReader transform(Object source, TransformationContext context) {
- try {
- JSONObject json = JSONHelper.toJettison(source);
- return new BadgerFishXMLStreamReader(json);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 500;
- }
- @Override
- public String getSourceDataBinding() {
- return JSONDataBinding.NAME;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONDataBinding.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONDataBinding.java
deleted file mode 100644
index 4bda838b18..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONDataBinding.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.json;
-
-
-import javax.xml.namespace.QName;
-
-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.codehaus.jettison.json.JSONObject;
-
-/**
- * JAXB DataBinding
- *
- * @version $Rev$ $Date$
- */
-public class JSONDataBinding extends BaseDataBinding {
- public static final String NAME = "JSON";
- public static final String[] ALIASES = new String[] {"json"};
-
- public static final String ROOT_NAMESPACE = "http://tuscany.apache.org/xmlns/sca/databinding/json/1.0";
- public static final QName ROOT_ELEMENT = new QName(ROOT_NAMESPACE, "root");
-
- public JSONDataBinding() {
- super(NAME, ALIASES, org.json.JSONObject.class);
- }
-
- @Override
- public boolean introspect(DataType type, Operation operation) {
- assert type != null;
- Class cls = type.getPhysical();
- if (JSONObject.class.isAssignableFrom(cls) || org.json.JSONObject.class.isAssignableFrom(cls)) {
- type.setDataBinding(getName());
- if (type.getLogical() == null) {
- type.setLogical(XMLType.UNKNOWN);
- }
- return true;
- }
- return false;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Object copy(Object arg, DataType dataType, Operation operation) {
- if (arg == null) {
- return null;
- }
- try {
- Class type = arg != null ? arg.getClass() : null;
- return JSONHelper.toJSON(arg.toString(), type);
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONHelper.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONHelper.java
deleted file mode 100644
index fb29710506..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONHelper.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.json;
-
-import java.text.ParseException;
-
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JSONHelper {
- private JSONHelper() {
-
- }
-
- /**
- * Convert to Jettison JSONObject
- * @param source
- * @return
- */
- public static JSONObject toJettison(Object source) {
- JSONObject json = null;
- if (source instanceof JSONObject) {
- json = (JSONObject)source;
- } else if (source instanceof org.json.JSONObject) {
- try {
- json = new JSONObject(((org.json.JSONObject)source).toString());
- } catch (JSONException e) {
- throw new IllegalArgumentException(e);
- }
- }
- return json;
- }
-
- /**
- * Convert to org.json.JSONObject
- * @param source
- * @return
- */
- public static org.json.JSONObject toJSONOrg(Object source) {
- org.json.JSONObject json = null;
- if (source instanceof JSONObject) {
- try {
- json = new org.json.JSONObject(((JSONObject)source).toString());
- } catch (ParseException e) {
- throw new IllegalArgumentException(e);
- }
- } else if (source instanceof org.json.JSONObject) {
- json = (org.json.JSONObject)source;
- }
- return json;
- }
-
- public static <T> T toJSON(String json, Class<T> type) {
- if (type == JSONObject.class) {
- try {
- return type.cast(new JSONObject(json));
- } catch (JSONException e) {
- throw new IllegalArgumentException(e);
- }
- } else {
- if (type == null) {
- type = (Class<T>)org.json.JSONObject.class;
- }
- try {
- return type.cast(new org.json.JSONObject(json));
- } catch (ParseException e) {
- throw new IllegalArgumentException(e);
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSON.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSON.java
deleted file mode 100644
index a928deef22..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSON.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.json;
-
-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.javabeans.JavaBeansDataBinding;
-
-import com.metaparadigm.jsonrpc.JSONSerializer;
-import com.metaparadigm.jsonrpc.SerializerState;
-
-public class JavaBean2JSON extends BaseTransformer<Object, Object> implements PullTransformer<Object, Object> {
- private JSONSerializer serializer;
-
- public JavaBean2JSON() {
- serializer = new JSONSerializer();
- try {
- serializer.registerDefaultSerializers();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- serializer.setMarshallClassHints(true);
- serializer.setMarshallNullAttributes(true);
- }
-
- @Override
- public String getSourceDataBinding() {
- return JavaBeansDataBinding.NAME;
- }
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JSONDataBinding.NAME;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- public Object toJSON(Object source) throws Exception {
- if (source == null) {
- return org.json.JSONObject.NULL;
- }
-
- SerializerState state = new SerializerState();
- return serializer.marshall(state, source);
- }
-
- public Object transform(Object source, TransformationContext context) {
- try {
- return toJSON(source);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSONObject.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSONObject.java
deleted file mode 100644
index de023157bc..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSONObject.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.json;
-
-import java.beans.BeanInfo;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Array;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-
-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.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONObject;
-
-public class JavaBean2JSONObject extends BaseTransformer<Object, Object> implements PullTransformer<Object, Object> {
- private static final Comparator<PropertyDescriptor> COMPARATOR = new Comparator<PropertyDescriptor>() {
- public int compare(PropertyDescriptor o1, PropertyDescriptor o2) {
- return o1.getName().compareTo(o2.getName());
- }
- };
-
- private static final SimpleTypeMapperImpl MAPPER = new SimpleTypeMapperImpl();
- private static final Object[] NULL = 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);
- }
- }
-
- private static boolean isSimpleType(Class<?> javaType) {
- return SimpleTypeMapperImpl.getXMLType(javaType) != null;
- }
-
- public JavaBean2JSONObject() {
- }
-
- @Override
- public String getSourceDataBinding() {
- return JavaBeansDataBinding.NAME;
- }
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JSONDataBinding.NAME;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- public Object toJSON(Object source) throws Exception {
- if (source == null) {
- return JSONObject.NULL;
- }
- Class<?> type = source.getClass();
- if (isSimpleType(type)) {
- return source;
- } else if (type.isArray()) {
- JSONArray array = new JSONArray();
- int i1 = Array.getLength(source);
- for (int j = 0; j < i1; j++) {
- Object o = Array.get(source, j);
- array.put(toJSON(o));
- }
- return array;
- } else if (Collection.class.isAssignableFrom(type)) {
- Collection c = (Collection)source;
- JSONArray array = new JSONArray();
- for (Object element : c) {
- array.put(toJSON(element));
- }
- return array;
- }
- JSONObject json = new JSONObject();
- BeanInfo beanInfo = Introspector.getBeanInfo(type);
- PropertyDescriptor[] propDescs = beanInfo.getPropertyDescriptors();
- Collections.sort(Arrays.asList(propDescs), COMPARATOR);
-
- for (int i = 0; i < propDescs.length; i++) {
- PropertyDescriptor propDesc = propDescs[i];
- Class<?> pType = propDesc.getPropertyType();
- if ("class".equals(propDesc.getName())) {
- continue;
- }
- Object pValue = propDesc.getReadMethod().invoke(source, NULL);
- json.put(propDesc.getName(), toJSON(pValue));
- }
- return json;
-
- }
-
- public Object transform(Object source, TransformationContext context) {
- try {
- return toJSON(source);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/String2JSON.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/String2JSON.java
deleted file mode 100644
index ff5968bccd..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/String2JSON.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.json;
-
-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 String2JSON extends BaseTransformer<String, Object> implements PullTransformer<String, Object> {
-
- @Override
- protected Class<String> getSourceType() {
- return String.class;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- public Object transform(String source, TransformationContext context) {
- try {
- Class type = null;
- if (context != null && context.getTargetDataType() != null) {
- type = context.getTargetDataType().getPhysical();
- }
- return JSONHelper.toJSON(source, type);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 500;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JSONDataBinding.NAME;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/XMLStreamReader2JSON.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/XMLStreamReader2JSON.java
deleted file mode 100644
index aa75afc9d4..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/XMLStreamReader2JSON.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.json;
-
-import java.io.StringWriter;
-
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-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.XMLStreamSerializer;
-import org.codehaus.jettison.badgerfish.BadgerFishXMLStreamWriter;
-
-/**
- * @version $Rev$ $Date$
- */
-public class XMLStreamReader2JSON extends BaseTransformer<XMLStreamReader, Object> implements
- PullTransformer<XMLStreamReader, Object> {
-
- @Override
- protected Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- public Object transform(XMLStreamReader source, TransformationContext context) {
- try {
- StringWriter writer = new StringWriter();
- XMLStreamWriter jsonWriter = new BadgerFishXMLStreamWriter(writer);
- XMLStreamSerializer serializer = new XMLStreamSerializer();
- serializer.serialize(source, jsonWriter);
- source.close();
- Class type = null;
- if (context != null && context.getTargetDataType() != null) {
- type = context.getTargetDataType().getPhysical();
- }
- return JSONHelper.toJSON(writer.toString(), type);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 500;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JSONDataBinding.NAME;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSON2OMElement.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSON2OMElement.java
deleted file mode 100644
index 1072b70029..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSON2OMElement.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.json.axiom;
-
-
-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.Transformer;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.json.JSONDataBinding;
-import org.apache.tuscany.sca.databinding.json.JSONHelper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.codehaus.jettison.json.JSONObject;
-import org.osoa.sca.annotations.Service;
-
-/**
- * @version $Rev$ $Date$
- */
-@Service(Transformer.class)
-public class JSON2OMElement extends BaseTransformer<Object, OMElement> implements PullTransformer<Object, OMElement> {
-
- private OMFactory factory = OMAbstractFactory.getOMFactory();
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- protected Class<OMElement> getTargetType() {
- return OMElement.class;
- }
-
- public OMElement transform(Object source, TransformationContext context) {
- try {
- JSONObject json = JSONHelper.toJettison(source);
- if (json == null) {
- return null;
- }
- String ns = JSONDataBinding.ROOT_ELEMENT.getNamespaceURI();
- String name = JSONDataBinding.ROOT_ELEMENT.getLocalPart();
- if (context != null) {
- DataType<?> dataType = context.getTargetDataType();
- Object logical = dataType.getLogical();
- if (logical instanceof XMLType) {
- XMLType xmlType = (XMLType)logical;
- if (xmlType.isElement()) {
- ns = xmlType.getElementName().getNamespaceURI();
- name = xmlType.getElementName().getLocalPart();
- }
- }
- }
- JSONBadgerfishDataSource ds = new JSONBadgerfishDataSource(json);
- OMNamespace namespace = factory.createOMNamespace(ns, "");
- return factory.createOMElement(ds, name, namespace);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 500;
- }
-
- @Override
- public String getSourceDataBinding() {
- return JSONDataBinding.NAME;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSONBadgerfishDataSource.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSONBadgerfishDataSource.java
deleted file mode 100644
index adc38772be..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSONBadgerfishDataSource.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.json.axiom;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.codehaus.jettison.badgerfish.BadgerFishXMLStreamReader;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
-/**
- * JSONDataSource keeps the JSON String inside and consumes it when needed. This is to be kept in the
- * OMSourcedElementImpl and can be used either to expand the tree or get the JSON String directly without expanding.
- * This uses the "Badgerfish" JSON convention.
- *
- * @version $Rev$ $Date$
- */
-
-public class JSONBadgerfishDataSource extends JSONDataSource {
-
- public JSONBadgerfishDataSource(JSONObject json) {
- super(json);
- }
-
- /**
- * Gives the StAX reader using the "Badgerfish" formatted input JSON String.
- *
- * @return The XMLStreamReader according to the JSON String.
- * @throws javax.xml.stream.XMLStreamException if there is an error while making the StAX reader.
- */
- @Override
- public javax.xml.stream.XMLStreamReader getReader() throws XMLStreamException {
- try {
- return new BadgerFishXMLStreamReader(json);
- } catch (JSONException e) {
- throw new XMLStreamException(e);
- }
-
- }
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSONDataSource.java b/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSONDataSource.java
deleted file mode 100644
index 5b0312056e..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/axiom/JSONDataSource.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.json.axiom;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMOutputFormat;
-import org.codehaus.jettison.json.JSONObject;
-import org.codehaus.jettison.json.JSONTokener;
-import org.codehaus.jettison.mapped.MappedXMLInputFactory;
-
-/**
- * JSONDataSource keeps the JSON String inside and consumes it when needed. This is to be kept in the
- * OMSourcedElementImpl and can be used either to expand the tree or get the JSON String directly without expanding.
- * This uses the "Mapped" JSON convention.
- *
- * @version $Rev$ $Date$
- */
-
-public class JSONDataSource implements OMDataSource {
- protected JSONObject json;
-
- public JSONDataSource(JSONObject json) {
- this.json = json;
- }
-
- /**
- * Writes JSON into the output stream. As this should write JSON, it directly gets the JSON string and writes it
- * without expanding the tree.
- *
- * @param outputStream the stream to be written into
- * @param omOutputFormat format of the message, this is ignored.
- * @throws javax.xml.stream.XMLStreamException if there is an error while writing the message in to the output
- * stream.
- */
- public void serialize(OutputStream outputStream, OMOutputFormat omOutputFormat)
- throws javax.xml.stream.XMLStreamException {
- try {
- String encoding = omOutputFormat == null ? "UTF-8" : omOutputFormat.getCharSetEncoding();
- outputStream.write(getJSONString().getBytes(encoding));
- } catch (IOException e) {
- throw new OMException();
- }
- }
-
- /**
- * Writes JSON through the writer. As this should write JSON, it directly gets the JSON string and writes it without
- * expanding the tree.
- *
- * @param writer Writer to be written into
- * @param omOutputFormat format of the message, this is ignored.
- * @throws javax.xml.stream.XMLStreamException if there is an error while writing the message through the writer.
- */
- public void serialize(Writer writer, OMOutputFormat omOutputFormat) throws javax.xml.stream.XMLStreamException {
- try {
- writer.write(getJSONString());
- } catch (IOException e) {
- throw new OMException();
- }
- }
-
- /**
- * Writes XML through the XMLStreamWriter. As the input data source is JSON, this method needs to get a StAX reader
- * from that JSON String. Therefore this uses the getReader() method to get the StAX reader writes the events into
- * the XMLStreamWriter.
- *
- * @param xmlStreamWriter StAX writer to be written into
- * @throws javax.xml.stream.XMLStreamException if there is an error while writing the message through the StAX
- * writer.
- */
- public void serialize(javax.xml.stream.XMLStreamWriter xmlStreamWriter) throws javax.xml.stream.XMLStreamException {
- XMLStreamReader reader = getReader();
- xmlStreamWriter.writeStartDocument();
- while (reader.hasNext()) {
- int x = reader.next();
- switch (x) {
- case XMLStreamConstants.START_ELEMENT:
- xmlStreamWriter.writeStartElement(reader.getPrefix(), reader.getLocalName(), reader
- .getNamespaceURI());
- int namespaceCount = reader.getNamespaceCount();
- for (int i = namespaceCount - 1; i >= 0; i--) {
- xmlStreamWriter.writeNamespace(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
- }
- int attributeCount = reader.getAttributeCount();
- for (int i = 0; i < attributeCount; i++) {
- xmlStreamWriter.writeAttribute(reader.getAttributePrefix(i),
- reader.getAttributeNamespace(i),
- reader.getAttributeLocalName(i),
- reader.getAttributeValue(i));
- }
- break;
- case XMLStreamConstants.START_DOCUMENT:
- break;
- case XMLStreamConstants.CHARACTERS:
- xmlStreamWriter.writeCharacters(reader.getText());
- break;
- case XMLStreamConstants.CDATA:
- xmlStreamWriter.writeCData(reader.getText());
- break;
- case XMLStreamConstants.END_ELEMENT:
- xmlStreamWriter.writeEndElement();
- break;
- case XMLStreamConstants.END_DOCUMENT:
- xmlStreamWriter.writeEndDocument();
- break;
- case XMLStreamConstants.SPACE:
- break;
- case XMLStreamConstants.COMMENT:
- xmlStreamWriter.writeComment(reader.getText());
- break;
- case XMLStreamConstants.DTD:
- xmlStreamWriter.writeDTD(reader.getText());
- break;
- case XMLStreamConstants.PROCESSING_INSTRUCTION:
- xmlStreamWriter.writeProcessingInstruction(reader.getPITarget(), reader.getPIData());
- break;
- case XMLStreamConstants.ENTITY_REFERENCE:
- xmlStreamWriter.writeEntityRef(reader.getLocalName());
- break;
- default:
- throw new OMException();
- }
- }
- xmlStreamWriter.writeEndDocument();
- }
-
- /**
- * Gives the StAX reader using the "Mapped" formatted input JSON String.
- *
- * @return The XMLStreamReader according to the JSON String.
- * @throws javax.xml.stream.XMLStreamException if there is an error while making the StAX reader.
- */
-
- public javax.xml.stream.XMLStreamReader getReader() throws javax.xml.stream.XMLStreamException {
-
- Map<String, String> nsMap = new HashMap<String, String>();
- nsMap.put("", "");
-
- // input factory for "Mapped" convention
- MappedXMLInputFactory inputFactory = new MappedXMLInputFactory(nsMap);
- String jsonString = this.getJSONString();
- return inputFactory.createXMLStreamReader(new JSONTokener(jsonString));
- }
-
- // returns the json string by consuming the JSON input stream.
- protected String getJSONString() {
- return json.toString();
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding b/branches/sca-android/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
deleted file mode 100644
index b0baaeb398..0000000000
--- a/branches/sca-android/modules/databinding-json/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.json.JSONDataBinding;type=JSON,name=json \ No newline at end of file
diff --git a/branches/sca-android/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/branches/sca-android/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index b122533f6e..0000000000
--- a/branches/sca-android/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
+++ /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.
-
-# Implementation classes for the transformers
-org.apache.tuscany.sca.databinding.json.JSON2XMLStreamReader;source=JSON,target=javax.xml.stream.XMLStreamReader,weight=5000
-org.apache.tuscany.sca.databinding.json.XMLStreamReader2JSON;source=javax.xml.stream.XMLStreamReader,target=JSON,weight=5000,public=false
-org.apache.tuscany.sca.databinding.json.JavaBean2JSON;source=java:complexType,target=JSON,weight=80000,public=false
-org.apache.tuscany.sca.databinding.json.JavaBean2JSON;source=java:simpleType,target=JSON,weight=80000,public=false
-org.apache.tuscany.sca.databinding.json.axiom.JSON2OMElement;source=JSON,target=org.apache.axiom.om.OMElement,weight=500
-org.apache.tuscany.sca.databinding.json.JavaBean2JSON;source=java:array,target=JSON,weight=80000,public=false
-org.apache.tuscany.sca.databinding.json.JavaBean2JSON;source=commonj.sdo.DataObject,target=JSON,weight=80000,public=false
-org.apache.tuscany.sca.databinding.json.JavaBean2JSON;source=javax.xml.bind.JAXBElement,target=JSON,weight=80000,public=false
-org.apache.tuscany.sca.databinding.json.JSON2JavaBean;source=JSON,target=java:complexType,weight=80000,public=false
-org.apache.tuscany.sca.databinding.json.JSON2JavaBean;source=JSON,target=java:simpleType,weight=80000,public=false
-org.apache.tuscany.sca.databinding.json.JSON2JavaBean;source=JSON,target=commonj.sdo.DataObject,weight=80000,public=false
-org.apache.tuscany.sca.databinding.json.JSON2JavaBean;source=JSON,target=javax.xml.bind.JAXBElement,weight=80000,public=false
-org.apache.tuscany.sca.databinding.json.JSON2JavaBean;source=JSON,target=java:array,weight=80000,public=false
diff --git a/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/JSONTransformerTestCase.java b/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/JSONTransformerTestCase.java
deleted file mode 100644
index 3c7f151ed7..0000000000
--- a/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/JSONTransformerTestCase.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.databinding.json;
-
-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 junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.databinding.json.axiom.JSON2OMElement;
-import org.apache.tuscany.sca.databinding.xml.XMLStreamSerializer;
-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.json.JSONObject;
-
-public class JSONTransformerTestCase 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>";
-
- private static final String JSON_STR = "{\"xsl:root\":{\"@xmlns\":{\"xsl\":\"http://foo.com\"},\"data\":{\"$\":\"my json string\"}}}";
-
- public void testXML2JSON() throws Exception {
- XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(IPO_XML));
- XMLStreamReader2JSON t1 = new XMLStreamReader2JSON();
- JSONObject json = (JSONObject) t1.transform(reader, null);
- Assert.assertNotNull(json);
-
- // Cannot round-trip as we hit a bug in Jettison: http://jira.codehaus.org/browse/JETTISON-37
- /*
- JSON2XMLStreamReader t2 = new JSON2XMLStreamReader();
- XMLStreamReader reader2 = t2.transform(json, null);
- StringWriter sw = new StringWriter();
- XMLStreamWriter streamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(sw);
- new XMLStreamSerializer().serialize(reader2, streamWriter);
- streamWriter.flush();
- System.out.println(sw.toString());
- */
-
- }
-
- public void testJSON2XML() throws Exception {
- JSON2XMLStreamReader t2 = new JSON2XMLStreamReader();
- XMLStreamReader reader2 = t2.transform(new JSONObject(JSON_STR), null);
- StringWriter sw = new StringWriter();
- XMLStreamWriter streamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(sw);
- new XMLStreamSerializer().serialize(reader2, streamWriter);
- streamWriter.flush();
- Assert.assertTrue(sw.toString()
- .contains("<xsl:root xmlns:xsl=\"http://foo.com\"><data>my json string</data></xsl:root>"));
- }
-
- public void testJSON2OMElement() throws Exception {
- JSON2OMElement t1 = new JSON2OMElement();
- TransformationContext context = new TransformationContextImpl();
- DataType dt = new DataTypeImpl(Object.class, new XMLType(new QName("http://foo.com", "root"), null));
- context.setTargetDataType(dt);
- OMElement element = t1.transform(new JSONObject(JSON_STR), context);
- StringWriter writer = new StringWriter();
- element.serialize(writer);
- // System.out.println(writer.toString());
- }
-
- public void testString2JSON() throws Exception {
- String json = "{\"name\":\"John\",\"age\":25}";
- String2JSON t1 = new String2JSON();
- JSONObject jsonObject = (JSONObject) t1.transform(json, null);
- assertEquals(jsonObject.getString("name"), "John");
- assertEquals(jsonObject.getInt("age"), 25);
- JSON2String t2 = new JSON2String();
- String str = t2.transform(jsonObject, null);
- assertTrue(str.contains("\"name\":\"John\""));
- assertTrue(str.contains("\"age\":25"));
- }
-}
diff --git a/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSONTestCase.java b/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSONTestCase.java
deleted file mode 100644
index 3b36f5be74..0000000000
--- a/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSONTestCase.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.json;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.json.JSONObject;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaBean2JSONTestCase {
-
- public static class MyBean {
- private String name;
- private int age;
- private boolean vip;
- private String friends[];
- private List<String> books;
- private YourBean you;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public int getAge() {
- return age;
- }
-
- public void setAge(int age) {
- this.age = age;
- }
-
- public boolean isVip() {
- return vip;
- }
-
- public void setVip(boolean vip) {
- this.vip = vip;
- }
-
- public String[] getFriends() {
- return friends;
- }
-
- public void setFriends(String[] friends) {
- this.friends = friends;
- }
-
- public List<String> getBooks() {
- return books;
- }
-
- public void setBooks(List<String> books) {
- this.books = books;
- }
-
- public YourBean getYou() {
- return you;
- }
-
- public void setYou(YourBean you) {
- this.you = you;
- }
-
- }
-
- public static class YourBean {
- private int id;
- private String name;
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
- }
-
- @Test
- public void testBean2JSON() throws Exception {
- MyBean me = new MyBean();
- me.setAge(30);
- me.setBooks(new ArrayList<String>());
- me.setFriends(new String[] {"John", "Mike"});
- me.setVip(true);
- me.setName("Me");
- YourBean you = new YourBean();
- you.setId(123);
- you.setName(null);
- me.setYou(you);
- JavaBean2JSON t1 = new JavaBean2JSON();
- Object result = t1.transform(me, null);
- System.out.println(result);
- JSON2JavaBean t2 = new JSON2JavaBean();
- TransformationContext context = new TransformationContextImpl();
- context.setTargetDataType(new DataTypeImpl(MyBean.class, null));
- Object v = t2.transform(new JSONObject(result.toString()), context);
- Assert.assertTrue(v instanceof MyBean);
- // String json =
- // "{\"age\":30,\"books\":[],\"friends\":[\"John\",\"Mike\"],\"name\":\"Me\",\"vip\":true,\"you\":{\"id\":123,\"name\":null}}";
- // Assert.assertEquals(json, result.toString());
- }
-
- @Test
- public void testString2JSON() throws Exception {
- JavaBean2JSONObject t1 = new JavaBean2JSONObject();
- Object result = t1.transform("ABC", null);
- System.out.println(result);
- JSON2JavaBean t2 = new JSON2JavaBean();
- TransformationContext context = new TransformationContextImpl();
- context.setTargetDataType(new DataTypeImpl(String.class, null));
- Object v = t2.transform(result, context);
- Assert.assertTrue(v instanceof String);
- Assert.assertEquals("ABC", v);
- }
-
- @Test
- public void testStringArray2JSON() throws Exception {
- JavaBean2JSON t1 = new JavaBean2JSON();
- Object result = t1.transform(new String[] {"ABC", "DF"}, null);
- System.out.println(result);
- JSON2JavaBean t2 = new JSON2JavaBean();
- TransformationContext context = new TransformationContextImpl();
- context.setTargetDataType(new DataTypeImpl(String[].class, null));
- Object v = t2.transform(result, context);
- Assert.assertTrue(v instanceof String[]);
- String[] strs = (String[])v;
- Assert.assertEquals("ABC", strs[0]);
- Assert.assertEquals("DF", strs[1]);
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/MyBean.java b/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/MyBean.java
deleted file mode 100644
index 60b293c1d4..0000000000
--- a/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/MyBean.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.databinding.json;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-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/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/MyInterface.java b/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/MyInterface.java
deleted file mode 100644
index d32e0763c7..0000000000
--- a/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/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.json;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface MyInterface {
- void setId(String id);
-
- String getId();
-}
diff --git a/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/MyInterfaceImpl.java b/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/MyInterfaceImpl.java
deleted file mode 100644
index 3a2b95a4e2..0000000000
--- a/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/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.json;
-
-/**
- * @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/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/POJOTestCase.java b/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/POJOTestCase.java
deleted file mode 100644
index 84995baadf..0000000000
--- a/branches/sca-android/modules/databinding-json/src/test/java/org/apache/tuscany/sca/databinding/json/POJOTestCase.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.databinding.json;
-
-import java.lang.reflect.Array;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-
-public class POJOTestCase extends TestCase {
- public void testPOJO() throws Exception {
- 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);
-
- roundTrip(bean);
- }
-
- private <T> void roundTrip(T bean) {
- JavaBean2JSON t1 = new JavaBean2JSON();
-
- Object json = t1.transform(bean, null);
- System.out.println(json);
- JSON2JavaBean t2 = new JSON2JavaBean();
-
- TransformationContext context = new TransformationContextImpl();
- context.setTargetDataType(new DataTypeImpl(bean == null ? Object.class : bean.getClass(), null));
- Object newBean = t2.transform(json, context);
-
- if (newBean != null && newBean.getClass().isArray()) {
- int len = Array.getLength(newBean);
- assertEquals(Array.getLength(bean), len);
- for (int i = 0; i < len; i++) {
- assertEquals(Array.get(bean, i), Array.get(newBean, i));
- }
- return;
- }
- assertEquals(bean, newBean);
- }
-
- public void testString() throws Exception {
- roundTrip("ABC");
- }
-
- public void testNull() throws Exception {
- roundTrip(null);
- }
-
- public void testArray() throws Exception {
- roundTrip(new String[] {"123", "ABC"});
- }
-
- public void testByteArray() throws Exception {
- roundTrip("ABC".getBytes());
- }
-
- public void testPrimitive() throws Exception {
- roundTrip(123);
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-json/src/test/resources/ipo.xsd b/branches/sca-android/modules/databinding-json/src/test/resources/ipo.xsd
deleted file mode 100644
index 5a493e1746..0000000000
--- a/branches/sca-android/modules/databinding-json/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/branches/sca-android/modules/databinding-saxon/LICENSE b/branches/sca-android/modules/databinding-saxon/LICENSE
deleted file mode 100644
index d645695673..0000000000
--- a/branches/sca-android/modules/databinding-saxon/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/branches/sca-android/modules/databinding-saxon/META-INF/README b/branches/sca-android/modules/databinding-saxon/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/databinding-saxon/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/databinding-saxon/NOTICE b/branches/sca-android/modules/databinding-saxon/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/databinding-saxon/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/branches/sca-android/modules/databinding-saxon/pom.xml b/branches/sca-android/modules/databinding-saxon/pom.xml
deleted file mode 100644
index 390bf1f4f5..0000000000
--- a/branches/sca-android/modules/databinding-saxon/pom.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding-saxon</artifactId>
- <name>Apache Tuscany SCA Data Binding for Saxon</name>
-
- <repositories>
- <repository>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>rfeng</id>
- <name>Tuscany Maven 2.0 Repository</name>
- <url>http://svn.apache.org/repos/asf/incubator/tuscany/maven</url>
- <layout>default</layout>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <!--dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon</artifactId>
- <version>9.0.0.2</version>
- </dependency>
-
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-api</artifactId>
- <version>9.0.0.2</version>
- </dependency>
-
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-dom</artifactId>
- <version>9.0.0.2</version>
- </dependency-->
-
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon</artifactId>
- <version>8.7</version>
- </dependency>
-
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-dom</artifactId>
- <version>8.7</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-lib</artifactId>
- <version>1.1.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-impl</artifactId>
- <version>1.1.1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.1</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.databinding.saxon</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.databinding.saxon*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/DataObject2NodeInfoTransformer.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/DataObject2NodeInfoTransformer.java
deleted file mode 100644
index 25f8ee886f..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/DataObject2NodeInfoTransformer.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.saxon;
-
-import javax.xml.transform.dom.DOMResult;
-
-import net.sf.saxon.om.NodeInfo;
-
-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 commonj.sdo.DataObject;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-
-/**
- * Transforms SDO DataObject-s to NodeInfo objects needed by Saxon parser.
- *
- * For root element when Serializing the DataObject the name of its
- * implemented interface is used with its first letter made lowercase.
- * Also any namespaces that are defined are deleted, because otherwise
- * the SaxonB parser does not work
- *
- * @version $Rev$ $Date$
- */
-public class DataObject2NodeInfoTransformer extends BaseTransformer<DataObject, NodeInfo> implements
- PullTransformer<DataObject, NodeInfo> {
-
- private Node2NodeInfoTransformer node2NodeInfoTransformer;
-
- public DataObject2NodeInfoTransformer(Node2NodeInfoTransformer node2NodeInfoTransformer) {
- this.node2NodeInfoTransformer = node2NodeInfoTransformer;
- }
-
- public DataObject2NodeInfoTransformer() {
- this.node2NodeInfoTransformer = new Node2NodeInfoTransformer();
- }
-
- public NodeInfo transform(DataObject source, TransformationContext context) {
- // FIXME: Need to create the HelperContext from the transformation context
- // FIXME: This is a big hack to create a document using the class name
- XMLHelper helper = XMLHelper.INSTANCE;
- String name = null;
- if (source.getClass().getInterfaces().length > 0) {
- name = source.getClass().getInterfaces()[0].getSimpleName();
- } else {
- name = source.getClass().getName();
- }
-
- if (name.length() > 0) {
- name = Character.toLowerCase(name.charAt(0)) + name.substring(1, name.length());
- }
-
- try {
- DOMResult domResult = new DOMResult(DOMHelper.newDocument());
- XMLDocument xmlDoc = helper.createDocument(source, null, name);
- helper.save(xmlDoc, domResult, null);
- return node2NodeInfoTransformer.transform(domResult.getNode(), context);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
-
- }
-
- @Override
- protected Class<DataObject> getSourceType() {
- return DataObject.class;
- }
-
- @Override
- protected Class<NodeInfo> getTargetType() {
- return NodeInfo.class;
- }
-
- @Override
- public int getWeight() {
- return 30 + node2NodeInfoTransformer.getWeight();
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/ItemList2ObjectTransformer.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/ItemList2ObjectTransformer.java
deleted file mode 100644
index 7122217b8b..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/ItemList2ObjectTransformer.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.databinding.saxon;
-
-import java.lang.reflect.Array;
-
-import net.sf.saxon.om.Item;
-import net.sf.saxon.om.NodeInfo;
-import net.sf.saxon.trans.XPathException;
-import net.sf.saxon.value.Value;
-
-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.saxon.collection.ItemList;
-
-/**
- * Transforms each object contained in the ItemList object.
- *
- * If the object type is the same as the target type, it is not transformed.
- *
- * If the object is a NodeInfo, it's transformed to a DataObject.
- *
- * If the object is a Value, it's transformed to a Java object.
- *
- * If the target type is not an array, the first transformed object is returned.
- *
- * If the first transformed object type is not a target type, then a
- * TransformException is thrown
- *
- * If the target type is an array, a array of this type is created containing
- * all transformed objects and it is returned
- *
- * If any transformed object is not a target type, then a TransformException is
- * thrown
- *
- * @version $Rev: 659284 $ $Date: 2008-05-22 14:26:18 -0800 (Thu, 22 May 2008) $
- */
-public class ItemList2ObjectTransformer extends BaseTransformer<ItemList, Object> implements
- PullTransformer<ItemList, Object> {
-
- private NodeInfo2DataObjectTransformer nodeInfo2DataObjectTransformer = new NodeInfo2DataObjectTransformer();
-
- public ItemList2ObjectTransformer() {
- }
-
- @Override
- protected Class<ItemList> getSourceType() {
- return ItemList.class;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- @Override
- public int getWeight() {
- return 30 + nodeInfo2DataObjectTransformer.getWeight();
- }
-
- public Object transform(ItemList source, TransformationContext context) {
-
- if (source.size() == 0) {
- return null;
- }
-
- Class<?> targetType = context.getTargetDataType().getPhysical();
-
- if (targetType.isArray()) {
- int i = 0;
- Class<?> componentClass = targetType.getComponentType();
- Object[] result = (Object[])Array.newInstance(componentClass, source.size());
-
- try {
-
- if (componentClass.isAssignableFrom(NodeInfo.class) || componentClass.isAssignableFrom(Value.class)) {
-
- for (Item item : source) {
- result[i++] = item;
- }
-
- } else {
-
- for (Item item : source) {
-
- if (item instanceof NodeInfo) {
- result[i] = nodeInfo2DataObjectTransformer.transform((NodeInfo)item, context);
-
- } else if (item instanceof Value) {
- result[i] = Value.convert(item);
-
- } else {
- result[i] = item;
- }
-
- i++;
-
- }
-
- }
-
- } catch (ArrayStoreException ex) {
- throw new TransformationException(ex);
-
- } catch (XPathException ex) {
- throw new TransformationException(ex);
- }
-
- return result;
-
- } else {
- Item item = source.iterator().next();
-
- if (item.getClass().isAssignableFrom(targetType)) {
- return item;
-
- } else if (item instanceof NodeInfo) {
- return nodeInfo2DataObjectTransformer.transform((NodeInfo)item, context);
-
- } else {
-
- try {
- return Value.convert(item);
-
- } catch (XPathException e) {
- throw new TransformationException(e);
- }
-
- }
-
- }
-
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Node2NodeInfoTransformer.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Node2NodeInfoTransformer.java
deleted file mode 100644
index fabadd34ea..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Node2NodeInfoTransformer.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.saxon;
-
-import javax.xml.transform.dom.DOMSource;
-
-import net.sf.saxon.Configuration;
-import net.sf.saxon.event.Builder;
-import net.sf.saxon.om.NodeInfo;
-import net.sf.saxon.trans.XPathException;
-
-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;
-
-/**
- * Transforms DOM Node-s to NodeInfo objects needed by Saxon parser.
- *
- * Any namespaces that are defined are deleted, because otherwise
- * the SaxonB parser does not work
- *
- * @version $Rev$ $Date$
- */
-public class Node2NodeInfoTransformer extends BaseTransformer<Node, NodeInfo> implements
- PullTransformer<Node, NodeInfo> {
-
- public NodeInfo transform(Node source, TransformationContext context) {
- Configuration configuration = SaxonDataBindingHelper.CURR_EXECUTING_CONFIG;
- if (configuration == null) {
- configuration = new Configuration();
- }
-
- NodeInfo docInfo = null;
- try {
- source = DOMHelper.promote(source);
- docInfo = Builder.build(new DOMSource(source), null, configuration);
- } catch (XPathException e) {
- throw new TransformationException(e);
- }
- return docInfo;
- }
-
- @Override
- protected Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- protected Class<NodeInfo> getTargetType() {
- return NodeInfo.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2DataObjectTransformer.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2DataObjectTransformer.java
deleted file mode 100644
index a5093f8cdf..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2DataObjectTransformer.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.saxon;
-
-import java.io.IOException;
-
-import javax.xml.transform.dom.DOMSource;
-
-import net.sf.saxon.om.NodeInfo;
-
-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.Document;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.XMLHelper;
-
-/**
- * Transforms NodeInfo objects to SDO DataObjects.
- *
- * Before constructing the data object, resulting XML is populated
- * with correct namespaces (which are taken from the logical target data type)
- * These namespaces are crucial for constructing the right instance of
- * the DataObject (i.e. if there is a SDO factory, an instance from this factory will
- * be used, not the generic any data object)
- *
- * @version $Rev$ $Date$
- */
-public class NodeInfo2DataObjectTransformer extends BaseTransformer<NodeInfo, DataObject> implements
- PullTransformer<NodeInfo, DataObject> {
-
- private NodeInfo2NodeTransformer nodeInfo2NodeTransformer;
-
- public NodeInfo2DataObjectTransformer(NodeInfo2NodeTransformer nodeInfo2NodeTransformer) {
- this.nodeInfo2NodeTransformer = nodeInfo2NodeTransformer;
- }
-
- public NodeInfo2DataObjectTransformer() {
- this.nodeInfo2NodeTransformer = new NodeInfo2NodeTransformer();
- }
-
- @Override
- protected Class<NodeInfo> getSourceType() {
- return NodeInfo.class;
- }
-
- @Override
- protected Class<DataObject> getTargetType() {
- return DataObject.class;
- }
-
- @Override
- public int getWeight() {
- return 30 + nodeInfo2NodeTransformer.getWeight();
- }
-
- public DataObject transform(NodeInfo source, TransformationContext context) {
- Document doc = (Document)nodeInfo2NodeTransformer.transform(source, context);
-
- return produceResult(doc);
- }
-
- private DataObject produceResult(Document doc) {
- try {
- // FIXME: [rfeng] We should use the HelperContext from the context
- DataObject resultingObject =
- XMLHelper.INSTANCE.load(new DOMSource(doc), doc.getDocumentURI(), null).getRootObject();
- return resultingObject;
- } catch (IOException e) {
- throw new TransformationException(e);
- }
- }
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2JavaArrayTransformer.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2JavaArrayTransformer.java
deleted file mode 100644
index 36ebac3aea..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2JavaArrayTransformer.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.saxon;
-
-import java.lang.reflect.Array;
-
-import net.sf.saxon.om.Item;
-import net.sf.saxon.om.NodeInfo;
-import net.sf.saxon.trans.XPathException;
-import net.sf.saxon.value.Value;
-
-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.saxon.collection.ItemList;
-
-import commonj.sdo.DataObject;
-
-/**
- * Transforms a NodeInfo object to a DataObject and return it in an array.
- *
- * @version $Rev: 659284 $ $Date: 2008-05-22 14:26:18 -0800 (Thu, 22 May 2008) $
- */
-public class NodeInfo2JavaArrayTransformer extends
- BaseTransformer<NodeInfo, Object[]> implements
- PullTransformer<NodeInfo, Object[]> {
-
- private NodeInfo2DataObjectTransformer nodeInfo2DataObjectTransformer = new NodeInfo2DataObjectTransformer();
-
- public NodeInfo2JavaArrayTransformer() {}
-
- @Override
- protected Class<NodeInfo> getSourceType() {
- return NodeInfo.class;
- }
-
- @Override
- protected Class<Object[]> getTargetType() {
- return Object[].class;
- }
-
- @Override
- public int getWeight() {
- return 30 + nodeInfo2DataObjectTransformer.getWeight();
- }
-
- public Object[] transform(NodeInfo source, TransformationContext context) {
- Object object = nodeInfo2DataObjectTransformer.transform(source, context);
-
- Class<?> componentClass = context.getTargetDataType().getPhysical().getComponentType();
- Object[] result = (Object[]) Array.newInstance(componentClass, 1);
-
- result[0] = object;
-
- return result;
-
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2NodeTransformer.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2NodeTransformer.java
deleted file mode 100644
index 1e5b816662..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2NodeTransformer.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.saxon;
-
-import java.util.Properties;
-
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.dom.DOMResult;
-
-import net.sf.saxon.om.NodeInfo;
-import net.sf.saxon.query.QueryResult;
-
-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;
-
-/**
- * Transforms NodeInfo objects to SDO DataObjects.
- *
- * @version $Rev$ $Date$
- */
-public class NodeInfo2NodeTransformer extends BaseTransformer<NodeInfo, Node> implements
- PullTransformer<NodeInfo, Node> {
-
- public Node transform(NodeInfo source, TransformationContext context) {
- DOMResult destination = new DOMResult();
- try {
- Properties props = new Properties();
- props.setProperty(OutputKeys.METHOD, "xml");
- props.setProperty(OutputKeys.INDENT, "yes");
- QueryResult.serialize(source, destination, props, source.getConfiguration());
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- return destination.getNode();
- }
-
- @Override
- protected Class<NodeInfo> getSourceType() {
- return NodeInfo.class;
- }
-
- @Override
- protected Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Object2ValueTransformer.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Object2ValueTransformer.java
deleted file mode 100644
index 616bcca6c5..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Object2ValueTransformer.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.saxon;
-
-import net.sf.saxon.value.FloatValue;
-import net.sf.saxon.value.ObjectValue;
-import net.sf.saxon.value.Value;
-
-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.javabeans.JavaBeansDataBinding;
-
-/**
- * Transforms generic java objects to Value objects needed by Saxon parser.
- *
- * @version $Rev$ $Date$
- */
-public class Object2ValueTransformer extends BaseTransformer<Object, Value> implements PullTransformer<Object, Value> {
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- protected Class<Value> getTargetType() {
- return Value.class;
- }
-
- @Override
- public String getSourceDataBinding() {
- return JavaBeansDataBinding.NAME;
- }
-
- @Override
- public int getWeight() {
- return 10000;
- }
-
- public Value transform(Object source, TransformationContext context) {
- // WORKAROUND for ClassCastException in ObjectValue.toJavaObject(float)
- if (source instanceof Float) {
- return new FloatValue(((Float)source).floatValue());
- }
- return new ObjectValue(source);
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonDataBindingHelper.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonDataBindingHelper.java
deleted file mode 100644
index ecb20b24b5..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonDataBindingHelper.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.databinding.saxon;
-
-import net.sf.saxon.Configuration;
-
-/**
- * Provides helper functionality for Saxon data bindings
- * @version $Rev$ $Date$
- */
-public class SaxonDataBindingHelper {
- /**
- * This variable is meaningful only in the context of XQoery expression
- * execution. It is used by the DataObject2NodeInfoTransformer and
- * Node2NodeInfoTransformer to create the correct NodeInfo objects
- * in the Output2Output transformations.
- * For Input2Input transformations it is meaningless:
- * - if it is null - it is ignored by the transformers as they create new
- * configuration objects
- * - if it is not null - it is reused
- * However the XQueryInvoker transforms all NodeInfo-s to NodeInfo-s with
- * its current configuration, so there is no effect for Input2Input transformations
- */
- public static Configuration CURR_EXECUTING_CONFIG = null;
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonNodeDataBinding.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonNodeDataBinding.java
deleted file mode 100644
index ccf842710d..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonNodeDataBinding.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.databinding.saxon;
-
-
-import net.sf.saxon.om.NodeInfo;
-
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * Represents data binding for parameters of type NodeInfo.
- *
- * The NodeInfo type is the type accepted by the Saxon XQuery processor for
- * all XML - based content (i.e. not strings and simple types)
- *
- * @version $Rev$ $Date$
- */
-public class SaxonNodeDataBinding extends BaseDataBinding {
-
- public static final String NAME = NodeInfo.class.getName();
- public static final String[] ALIASES = new String[] {"saxon_node"};
-
- public SaxonNodeDataBinding() {
- super(NAME, NodeInfo.class);
- }
-
- @Override
- public boolean introspect(DataType type, Operation operation) {
- if (super.introspect(type, operation)) {
- // type.setLogical(XMLType.UNKNOWN);
- return true;
- } else {
- return false;
- }
- }
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonValueDataBinding.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonValueDataBinding.java
deleted file mode 100644
index 2f51cf86ec..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SaxonValueDataBinding.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.saxon;
-
-
-import net.sf.saxon.value.Value;
-
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * Represents data binding for parameters of type Value.
- *
- * The Value type is the type accepted by the Saxon XQuery processor for
- * all simple types and strings
- *
- * @version $Rev$ $Date$
- */
-public class SaxonValueDataBinding extends BaseDataBinding {
- public static final String NAME = Value.class.getName();
- public static final String[] ALIASES = new String[] {"saxon_value"};
-
- public SaxonValueDataBinding() {
- super(NAME, Value.class);
- }
-
- @Override
- public boolean introspect(DataType type, Operation operation) {
- if (super.introspect(type, operation)) {
- // type.setLogical(XMLType.UNKNOWN);
- return true;
- } else {
- return false;
- }
- }
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SimpleType2ValueTransformer.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SimpleType2ValueTransformer.java
deleted file mode 100644
index 67d89a6e0b..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SimpleType2ValueTransformer.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.databinding.saxon;
-
-import java.math.BigDecimal;
-
-import net.sf.saxon.value.DecimalValue;
-import net.sf.saxon.value.DoubleValue;
-import net.sf.saxon.value.FloatValue;
-import net.sf.saxon.value.IntegerValue;
-import net.sf.saxon.value.ObjectValue;
-import net.sf.saxon.value.StringValue;
-import net.sf.saxon.value.Value;
-
-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.javabeans.SimpleJavaDataBinding;
-
-/**
- * Transforms simple types and strings to Value objects needed by Saxon parser
- * @version $Rev$ $Date$
- */
-public class SimpleType2ValueTransformer extends BaseTransformer<Object, Value> implements
- PullTransformer<Object, Value> {
-
- @Override
- public String getSourceDataBinding() {
- return SimpleJavaDataBinding.NAME;
- }
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- protected Class<Value> getTargetType() {
- return Value.class;
- }
-
- @Override
- public int getWeight() {
- return 10000;
- }
-
- public Value transform(Object source, TransformationContext context) {
- Value result = null;
- if (source instanceof Integer) {
- result = new IntegerValue((Integer)source);
- } else if (source instanceof Long) {
- result = new IntegerValue((Long)source);
- } else if (source instanceof Short) {
- result = new IntegerValue((Short)source);
- } else if (source instanceof Byte) {
- result = new IntegerValue((Byte)source);
- } else if (source instanceof Double) {
- result = new DoubleValue((Double)source);
- } else if (source instanceof Float) {
- result = new FloatValue((Float)source);
- } else if (source instanceof BigDecimal) {
- result = new DecimalValue((BigDecimal)source);
- } else if (source instanceof String) {
- result = new StringValue(((String)source));
- } else {
- result = new ObjectValue(source);
- }
-
- return result;
- }
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2JavaArray.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2JavaArray.java
deleted file mode 100644
index 16d5f524bb..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2JavaArray.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.saxon;
-
-import java.lang.reflect.Array;
-
-import net.sf.saxon.trans.XPathException;
-import net.sf.saxon.value.Value;
-
-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;
-
-/**
- * Transforms a Value object to a Java Object and return it in an array.
- *
- * @version $Rev: 659284 $ $Date: 2008-05-22 14:26:18 -0800 (Thu, 22 May 2008) $
- */
-public class Value2JavaArray extends BaseTransformer<Value, Object[]> implements PullTransformer<Value, Object[]> {
-
- public Value2JavaArray() {
- }
-
- @Override
- protected Class<Value> getSourceType() {
- return Value.class;
- }
-
- @Override
- protected Class<Object[]> getTargetType() {
- return Object[].class;
- }
-
- @Override
- public int getWeight() {
- return super.getWeight() + 100;
- }
-
- public Object[] transform(Value source, TransformationContext context) {
-
- try {
- Object object = Value.convert(Value.asItem(source));
-
- Class<?> componentClass = context.getTargetDataType().getPhysical().getComponentType();
- Object[] result = (Object[])Array.newInstance(componentClass, 1);
-
- result[0] = object;
-
- return result;
-
- } catch (XPathException e) {
- throw new TransformationException(e.getMessage());
- }
-
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2ObjectTransformer.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2ObjectTransformer.java
deleted file mode 100644
index 7589f6789b..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2ObjectTransformer.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.saxon;
-
-import net.sf.saxon.trans.XPathException;
-import net.sf.saxon.value.Value;
-
-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.javabeans.JavaBeansDataBinding;
-
-/**
- * Transforms Value objects to generic java objects
- * @version $Rev$ $Date$
- */
-public class Value2ObjectTransformer extends BaseTransformer<Value, Object> implements PullTransformer<Value, Object> {
-
- public Object transform(Value source, TransformationContext context) {
- Object object;
- try {
- object = Value.convert(Value.asItem(source));
- } catch (XPathException e) {
- throw new TransformationException(e);
- }
- return object;
- }
-
- @Override
- protected Class<Value> getSourceType() {
- return Value.class;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JavaBeansDataBinding.NAME;
- }
-
- @Override
- public int getWeight() {
- return 10000;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2SimpleTypeTransformer.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2SimpleTypeTransformer.java
deleted file mode 100644
index 5da4effcfd..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2SimpleTypeTransformer.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.saxon;
-
-import net.sf.saxon.trans.XPathException;
-import net.sf.saxon.value.Value;
-
-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.javabeans.SimpleJavaDataBinding;
-
-/**
- * Transforms Value objects to simple types
- * @version $Rev$ $Date$
- */
-public class Value2SimpleTypeTransformer extends BaseTransformer<Value, Object> implements
- PullTransformer<Value, Object> {
- public Object transform(Value source, TransformationContext context) {
- Object object;
- try {
- object = Value.convert(Value.asItem(source));
- } catch (XPathException e) {
- throw new TransformationException(e);
- }
- return object;
- }
-
- @Override
- public String getTargetDataBinding() {
- return SimpleJavaDataBinding.NAME;
- }
-
- @Override
- protected Class<Value> getSourceType() {
- return Value.class;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- @Override
- public int getWeight() {
- return 10000;
- }
-}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/collection/ItemList.java b/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/collection/ItemList.java
deleted file mode 100644
index 065121520b..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/collection/ItemList.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.saxon.collection;
-
-import java.util.ArrayList;
-
-import net.sf.saxon.om.Item;
-
-/**
- * Stores a list of Item objects.
- *
- * Used by the implementation.xquery to store a collection of results
- * generated by the xquery execution.
- *
- * @version $Rev: 659284 $ $Date: 2008-05-22 14:26:18 -0800 (Thu, 22 May 2008) $
- */
-public class ItemList extends ArrayList<Item> {}
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding b/branches/sca-android/modules/databinding-saxon/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
deleted file mode 100644
index d895237c7d..0000000000
--- a/branches/sca-android/modules/databinding-saxon/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.saxon.SaxonNodeDataBinding;type=net.sf.saxon.om.NodeInfo,name=saxon_node
-org.apache.tuscany.sca.databinding.saxon.SaxonValueDataBinding;type=net.sf.saxon.value.Value,name=saxon_value \ No newline at end of file
diff --git a/branches/sca-android/modules/databinding-saxon/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/branches/sca-android/modules/databinding-saxon/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index 4d927ce53d..0000000000
--- a/branches/sca-android/modules/databinding-saxon/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
+++ /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.
-
-# Implementation classes for the transformers
-org.apache.tuscany.sca.databinding.saxon.Node2NodeInfoTransformer;source=org.w3c.dom.Node,target=net.sf.saxon.om.NodeInfo,weight=2000
-org.apache.tuscany.sca.databinding.saxon.NodeInfo2NodeTransformer;source=net.sf.saxon.om.NodeInfo,target=org.w3c.dom.Node,weight=2000
-org.apache.tuscany.sca.databinding.saxon.Object2ValueTransformer;source=java:complexType,target=net.sf.saxon.value.Value,weight=80000
-org.apache.tuscany.sca.databinding.saxon.Value2ObjectTransformer;source=net.sf.saxon.value.Value,target=java:complexType,weight=80000
-org.apache.tuscany.sca.databinding.saxon.SimpleType2ValueTransformer;source=java:simpleType,target=net.sf.saxon.value.Value,weight=80000
-org.apache.tuscany.sca.databinding.saxon.Value2SimpleTypeTransformer;source=net.sf.saxon.value.Value,target=java:simpleType,weight=80000
-org.apache.tuscany.sca.databinding.saxon.NodeInfo2DataObjectTransformer;source=net.sf.saxon.om.NodeInfo,target=commonj.sdo.DataObject,weight=1000
-org.apache.tuscany.sca.databinding.saxon.DataObject2NodeInfoTransformer;source=commonj.sdo.DataObject,target=net.sf.saxon.om.NodeInfo,weight=1000
-org.apache.tuscany.sca.databinding.saxon.ItemList2ObjectTransformer;source=org.apache.tuscany.sca.databinding.saxon.collection.ItemList,target=net.sf.saxon.om.NodeInfo,weight=1000
-org.apache.tuscany.sca.databinding.saxon.ItemList2ObjectTransformer;source=org.apache.tuscany.sca.databinding.saxon.collection.ItemList,target=net.sf.saxon.value.Value,weight=1000
-org.apache.tuscany.sca.databinding.saxon.ItemList2ObjectTransformer;source=org.apache.tuscany.sca.databinding.saxon.collection.ItemList,target=commonj.sdo.DataObject,weight=1000
-org.apache.tuscany.sca.databinding.saxon.ItemList2ObjectTransformer;source=org.apache.tuscany.sca.databinding.saxon.collection.ItemList,target=java:complex,weight=1000
-org.apache.tuscany.sca.databinding.saxon.ItemList2ObjectTransformer;source=org.apache.tuscany.sca.databinding.saxon.collection.ItemList,target=java:simple,weight=1000
-org.apache.tuscany.sca.databinding.saxon.ItemList2ObjectTransformer;source=org.apache.tuscany.sca.databinding.saxon.collection.ItemList,target=java:array,weight=1000
-org.apache.tuscany.sca.databinding.saxon.NodeInfo2JavaArrayTransformer;source=net.sf.saxon.om.NodeInfo,target=java:array,weight=1000
-org.apache.tuscany.sca.databinding.saxon.Value2JavaArrayTransformer;source=net.sf.saxon.value.Value,target=java:array,weight=1000
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/LICENSE b/branches/sca-android/modules/databinding-sdo-axiom/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/META-INF/README b/branches/sca-android/modules/databinding-sdo-axiom/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/NOTICE b/branches/sca-android/modules/databinding-sdo-axiom/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/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/branches/sca-android/modules/databinding-sdo-axiom/pom.xml b/branches/sca-android/modules/databinding-sdo-axiom/pom.xml
deleted file mode 100644
index b63e362616..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/pom.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding-sdo-axiom</artifactId>
- <name>Apache Tuscany SCA Data Binding for SDO/AXIOM</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.5</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.5</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </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-po-sdo</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/test/resources/ipo.xsd</schemaFile>
- <javaPackage>com.example.ipo.sdo</javaPackage>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <execution>
- <id>generate-stock-sdo</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/test/resources/stock.xsd</schemaFile>
- <javaPackage>com.example.stock.sdo</javaPackage>
- <prefix>Stock</prefix>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <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.databinding.sdo.axiom</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.databinding.sdo*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-
-</project>
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/AxiomHelper.java b/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/AxiomHelper.java
deleted file mode 100644
index 02f43000b4..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/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.sdo2om;
-
-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;
- if (namespaceURI.length() != 0) {
- // 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/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElement.java b/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElement.java
deleted file mode 100644
index aa7f99724d..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElement.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.sdo2om;
-
-import static org.apache.tuscany.sca.databinding.sdo.SDODataBinding.ROOT_ELEMENT;
-
-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.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.sdo.SDOContextHelper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-
-/**
- * SDO DataObject --> AXIOM OMElement transformer
- *
- * @version $Rev$ $Date$
- */
-public class DataObject2OMElement extends BaseTransformer<DataObject, OMElement> implements
- PullTransformer<DataObject, OMElement> {
-
- public OMElement transform(DataObject source, TransformationContext context) {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, true);
- OMFactory factory = OMAbstractFactory.getOMFactory();
-
- QName name = ROOT_ELEMENT;
- if (context != null) {
- DataType dataType = context.getTargetDataType();
- Object logical = dataType == null ? null : dataType.getLogical();
- if (logical instanceof XMLType) {
- XMLType xmlType = (XMLType)logical;
- if (xmlType.isElement()) {
- name = xmlType.getElementName();
- }
- }
- }
-
- XMLDocument document = helperContext.getXMLHelper().createDocument(source,
- name.getNamespaceURI(),
- name.getLocalPart());
- SDODataSource dataSource = new SDODataSource(document, helperContext);
- OMElement element = AxiomHelper.createOMElement(factory, name, dataSource);
- return element;
- }
-
- @Override
- protected Class<DataObject> getSourceType() {
- return DataObject.class;
- }
-
- @Override
- protected Class<OMElement> getTargetType() {
- return OMElement.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/SDODataSource.java b/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/SDODataSource.java
deleted file mode 100644
index dc3c2610a4..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/SDODataSource.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.sdo2om;
-
-import static org.apache.tuscany.sca.databinding.sdo.SDODataBinding.ROOT_ELEMENT;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axiom.om.impl.serialize.StreamingOMSerializer;
-import org.apache.tuscany.sdo.api.SDOUtil;
-import org.apache.tuscany.sdo.api.XMLStreamHelper;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class SDODataSource implements OMDataSource {
- private HelperContext helperContext;
- private XMLDocument sourceDocument;
-
- public SDODataSource(XMLDocument source, HelperContext helperContext) {
- this.sourceDocument = source;
- this.helperContext = helperContext;
- }
-
- public SDODataSource(DataObject obj, HelperContext helperContext) {
- this.helperContext = helperContext;
- this.sourceDocument =
- helperContext.getXMLHelper().createDocument(obj,
- ROOT_ELEMENT.getNamespaceURI(),
- ROOT_ELEMENT.getLocalPart());
- }
-
- public XMLStreamReader getReader() throws XMLStreamException {
- XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext);
- return streamHelper.createXMLStreamReader(sourceDocument);
- }
-
- public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
- StreamingOMSerializer serializer = new StreamingOMSerializer();
- serializer.serialize(getReader(), xmlWriter);
- }
-
- public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException {
- try {
- helperContext.getXMLHelper().save(sourceDocument, output, null);
- } catch (Exception e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException {
- try {
- helperContext.getXMLHelper().save(sourceDocument, writer, null);
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElement.java b/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElement.java
deleted file mode 100644
index a55a9f37cb..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElement.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.sdo2om;
-
-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.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.sdo.SDOContextHelper;
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-
-/**
- * SDO XMLDocument --> AXIOM OMElement transformer
- * @version $Rev$ $Date$
- */
-public class XMLDocument2OMElement extends BaseTransformer<XMLDocument, OMElement> implements
- PullTransformer<XMLDocument, OMElement> {
-
- public OMElement transform(XMLDocument source, TransformationContext context) {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, true);
- SDODataSource dataSource = new SDODataSource(source, helperContext);
- OMFactory factory = OMAbstractFactory.getOMFactory();
- QName name = new QName(source.getRootElementURI(), source.getRootElementName());
- OMElement element = AxiomHelper.createOMElement(factory, name, dataSource);
- return element;
- }
-
- @Override
- protected Class<XMLDocument> getSourceType() {
- return XMLDocument.class;
- }
-
- @Override
- protected Class<OMElement> getTargetType() {
- return OMElement.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/branches/sca-android/modules/databinding-sdo-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index c870ec2406..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
+++ /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 transformers
-org.apache.tuscany.sca.databinding.sdo2om.DataObject2OMElement;source=commonj.sdo.DataObject,target=org.apache.axiom.om.OMElement,weight=3000
-org.apache.tuscany.sca.databinding.sdo2om.XMLDocument2OMElement;source=commonj.sdo.helper.XMLDocument,target=org.apache.axiom.om.OMElement,weight=3000
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElementTestCase.java b/branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElementTestCase.java
deleted file mode 100644
index 57dd056526..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElementTestCase.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.sdo2om;
-
-import java.io.StringWriter;
-
-import javax.xml.stream.XMLStreamException;
-
-import junit.framework.Assert;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import commonj.sdo.DataObject;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DataObject2OMElementTestCase extends SDOTransformerTestCaseBase {
-
- @Override
- protected DataType<?> getSourceDataType() {
- return new DataTypeImpl<XMLType>(DataObject.class.getName(), DataObject.class, new XMLType(ORDER_QNAME, null));
- }
-
- @Override
- protected DataType<?> getTargetDataType() {
- return new DataTypeImpl<XMLType>(OMElement.class.getName(), OMElement.class, new XMLType(ORDER_QNAME, null));
- }
-
- public final void testTransform() throws XMLStreamException {
- OMElement element = new DataObject2OMElement().transform(dataObject, context);
- Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), element.getNamespace().getNamespaceURI());
- Assert.assertEquals(ORDER_QNAME.getLocalPart(), element.getLocalName());
- // TODO: See https://issues.apache.org/jira/browse/WSCOMMONS-226
- // element.getBuilder().setCache(false);
- StringWriter writer = new StringWriter();
- element.serialize(writer);
- }
-
- public final void testTransformWrapper() throws XMLStreamException {
- OMElement element = new DataObject2OMElement().transform(dataObject, context);
- Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), element.getNamespace().getNamespaceURI());
- Assert.assertEquals(ORDER_QNAME.getLocalPart(), element.getLocalName());
-
- OMNamespace ns = OMAbstractFactory.getOMFactory().createOMNamespace("http://ns1", "ns1");
- element.setNamespace(ns);
- element.setLocalName("dummy");
- // TODO: See https://issues.apache.org/jira/browse/WSCOMMONS-226
- // element.getBuilder().setCache(true);
- StringWriter writer = new StringWriter();
- element.serializeAndConsume(writer);
- // System.out.println(writer);
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/SDOTransformerTestCaseBase.java b/branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/SDOTransformerTestCaseBase.java
deleted file mode 100644
index f69ef598b8..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/SDOTransformerTestCaseBase.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.sdo2om;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.interfacedef.DataType;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-import com.example.ipo.sdo.SdoFactory;
-import com.example.ipo.sdo.USAddress;
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- * The base class for SDO-related test cases
- *
- * @version $Rev$ $Date$
- */
-public abstract class SDOTransformerTestCaseBase extends TestCase {
- protected static final QName ORDER_QNAME = new QName("http://www.example.com/IPO", "purchaseOrder");
-
- protected HelperContext helperContext;
- protected String binding = DataObject.class.getName();
- protected TransformationContext context;
- protected TransformationContext reversedContext;
- protected DataObject dataObject;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- helperContext = HelperProvider.getDefaultContext();
- SdoFactory.INSTANCE.register(helperContext);
-
- context = new TransformationContextImpl();
- context.setSourceDataType(getSourceDataType());
- context.setTargetDataType(getTargetDataType());
-
- reversedContext = new TransformationContextImpl();
- reversedContext.setSourceDataType(getTargetDataType());
- reversedContext.setTargetDataType(getSourceDataType());
-
- PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
- USAddress address = SdoFactory.INSTANCE.createUSAddress();
- address.setCity("San Jose");
- address.setStreet("123 ABC St");
- address.setState("CA");
- address.setStreet("95131");
- po.setBillTo(address);
- dataObject = (DataObject) po;
- }
-
- protected abstract DataType<?> getSourceDataType();
-
- protected abstract DataType<?> getTargetDataType();
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElementTestCase.java b/branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElementTestCase.java
deleted file mode 100644
index 5015a1b697..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElementTestCase.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.sdo2om;
-
-import java.io.StringWriter;
-
-import javax.xml.stream.XMLStreamException;
-
-import junit.framework.Assert;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import commonj.sdo.helper.XMLDocument;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class XMLDocument2OMElementTestCase extends SDOTransformerTestCaseBase {
-
- @Override
- protected DataType<?> getSourceDataType() {
- return new DataTypeImpl<XMLType>(XMLDocument.class.getName(), XMLDocument.class, new XMLType(ORDER_QNAME, null));
- }
-
- @Override
- protected DataType<?> getTargetDataType() {
- return new DataTypeImpl<XMLType>(OMElement.class.getName(), OMElement.class, new XMLType(ORDER_QNAME, null));
- }
-
- public final void testTransform() throws XMLStreamException {
- XMLDocument document =
- helperContext.getXMLHelper().createDocument(dataObject,
- ORDER_QNAME.getNamespaceURI(),
- ORDER_QNAME.getLocalPart());
- OMElement element = new XMLDocument2OMElement().transform(document, context);
- Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), element.getNamespace().getNamespaceURI());
- Assert.assertEquals(ORDER_QNAME.getLocalPart(), element.getLocalName());
- StringWriter writer = new StringWriter();
- element.serialize(writer);
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo-axiom/src/test/resources/ipo.xsd b/branches/sca-android/modules/databinding-sdo-axiom/src/test/resources/ipo.xsd
deleted file mode 100644
index 241ec15d36..0000000000
--- a/branches/sca-android/modules/databinding-sdo-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/branches/sca-android/modules/databinding-sdo-axiom/src/test/resources/stock.xsd b/branches/sca-android/modules/databinding-sdo-axiom/src/test/resources/stock.xsd
deleted file mode 100644
index a0a6717371..0000000000
--- a/branches/sca-android/modules/databinding-sdo-axiom/src/test/resources/stock.xsd
+++ /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.
--->
-<schema targetNamespace="http://www.example.com/stock" xmlns="http://www.w3.org/2001/XMLSchema">
- <!-- Faults -->
- <element name="InvalidSymbolFault">
- <complexType>
- <sequence>
- <element name="message" minOccurs="1" type="string" />
- <element name="symbol" minOccurs="1" type="string" />
- </sequence>
- </complexType>
- </element>
-
- <element name="MarketClosedFault" type="string" />
-
-</schema> \ No newline at end of file
diff --git a/branches/sca-android/modules/databinding-sdo/LICENSE b/branches/sca-android/modules/databinding-sdo/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/databinding-sdo/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/databinding-sdo/META-INF/README b/branches/sca-android/modules/databinding-sdo/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/databinding-sdo/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/databinding-sdo/NOTICE b/branches/sca-android/modules/databinding-sdo/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/databinding-sdo/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/branches/sca-android/modules/databinding-sdo/pom.xml b/branches/sca-android/modules/databinding-sdo/pom.xml
deleted file mode 100644
index 14e353699c..0000000000
--- a/branches/sca-android/modules/databinding-sdo/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <name>Apache Tuscany SCA Data Binding for SDO</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <!-- FIXME: We might want to create a separate module to host the processor -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-lib</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-impl</artifactId>
- <version>1.1.1</version>
- </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-po-sdo</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/test/resources/ipo.xsd</schemaFile>
- <javaPackage>com.example.ipo.sdo</javaPackage>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <execution>
- <id>generate-stock-sdo</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/test/resources/stock.xsd</schemaFile>
- <javaPackage>com.example.stock.sdo</javaPackage>
- <prefix>Stock</prefix>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <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.databinding.sdo</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.databinding.sdo*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2Node.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2Node.java
deleted file mode 100644
index 503e54e530..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2Node.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.sdo;
-
-import javax.xml.namespace.QName;
-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;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-
-public class DataObject2Node extends BaseTransformer<DataObject, Node> implements
- PullTransformer<DataObject, Node> {
-
- public Node transform(DataObject source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, true);
- XMLHelper xmlHelper = helperContext.getXMLHelper();
- QName elementName = SDOContextHelper.getElement(context);
- Document doc = DOMHelper.newDocument();
- DOMResult result = new DOMResult(doc);
- XMLDocument xmlDoc = xmlHelper.createDocument(source, elementName.getNamespaceURI(), elementName.getLocalPart());
- xmlHelper.save(xmlDoc, result, null);
- return doc.getDocumentElement();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<DataObject> getSourceType() {
- return DataObject.class;
- }
-
- @Override
- protected Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java
deleted file mode 100644
index 8ce8eae587..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLHelper;
-
-public class DataObject2String extends BaseTransformer<DataObject, String> implements
- PullTransformer<DataObject, String> {
-
- public String transform(DataObject source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, true);
- XMLHelper xmlHelper = helperContext.getXMLHelper();
- QName elementName = SDOContextHelper.getElement(context);
- return xmlHelper.save(source, elementName.getNamespaceURI(), elementName.getLocalPart());
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<DataObject> getSourceType() {
- return DataObject.class;
- }
-
- @Override
- protected Class<String> getTargetType() {
- return String.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java
deleted file mode 100644
index 116ac4c553..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sdo.api.SDOUtil;
-import org.apache.tuscany.sdo.api.XMLStreamHelper;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-
-public class DataObject2XMLStreamReader extends BaseTransformer<DataObject, XMLStreamReader> implements
- PullTransformer<DataObject, XMLStreamReader> {
-
- public XMLStreamReader transform(final DataObject source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, true);
- XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext);
- final QName elementName = SDOContextHelper.getElement(context);
- final XMLHelper xmlHelper = helperContext.getXMLHelper();
- // Allow privileged access to read properties. REquires java.util.PropertyPermission
- // XML.load.form.lax read in security policy.
- XMLDocument document = AccessController.doPrivileged(new PrivilegedAction<XMLDocument>() {
- public XMLDocument run() {
- return xmlHelper.createDocument(source, elementName.getNamespaceURI(), elementName.getLocalPart());
- }
- });
-
- return streamHelper.createXMLStreamReader(document);
- } catch (XMLStreamException e) {
- // TODO: Add context to the exception
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<DataObject> getSourceType() {
- return DataObject.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java
deleted file mode 100644
index 30a3e1c3a9..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.impl.BaseImpl;
-
-import commonj.sdo.helper.HelperContext;
-
-/**
- * The model object for import.sdo
- *
- * @version $Rev$ $Date$
- */
-public class ImportSDO extends BaseImpl {
- public static final QName IMPORT_SDO =
- new QName("http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0", "import.sdo");
-
- private HelperContext helperContext;
- private String factoryClassName;
- private String schemaLocation;
-
- public ImportSDO(HelperContext helperContext) {
- super();
- this.helperContext = helperContext;
- setUnresolved(true);
- }
-
- public HelperContext getHelperContext() {
- return helperContext;
- }
-
- /**
- * @return the factoryClassName
- */
- public String getFactoryClassName() {
- return factoryClassName;
- }
-
- /**
- * @param factoryClassName the factoryClassName to set
- */
- public void setFactoryClassName(String factoryClassName) {
- this.factoryClassName = factoryClassName;
- }
-
- /**
- * @return the schemaLocation
- */
- public String getSchemaLocation() {
- return schemaLocation;
- }
-
- /**
- * @param schemaLocation the schemaLocation to set
- */
- public void setSchemaLocation(String schemaLocation) {
- this.schemaLocation = schemaLocation;
- }
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java
deleted file mode 100644
index 115af19042..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.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.databinding.sdo;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static org.apache.tuscany.sca.databinding.sdo.ImportSDO.IMPORT_SDO;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.URLConnection;
-
-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.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XSDHelper;
-
-/**
- * Loader that handles &lt;import.sdo&gt; elements.
- *
- * @version $Rev$ $Date$
- * @deprecated
- */
-@Deprecated
-public class ImportSDOProcessor implements StAXArtifactProcessor<ImportSDO> {
-
- private ContributionFactory contributionFactory;
- private Monitor monitor;
-
- public ImportSDOProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.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 = new ProblemImpl(this.getClass().getName(), "databinding-sdo-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 = new ProblemImpl(this.getClass().getName(), "databinding-sdo-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- public QName getXMLType() {
- return IMPORT_SDO;
- }
-
- public ImportSDO read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- assert IMPORT_SDO.equals(reader.getName());
-
- // FIXME: How do we associate the application HelperContext with the one
- // imported by the composite
- ImportSDO importSDO = new ImportSDO(SDOContextHelper.getDefaultHelperContext());
- String factoryName = reader.getAttributeValue(null, "factory");
- if (factoryName != null) {
- importSDO.setFactoryClassName(factoryName);
- }
- String location = reader.getAttributeValue(null, "location");
- if (location != null) {
- importSDO.setSchemaLocation(location);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && ImportSDO.IMPORT_SDO.equals(reader.getName())) {
- break;
- }
- }
- return importSDO;
- }
-
- private void importFactory(ImportSDO importSDO, ModelResolver resolver) throws ContributionResolveException {
- String factoryName = importSDO.getFactoryClassName();
- if (factoryName != null) {
- ClassReference reference = new ClassReference(factoryName);
- ClassReference resolved = resolver.resolveModel(ClassReference.class, reference);
- if (resolved != null && !resolved.isUnresolved()) {
- try {
- Class<?> factoryClass = resolved.getJavaClass();
- register(factoryClass, importSDO.getHelperContext());
- importSDO.setUnresolved(false);
- } catch (Exception e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", resolver, ce);
- //throw ce;
- }
- } else {
- error("FailToResolveClass", resolver, factoryName);
- //ContributionResolveException loaderException =
- //new ContributionResolveException("Fail to resolve class: " + factoryName);
- //throw loaderException;
- }
- }
- }
-
- private static void register(Class factoryClass, HelperContext helperContext) throws Exception {
- Field field = factoryClass.getField("INSTANCE");
- Object factory = field.get(null);
- Method method = factory.getClass().getMethod("register", new Class[] {HelperContext.class});
- method.invoke(factory, new Object[] {helperContext});
-
- // HelperContext defaultContext = HelperProvider.getDefaultContext();
- // method.invoke(factory, new Object[] {defaultContext});
- }
-
- private void importWSDL(ImportSDO importSDO, ModelResolver resolver) throws ContributionResolveException {
- String location = importSDO.getSchemaLocation();
- if (location != null) {
- try {
- Artifact artifact = contributionFactory.createArtifact();
- artifact.setURI(location);
- artifact = resolver.resolveModel(Artifact.class, artifact);
- if (artifact.getLocation() != null) {
- String wsdlURL = artifact.getLocation();
- URLConnection connection = new URL(wsdlURL).openConnection();
- connection.setUseCaches(false);
- InputStream xsdInputStream = connection.getInputStream();
- try {
- XSDHelper xsdHelper = importSDO.getHelperContext().getXSDHelper();
- xsdHelper.define(xsdInputStream, wsdlURL);
- } finally {
- xsdInputStream.close();
- }
- importSDO.setUnresolved(false);
- } else {
- error("FailToResolveLocation", resolver, location);
- //ContributionResolveException loaderException = new ContributionResolveException("Fail to resolve location: " + location);
- //throw loaderException;
- }
- } catch (IOException e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", resolver, ce);
- //throw ce;
- }
- }
- }
-
- public QName getArtifactType() {
- return ImportSDO.IMPORT_SDO;
- }
-
- public void write(ImportSDO model, XMLStreamWriter outputSource) throws ContributionWriteException {
- // Not implemented as <import.sdo> is deprecated
- }
-
- public Class<ImportSDO> getModelType() {
- return ImportSDO.class;
- }
-
- public void resolve(ImportSDO importSDO, ModelResolver resolver) throws ContributionResolveException {
- importFactory(importSDO, resolver);
- importWSDL(importSDO, resolver);
- if (!importSDO.isUnresolved()) {
- resolver.addModel(importSDO);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/Node2DataObject.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/Node2DataObject.java
deleted file mode 100644
index 4a05492dd8..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/Node2DataObject.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.sdo;
-
-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.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-
-public class Node2DataObject extends BaseTransformer<Node, DataObject> implements PullTransformer<Node, DataObject> {
-
- public DataObject transform(Node source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, false);
- XMLHelper xmlHelper = helperContext.getXMLHelper();
- Document doc = DOMHelper.promote(source);
- DOMSource domSource = new DOMSource(doc);
- XMLDocument xmlDoc = xmlHelper.load(domSource, doc.getDocumentURI(), null);
- return xmlDoc.getRootObject();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- protected Class<DataObject> getTargetType() {
- return DataObject.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java
deleted file mode 100644
index 695722be18..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.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.databinding.sdo;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-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.util.DataTypeHelper;
-import org.apache.tuscany.sca.databinding.util.LRUCache;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sdo.api.SDOUtil;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Type;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.TypeHelper;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- * Helper class to get TypeHelper from the context
- *
- * @version $Rev$ $Date$
- */
-public final class SDOContextHelper {
- private static final LRUCache<Object, HelperContext> cache = new LRUCache<Object, HelperContext>(1024);
-
- private SDOContextHelper() {
- }
-
- public static HelperContext getHelperContext(TransformationContext context, boolean source) {
- if (context == null) {
- return getDefaultHelperContext();
- }
-
- HelperContext helperContext = null;
- Operation op = source ? context.getSourceOperation() : context.getTargetOperation();
- if (op == null) {
- DataType<?> dt = source ? context.getSourceDataType() : context.getTargetDataType();
-
- helperContext = dt.getMetaData(HelperContext.class);
- if (helperContext != null) {
- return helperContext;
- }
- helperContext = SDOUtil.createHelperContext();
- boolean found = register(helperContext, dt);
- if (!found) {
- helperContext = getDefaultHelperContext();
- }
- dt.setMetaData(HelperContext.class, helperContext);
- return helperContext;
- } else {
- return getHelperContext(op);
- }
-
- }
-
- public static HelperContext getHelperContext(Operation op) {
- if (op == null) {
- return getDefaultHelperContext();
- }
-
- HelperContext helperContext = op.getInputType().getMetaData(HelperContext.class);
-
- if (helperContext != null) {
- return helperContext;
- }
-
- // Use the default HelperContext until a type is registered later on
- helperContext = getDefaultHelperContext();
-
- /*
- List<DataType> dataTypes = DataTypeHelper.getDataTypes(op, false);
- boolean found = false;
- for (DataType d : dataTypes) {
- if (register(helperContext, d)) {
- found = true;
- }
- }
- if (!found) {
- helperContext = getDefaultHelperContext();
- }
- */
- op.getInputType().setMetaData(HelperContext.class, helperContext);
- return helperContext;
- }
-
- /**
- * @param helperContext
- * @param dataType
- * @return
- */
- private static boolean register(HelperContext helperContext, DataType dataType) {
- if (dataType == null) {
- return false;
- }
- Set<Class<?>> classes = DataTypeHelper.findClasses(dataType);
- boolean found = false;
- for (Class<?> cls : classes) {
- found = register(helperContext, dataType.getPhysical()) || found;
- }
- return found;
- }
-
- /**
- * FIXME: [rfeng] This is a hack to get the factory out a SDO class
- * @param helperContext
- * @param javaType
- */
-
- public static boolean register(HelperContext helperContext, Class javaType) {
- if (javaType == null || DataObject.class == javaType) {
- return false;
- }
- try {
- Type type = helperContext.getTypeHelper().getType(javaType);
- if (type != null && (!type.isDataType())) {
- Method method = type.getClass().getMethod("getEPackage");
- Object factory = method.invoke(type, new Object[] {});
- method = factory.getClass().getMethod("register", HelperContext.class);
- method.invoke(factory, new Object[] {helperContext});
- return true;
- }
- return false;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- public static HelperContext getDefaultHelperContext() {
- // SDOUtil.createHelperContext();
- return HelperProvider.getDefaultContext();
- }
-
- public static QName getElement(TransformationContext context) {
- if (context == null) {
- return SDODataBinding.ROOT_ELEMENT;
- }
- DataType<?> dataType = context.getTargetDataType();
- Object logical = dataType.getLogical();
- QName elementName = null;
- if (logical instanceof XMLType) {
- XMLType xmlType = (XMLType)logical;
- QName element = xmlType.getElementName();
- if (element != null) {
- elementName = element;
- }
- }
- if (elementName == null) {
- // Try source type
- dataType = context.getSourceDataType();
- logical = dataType.getLogical();
- if (logical instanceof XMLType) {
- XMLType xmlType = (XMLType)logical;
- QName element = xmlType.getElementName();
- if (element != null) {
- elementName = element;
- }
- }
- }
- if (elementName != null) {
- return elementName;
- } else {
- return SDODataBinding.ROOT_ELEMENT;
- }
- }
-
- public static String generateSchema(HelperContext context, Class<?>[] classes) {
- TypeHelper typeHelper = context.getTypeHelper();
- List<Type> types = new ArrayList<Type>();
- for (Class<?> cls : classes) {
- Type type = typeHelper.getType(cls);
- if (type != null) {
- types.add(type);
- }
- }
- return generateSchema(context, types);
- }
-
- public static String generateSchema(HelperContext context, List<Type> types) {
- // FIXME: SDO throws IllegalArgumentException for types generated from existing XSDs
- return context.getXSDHelper().generate(types);
- }
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java
deleted file mode 100644
index 5a5e35cbbd..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.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.databinding.sdo;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
-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.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sdo.api.SDOUtil;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Type;
-import commonj.sdo.helper.CopyHelper;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-
-/**
- * SDO Databinding
- *
- * @version $Rev$ $Date$
- */
-public class SDODataBinding extends BaseDataBinding {
- public static final String NAME = DataObject.class.getName();
- public static final String[] ALIASES = new String[] {"sdo"};
-
- public static final String ROOT_NAMESPACE = "commonj.sdo";
- public static final QName ROOT_ELEMENT = new QName(ROOT_NAMESPACE, "dataObject");
-
- private WrapperHandler<Object> wrapperHandler;
- private XMLTypeHelper xmlTypeHelper;
-
- public SDODataBinding() {
- super(NAME, ALIASES, DataObject.class);
- wrapperHandler = new SDOWrapperHandler();
- xmlTypeHelper = new SDOTypeHelper();
- }
-
- @Override
- public boolean introspect(DataType dataType, final Operation operation) {
- final Class javaType = dataType.getPhysical();
- // Allow privileged access to read system properties. Requires PropertyPermission
- // java.specification.version read in security policy.
- final HelperContext context = AccessController.doPrivileged(new PrivilegedAction<HelperContext>() {
- public HelperContext run() {
- return SDOContextHelper.getHelperContext(operation);
- }
- });
-
- Type type = context.getTypeHelper().getType(javaType);
- if (type == null) {
- // FIXME: Need a better to test dynamic SDO
- if (DataObject.class.isAssignableFrom(javaType)) {
- // Dynamic SDO
- dataType.setDataBinding(getName());
- if (dataType.getLogical() == null) {
- dataType.setLogical(XMLType.UNKNOWN);
- }
- return true;
- }
- return false;
- }
- if (type.isDataType()) {
- // FIXME: Ignore simple types?
- return false;
- }
-
- // Found a SDO type, replace the default context with a private one
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- if (context == SDOContextHelper.getDefaultHelperContext()) {
- HelperContext newContext = SDOUtil.createHelperContext();
- SDOContextHelper.register(newContext, javaType);
- if (operation != null) {
- operation.getInputType().setMetaData(HelperContext.class, newContext);
- }
- }
- return null;
- }
- });
-
- String namespace = type.getURI();
- String name = context.getXSDHelper().getLocalName(type);
- QName xmlType = new QName(namespace, name);
- dataType.setDataBinding(getName());
- QName elementName = null;
- Object logical = dataType.getLogical();
- if (logical instanceof XMLType) {
- elementName = ((XMLType)logical).getElementName();
- }
- dataType.setLogical(new XMLType(elementName, xmlType));
-
- return true;
- }
-
- @Override
- public WrapperHandler getWrapperHandler() {
- return wrapperHandler;
- }
-
- @Override
- public SimpleTypeMapper getSimpleTypeMapper() {
- return new SDOSimpleTypeMapper();
- }
-
- @Override
- public XMLTypeHelper getXMLTypeHelper() {
- // return new SDOTypeHelper();
- return xmlTypeHelper;
- }
-
- @Override
- public Object copy(Object arg, DataType dataType, Operation operation) {
- HelperContext context = SDOContextHelper.getHelperContext(operation);
- CopyHelper copyHelper = context.getCopyHelper();
- if (arg instanceof XMLDocument) {
- XMLDocument document = (XMLDocument)arg;
- DataObject dataObject = copyHelper.copy(document.getRootObject());
- return context.getXMLHelper().createDocument(dataObject,
- document.getRootElementURI(),
- document.getRootElementName());
- } else if (arg instanceof DataObject) {
- return context.getCopyHelper().copy((DataObject)arg);
- } else {
- return super.copy(arg, dataType, operation);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java
deleted file mode 100644
index c83ec53b01..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.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.sdo;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sdo.api.SDOUtil;
-
-import commonj.sdo.Type;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.TypeHelper;
-
-/**
- * SDO Java/XML mapping for simple XSD types
- *
- * @version $Rev$ $Date$
- */
-public class SDOSimpleTypeMapper implements SimpleTypeMapper {
- public static final String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
-
- public SDOSimpleTypeMapper() {
- super();
- }
-
- public Object toJavaObject(QName typeName, String value, TransformationContext context) {
- Type type = null;
- if (URI_2001_SCHEMA_XSD.equals(typeName.getNamespaceURI())) {
- type = SDOUtil.getXSDSDOType(typeName.getLocalPart());
- } else {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, false);
- TypeHelper typeHelper = helperContext.getTypeHelper();
- type = typeHelper.getType(typeName.getNamespaceURI(), typeName.getLocalPart());
- }
- return SDOUtil.createFromString(type, value);
- }
-
- public String toXMLLiteral(QName typeName, Object obj, TransformationContext context) {
- Type type = null;
- if (URI_2001_SCHEMA_XSD.equals(typeName.getNamespaceURI())) {
- type = SDOUtil.getXSDSDOType(typeName.getLocalPart());
- } else {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, true);
- TypeHelper typeHelper = helperContext.getTypeHelper();
- type = typeHelper.getType(typeName.getNamespaceURI(), typeName.getLocalPart());
- }
- return SDOUtil.convertToString(type, obj);
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java
deleted file mode 100644
index c1978883df..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.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.databinding.sdo;
-
-import java.beans.Introspector;
-import java.io.StringReader;
-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.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.Operation;
-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.xsd.XSDFactory;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-import org.osoa.sca.ServiceRuntimeException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.bootstrap.DOMImplementationRegistry;
-import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSParser;
-
-import commonj.sdo.Type;
-import commonj.sdo.helper.TypeHelper;
-import commonj.sdo.helper.XSDHelper;
-
-public class SDOTypeHelper implements XMLTypeHelper {
- private static final String SCHEMA_NS = "http://www.w3.org/2001/XMLSchema";
-
- private TypeHelper typeHelper;
- private XSDHelper xsdHelper;
- // private Map<String, List<Type>> xsdTypesMap = new HashMap<String, List<Type>>();
- // private Map<String, List<Type>> typesMap = new HashMap<String, List<Type>>();
-
- public SDOTypeHelper() {
- super();
- typeHelper = SDOContextHelper.getDefaultHelperContext().getTypeHelper();
- xsdHelper = SDOContextHelper.getDefaultHelperContext().getXSDHelper();
- }
-
- public TypeInfo getTypeInfo(Class javaType, Object logical) {
- QName xmlType = JavaXMLMapper.getXMLType(javaType);
- if (xmlType != null) {
- return new TypeInfo(xmlType, true, null);
- } else {
- // introspect(javaType, xsdTypesMap, typesMap);
- if (logical instanceof XMLType) {
- xmlType = ((XMLType)logical).getTypeName();
- }
- if (xmlType == null) {
- xmlType =
- new QName(JavaXMLMapper.getNamespace(javaType), Introspector.decapitalize(javaType.getSimpleName()));
- }
- return new TypeInfo(xmlType, false, null);
- }
- }
-
- private void introspect(Class javaType, Map<String, List<Type>> xsdTypesMap, Map<String, List<Type>> typesMap) {
- Type type = typeHelper.getType(javaType);
- if (type == null) {
- return;
- }
- if (xsdHelper.isXSD(type)) {
- addToMap(xsdTypesMap, type);
- } else {
- addToMap(typesMap, type);
- }
- }
-
- private void addToMap(Map<String, List<Type>> map, Type type) {
- List<Type> types = map.get(type.getURI());
- if (types == null) {
- types = new ArrayList<Type>();
- map.put(type.getURI(), types);
- }
- if (!types.contains(type)) {
- types.add(type);
- }
- }
-
- /*
- public List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver) {
- List<XSDefinition> definitions = new ArrayList<XSDefinition>();
- generateSDOSchemas(definitions, factory, typesMap);
- addResolvedXSDs(definitions, factory, resolver, xsdTypesMap);
- return definitions;
- }
- */
-
- private void generateSDOSchemas(List<XSDefinition> definitions, XSDFactory factory, Map<String, List<Type>> map) {
- for (Map.Entry<String, List<Type>> entry : map.entrySet()) {
- List<Type> types = entry.getValue();
- String ns = entry.getKey();
- generateSchema(definitions, factory, types, ns);
- }
- }
-
- private void generateSchema(List<XSDefinition> definitions, XSDFactory factory, List<Type> types, String ns) {
- String schema = xsdHelper.generate(types);
- DOMImplementationRegistry registry = null;
- try {
- registry = DOMImplementationRegistry.newInstance();
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- DOMImplementation impl = registry.getDOMImplementation("XML 3.0");
- DOMImplementationLS ls = (DOMImplementationLS)impl.getFeature("LS", "3.0");
- LSParser parser = ls.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, SCHEMA_NS);
- LSInput input = ls.createLSInput();
- input.setCharacterStream(new StringReader(schema));
- Document document = parser.parse(input);
- XSDefinition definition = factory.createXSDefinition();
- definition.setUnresolved(true);
- definition.setDocument(document);
- definition.setNamespace(ns);
- definitions.add(definition);
- }
-
- private void addResolvedXSDs(List<XSDefinition> definitions,
- XSDFactory factory,
- ModelResolver resolver,
- Map<String, List<Type>> map) {
- for (Map.Entry<String, List<Type>> entry : map.entrySet()) {
- XSDefinition definition = factory.createXSDefinition();
- definition.setUnresolved(true);
- definition.setNamespace(entry.getKey());
- //FIXME: set location URI
- XSDefinition resolved = resolver.resolveModel(XSDefinition.class, definition);
- if (resolved.getSchema() == null) {
- //FIXME: create a checked exception and propagate it back up to the activator
- throw new RuntimeException("No XSD found for namespace " + entry.getKey());
- }
- // make sure all the required types are defined in the resolved schema
- for (Type type : entry.getValue()) {
- String name = xsdHelper.getLocalName(type);
- QName typeName = null;
- if (name.endsWith("_._type")) {
- // FIXME: Anonymous tyype
- name = name.substring(0, name.length() - "_._type".length());
- typeName = new QName(type.getURI(), name);
- if (resolved.getXmlSchemaElement(typeName) == null) {
- //FIXME: create a checked exception and propagate it back up to the activator
- throw new RuntimeException("No XSD found for " + typeName.toString());
- }
- } else {
- typeName = new QName(type.getURI(), name);
- if (resolved.getXmlSchemaType(typeName) == null) {
- //FIXME: create a checked exception and propagate it back up to the activator
- throw new RuntimeException("No XSD found for " + typeName.toString());
- }
- }
-
- }
- definitions.add(resolved);
- }
- }
-
- private static List<DataType> getDataTypes(Interface intf) {
- List<DataType> dataTypes = new ArrayList<DataType>();
- for (Operation op : intf.getOperations()) {
- WrapperInfo wrapper = op.getWrapper();
- if (wrapper != null) {
- DataType dt1 = wrapper.getInputWrapperType();
- if (dt1 != null) {
- dataTypes.add(dt1);
- }
- DataType dt2 = wrapper.getOutputWrapperType();
- if (dt2 != null) {
- dataTypes.add(dt2);
- }
- } 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);
- }
- }
- }
- }
- return dataTypes;
- }
-
- public List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver, Interface intf) {
- return getSchemaDefinitions(factory, resolver, getDataTypes(intf));
- }
-
- public List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver, List<DataType> dataTypes) {
- Map<String, List<Type>> xsdTypesMap = new HashMap<String, List<Type>>();
- Map<String, List<Type>> typesMap = new HashMap<String, List<Type>>();
- for (DataType d : dataTypes) {
- if (SDODataBinding.NAME.equals(d.getDataBinding())) {
- introspect(d.getPhysical(), xsdTypesMap, typesMap);
- }
- }
- List<XSDefinition> definitions = new ArrayList<XSDefinition>();
- generateSDOSchemas(definitions, factory, typesMap);
- addResolvedXSDs(definitions, factory, resolver, xsdTypesMap);
- return definitions;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java
deleted file mode 100644
index 8a1cd666d8..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.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;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Property;
-import commonj.sdo.Sequence;
-import commonj.sdo.Type;
-import commonj.sdo.helper.DataFactory;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XSDHelper;
-
-/**
- * SDO Wrapper Handler
- *
- * @version $Rev$ $Date$
- */
-public class SDOWrapperHandler implements WrapperHandler<Object> {
-
- public Object create(Operation operation, boolean input) {
- WrapperInfo wrapperInfo = operation.getWrapper();
- ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
- // Class<?> wrapperClass = input ? wrapperInfo.getInputWrapperClass() : wrapperInfo.getOutputWrapperClass();
- HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
- Type sdoType = getSDOType(helperContext, element);
- if (sdoType != null) {
- DataFactory dataFactory = helperContext.getDataFactory();
- return dataFactory.create(sdoType);
- }
- return null;
- }
-
- public void setChildren(Object 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]);
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#setChild(java.lang.Object, int, ElementInfo,
- * java.lang.Object)
- */
- public void setChild(Object wrapper, int i, ElementInfo childElement, Object value) {
- DataObject wrapperDO =
- (wrapper instanceof XMLDocument) ? ((XMLDocument)wrapper).getRootObject() : (DataObject)wrapper;
- String name = childElement.getQName().getLocalPart();
- if (childElement.isMany()) {
- // FIXME: If we look up by name, we need to make sure the WrapperInfo has the correct element names
- wrapperDO.getList(i).addAll((Collection)value);
- } else {
- wrapperDO.set(i, value);
- }
- }
-
- @SuppressWarnings("unchecked")
- public List getChildren(Object wrapper, Operation operation, boolean input) {
- DataObject wrapperDO =
- (wrapper instanceof XMLDocument) ? ((XMLDocument)wrapper).getRootObject() : (DataObject)wrapper;
- List<Property> properties = wrapperDO.getInstanceProperties();
- List<Object> elements = new ArrayList<Object>();
- Type type = wrapperDO.getType();
- if (type.isSequenced()) {
- // Add values in the sequence
- Sequence sequence = wrapperDO.getSequence();
- for (int i = 0; i < sequence.size(); i++) {
- // Skip mixed text
- if (sequence.getProperty(i) != null) {
- elements.add(sequence.getValue(i));
- }
- }
- } else {
- for (Property p : properties) {
- Object child = wrapperDO.get(p);
- if (p.isMany()) {
- for (Object c : (Collection<?>)child) {
- elements.add(c);
- }
- } else {
- elements.add(child);
- }
- }
- }
- return elements;
- }
-
- /**
- * @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();
- HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
- Type sdoType = getSDOType(helperContext, element);
- if (sdoType != null) {
- // Check if child elements matches
- Class physical = sdoType.getInstanceClass();
- DataType<XMLType> wrapperType =
- new DataTypeImpl<XMLType>(SDODataBinding.NAME, physical, new XMLType(element));
- return wrapperType;
- } else {
- return null;
- }
- }
-
- /**
- * @param helperContext
- * @param element
- * @return
- */
- private Type getSDOType(HelperContext helperContext, ElementInfo element) {
- XSDHelper xsdHelper = helperContext.getXSDHelper();
- Type sdoType = null;
- Property prop =
- xsdHelper.getGlobalProperty(element.getQName().getNamespaceURI(), element.getQName().getLocalPart(), true);
- if (prop != null) {
- sdoType = prop.getType();
- } else {
- TypeInfo type = element.getType();
- QName typeName = type != null ? type.getQName() : null;
- if (typeName != null) {
- sdoType = helperContext.getTypeHelper().getType(typeName.getNamespaceURI(), typeName.getLocalPart());
- }
- }
- return sdoType;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#isInstance(java.lang.Object, Operation, boolean)
- */
- public boolean isInstance(Object wrapper, Operation operation, boolean input) {
- WrapperInfo wrapperInfo = operation.getWrapper();
- ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
- // List<ElementInfo> childElements =
- // input ? wrapperInfo.getInputChildElements() : wrapperInfo.getOutputChildElements();
- HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
- Type sdoType = getSDOType(helperContext, element);
- if (sdoType != null) {
- return sdoType.isInstance(wrapper);
- }
- return false;
- }
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java
deleted file mode 100644
index 7ac423f8d8..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLHelper;
-
-public class String2DataObject extends BaseTransformer<String, DataObject> implements
- PullTransformer<String, DataObject> {
-
- public DataObject transform(String source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, false);
- XMLHelper xmlHelper = helperContext.getXMLHelper();
- return xmlHelper.load(source).getRootObject();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<String> getSourceType() {
- return String.class;
- }
-
- @Override
- protected Class<DataObject> getTargetType() {
- return DataObject.class;
- }
-
- @Override
- public int getWeight() {
- return 50;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java
deleted file mode 100644
index 4e5aa1d5fd..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.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.sdo;
-
-import java.io.StringWriter;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-
-public class XMLDocument2String extends BaseTransformer<XMLDocument, String> implements
- PullTransformer<XMLDocument, String> {
-
- public String transform(XMLDocument source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, true);
- XMLHelper xmlHelper = helperContext.getXMLHelper();
- StringWriter writer = new StringWriter();
- xmlHelper.save(source, writer, null);
- return writer.toString();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<XMLDocument> getSourceType() {
- return XMLDocument.class;
- }
-
- @Override
- protected Class<String> getTargetType() {
- return String.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java
deleted file mode 100644
index e70fa08477..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.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.sdo;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sdo.api.SDOUtil;
-import org.apache.tuscany.sdo.api.XMLStreamHelper;
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-
-public class XMLDocument2XMLStreamReader extends BaseTransformer<XMLDocument, XMLStreamReader> implements
- PullTransformer<XMLDocument, XMLStreamReader> {
- /**
- * @param source
- * @param context
- * @return
- */
- public XMLStreamReader transform(XMLDocument source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, true);
- XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext);
- return streamHelper.createXMLStreamReader(source);
- } catch (XMLStreamException e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<XMLDocument> getSourceType() {
- return XMLDocument.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java
deleted file mode 100644
index baf3e2e90a..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.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.databinding.sdo;
-
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sdo.api.SDOUtil;
-import org.apache.tuscany.sdo.api.XMLStreamHelper;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-
-public class XMLStreamReader2DataObject extends BaseTransformer<XMLStreamReader, DataObject> implements
- PullTransformer<XMLStreamReader, DataObject> {
-
- public DataObject transform(XMLStreamReader source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, false);
- XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext);
- // The XMLStreamHelper requires that the reader is positioned at
- // START_ELEMENT
- while (source.getEventType() != XMLStreamConstants.START_ELEMENT && source.hasNext()) {
- source.next();
- }
- DataObject target = streamHelper.loadObject(source);
- source.close();
- return target;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<DataObject> getTargetType() {
- return DataObject.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 15;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java b/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java
deleted file mode 100644
index ac452910f6..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sdo.api.SDOUtil;
-import org.apache.tuscany.sdo.api.XMLStreamHelper;
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-
-public class XMLStreamReader2XMLDocument extends BaseTransformer<XMLStreamReader, XMLDocument> implements
- PullTransformer<XMLStreamReader, XMLDocument> {
-
- public XMLDocument transform(XMLStreamReader source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context, false);
- XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext);
- XMLDocument target = streamHelper.load(source);
- source.close();
- return target;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<XMLDocument> getTargetType() {
- return XMLDocument.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 15;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index ffe8b895b8..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /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.sdo.ImportSDOProcessor;qname=http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0#import.sdo,model=org.apache.tuscany.sca.databinding.sdo.ImportSDO
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding b/branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
deleted file mode 100644
index afd00b552c..0000000000
--- a/branches/sca-android/modules/databinding-sdo/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.sdo.SDODataBinding;type=commonj.sdo.DataObject,name=sdo \ No newline at end of file
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index b1916fd32a..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
+++ /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 classes for the transformers
-org.apache.tuscany.sca.databinding.sdo.DataObject2String;source=commonj.sdo.DataObject,target=java.lang.String,weight=510
-org.apache.tuscany.sca.databinding.sdo.DataObject2XMLStreamReader;source=commonj.sdo.DataObject,target=javax.xml.stream.XMLStreamReader,weight=490
-org.apache.tuscany.sca.databinding.sdo.XMLDocument2String;source=commonj.sdo.helper.XMLDocument,target=java.lang.String,weight=510
-org.apache.tuscany.sca.databinding.sdo.String2DataObject;source=java.lang.String,target=commonj.sdo.DataObject,weight=500
-org.apache.tuscany.sca.databinding.sdo.XMLDocument2XMLStreamReader;source=commonj.sdo.helper.XMLDocument,target=javax.xml.stream.XMLStreamReader,weight=490
-org.apache.tuscany.sca.databinding.sdo.XMLStreamReader2DataObject;source=javax.xml.stream.XMLStreamReader,target=commonj.sdo.DataObject,weight=490
-org.apache.tuscany.sca.databinding.sdo.XMLStreamReader2XMLDocument;source=javax.xml.stream.XMLStreamReader,target=commonj.sdo.helper.XMLDocument,weight=490
-org.apache.tuscany.sca.databinding.sdo.DataObject2Node;source=commonj.sdo.DataObject,target=org.w3c.dom.Node,weight=500
-org.apache.tuscany.sca.databinding.sdo.Node2DataObject;source=org.w3c.dom.Node,target=commonj.sdo.DataObject,weight=500
diff --git a/branches/sca-android/modules/databinding-sdo/src/main/resources/databinding-sdo-validation-messages.properties b/branches/sca-android/modules/databinding-sdo/src/main/resources/databinding-sdo-validation-messages.properties
deleted file mode 100644
index f53f08f377..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/main/resources/databinding-sdo-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.
-#
-#
-FailToResolveClass = Fail to resolve class: {0}
-FailToResolveLocation = Fail to resolve location: {0}
-ContributionResolveException = ContributionResolveException occured due to:
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java b/branches/sca-android/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java
deleted file mode 100644
index 5a0208b290..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.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 com.example.stock.sdo.fault;
-
-import javax.xml.namespace.QName;
-
-import com.example.stock.sdo.InvalidSymbolFault;
-
-/**
- * Hand-crafted java exception for SDO fault
- *
- * @version $Rev$ $Date$
- */
-public class InvalidSymbolFault_Exception extends Exception {
- private static final long serialVersionUID = 8602157311925253920L;
-
- /**
- * Generated QName for the fault element
- */
- public static final QName FAULT_ELEMENT = new QName("http://www.example.com/stock", "InvalidSymbolFault");
- /**
- * Java type that goes as soapenv:Fault detail element.
- */
- private InvalidSymbolFault faultInfo;
-
- /**
- * @param faultInfo
- * @param message
- */
- public InvalidSymbolFault_Exception(String message, InvalidSymbolFault faultInfo) {
- super(message);
- this.faultInfo = faultInfo;
- }
-
- /**
- * @param faultInfo
- * @param message
- * @param cause
- */
- public InvalidSymbolFault_Exception(String message, InvalidSymbolFault faultInfo, Throwable cause) {
- super(message, cause);
- this.faultInfo = faultInfo;
- }
-
- /**
- * @return returns fault bean:
- * org.apache.tuscany.sca.test.exceptions.impl.jaxb.InvalidSymbolFault
- */
- public InvalidSymbolFault getFaultInfo() {
- return faultInfo;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2NodeTestCase.java b/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2NodeTestCase.java
deleted file mode 100644
index 4bc41a5541..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2NodeTestCase.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-import commonj.sdo.DataObject;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DataObject2NodeTestCase extends SDOTransformerTestCaseBase {
- @Override
- protected DataType<?> getSourceDataType() {
- return new DataTypeImpl<XMLType>(binding, PurchaseOrderType.class, new XMLType(ORDER_QNAME, null));
- }
-
- @Override
- protected DataType<?> getTargetDataType() {
- return new DataTypeImpl<Class<String>>(String.class, String.class);
- }
-
- public final void testTransform() {
- Node node = new DataObject2Node().transform(dataObject, context);
- Assert.assertNotNull(node);
- Element element = (Element) node;
- Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), element.getNamespaceURI());
- Assert.assertEquals(ORDER_QNAME.getLocalPart(), element.getLocalName());
- DataObject po = new Node2DataObject().transform(node, reversedContext);
- Assert.assertTrue(po instanceof PurchaseOrderType);
- PurchaseOrderType orderType = (PurchaseOrderType)po;
- Assert.assertEquals("San Jose", orderType.getBillTo().getCity());
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java b/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java
deleted file mode 100644
index 44d11cd586..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.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.sdo;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-import commonj.sdo.DataObject;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DataObject2StringTestCase extends SDOTransformerTestCaseBase {
- @Override
- protected DataType<?> getSourceDataType() {
- return new DataTypeImpl<XMLType>(binding, PurchaseOrderType.class, new XMLType(ORDER_QNAME, null));
- }
-
- @Override
- protected DataType<?> getTargetDataType() {
- return new DataTypeImpl<Class<String>>(String.class, String.class);
- }
-
- public final void testTransform() {
- String xml = new DataObject2String().transform(dataObject, context);
- Assert.assertTrue(xml.indexOf("<city>San Jose</city>") != -1);
- DataObject po = new String2DataObject().transform(xml, reversedContext);
- Assert.assertTrue(po instanceof PurchaseOrderType);
- PurchaseOrderType orderType = (PurchaseOrderType)po;
- Assert.assertEquals("San Jose", orderType.getBillTo().getCity());
- }
-
- public final void testXML() {
- String xml =
- "<foo xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
- + "xmlns:ipo=\"http://www.example.com/IPO\" xsi:type=\"ipo:USAddress\"/>";
- DataObject dataObject = new String2DataObject().transform(xml, reversedContext);
- context.setSourceDataType(new DataTypeImpl<XMLType>(DataObject.class.getName(), DataObject.class, null));
- xml = new DataObject2String().transform(dataObject, context);
- Assert.assertTrue(xml.contains("xsi:type=\"ipo:USAddress\""));
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java b/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java
deleted file mode 100644
index 6a82a7fb18..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.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.sdo;
-
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.xml.Node2String;
-import org.apache.tuscany.sca.databinding.xml.XMLStreamReader2Node;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.EqualityHelper;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DataObject2XMLStreamReaderTestCase extends SDOTransformerTestCaseBase {
-
- @Override
- protected DataType<?> getSourceDataType() {
- return new DataTypeImpl<XMLType>(binding, PurchaseOrderType.class, new XMLType(ORDER_QNAME, null));
- }
-
- @Override
- protected DataType<?> getTargetDataType() {
- return new DataTypeImpl<Class<XMLStreamReader>>(XMLStreamReader.class, XMLStreamReader.class);
- }
-
- public final void testTransform() throws XMLStreamException {
- XMLStreamReader reader = new DataObject2XMLStreamReader().transform(dataObject, context);
- while (reader.hasNext()) {
- int event = reader.next();
- if (event == XMLStreamConstants.START_ELEMENT) {
- break;
- }
- }
- DataObject d = new XMLStreamReader2DataObject().transform(reader, reversedContext);
- assertNotNull(d);
- assertTrue(EqualityHelper.INSTANCE.equal(dataObject, d));
- }
-
- public final void testTransform1() throws XMLStreamException {
- XMLStreamReader reader = new DataObject2XMLStreamReader().transform(dataObject, context);
- XMLStreamReader2Node t2 = new XMLStreamReader2Node();
- org.w3c.dom.Node node = t2.transform(reader, context);
- assertNotNull(node);
- Node2String t3 = new Node2String();
- String xml = t3.transform(node, context);
- assertTrue(xml.contains("xmlns:xsi"));
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java b/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java
deleted file mode 100644
index fa765f9bf4..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.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.sdo;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-import com.example.ipo.sdo.SdoFactory;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ImportSDOProcessorTestCase extends TestCase {
- private static boolean inited;
-
- private ImportSDOProcessor loader;
- private XMLInputFactory xmlFactory;
-
- public void testMinimal() throws Exception {
- String xml = "<import.sdo xmlns='http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0'/>";
- XMLStreamReader reader = getReader(xml);
- assertTrue(loader.read(reader) instanceof ImportSDO);
- }
-
- public void testLocation() throws Exception {
- String xml = "<import.sdo xmlns='http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0' location='ipo.xsd'/>";
- XMLStreamReader reader = getReader(xml);
- assertTrue(loader.read(reader) instanceof ImportSDO);
- }
-
- public void testFactory() throws Exception {
- String xml = "<import.sdo xmlns='http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0' " + "factory='"
- + MockFactory.class.getName()
- + "'/>";
- XMLStreamReader reader = getReader(xml);
- assertFalse(inited);
- ImportSDO importSDO = loader.read(reader);
- assertNotNull(importSDO);
- ModelResolver resolver = new TestModelResolver();
- resolver.addModel(new ClassReference(MockFactory.class));
- loader.resolve(importSDO, resolver);
- assertTrue(inited);
- }
-
- @Override
- protected void setUp() throws Exception {
- loader = new ImportSDOProcessor(new DefaultModelFactoryExtensionPoint(), null);
- xmlFactory = XMLInputFactory.newInstance();
- }
-
- protected XMLStreamReader getReader(String xml) throws XMLStreamException {
- XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(xml));
- reader.next();
- return reader;
- }
-
- public static class MockFactory {
- public static final Object INSTANCE = SdoFactory.INSTANCE;
-
- static {
- ImportSDOProcessorTestCase.inited = true;
- }
- }
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelperTestCase.java b/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelperTestCase.java
deleted file mode 100644
index e0d1c9bf12..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelperTestCase.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sdo.api.SDOUtil;
-import org.junit.Test;
-
-import commonj.sdo.Type;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.TypeHelper;
-import commonj.sdo.helper.XSDHelper;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SDOContextHelperTestCase {
- @Test
- public void testGenerateSchema() throws IOException {
- HelperContext context = SDOUtil.createHelperContext();
- URL url = getClass().getResource("/ipo.xsd");
- Assert.assertNotNull(url);
- InputStream is = url.openStream();
- XSDHelper xsdHelper = context.getXSDHelper();
- xsdHelper.define(is, url.toExternalForm());
- TypeHelper typeHelper = context.getTypeHelper();
- Type type = typeHelper.getType("http://www.example.com/IPO", "PurchaseOrderType");
- Assert.assertNotNull(type);
- /*
- SDOContextHelper.generateSchema(context, Arrays.asList(type));
- */
- }
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java b/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java
deleted file mode 100644
index 3c21b56c9f..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.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.sdo;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-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 com.example.ipo.sdo.PurchaseOrderType;
-import com.example.ipo.sdo.SdoFactory;
-import com.example.ipo.sdo.USAddress;
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class SDODataBindingTestCase extends TestCase {
- protected static final QName ORDER_QNAME = new QName("http://www.example.com/IPO", "purchaseOrder");
- private SDODataBinding binding;
- private HelperContext context;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- binding = new SDODataBinding();
- context = HelperProvider.getDefaultContext();
- SdoFactory.INSTANCE.register(context);
- }
-
- public final void testIntrospect() {
- Operation op = null;
- DataType dataType = new DataTypeImpl<Class>(DataObject.class, null);
- boolean yes = binding.introspect(dataType, op);
- assertTrue(yes);
- assertTrue(dataType.getDataBinding().equals(binding.getName()));
- assertTrue(dataType.getPhysical() == DataObject.class && dataType.getLogical() == XMLType.UNKNOWN);
- dataType = new DataTypeImpl<Class>(PurchaseOrderType.class, null);
- yes = binding.introspect(dataType, op);
- assertTrue(yes);
- assertEquals(PurchaseOrderType.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());
- }
-
- public final void testCopyRoot() {
- PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
- po.setComment("Comment");
- Object copy = binding.copy(po, null, null);
- assertTrue(copy instanceof PurchaseOrderType);
- assertTrue(po != copy);
- assertTrue(context.getEqualityHelper().equal((DataObject)po, (DataObject)copy));
- assertEquals("Comment", ((PurchaseOrderType)copy).getComment());
- }
-
- public final void testCopyNonRoot() {
- USAddress address = SdoFactory.INSTANCE.createUSAddress();
- address.setCity("San Jose");
- Object copy = binding.copy(address, null, null);
- assertTrue(copy instanceof USAddress);
- assertTrue(address != copy);
- assertTrue(context.getEqualityHelper().equal((DataObject)address, (DataObject)copy));
- assertEquals("San Jose", ((USAddress)copy).getCity());
- }
-
- public final void testCopyXMLDocument() {
- PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
- po.setComment("Comment");
- XMLDocument doc =
- context.getXMLHelper().createDocument((DataObject)po,
- ORDER_QNAME.getNamespaceURI(),
- ORDER_QNAME.getLocalPart());
- Object copy = binding.copy(doc, null, null);
- assertTrue(copy instanceof XMLDocument);
- XMLDocument docCopy = (XMLDocument)copy;
- assertTrue(doc != copy);
- assertTrue(context.getEqualityHelper().equal((DataObject)po, docCopy.getRootObject()));
- assertEquals("Comment", ((PurchaseOrderType)docCopy.getRootObject()).getComment());
- }
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java b/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java
deleted file mode 100644
index 2aaae3c6d8..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.interfacedef.DataType;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-import com.example.ipo.sdo.SdoFactory;
-import com.example.ipo.sdo.USAddress;
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- * The base class for SDO-related test cases
- *
- * @version $Rev$ $Date$
- */
-public abstract class SDOTransformerTestCaseBase extends TestCase {
- protected static final QName ORDER_QNAME = new QName("http://www.example.com/IPO", "purchaseOrder");
-
- protected HelperContext helperContext;
- protected String binding = DataObject.class.getName();
- protected TransformationContext context;
- protected TransformationContext reversedContext;
- protected DataObject dataObject;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- helperContext = HelperProvider.getDefaultContext();
- SdoFactory.INSTANCE.register(helperContext);
-
- context = new TransformationContextImpl();
- context.setSourceDataType(getSourceDataType());
- context.setTargetDataType(getTargetDataType());
-
- reversedContext = new TransformationContextImpl();
- reversedContext.setSourceDataType(getTargetDataType());
- reversedContext.setTargetDataType(getSourceDataType());
-
- PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
- USAddress address = SdoFactory.INSTANCE.createUSAddress();
- address.setCity("San Jose");
- address.setStreet("123 ABC St");
- address.setState("CA");
- address.setStreet("95131");
- po.setBillTo(address);
- dataObject = (DataObject) po;
- }
-
- protected abstract DataType<?> getSourceDataType();
-
- protected abstract DataType<?> getTargetDataType();
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java b/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java
deleted file mode 100644
index 11d8495de8..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-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.sdo.api.SDOUtil;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-import commonj.sdo.helper.XSDHelper;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SDOWrapperHandlerTestCase extends TestCase {
- private HelperContext context;
- private SDOWrapperHandler handler;
-
- @Override
- public void setUp() throws Exception {
- context = SDOUtil.createHelperContext();
- handler = new SDOWrapperHandler();
- }
-
- public void testWrapperAnyType() throws Exception {
- XMLHelper xmlHelper = context.getXMLHelper();
- XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
- Operation op = new OperationImpl();
- List children = handler.getChildren(document, op, true);
- assertEquals(5, children.size());
- }
-
- public void testWrapper() throws Exception {
- XSDHelper xsdHelper = context.getXSDHelper();
- xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
- XMLHelper xmlHelper = context.getXMLHelper();
- XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
- Operation op = new OperationImpl();
- List children = handler.getChildren(document, op, true);
- assertEquals(5, children.size());
- }
-
- public void testCreate() {
- HelperContext context = HelperProvider.getDefaultContext();
- XSDHelper xsdHelper = context.getXSDHelper();
- xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
- ElementInfo element = new ElementInfo(new QName("http://www.example.com/wrapper", "op"), null);
- Operation op = new OperationImpl();
- WrapperInfo wrapperInfo = new WrapperInfo(SDODataBinding.NAME, element, null, null, null);
- op.setWrapper(wrapperInfo);
- DataObject wrapper = (DataObject) handler.create(op, true);
- assertNotNull(wrapper);
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java b/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java
deleted file mode 100644
index ce04f5be3f..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-
-/**
- * A default implementation of an artifact resolver, based on a map.
- *
- * @version $Rev$ $Date$
- */
-public class TestModelResolver implements ModelResolver {
- private static final long serialVersionUID = -7826976465762296634L;
-
- private Map<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/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java b/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java
deleted file mode 100644
index 114c568c38..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.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.sdo;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-import commonj.sdo.helper.XMLDocument;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class XMLDocument2XMLStreamReaderTestCase extends SDOTransformerTestCaseBase {
-
- @Override
- protected DataType<?> getSourceDataType() {
- return new DataTypeImpl<XMLType>(XMLDocument.class.getName(), XMLDocument.class, new XMLType(ORDER_QNAME, null));
- }
-
- @Override
- protected DataType<?> getTargetDataType() {
- return new DataTypeImpl<Class<XMLStreamReader>>(XMLStreamReader.class, XMLStreamReader.class);
- }
-
- public final void testTransform() throws XMLStreamException {
- XMLDocument document =
- helperContext.getXMLHelper().createDocument(dataObject,
- ORDER_QNAME.getNamespaceURI(),
- ORDER_QNAME.getLocalPart());
- XMLStreamReader reader = new XMLDocument2XMLStreamReader().transform(document, context);
- XMLDocument document2 = new XMLStreamReader2XMLDocument().transform(reader, reversedContext);
- Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), document2.getRootElementURI());
- Assert.assertEquals(ORDER_QNAME.getLocalPart(), document2.getRootElementName());
- Assert.assertTrue(document2.getRootObject() instanceof PurchaseOrderType);
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/resources/ipo.xsd b/branches/sca-android/modules/databinding-sdo/src/test/resources/ipo.xsd
deleted file mode 100755
index 241ec15d36..0000000000
--- a/branches/sca-android/modules/databinding-sdo/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/branches/sca-android/modules/databinding-sdo/src/test/resources/model/sca-core.xsd b/branches/sca-android/modules/databinding-sdo/src/test/resources/model/sca-core.xsd
deleted file mode 100755
index 56c6977254..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/resources/model/sca-core.xsd
+++ /dev/null
@@ -1,233 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/0.9"
- xmlns:sca="http://www.osoa.org/xmlns/sca/0.9"
- elementFormDefault="qualified">
-
- <element name="componentType" type="sca:ComponentType"/>
- <complexType name="ComponentType">
- <sequence>
- <element minOccurs="0" maxOccurs="unbounded" name="service" type="sca:Service"/>
- <element minOccurs="0" maxOccurs="unbounded" name="reference" type="sca:Reference"/>
- <element minOccurs="0" maxOccurs="unbounded" name="property" type="sca:Property"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Service">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:interface"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="interface" type="sca:Interface"/>
- <complexType name="Interface"/>
-
- <complexType name="Reference">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:interface"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="multiplicity" type="sca:Multiplicity" use="optional" default="1..1"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Property">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="type" type="QName" use="required"/>
- <attribute name="many" type="boolean" default="false" use="optional"/>
- <attribute name="required" type="boolean" default="false" use="optional"/>
- <attribute name="default" type="string" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
-
- <element name="moduleFragment" type="sca:ModuleFragment"/>
- <complexType name="ModuleFragment">
- <sequence>
- <element minOccurs="0" maxOccurs="unbounded" name="entryPoint" type="sca:EntryPoint"/>
- <element minOccurs="0" maxOccurs="unbounded" name="component" type="sca:Component"/>
- <element minOccurs="0" maxOccurs="unbounded" name="externalService" type="sca:ExternalService"/>
- <element minOccurs="0" maxOccurs="unbounded" name="wire" type="sca:ModuleWire"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="module" type="sca:Module"/>
- <complexType name="Module">
- <complexContent>
- <extension base="sca:ModuleFragment"/>
- </complexContent>
- </complexType>
-
- <complexType name="EntryPoint">
- <sequence>
- <element minOccurs="0" maxOccurs="1" ref="sca:interface"/>
- <element minOccurs="1" maxOccurs="unbounded" ref="sca:binding"/>
- <element minOccurs="1" maxOccurs="unbounded" name="reference" type="anyURI"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="multiplicity" type="sca:Multiplicity" use="optional" default="1..1"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
- <!-- a multiplicity 1..1 or 0..n sample
- <reference>StockQuoteComponent</reference> - type must be URI
- a multiplicity 1..n or 0..n sample
- <reference>StockQuoteComponent1</reference> - type must be URI
- <reference>StockQuoteComponent2</reference>
- -->
-
- <element name="binding" type="sca:Binding"/>
- <complexType name="Binding">
- <attribute name="uri" type="anyURI" use="optional"/>
- </complexType>
-
- <complexType name="Component">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:implementation"/>
- <element minOccurs="0" maxOccurs="1" name="properties" type="sca:PropertyValues"/>
- <element minOccurs="0" maxOccurs="1" name="references" type="sca:ReferenceValues"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
- <!-- a multiplicity 1..1 or 0..1 sample
- <references>
- <v:stockQuote>StockQuoteComponent</v:stockquote> - type must be URI
- </references>
- a multiplicity 1..n or 0..n sample
- <references>
- <v:stockQuote>StockQuoteComponent1</v:stockQuote> - type must be URI
- <v:stockQuote>StockQuoteComponent2</v:stockQuote>
- </references>
- -->
-
- <element name="implementation" type="sca:Implementation"/>
- <complexType name="Implementation"/>
-
- <complexType name="PropertyValues">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="ReferenceValues">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
-
- <complexType name="ExternalService">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:interface"/>
- <element minOccurs="0" maxOccurs="unbounded" ref="sca:binding"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="overridable" type="sca:OverrideOptions" default="may" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
-
- <complexType name="ModuleWire">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:source.uri"/>
- <element minOccurs="1" maxOccurs="1" ref="sca:target.uri"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="source" type="anyType"/>
- <element name="target" type="anyType"/>
-
- <element name="source.uri" type="anyURI" substitutionGroup="sca:source"/>
- <element name="target.uri" type="anyURI" substitutionGroup="sca:target"/>
-
- <element name="subsystem" type="sca:Subsystem"/>
- <complexType name="Subsystem">
- <sequence>
- <element minOccurs="0" maxOccurs="unbounded" name="entryPoint" type="sca:EntryPoint"/>
- <element minOccurs="0" maxOccurs="unbounded" name="moduleComponent" type="sca:ModuleComponent"/>
- <element minOccurs="0" maxOccurs="unbounded" name="externalService" type="sca:ExternalService"/>
- <element minOccurs="0" maxOccurs="unbounded" name="wire" type="sca:SystemWire"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="uri" type="anyURI" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="ModuleComponent">
- <sequence>
- <element minOccurs="0" maxOccurs="1" name="properties" type="sca:PropertyValues"/>
- <element minOccurs="0" maxOccurs="1" name="references" type="sca:ReferenceValues"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="module" type="NCName" use="required"/>
- <attribute name="uri" type="anyURI" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="SystemWire">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:source"/>
- <element minOccurs="1" maxOccurs="1" ref="sca:target"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <element name="source.epr" type="anyType" substitutionGroup="sca:source"/>
- <element name="target.epr" type="anyType" substitutionGroup="sca:target"/>
-
- <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>
-
-</schema>
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd b/branches/sca-android/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd
deleted file mode 100755
index bbaf58f00c..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.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://www.osoa.org/xmlns/mock/0.9"
- elementFormDefault="qualified"
- xmlns:mock="http://www.osoa.org/xmlns/mock/0.9"
- xmlns:sca="http://www.osoa.org/xmlns/sca/0.9">
-
- <import namespace="http://www.osoa.org/xmlns/sca/0.9"
- schemaLocation="sca-core.xsd" />
-
- <element name="implementation.mock" type="mock:MockImplementation"
- substitutionGroup="sca:implementation" />
- <complexType name="MockImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded" />
- </sequence>
- <attribute name="myAttr" type="NCName" use="required" />
- <anyAttribute namespace="##any" processContents="lax" />
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/resources/stock.xsd b/branches/sca-android/modules/databinding-sdo/src/test/resources/stock.xsd
deleted file mode 100644
index a0a6717371..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/resources/stock.xsd
+++ /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.
--->
-<schema targetNamespace="http://www.example.com/stock" xmlns="http://www.w3.org/2001/XMLSchema">
- <!-- Faults -->
- <element name="InvalidSymbolFault">
- <complexType>
- <sequence>
- <element name="message" minOccurs="1" type="string" />
- <element name="symbol" minOccurs="1" type="string" />
- </sequence>
- </complexType>
- </element>
-
- <element name="MarketClosedFault" type="string" />
-
-</schema> \ No newline at end of file
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/resources/wrapper.xml b/branches/sca-android/modules/databinding-sdo/src/test/resources/wrapper.xml
deleted file mode 100644
index 2526629409..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/resources/wrapper.xml
+++ /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.
--->
-<p:op xmlns:p="http://www.example.com/wrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.example.com/wrapper wrapper.xsd ">
- <message>message</message>
- <symbol>symbol</symbol>
- <message>message1</message>
- <symbol>symbol1</symbol>
- <symbol>symbol2</symbol>
-</p:op>
diff --git a/branches/sca-android/modules/databinding-sdo/src/test/resources/wrapper.xsd b/branches/sca-android/modules/databinding-sdo/src/test/resources/wrapper.xsd
deleted file mode 100644
index ea4dc5f7f3..0000000000
--- a/branches/sca-android/modules/databinding-sdo/src/test/resources/wrapper.xsd
+++ /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.
--->
-<schema targetNamespace="http://www.example.com/wrapper" xmlns="http://www.w3.org/2001/XMLSchema">
- <!-- Faults -->
- <element name="op">
- <complexType>
- <sequence maxOccurs="unbounded">
- <element name="message" minOccurs="1" type="string" />
- <element name="symbol" minOccurs="1" maxOccurs="3" type="string" />
- </sequence>
- </complexType>
- </element>
-
- <element name="opResponse">
- <complexType>
- <sequence maxOccurs="1">
- <element name="price" minOccurs="1" maxOccurs="unbounded" type="string" />
- </sequence>
- </complexType>
- </element>
-</schema> \ No newline at end of file
diff --git a/branches/sca-android/modules/databinding-xmlbeans/LICENSE b/branches/sca-android/modules/databinding-xmlbeans/LICENSE
deleted file mode 100755
index d645695673..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/branches/sca-android/modules/databinding-xmlbeans/META-INF/README b/branches/sca-android/modules/databinding-xmlbeans/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/databinding-xmlbeans/NOTICE b/branches/sca-android/modules/databinding-xmlbeans/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/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/branches/sca-android/modules/databinding-xmlbeans/pom.xml b/branches/sca-android/modules/databinding-xmlbeans/pom.xml
deleted file mode 100644
index 3e92649675..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/pom.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding-xmlbeans</artifactId>
- <name>Apache Tuscany SCA Data Binding for XmlBeans</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.xmlbeans</groupId>
- <artifactId>xmlbeans</artifactId>
- <version>2.3.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- </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/xmlbeans-source</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-trax</artifactId>
- <version>1.6.5</version>
- </dependency>
- </dependencies>
-
- <executions>
- <execution>
- <id>generate-xmlbeans</id>
- <phase>generate-sources</phase>
- <configuration>
- <tasks>
- <taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean"
- classpathref="maven.compile.classpath" />
- <xmlbean schema="${basedir}/src/test/resources" classpathref="maven.compile.classpath"
- destfile="${project.build.directory}/ipo-xmlbeans.jar"
- srcgendir="${project.build.directory}/xmlbeans-source" javasource="1.5"
- classgendir="${project.build.directory}/test-classes" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <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.databinding.xmlbeans</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.databinding.xmlbeans*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/Node2XmlObject.java b/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/Node2XmlObject.java
deleted file mode 100644
index e7b240b781..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/Node2XmlObject.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.xmlbeans;
-
-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.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.w3c.dom.Node;
-
-/**
- * Transforms a DOM Node to an XML Object.
- *
- * @version $Rev$ $Date$
- */
-public class Node2XmlObject extends BaseTransformer<Node, XmlObject> implements
- PullTransformer<Node, XmlObject> {
- // private XmlOptions options;
-
- public XmlObject transform(Node source, TransformationContext context) {
- try {
- return XmlObject.Factory.parse(source);
- } catch (XmlException e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<XmlObject> getTargetType() {
- return XmlObject.class;
- }
-
- @Override
- protected Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 30;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLBeansDataBinding.java b/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLBeansDataBinding.java
deleted file mode 100644
index 15616979c2..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLBeansDataBinding.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.xmlbeans;
-
-import java.lang.reflect.Field;
-
-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.apache.xmlbeans.SchemaType;
-import org.apache.xmlbeans.XmlObject;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * XMLBeans DataBinding
- *
- * @version $Rev$ $Date$
- */
-public class XMLBeansDataBinding extends BaseDataBinding {
- public static final String NAME = XmlObject.class.getName();
- public static final String[] ALIASES = {"xmlbeans"};
-
- public XMLBeansDataBinding() {
- super(NAME, XmlObject.class);
- }
-
- @Override
- public WrapperHandler getWrapperHandler() {
- return new XMLBeansWrapperHandler();
- }
-
- @Override
- public boolean introspect(DataType type, Operation operation) {
- if (XmlObject.class.isAssignableFrom(type.getPhysical())) {
- Class<?> cls = type.getPhysical();
- SchemaType schemaType = null;
- try {
- Field f = cls.getField("type");
- schemaType = (SchemaType)f.get(null);
- } catch (Throwable e) {
- throw new ServiceRuntimeException(e);
- }
- QName typeName = schemaType.getName();
- Object logical = type.getLogical();
- QName elementName = null;
- if (logical instanceof XMLType) {
- elementName = ((XMLType)logical).getElementName();
- }
- type.setLogical(new XMLType(elementName, typeName));
- type.setMetaData(SchemaType.class, schemaType);
- return true;
- }
- return false;
- }
-
- @Override
- public Object copy(Object object, DataType dataType, Operation operation) {
- return ((XmlObject)object).copy();
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLBeansWrapperHandler.java b/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLBeansWrapperHandler.java
deleted file mode 100644
index 506c42e40f..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLBeansWrapperHandler.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.xmlbeans;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-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;
-import org.apache.xmlbeans.SchemaProperty;
-import org.apache.xmlbeans.SimpleValue;
-import org.apache.xmlbeans.XmlObject;
-
-/**
- * @version $Rev$ $Date$
- */
-public class XMLBeansWrapperHandler implements WrapperHandler<XmlObject> {
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#create(org.apache.tuscany.sca.interfacedef.Operation, boolean)
- */
- public XmlObject create(Operation operation, boolean input) {
- WrapperInfo wrapperInfo = operation.getWrapper();
- ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#getChildren(java.lang.Object, org.apache.tuscany.sca.interfacedef.Operation, boolean)
- */
- public List getChildren(XmlObject wrapper, Operation operation, boolean input) {
- List<Object> children = new ArrayList<Object>();
-
- List<ElementInfo> childElements =
- input ? operation.getWrapper().getInputChildElements() : operation.getWrapper().getOutputChildElements();
- for (ElementInfo e : childElements) {
- XmlObject[] objects = wrapper.selectChildren(e.getQName());
- if (objects != null && objects.length == 1) {
- if (objects[0] instanceof SimpleValue) {
- children.add(((SimpleValue)objects[0]).getObjectValue());
- } else {
- children.add(objects[0]);
- }
- }
- // FIXME: What should we do for many-value?
- }
- return children;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(org.apache.tuscany.sca.interfacedef.Operation, boolean)
- */
- public DataType getWrapperType(Operation operation, boolean input) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#isInstance(java.lang.Object, org.apache.tuscany.sca.interfacedef.Operation, boolean)
- */
- public boolean isInstance(Object wrapper, Operation operation, boolean input) {
- WrapperInfo wrapperInfo = operation.getWrapper();
- ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
- return true;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#setChildren(java.lang.Object, java.lang.Object[], org.apache.tuscany.sca.interfacedef.Operation, boolean)
- */
- public void setChildren(XmlObject wrapper, Object[] childObjects, Operation operation, boolean input) {
- List<ElementInfo> childElements =
- input ? operation.getWrapper().getInputChildElements() : operation.getWrapper().getOutputChildElements();
- int i = 0;
- for (ElementInfo c : childElements) {
- SchemaProperty property = wrapper.schemaType().getElementProperty(c.getQName());
-
- String prop = property.getJavaPropertyName();
-
- Method setter;
- try {
- setter = wrapper.schemaType().getJavaClass().getMethod("set" + prop, property.getType().getJavaClass());
- setter.invoke(wrapper, childObjects[i++]);
- } catch (Throwable e) {
- throw new IllegalArgumentException(e);
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLStreamReader2XmlObject.java b/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLStreamReader2XmlObject.java
deleted file mode 100644
index ca84f961b1..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XMLStreamReader2XmlObject.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.xmlbeans;
-
-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.xmlbeans.XmlObject;
-
-/**
- * Transforms an XMLStreamReader to an XML Object.
- *
- * @version $Rev$ $Date$
- */
-public class XMLStreamReader2XmlObject extends BaseTransformer<XMLStreamReader, XmlObject> implements PullTransformer<XMLStreamReader, XmlObject> {
- // private XmlOptions options;
-
- public XmlObject transform(XMLStreamReader source, TransformationContext context) {
- try {
- XmlObject target = XmlObject.Factory.parse(source);
- source.close();
- return target;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<XmlObject> getTargetType() {
- return XmlObject.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObject2Node.java b/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObject2Node.java
deleted file mode 100644
index c820d9d250..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObject2Node.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.xmlbeans;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.Transformer;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.xmlbeans.XmlObject;
-import org.osoa.sca.annotations.Service;
-import org.w3c.dom.Node;
-
-/**
- * Transforms an XML Object to a DOM Node.
- *
- * @version $Rev$ $Date$
- */
-@Service(Transformer.class)
-public class XmlObject2Node extends BaseTransformer<XmlObject, Node> implements
- PullTransformer<XmlObject, Node> {
- // private XmlOptions options;
-
- public Node transform(XmlObject source, TransformationContext context) {
- if (source == null)
- return null;
- return source.newDomNode();
- }
-
- @Override
- protected Class<XmlObject> getSourceType() {
- return XmlObject.class;
- }
-
- @Override
- protected Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 30;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObject2XMLStreamReader.java b/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObject2XMLStreamReader.java
deleted file mode 100644
index bbffb7d748..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/src/main/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObject2XMLStreamReader.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.xmlbeans;
-
-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.impl.BaseTransformer;
-import org.apache.xmlbeans.XmlObject;
-
-/**
- * Transforms an XML Object to an XMLStreamReader.
- *
- * @version $Rev$ $Date$
- */
-public class XmlObject2XMLStreamReader extends BaseTransformer<XmlObject, XMLStreamReader> implements PullTransformer<XmlObject, XMLStreamReader> {
- // private XmlOptions options;
-
- public XMLStreamReader transform(XmlObject source, TransformationContext context) {
- return source.newXMLStreamReader();
- }
-
- @Override
- protected Class<XmlObject> getSourceType() {
- return XmlObject.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-xmlbeans/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding b/branches/sca-android/modules/databinding-xmlbeans/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
deleted file mode 100644
index 907d06559a..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/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.xmlbeans.XMLBeansDataBinding;type=org.apache.xmlbeans.XmlObject,name=xmlbeans \ No newline at end of file
diff --git a/branches/sca-android/modules/databinding-xmlbeans/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/branches/sca-android/modules/databinding-xmlbeans/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index 4e419de051..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
+++ /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.
-
-# Implementation classes for the transformers
-org.apache.tuscany.sca.databinding.xmlbeans.Node2XmlObject;source=org.w3c.dom.Node,target=org.apache.xmlbeans.XmlObject,weight=500
-org.apache.tuscany.sca.databinding.xmlbeans.XmlObject2Node;source=org.apache.xmlbeans.XmlObject,target=org.w3c.dom.Node,weight=500
-org.apache.tuscany.sca.databinding.xmlbeans.XmlObject2XMLStreamReader;source=org.apache.xmlbeans.XmlObject,target=javax.xml.stream.XMLStreamReader,weight=490
-org.apache.tuscany.sca.databinding.xmlbeans.XMLStreamReader2XmlObject;source=javax.xml.stream.XMLStreamReader,target=org.apache.xmlbeans.XmlObject,weight=490
diff --git a/branches/sca-android/modules/databinding-xmlbeans/src/test/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObjectTestCase.java b/branches/sca-android/modules/databinding-xmlbeans/src/test/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObjectTestCase.java
deleted file mode 100644
index 7b98ddb021..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/src/test/java/org/apache/tuscany/sca/databinding/xmlbeans/XmlObjectTestCase.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.databinding.xmlbeans;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.xmlbeans.XmlObject;
-import org.w3c.dom.Node;
-
-import com.example.ipo.xmlbeans.PurchaseOrderDocument;
-
-/**
- * Test cases for testing XML Object transformations.
- *
- * @version $Rev$ $Date$
- */
-public class XmlObjectTestCase 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>";
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- public void testXmlObject() throws Exception {
- // URL/Stream/Reader to XmlObject
- XmlObject object = XmlObject.Factory.parse(new StringReader(IPO_XML));
-
- // XmlObject to XMLStreamReader
- XmlObject2XMLStreamReader t1 = new XmlObject2XMLStreamReader();
- XMLStreamReader reader = t1.transform(object, null);
-
- // XMLStreamReader to XmlObject
- XMLStreamReader2XmlObject t2 = new XMLStreamReader2XmlObject();
- XmlObject object2 = t2.transform(reader, null);
-
- // XmlObject to Node
- XmlObject2Node t3 = new XmlObject2Node();
- Node node = t3.transform(object2, null);
-
- // Node to XmlObject
- Node2XmlObject t4 = new Node2XmlObject();
- XmlObject object3 = t4.transform(node, null);
- Assert.assertNotNull(object3);
- }
-
- public void testGeneratedXmlObject() throws Exception {
- // URL xmlFile = getClass().getClassLoader().getResource("ipo.xml");
- // URL/Stream/Reader to XmlObject
- PurchaseOrderDocument object = PurchaseOrderDocument.Factory.parse(new StringReader(IPO_XML));
-
- // XmlObject to XMLStreamReader
- XmlObject2XMLStreamReader t1 = new XmlObject2XMLStreamReader();
- XMLStreamReader reader = t1.transform(object, null);
-
- // XMLStreamReader to XmlObject
- XMLStreamReader2XmlObject t2 = new XMLStreamReader2XmlObject();
- PurchaseOrderDocument object2 = (PurchaseOrderDocument) t2.transform(reader, null);
-
- // XmlObject to Node
- XmlObject2Node t3 = new XmlObject2Node();
- Node node = t3.transform(object2, null);
-
- // Node to XmlObject
- Node2XmlObject t4 = new Node2XmlObject();
- PurchaseOrderDocument object3 = (PurchaseOrderDocument) t4.transform(node, null);
- Assert.assertNotNull(object3);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/branches/sca-android/modules/databinding-xmlbeans/src/test/resources/ipo.xsd b/branches/sca-android/modules/databinding-xmlbeans/src/test/resources/ipo.xsd
deleted file mode 100755
index 5a493e1746..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/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/branches/sca-android/modules/databinding-xmlbeans/src/test/resources/ipo.xsdconfig b/branches/sca-android/modules/databinding-xmlbeans/src/test/resources/ipo.xsdconfig
deleted file mode 100755
index a397182672..0000000000
--- a/branches/sca-android/modules/databinding-xmlbeans/src/test/resources/ipo.xsdconfig
+++ /dev/null
@@ -1,21 +0,0 @@
-<!-- Copyright 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. -->
-<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config"
- xmlns:ipo="http://www.example.com/IPO">
-
- <xb:namespace uri="http://www.example.com/IPO">
- <xb:package>com.example.ipo.xmlbeans</xb:package>
- </xb:namespace>
-
-</xb:config>
diff --git a/branches/sca-android/modules/domain-manager/LICENSE b/branches/sca-android/modules/domain-manager/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/domain-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/branches/sca-android/modules/domain-manager/META-INF/README b/branches/sca-android/modules/domain-manager/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/domain-manager/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/domain-manager/NOTICE b/branches/sca-android/modules/domain-manager/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/domain-manager/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/branches/sca-android/modules/domain-manager/pom.xml b/branches/sca-android/modules/domain-manager/pom.xml
deleted file mode 100644
index 5a526b158a..0000000000
--- a/branches/sca-android/modules/domain-manager/pom.xml
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-domain-manager</artifactId>
- <name>Apache Tuscany SCA Domain Manager Application</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-atom</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.1.1</version>
- </dependency>
-
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.8.1</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-manager</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-resource</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-widget-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-atom-abdera</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-http-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-monitor-logging</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</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.domain.manager</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.domain.manager*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationCollectionImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationCollectionImpl.java
deleted file mode 100644
index 0e25068f5f..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationCollectionImpl.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.domain.manager.impl;
-
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeQName;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeTitle;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.contributionURI;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.ItemCollection;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a component that returns composite configuration collections.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(interfaces={ItemCollection.class, LocalItemCollection.class})
-public class CompositeConfigurationCollectionImpl implements ItemCollection, LocalItemCollection {
-
- private static final Logger logger = Logger.getLogger(CompositeConfigurationCollectionImpl.class.getName());
-
- @Reference
- public LocalItemCollection contributionCollection;
-
- @Reference
- public LocalItemCollection cloudCollection;
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() {
- }
-
- public Entry<String, Item>[] getAll() {
- throw new UnsupportedOperationException();
- }
-
- public Item get(String key) throws NotFoundException {
- throw new UnsupportedOperationException();
- }
-
- public String post(String key, Item item) {
- throw new UnsupportedOperationException();
- }
-
- public void put(String key, Item item) throws NotFoundException {
- throw new UnsupportedOperationException();
- }
-
- public void delete(String key) throws NotFoundException {
- throw new UnsupportedOperationException();
- }
-
- public Entry<String, Item>[] query(String queryString) {
- logger.fine("query " + queryString);
-
- if (queryString.startsWith("composite=")) {
-
- // Expecting a key in the form:
- // composite:contributionURI;namespace;localName
- int e = queryString.indexOf('=');
- String key = queryString.substring(e + 1);
- String contributionURI = contributionURI(key);
- QName qname = compositeQName(key);
-
- // Return a collection containing the following entries:
- // the resolved version of the specified composite
- // the required contributions
- List<Entry<String, Item>> entries = new ArrayList<Entry<String, Item>>();
-
- // Add the resolved composite entry
- Entry<String, Item> compositeEntry = new Entry<String, Item>();
- Item compositeItem = new Item();
- compositeItem.setTitle(compositeTitle(contributionURI, qname));
- compositeItem.setLink("/composite-resolved/" + key);
- compositeEntry.setKey(key);
- compositeEntry.setData(compositeItem);
- entries.add(compositeEntry);
-
- // Get the collection of required contributions
- Entry<String, Item>[] contributionEntries = contributionCollection.query("alldependencies=" + contributionURI);
- for (Entry<String, Item> entry: contributionEntries) {
- Item item = entry.getData();
- item.setContents(null);
- entries.add(entry);
- }
-
- return entries.toArray(new Entry[entries.size()]);
-
- } else {
- throw new UnsupportedOperationException();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java
deleted file mode 100644
index 09bb05cf87..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.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.domain.manager.impl;
-
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeQName;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.contributionURI;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.locationURL;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamWriter;
-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.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.assembly.builder.impl.CompositeBuilderImpl;
-import org.apache.tuscany.sca.assembly.builder.impl.CompositeIncludeBuilderImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.resolver.ExtensibleModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.apache.tuscany.sca.implementation.node.NodeImplementation;
-import org.apache.tuscany.sca.implementation.node.builder.impl.NodeCompositeBuilderImpl;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-import org.apache.tuscany.sca.workspace.Workspace;
-import org.apache.tuscany.sca.workspace.WorkspaceFactory;
-import org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder;
-import org.apache.tuscany.sca.workspace.builder.impl.ContributionDependencyBuilderImpl;
-import org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProcessor;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a service that returns a fully configured composite.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(Servlet.class)
-public class CompositeConfigurationServiceImpl extends HttpServlet implements Servlet {
- private static final long serialVersionUID = -8809641932774129152L;
-
- private static final Logger logger = Logger.getLogger(CompositeConfigurationServiceImpl.class.getName());
-
- @Reference
- public LocalItemCollection contributionCollection;
-
- @Reference
- public LocalItemCollection domainCompositeCollection;
-
- @Reference
- public DomainManagerConfiguration domainManagerConfiguration;
-
- @Reference
- public LocalItemCollection cloudCollection;
-
- private ModelFactoryExtensionPoint modelFactories;
- private ModelResolverExtensionPoint modelResolvers;
- private AssemblyFactory assemblyFactory;
- private WorkspaceFactory workspaceFactory;
- private URLArtifactProcessor<Contribution> contributionProcessor;
- private StAXArtifactProcessorExtensionPoint staxProcessors;
- private StAXArtifactProcessor<Composite> compositeProcessor;
- private XMLOutputFactory outputFactory;
- private ContributionDependencyBuilder contributionDependencyBuilder;
- private CompositeBuilder compositeBuilder;
- private CompositeBuilder compositeIncludeBuilder;
- private CompositeBuilder nodeConfigurationBuilder;
- private Monitor monitor;
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() throws ParserConfigurationException {
-
- ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints();
-
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- monitor = monitorFactory.createMonitor();
-
- // Get model factories
- modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
- outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
- workspaceFactory = modelFactories.getFactory(WorkspaceFactory.class);
-
- // Get and initialize artifact processors
- staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- compositeProcessor = (StAXArtifactProcessor<Composite>)staxProcessors.getProcessor(Composite.class);
- StAXArtifactProcessor<Object> staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, monitor);
-
- URLArtifactProcessorExtensionPoint urlProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- URLArtifactProcessor<Object> urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors, monitor);
-
- // Create contribution processor
- modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
- contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor, monitor);
-
- // Create contribution and composite builders
- DocumentBuilderFactory documentBuilderFactory = modelFactories.getFactory(DocumentBuilderFactory.class);
- TransformerFactory transformerFactory = modelFactories.getFactory(TransformerFactory.class);
- contributionDependencyBuilder = new ContributionDependencyBuilderImpl(monitor);
- SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
- IntentAttachPointTypeFactory intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- InterfaceContractMapper contractMapper = utilities.getUtility(InterfaceContractMapper.class);
- compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, intentAttachPointTypeFactory, documentBuilderFactory, transformerFactory, contractMapper, monitor);
- compositeIncludeBuilder = new CompositeIncludeBuilderImpl(monitor);
- nodeConfigurationBuilder = new NodeCompositeBuilderImpl(assemblyFactory, scaBindingFactory, documentBuilderFactory, transformerFactory, contractMapper, null, monitor);
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- String key;
- if (path.startsWith("/")) {
- if (path.length() > 1) {
- key = path.substring(1);
- } else {
- key ="";
- }
- } else {
- key =path;
- }
- logger.fine("get " + key);
-
- // Expect a key in the form composite:contributionURI;namespace;localName or
- // a path in the form componentName/componentName/...
- // and return the corresponding resolved composite
- String requestedContributionURI = null;
- QName requestedCompositeName = null;
- String[] requestedComponentPath = null;
- if (key.startsWith("composite:")) {
-
- // Extract the composite qname from the key
- requestedContributionURI = contributionURI(key);
- requestedCompositeName = compositeQName(key);
-
- } else if (key.length() != 0) {
-
- // Extract the path to the requested component from the key
- requestedComponentPath = key.split("/");
- }
-
- // Somewhere to store the composite we expect to write out at the end
- Composite requestedComposite = null;
-
- // Create a domain composite model
- Composite domainComposite = assemblyFactory.createComposite();
- domainComposite.setName(new QName(Constants.SCA10_TUSCANY_NS, "domain"));
-
- // Get the domain composite items
- Entry<String, Item>[] domainEntries = domainCompositeCollection.getAll();
-
- // Populate the domain composite
- Workspace workspace = workspaceFactory.createWorkspace();
- workspace.setModelResolver(new ExtensibleModelResolver(workspace, modelResolvers, modelFactories));
-
- Map<String, Contribution> contributionMap = new HashMap<String, Contribution>();
- for (Entry<String, Item> domainEntry: domainEntries) {
-
- // Load the required contributions
- String contributionURI = contributionURI(domainEntry.getKey());
- Contribution contribution = contributionMap.get(contributionURI);
- if (contribution == null) {
-
- // The contribution has not been loaded yet, load it with all its dependencies
- Entry<String, Item>[] entries = contributionCollection.query("alldependencies=" + contributionURI);
- for (Entry<String, Item> entry: entries) {
- Item dependencyItem = entry.getData();
- String dependencyURI = entry.getKey();
-
- if (!contributionMap.containsKey(dependencyURI)) {
-
- // Read the contribution
- Contribution dependency;
- try {
- String dependencyLocation = dependencyItem.getAlternate();
- dependency = contribution(workspace, dependencyURI, dependencyLocation);
- } catch (ContributionReadException e) {
- continue;
- }
- workspace.getContributions().add(dependency);
- contributionMap.put(dependencyURI, dependency);
-
- if (contributionURI.equals(entry.getKey())) {
- contribution = dependency;
- }
- }
- }
- }
-
- if (contribution == null) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, contributionURI);
- return;
- }
-
- // Find the specified deployable composite in the contribution
- Composite deployable = null;
- QName qn = compositeQName(domainEntry.getKey());
- for (Composite d: contribution.getDeployables()) {
- if (qn.equals(d.getName())) {
- deployable = d;
- break;
- }
- }
- if (deployable == null) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, qn.toString());
- return;
- }
-
- // add the deployable composite to the domain composite
- domainComposite.getIncludes().add(deployable);
-
- // Fuse includes into the deployable composite
- try {
- compositeIncludeBuilder.build(deployable);
- } catch (CompositeBuilderException e) {
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
- }
-
- // Store away the requested composite
- if (requestedCompositeName != null) {
- if (requestedContributionURI.equals(contributionURI) && requestedCompositeName.equals(deployable.getName())){
- requestedComposite = deployable;
- }
- }
- }
-
- // The requested composite was not found
- if (requestedCompositeName != null && requestedComposite == null) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, key);
- return;
- }
-
- // Get the clouds composite
- Composite cloudsComposite;
- try {
- cloudsComposite = cloud();
- } catch (NotFoundException e) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, e.getMessage());
- return;
- }
-
- // configure the endpoints for each composite in the domain
- List<Composite> domainIncludes = domainComposite.getIncludes();
- for (int i = 0, n =domainIncludes.size(); i < n; i++) {
- Composite composite = domainIncludes.get(i);
- QName compositeName = composite.getName();
- String contributionURI = contributionURI(domainEntries[i].getKey());
-
- // find the node that will run this composite and the default
- // bindings that it configures
- Component nodeComponent = null;
- QName nodeCompositeName = null;
- for (Composite cloudComposite : cloudsComposite.getIncludes()) {
- for (Component nc : cloudComposite.getComponents()) {
- NodeImplementation nodeImplementation = (NodeImplementation)nc.getImplementation();
- if (nodeImplementation.getComposite().getName().equals(compositeName) &&
- nodeImplementation.getComposite().getURI().equals(contributionURI)) {
- nodeImplementation.setComposite(composite);
- nodeComponent = nc;
- nodeCompositeName = cloudComposite.getName();
- break;
- }
- }
- }
-
- if (nodeComponent != null) {
- try {
- Composite nodeComposite = assemblyFactory.createComposite();
- nodeComposite.setName(nodeCompositeName);
- nodeComposite.getComponents().add(nodeComponent);
- nodeConfigurationBuilder.build(nodeComposite);
- } catch (CompositeBuilderException e) {
- throw new ServletException(e);
- }
- }
- }
-
- // Build the domain composite
- try {
- compositeBuilder.build(domainComposite);
- } catch (CompositeBuilderException e) {
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
- return;
- }
-
- // Return the requested composite
- if (requestedComposite != null) {
-
- // Rebuild the requested composite from the domain composite
- // we have to reverse the flattening that went on when the domain
- // composite was built
- List<Component> tempComponentList = new ArrayList<Component>();
- tempComponentList.addAll(requestedComposite.getComponents());
- requestedComposite.getComponents().clear();
- for (Component inputComponent : tempComponentList){
- for (Component deployComponent : domainComposite.getComponents()){
- if (deployComponent.getName().equals(inputComponent.getName())){
- requestedComposite.getComponents().add(deployComponent);
- }
- }
- }
-
- } else if (requestedComponentPath != null) {
-
- // If a component path was specified, walk the path to get to the requested
- // component and the composite that implements it
- Composite nestedComposite = domainComposite;
- for (String componentName: requestedComponentPath) {
- Component component = null;
- for (Component c: nestedComposite.getComponents()) {
- if (componentName.equals(c.getName())) {
- component = c;
- break;
- }
- }
- if (component == null) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, key);
- return;
- } else {
- if (component.getImplementation() instanceof Composite) {
- nestedComposite = (Composite)component.getImplementation();
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, key);
- return;
- }
- }
- }
-
- // Return the nested composite
- requestedComposite = nestedComposite;
-
- } else {
-
-
- // Return the whole domain composite
- requestedComposite = domainComposite;
- }
-
- // Write the composite in the requested format
- StAXArtifactProcessor<Composite> processor;
- String queryString = request.getQueryString();
- if (queryString != null && queryString.startsWith("format=")) {
- String format = queryString.substring(7);
- int s = format.indexOf(';');
- QName formatName = new QName(format.substring(0, s), format.substring(s +1));
- processor = (StAXArtifactProcessor<Composite>)staxProcessors.getProcessor(formatName);
- if (processor == null) {
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, new IllegalArgumentException(queryString).toString());
- return;
- }
- } else {
- processor = compositeProcessor;
- }
- try {
- response.setContentType("text/xml");
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(response.getOutputStream());
- processor.write(requestedComposite, writer);
- } catch (Exception e) {
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
- return;
- }
-
-
- }
-
- /**
- * Returns the cloud composite.
- *
- * @return the cloud composite
- */
- private Composite cloud() throws NotFoundException {
-
- // Create a new composite for the clouds
- Composite cloudComposite = assemblyFactory.createComposite();
- cloudComposite.setName(new QName(Constants.SCA10_TUSCANY_NS, "cloud"));
-
- // Get the collection of cloud composites
- Entry<String, Item>[] cloudEntries = cloudCollection.getAll();
-
- // Load the cloud contributions
- Workspace workspace = workspaceFactory.createWorkspace();
- Map<String, Contribution> contributionMap = new HashMap<String, Contribution>();
- for (Entry<String, Item> cloudEntry: cloudEntries) {
- String key = cloudEntry.getKey();
- String contributionURI = contributionURI(key);
-
- // Load the contribution
- Contribution contribution = contributionMap.get(contributionURI);
- if (contribution == null) {
- Item contributionItem = contributionCollection.get(contributionURI);
-
- // Read the contribution
- try {
- contribution = contribution(workspace, contributionURI, contributionItem.getAlternate());
- } catch (ContributionReadException e) {
- continue;
- }
- workspace.getContributions().add(contribution);
- contributionMap.put(contributionURI, contribution);
-
- }
-
- // Include the cloud composite in the clouds composite
- QName qname = compositeQName(key);
- for (Artifact artifact : contribution.getArtifacts()) {
- if (artifact.getModel() instanceof Composite) {
- Composite composite = (Composite)artifact.getModel();
- if (composite.getName().equals(qname)) {
- cloudComposite.getIncludes().add(composite);
- }
- }
- }
- }
-
- return cloudComposite;
- }
-
- /**
- * Returns the contribution with the given URI.
- *
- * @param workspace
- * @param contributionURI
- * @param contributionLocation
- * @return
- * @throws NotFoundException
- */
- private Contribution contribution(Workspace workspace, String contributionURI, String contributionLocation) throws ContributionReadException {
- try {
- URI uri = URI.create(contributionURI);
- URL location = locationURL(contributionLocation);
- Contribution contribution = (Contribution)contributionProcessor.read(null, uri, location);
-
- // Resolve the contribution dependencies
- contributionDependencyBuilder.buildContributionDependencies(contribution, workspace);
-
- contributionProcessor.resolve(contribution, workspace.getModelResolver());
- return contribution;
-
- } catch (ContributionReadException e) {
- throw e;
- } catch (ContributionResolveException e) {
- throw new ContributionReadException(e);
- } catch (MalformedURLException e) {
- throw new ContributionReadException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java
deleted file mode 100644
index 9e024d2d6b..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.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.domain.manager.impl;
-
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeQName;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.contributionURI;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.lastModified;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.locationURL;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLDecoder;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.resolver.DefaultModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.apache.tuscany.sca.domain.manager.impl.CompositeGeneratorServiceImpl.Cache.ContributionCache;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProcessor;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a service that generates a composite from a composite model.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(interfaces={Servlet.class})
-public class CompositeGeneratorServiceImpl extends HttpServlet implements Servlet {
- private static final long serialVersionUID = -6531448326726908269L;
-
- private static final Logger logger = Logger.getLogger(CompositeGeneratorServiceImpl.class.getName());
-
- @Reference
- public LocalItemCollection contributionCollection;
-
- @Reference
- public DomainManagerConfiguration domainManagerConfiguration;
-
- private ModelFactoryExtensionPoint modelFactories;
- private ModelResolverExtensionPoint modelResolvers;
- private URLArtifactProcessor<Contribution> contributionProcessor;
- private StAXArtifactProcessor<Composite> compositeProcessor;
- private XMLOutputFactory outputFactory;
-
- /**
- * Cache contribution models.
- */
- static class Cache {
- static class ContributionCache {
- private Contribution contribution;
- private long contributionLastModified;
- }
- private Map<URL, ContributionCache> contributions = new HashMap<URL, ContributionCache>();
- }
-
- private Cache cache = new Cache();
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() throws ParserConfigurationException {
-
- ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints();
-
- // Create a monitor
- UtilityExtensionPoint services = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = services.getUtility(MonitorFactory.class);
- Monitor monitor = monitorFactory.createMonitor();
-
- // Get model factories
- modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
- outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
-
- // Get and initialize artifact processors
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- compositeProcessor = (StAXArtifactProcessor<Composite>)staxProcessors.getProcessor(Composite.class);
- StAXArtifactProcessor<Object> staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, monitor);
-
- URLArtifactProcessorExtensionPoint urlProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- URLArtifactProcessor<Object> urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors, monitor);
-
- // Create contribution processor
- modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
- contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor, monitor);
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // Expect a key in the form
- // composite:contributionURI;namespace;localName
- // and return the corresponding source file
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- String key = path.startsWith("/")? path.substring(1) : path;
- logger.fine("get " + key);
-
- // Get the specified contribution info
- String contributionURI = contributionURI(key);
- Item contributionItem;
- try {
- contributionItem = contributionCollection.get(contributionURI);
- } catch (NotFoundException e) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, key);
- return;
- }
-
- // Read the contribution
- Contribution contribution;
- try {
- contribution = contribution(contributionURI, contributionItem.getAlternate());
- } catch (ContributionReadException e) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, key);
- return;
- }
-
- // Find the specified deployable composite
- QName qname = compositeQName(key);
- Composite composite = null;
- for (Composite deployable: contribution.getDeployables()) {
- if (qname.equals(deployable.getName())) {
- if (!deployable.isUnresolved()) {
- composite = deployable;
- }
- break;
- }
- }
- if (composite == null) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, key);
- return;
- }
-
- // Write the composite
- response.setContentType("text/xml");
- ServletOutputStream os = response.getOutputStream();
- try {
- compositeProcessor.write(composite, outputFactory.createXMLStreamWriter(os));
- } catch (ContributionWriteException e) {
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
- return;
- } catch (XMLStreamException e) {
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
- return;
- }
- os.flush();
- }
-
- /**
- * Returns the contribution with the given URI.
- *
- * @param contributionURI
- * @param contributionLocation
- * @return
- * @throws NotFoundException
- */
- private Contribution contribution(String contributionURI, String contributionLocation) throws ContributionReadException {
- try {
- URI uri = URI.create(contributionURI);
- URL location = locationURL(contributionLocation);
-
- // Get contribution from cache
- ContributionCache contributionCache = cache.contributions.get(location);
- long lastModified = lastModified(location);
- if (contributionCache != null) {
- if (contributionCache.contributionLastModified == lastModified) {
- return contributionCache.contribution;
- }
-
- // Reset contribution cache
- cache.contributions.remove(location);
- }
-
- Contribution contribution = (Contribution)contributionProcessor.read(null, uri, location);
-
- contributionProcessor.resolve(contribution, new DefaultModelResolver());
-
- // Cache contribution
- contributionCache = new ContributionCache();
- contributionCache.contribution = contribution;
- contributionCache.contributionLastModified = lastModified;
- cache.contributions.put(location, contributionCache);
-
- return contribution;
-
- } catch (ContributionReadException e) {
- throw e;
- } catch (MalformedURLException e) {
- throw new ContributionReadException(e);
- } catch (IOException e) {
- throw new ContributionReadException(e);
- } catch (ContributionResolveException e) {
- throw new ContributionReadException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
deleted file mode 100644
index 0b304a0854..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.domain.manager.impl;
-
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.DEPLOYMENT_CONTRIBUTION_URI;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeSimpleTitle;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeSourceLink;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.lastModified;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.locationURL;
-
-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.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-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.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-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.ModelFactoryExtensionPoint;
-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.service.ContributionReadException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.ItemCollection;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.apache.tuscany.sca.domain.manager.impl.ContributionCollectionImpl.Cache.ContributionCache;
-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.workspace.Workspace;
-import org.apache.tuscany.sca.workspace.WorkspaceFactory;
-import org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder;
-import org.apache.tuscany.sca.workspace.builder.impl.ContributionDependencyBuilderImpl;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
-import org.osoa.sca.ServiceRuntimeException;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Property;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-import org.w3c.dom.Document;
-
-/**
- * Implementation of a contribution collection service component.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(interfaces={ItemCollection.class, LocalItemCollection.class})
-public class ContributionCollectionImpl implements ItemCollection, LocalItemCollection {
-
- private static final Logger logger = Logger.getLogger(ContributionCollectionImpl.class.getName());
-
- @Property
- public String workspaceFile;
-
- @Property
- public String deploymentContributionDirectory;
-
- @Reference
- public DomainManagerConfiguration domainManagerConfiguration;
-
- private Monitor monitor;
- private ContributionFactory contributionFactory;
- private WorkspaceFactory workspaceFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private URLArtifactProcessor<Contribution> contributionProcessor;
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private DocumentBuilder documentBuilder;
-
- /**
- * Cache workspace and contribution models.
- */
- static class Cache {
- private Workspace workspace;
- private long workspaceLastModified;
-
- static class ContributionCache {
- private Contribution contribution;
- private long contributionLastModified;
- }
- private Map<URL, ContributionCache> contributions = new HashMap<URL, ContributionCache>();
- }
-
- private Cache cache = new Cache();
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() throws ParserConfigurationException {
-
- ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints();
-
- // Create a validation monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- monitor = monitorFactory.createMonitor();
-
- // Create model factories
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
- outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
- contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- workspaceFactory = modelFactories.getFactory(WorkspaceFactory.class);
-
- // Create artifact processors
- inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, monitor);
-
- URLArtifactProcessorExtensionPoint urlProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
-
- // Create contribution info processor
- contributionProcessor = urlProcessors.getProcessor(".contribution/info");
-
- // Create a document builder (used to pretty print XML)
- documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- }
-
- public Entry<String, Item>[] getAll() {
- logger.fine("getAll");
-
- // Return all the contributions
- List<Entry<String, Item>> entries = new ArrayList<Entry<String, Item>>();
- Workspace workspace = readContributions(readWorkspace());
-
- for (Contribution contribution: workspace.getContributions()) {
- if (contribution.getURI().equals(DEPLOYMENT_CONTRIBUTION_URI)) {
- continue;
- }
- entries.add(entry(workspace, contribution));
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
- public Item get(String key) throws NotFoundException {
- logger.fine("get " + key);
-
- // Returns the contribution with the given URI key
- Workspace workspace = readContributions(readWorkspace());
- for (Contribution contribution: workspace.getContributions()) {
- if (key.equals(contribution.getURI())) {
- return item(workspace, contribution);
- }
- }
- throw new NotFoundException(key);
- }
-
- public String post(String key, Item item) {
- logger.fine("post " + key);
-
- // Adds a new contribution to the workspace
- Workspace workspace = readWorkspace();
- Contribution contribution = contributionFactory.createContribution();
- contribution.setURI(key);
- try {
- contribution.setLocation(locationURL(item.getLink()).toString());
- } catch (MalformedURLException e) {
- throw new ServiceRuntimeException(e);
- }
- workspace.getContributions().add(contribution);
-
- // Write the workspace
- writeWorkspace(workspace);
-
- return key;
- }
-
- public void put(String key, Item item) throws NotFoundException {
-
- // Update a contribution already in the workspace
- Workspace workspace = readWorkspace();
- Contribution newContribution = contributionFactory.createContribution();
- newContribution.setURI(key);
- try {
- newContribution.setLocation(locationURL(item.getLink()).toString());
- } catch (MalformedURLException e) {
- throw new ServiceRuntimeException(e);
- }
- List<Contribution> contributions = workspace.getContributions();
- for (int i = 0, n = contributions.size(); i < n; i++) {
- if (contributions.get(i).getURI().equals(key)) {
- contributions.set(i, newContribution);
-
- // Write the workspace
- writeWorkspace(workspace);
- return;
- }
- }
- throw new NotFoundException(key);
- }
-
- public void delete(String key) throws NotFoundException {
- logger.fine("delete " + key);
-
- // Delete a contribution from the workspace
- Workspace workspace = readWorkspace();
- List<Contribution> contributions = workspace.getContributions();
- for (int i = 0, n = contributions.size(); i < n; i++) {
- if (contributions.get(i).getURI().equals(key)) {
- contributions.remove(i);
-
- // Write the workspace
- writeWorkspace(workspace);
- return;
- }
- }
- throw new NotFoundException(key);
- }
-
- public Entry<String, Item>[] query(String queryString) {
- logger.fine("query " + queryString);
-
- if (queryString.startsWith("dependencies=") || queryString.startsWith("alldependencies=")) {
-
- // Return the collection of dependencies of the specified contribution
- List<Entry<String, Item>> entries = new ArrayList<Entry<String,Item>>();
-
- // Extract the contribution URI
- int eq = queryString.indexOf('=');
- String key = queryString.substring(eq+1);
-
- // Read the metadata for all the contributions
- Workspace workspace = readContributions(readWorkspace());
-
- // Look for the specified contribution
- for (Contribution contribution: workspace.getContributions()) {
- if (key.equals(contribution.getURI())) {
-
- // Compute the contribution dependencies
- ContributionDependencyBuilder analyzer = new ContributionDependencyBuilderImpl(monitor);
- List<Contribution> dependencies = analyzer.buildContributionDependencies(contribution, workspace);
-
- // Returns entries for the dependencies
- // optionally skip the specified contribution
- boolean allDependencies = queryString.startsWith("alldependencies=");
- for (Contribution dependency: dependencies) {
- if (!allDependencies && dependency == contribution) {
- // Skip the specified contribution
- continue;
- }
- entries.add(entry(workspace, dependency));
- }
- break;
- }
- }
-
- return entries.toArray(new Entry[entries.size()]);
-
- } if (queryString.startsWith("suggestions=true")) {
-
- // Returns a list of contribution suggestions, scan the parent of the workspace
- // directory for potential contribution directories
-
- // For now, recognize project directories that contain .project files
- // Directories containing .classpath files are likely to be Java projects, we parse
- // the .classpath file to determine the Java project output location
- Workspace suggestionWorkspace = workspaceFactory.createWorkspace();
- List<Entry> entries = new ArrayList<Entry>();
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
- File rootLocation = new File(new File(rootDirectory).toURI().normalize());
- for (File project: rootLocation.getParentFile().listFiles()) {
- File dotProject = new File(project, ".project");
- if (!dotProject.exists()) {
- continue;
- }
-
- // We have a potential contribution
- String uri = project.getName();
- File location = project;
-
- // If this is a Java project, parse its .classpath file to determine it's output location
- File dotClasspath = new File(project, ".classpath");
- if (dotClasspath.exists()) {
- try {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new FileInputStream(dotClasspath));
- reader.nextTag();
- while (reader.hasNext()) {
- int event = reader.getEventType();
- if (event == START_ELEMENT) {
- if ("classpathentry".equals(reader.getName().getLocalPart())) {
- if ("output".equals(reader.getAttributeValue("", "kind"))) {
- location = new File(project, reader.getAttributeValue("", "path"));
- break;
- }
- }
- }
- if (reader.hasNext()) {
- reader.next();
- }
- }
- } catch (FileNotFoundException e) {
- } catch (XMLStreamException e) {
- }
-
- }
-
- // Create a contribution entry, skip the domain root directory and childrens of the
- // domain root directory
- String rootLocationPath = rootLocation.getPath();
- if (rootLocationPath.indexOf('\\') != -1 || rootLocationPath.indexOf(' ') != -1) {
- rootLocationPath = new File(rootLocationPath.replace('\\', '/')).toURI().toString();
- }
- String locationPath = location.getPath();
- if (locationPath.indexOf('\\') != -1 || locationPath.indexOf(' ') != -1) {
- locationPath = new File(locationPath.replace('\\', '/')).toURI().toString();
- }
- if (!locationPath.startsWith(rootLocationPath + "/") && !locationPath.equals(rootLocationPath)) {
- Contribution contribution = contributionFactory.createContribution();
- contribution.setURI(uri);
- contribution.setLocation(locationPath);
- entries.add(entry(suggestionWorkspace, contribution));
- }
- }
-
- return entries.toArray(new Entry[entries.size()]);
-
- } else {
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * Returns an entry representing a contribution
- * @param contribution
- * @return
- */
- private static Entry<String, Item> entry(Workspace workspace, Contribution contribution) {
- Entry<String, Item> entry = new Entry<String, Item>();
- entry.setKey(contribution.getURI());
- entry.setData(item(workspace, contribution));
- return entry;
- }
-
- /**
- * Returns an item representing a contribution.
- *
- * @param contribution
- * @return
- */
- private static Item item(Workspace workspace, Contribution contribution) {
- String contributionURI = contribution.getURI();
- Item item = new Item();
- item.setTitle(title(contributionURI));
- item.setLink(link(contributionURI));
- item.setAlternate(contribution.getLocation());
-
- // List the contribution dependencies in the item contents
- final List<String> problems = new ArrayList<String>();
- Monitor monitor = new Monitor() {
- public void problem(Problem problem) {
- problems.add(problem.getMessageId() + " " + problem.getProblemObject().toString());
- }
-
- public List<Problem> getProblems() {
- return null;
- }
- };
-
- StringBuffer sb = new StringBuffer();
- ContributionDependencyBuilderImpl analyzer = new ContributionDependencyBuilderImpl(monitor);
- List<Contribution> dependencies = analyzer.buildContributionDependencies(contribution, workspace);
- if (dependencies.size() > 1) {
- sb.append("Dependencies: <span id=\"dependencies\">");
- for (int i = 0, n = dependencies.size(); i < n ; i++) {
- if (i > 0) {
- sb.append(" ");
- }
- Contribution dependency = dependencies.get(i);
- if (dependency != contribution) {
- String dependencyURI = dependency.getURI();
- sb.append("<a href=\""+ link(dependencyURI) +"\">" + title(dependencyURI) + "</a>");
- }
- }
- sb.append("</span><br>");
- }
-
- // List the deployables
- List<Composite> deployables = contribution.getDeployables();
- if (!deployables.isEmpty()) {
- sb.append("Deployables: <span id=\"deployables\">");
- for (int i = 0, n = deployables.size(); i < n ; i++) {
- if (i > 0) {
- sb.append(" ");
- }
- Composite deployable = deployables.get(i);
- QName qname = deployable.getName();
- sb.append("<a href=\""+ compositeSourceLink(contributionURI, qname) +"\">" + compositeSimpleTitle(contributionURI, qname) + "</a>");
- }
- sb.append("</span><br>");
- }
-
- // List the dependency problems
- if (contribution.isUnresolved()) {
- problems.add("Contribution not found");
- }
- if (problems.size() > 0) {
- sb.append("<span id=\"problems\" style=\"color: red\">");
- for (int i = 0, n = problems.size(); i < n ; i++) {
- sb.append("Problem: "+ problems.get(i) + "<br>");
- }
- sb.append("</span>");
- }
-
- // Store in the item contents
- item.setContents(sb.toString());
-
- return item;
- }
-
- /**
- * Returns a link to a contribution.
- * @param contributionURI
- * @return
- */
- private static String link(String contributionURI) {
- return "/contribution/" + contributionURI;
- }
-
- /**
- * Returns a title for the given contribution
- *
- * @param contributionURI
- * @return
- */
- private static String title(String contributionURI) {
- return contributionURI;
- }
-
-
- /**
- * Read the workspace.
- *
- * @return
- */
- private Workspace readWorkspace() {
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
-
- Workspace workspace;
- File file = new File(rootDirectory + "/" + workspaceFile);
- if (file.exists()) {
-
- // Get workspace from cache
- if (cache.workspace != null && file.lastModified() == cache.workspaceLastModified) {
- workspace = cache.workspace;
-
- } else {
-
- try {
- FileInputStream is = new FileInputStream(file);
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- reader.nextTag();
- workspace = (Workspace)staxProcessor.read(reader);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
-
- // Cache workspace
- cache.workspaceLastModified = file.lastModified();
- cache.workspace = workspace;
- }
-
- } else {
-
- // Create new workspace
- workspace = workspaceFactory.createWorkspace();
-
- // Cache workspace
- cache.workspaceLastModified = 0;
- cache.workspace = workspace;
- }
-
- // Make sure that the workspace contains the cloud contribution
- // The cloud contribution contains the composites describing the
- // SCA nodes declared in the cloud
- Contribution cloudContribution = null;
- for (Contribution contribution: workspace.getContributions()) {
- if (contribution.getURI().equals(DEPLOYMENT_CONTRIBUTION_URI)) {
- cloudContribution = contribution;
- }
- }
- if (cloudContribution == null) {
- Contribution contribution = contributionFactory.createContribution();
- contribution.setURI(DEPLOYMENT_CONTRIBUTION_URI);
- File cloudDirectory = new File(rootDirectory + "/" + deploymentContributionDirectory);
- contribution.setLocation(cloudDirectory.toURI().toString());
- workspace.getContributions().add(contribution);
- }
-
- return workspace;
- }
-
- /**
- * Write the workspace back to disk
- *
- * @param workspace
- */
- private void writeWorkspace(Workspace workspace) {
- try {
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
-
- // First write to a byte stream
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(bos);
- staxProcessor.write(workspace, writer);
-
- // Parse again to pretty format the document
- Document document = documentBuilder.parse(new ByteArrayInputStream(bos.toByteArray()));
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
- format.setIndent(2);
-
- // Write to workspace.xml
- File file = new File(rootDirectory + "/" + workspaceFile);
- FileOutputStream os = new FileOutputStream(file);
- XMLSerializer serializer = new XMLSerializer(os, format);
- serializer.serialize(document);
- os.close();
-
- // Cache workspace
- cache.workspace = workspace;
- cache.workspaceLastModified = file.lastModified();
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * Returns a workspace populated with the contribution info read from
- * the contributions.
- *
- * @param workspace
- * @return
- */
- private Workspace readContributions(Workspace workspace) {
-
- Workspace contributions = workspaceFactory.createWorkspace();
- try {
- for (Contribution c: workspace.getContributions()) {
- URI uri = URI.create(c.getURI());
- URL location = locationURL(c.getLocation());
-
- // Get contribution from cache
- ContributionCache contributionCache = cache.contributions.get(location);
- long lastModified = lastModified(location);
- if (contributionCache != null) {
- if (contributionCache.contributionLastModified == lastModified) {
- Contribution contribution = contributionCache.contribution;
- contribution.setUnresolved(false);
- contributions.getContributions().add(contribution);
- continue;
- }
-
- // Reset contribution cache
- cache.contributions.remove(location);
- }
-
- try {
- Contribution contribution = (Contribution)contributionProcessor.read(null, uri, location);
- contribution.setUnresolved(false);
- contributions.getContributions().add(contribution);
-
- // Cache contribution
- contributionCache = new ContributionCache();
- contributionCache.contribution = contribution;
- contributionCache.contributionLastModified = lastModified;
- cache.contributions.put(location, contributionCache);
-
-
- // Make sure that the cloud contribution does not contain
- // default imports/exports as we want to isolate it from application
- // provided contributions
- if (contribution.getURI().equals(DEPLOYMENT_CONTRIBUTION_URI)) {
- for (Iterator<Import> i = contribution.getImports().iterator(); i.hasNext(); ) {
- Import import_ = i.next();
- if (import_ instanceof DefaultImport) {
- i.remove();
- }
- }
- for (Iterator<Export> i = contribution.getExports().iterator(); i.hasNext(); ) {
- Export export = i.next();
- if (export instanceof DefaultExport) {
- i.remove();
- }
- }
- }
-
- } catch (ContributionReadException e) {
- Contribution contribution = contributionFactory.createContribution();
- contribution.setURI(c.getURI());
- contribution.setLocation(c.getLocation());
- contribution.setUnresolved(true);
- contributions.getContributions().add(contribution);
- }
- }
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- return contributions;
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionServiceImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionServiceImpl.java
deleted file mode 100644
index a4d7680cb0..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionServiceImpl.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.domain.manager.impl;
-
-import java.io.IOException;
-import java.net.URLDecoder;
-import java.util.logging.Logger;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a contribution collection service component.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(interfaces={Servlet.class})
-public class ContributionServiceImpl extends HttpServlet implements Servlet {
- private static final long serialVersionUID = -4759297945439322773L;
-
- private static final Logger logger = Logger.getLogger(ContributionServiceImpl.class.getName());
-
- @Reference
- public LocalItemCollection contributionCollection;
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
-
- // The key is the contribution URI
- String key = path.startsWith("/")? path.substring(1) : path;
- logger.fine("get " + key);
-
- // Get the item describing the composite
- Item item;
- try {
- item = contributionCollection.get(key);
- } catch (NotFoundException e) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, key);
- return;
- }
-
- // Redirect to the actual contribution location
- response.sendRedirect("/files/" + item.getAlternate());
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java
deleted file mode 100644
index e66a8b6684..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.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.domain.manager.impl;
-
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeAlternateLink;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeKey;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeQName;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeSourceLink;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeTitle;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.contributionURI;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.lastModified;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.locationURL;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-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.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.resolver.DefaultModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.ItemCollection;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.apache.tuscany.sca.domain.manager.impl.DeployableCompositeCollectionImpl.Cache.ContributionCache;
-import org.apache.tuscany.sca.implementation.node.NodeImplementation;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder;
-import org.apache.tuscany.sca.workspace.builder.impl.ContributionDependencyBuilderImpl;
-import org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProcessor;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a deployable composite collection service.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(interfaces={ItemCollection.class, LocalItemCollection.class})
-public class DeployableCompositeCollectionImpl implements ItemCollection, LocalItemCollection {
-
- private static final Logger logger = Logger.getLogger(DeployableCompositeCollectionImpl.class.getName());
-
- @Reference
- public LocalItemCollection contributionCollection;
-
- @Reference
- public DomainManagerConfiguration domainManagerConfiguration;
-
- private ModelFactoryExtensionPoint modelFactories;
- private ModelResolverExtensionPoint modelResolvers;
- private URLArtifactProcessor<Contribution> contributionProcessor;
- private XMLOutputFactory outputFactory;
- private ContributionDependencyBuilder contributionDependencyBuilder;
- private Monitor monitor;
-
- /**
- * Cache contribution models.
- */
- static class Cache {
- static class ContributionCache {
- private Contribution contribution;
- private long contributionLastModified;
- }
- private Map<URL, ContributionCache> contributions = new HashMap<URL, ContributionCache>();
- }
-
- private Cache cache = new Cache();
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() throws ParserConfigurationException {
-
- ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints();
-
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- monitor = monitorFactory.createMonitor();
-
- // Get model factories
- modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
- outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
-
- // Get and initialize artifact processors
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- StAXArtifactProcessor<Object> staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, monitor);
-
- URLArtifactProcessorExtensionPoint urlProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- URLArtifactProcessor<Object> urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors, monitor);
-
- // Create contribution processor
- modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
- contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor, monitor);
-
- // Create contribution and composite builders
- contributionDependencyBuilder = new ContributionDependencyBuilderImpl(monitor);
- }
-
- public Entry<String, Item>[] getAll() {
- logger.fine("getAll");
-
- // Return all the deployable composites in the contributions
- List<Entry<String, Item>> entries = new ArrayList<Entry<String, Item>>();
-
- // Get the list of contributions in the workspace
- Entry<String, Item>[] contributionEntries = contributionCollection.getAll();
-
- // Read contribution metadata
- for (Entry<String, Item> contributionEntry: contributionEntries) {
- Item contributionItem = contributionEntry.getData();
- Contribution contribution;
- try {
- contribution = contribution(contributionEntry.getKey(), contributionItem.getAlternate());
- } catch (ContributionReadException e) {
- continue;
- }
-
- // Create entries for the deployable composites
- for (Composite deployable: contribution.getDeployables()) {
- entries.add(entry(contribution, deployable));
- }
-
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
- public Item get(String key) throws NotFoundException {
- logger.fine("get " + key);
-
- // Get the specified contribution info
- String contributionURI = contributionURI(key);
- Item contributionItem = contributionCollection.get(contributionURI);
-
- // Read the contribution
- Contribution contribution;
- try {
- contribution = contribution(contributionURI, contributionItem.getAlternate());
- } catch (ContributionReadException e) {
- throw new NotFoundException(key);
- }
-
- // Find the specified deployable composite
- QName qname = compositeQName(key);
- for (Composite deployable: contribution.getDeployables()) {
- if (qname.equals(deployable.getName())) {
- if (deployable.isUnresolved()) {
- throw new NotFoundException(key);
- }
-
- // Return an item describing the deployable composite
- return item(contribution, deployable);
- }
- }
-
- throw new NotFoundException(key);
- }
-
- public String post(String key, Item item) {
- throw new UnsupportedOperationException();
- }
-
- public void put(String key, Item item) throws NotFoundException {
- throw new UnsupportedOperationException();
- }
-
- public void delete(String key) throws NotFoundException {
- throw new UnsupportedOperationException();
- }
-
- public Entry<String, Item>[] query(String queryString) {
- logger.fine("query " + queryString);
-
- if (queryString.startsWith("contribution=")) {
-
- // Return all the deployable composites in the specified
- // contribution
- List<Entry<String, Item>> entries = new ArrayList<Entry<String, Item>>();
-
- // Get the specified contribution info
- String contributionURI = queryString.substring(queryString.indexOf('=') + 1);
- Item contributionItem;
- try {
- contributionItem = contributionCollection.get(contributionURI);
- } catch (NotFoundException e) {
- return entries.toArray(new Entry[entries.size()]);
- }
-
- // Read the contribution
- Contribution contribution;
- try {
- contribution = contribution(contributionURI, contributionItem.getAlternate());
- } catch (ContributionReadException e) {
- return entries.toArray(new Entry[entries.size()]);
- }
-
- // Create entries for the deployable composites
- for (Composite deployable: contribution.getDeployables()) {
- entries.add(entry(contribution, deployable));
- }
-
- return entries.toArray(new Entry[entries.size()]);
-
- } else {
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * Returns the contribution with the given URI.
- *
- * @param contributionURI
- * @param contributionLocation
- * @return
- * @throws NotFoundException
- */
- private Contribution contribution(String contributionURI, String contributionLocation) throws ContributionReadException {
- try {
- URI uri = URI.create(contributionURI);
- URL location = locationURL(contributionLocation);
-
- // Get contribution from cache
- ContributionCache contributionCache = cache.contributions.get(location);
- long lastModified = lastModified(location);
- if (contributionCache != null) {
- if (contributionCache.contributionLastModified == lastModified) {
- return contributionCache.contribution;
- }
-
- // Reset contribution cache
- cache.contributions.remove(location);
- }
-
- Contribution contribution = (Contribution)contributionProcessor.read(null, uri, location);
-
- contributionProcessor.resolve(contribution, new DefaultModelResolver());
-
- // Cache contribution
- contributionCache = new ContributionCache();
- contributionCache.contribution = contribution;
- contributionCache.contributionLastModified = lastModified;
- cache.contributions.put(location, contributionCache);
-
- return contribution;
-
- } catch (ContributionReadException e) {
- throw e;
- } catch (MalformedURLException e) {
- throw new ContributionReadException(e);
- } catch (ContributionResolveException e) {
- throw new ContributionReadException(e);
- } catch (Throwable e) {
- throw new ContributionReadException(e);
- }
- }
-
- /**
- * Returns the entry contents describing a composite.
- *
- * @param composite
- * @return
- */
- private static String content(Composite composite) {
- StringBuffer sb = new StringBuffer();
- List<Component> components = composite.getComponents();
- for (int i = 0, n = components.size(); i < n; i++) {
- Component component = components.get(i);
- if (component.getImplementation() instanceof NodeImplementation) {
- List<ComponentService> services = component.getServices();
- if (!services.isEmpty()) {
- List<Binding> bindings = services.get(0).getBindings();
- if (!bindings.isEmpty()) {
-
- // List node URIs
- sb.append("Node URI: <span id=\"nodeURI\">");
- sb.append(component.getServices().get(0).getBindings().get(0).getURI());
- break;
- }
- }
- } else {
-
- // List component names
- if (sb.length() == 0) {
- sb.append("Components: <span id=\"components\">");
- } else {
- sb.append(" ");
- }
- sb.append(component.getName());
- }
- }
- if (sb.length() != 0) {
- sb.append("</span>");
- }
- return sb.toString();
- }
-
- /**
- * Returns the link to the resource related to a composite.
- *
- * @param composite
- * @return
- */
- private static String relatedLink(Composite composite) {
- for (Component component: composite.getComponents()) {
- if (component.getImplementation() instanceof NodeImplementation) {
- NodeImplementation nodeImplementation = (NodeImplementation)component.getImplementation();
- Composite deployable = nodeImplementation.getComposite();
- String contributionURI = deployable.getURI();
- QName qname = deployable.getName();
- String key = compositeKey(contributionURI, qname);
- return "/composite-source/" + key;
- }
- }
- return null;
- }
-
- /**
- * Returns an entry describing the given deployable.
- *
- * @param contribution
- * @param deployable
- * @return
- */
- private static Entry<String, Item> entry(Contribution contribution, Composite deployable) {
- Entry<String, Item> entry = new Entry<String, Item>();
- entry.setKey(DomainManagerUtil.compositeKey(contribution.getURI(), deployable.getName()));
- entry.setData(item(contribution, deployable));
- return entry;
- }
-
- /**
- * Returns an item describing the given deployable.
- *
- * @param contribution
- * @param deployable
- * @return
- */
- private static Item item(Contribution contribution, Composite deployable) {
- String contributionURI = contribution.getURI();
- String contributionLocation = contribution.getLocation();
- QName qname = deployable.getName();
- String deployableURI = deployable.getURI();
- Item item = new Item();
- item.setTitle(compositeTitle(contributionURI, qname));
- item.setContents(content(deployable));
- item.setLink(compositeSourceLink(contributionURI, qname));
- item.setAlternate(compositeAlternateLink(contributionLocation, deployableURI));
- item.setRelated(relatedLink(deployable));
- return item;
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeServiceImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeServiceImpl.java
deleted file mode 100644
index 14ab9579f4..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeServiceImpl.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.domain.manager.impl;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLDecoder;
-import java.util.logging.Logger;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a service that returns the source of a deployable composite.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(Servlet.class)
-public class DeployableCompositeServiceImpl extends HttpServlet implements Servlet {
- private static final long serialVersionUID = -3477992129462720902L;
-
- private static final Logger logger = Logger.getLogger(DeployableCompositeServiceImpl.class.getName());
-
- @Reference
- public DomainManagerConfiguration domainManagerConfiguration;
-
- @Reference
- public LocalItemCollection deployableCollection;
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() throws ParserConfigurationException {
-
- ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints();
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // Expect a key in the form
- // composite:contributionURI;namespace;localName
- // and return the corresponding source file
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- String key = path.startsWith("/")? path.substring(1) : path;
- logger.fine("get " + key);
-
- // Get the item describing the composite
- Item item;
- try {
- item = deployableCollection.get(key);
- } catch (NotFoundException e) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, key);
- return;
- }
-
- // Redirect if there is no composite file
- String uri = item.getAlternate();
- if (uri == null) {
- response.sendRedirect("/composite-generated/" + key);
- return;
- }
-
- // Read the composite file and write to response
- InputStream is;
- try {
- URLConnection connection = new URL(uri).openConnection();
- connection.setUseCaches(false);
- connection.connect();
- is = connection.getInputStream();
- } catch (FileNotFoundException ex) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, key);
- return;
- }
-
- response.setContentType("text/xml");
- ServletOutputStream os = response.getOutputStream();
- byte[] buffer = new byte[4096];
- for (;;) {
- int n = is.read(buffer);
- if (n < 0) {
- break;
- }
- os.write(buffer, 0, n);
- }
- is.close();
- os.flush();
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployedCompositeCollectionImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployedCompositeCollectionImpl.java
deleted file mode 100644
index e95a0cc585..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployedCompositeCollectionImpl.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.domain.manager.impl;
-
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.DEPLOYMENT_CONTRIBUTION_URI;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeKey;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeQName;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeSourceLink;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeTitle;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.contributionURI;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-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.Composite;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.ItemCollection;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
-import org.osoa.sca.ServiceRuntimeException;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Property;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-import org.w3c.dom.Document;
-
-/**
- * Implementation of a composite collection service.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(interfaces={ItemCollection.class,LocalItemCollection.class})
-public class DeployedCompositeCollectionImpl implements ItemCollection, LocalItemCollection {
- private static final Logger logger = Logger.getLogger(DeployedCompositeCollectionImpl.class.getName());
-
- @Property
- public String compositeFile;
-
- @Property
- public String deploymentContributionDirectory;
-
- @Reference
- public LocalItemCollection deployableCollection;
-
- @Reference(required=false)
- public LocalItemCollection processCollection;
-
- @Reference
- public DomainManagerConfiguration domainManagerConfiguration;
-
- private ModelFactoryExtensionPoint modelFactories;
- private AssemblyFactory assemblyFactory;
- private StAXArtifactProcessor<Composite> compositeProcessor;
- private XMLOutputFactory outputFactory;
- private DocumentBuilder documentBuilder;
-
- /**
- * Cache domain composite model.
- */
- static class Cache {
- private Composite compositeCollection;
- private long compositeCollectionLastModified;
- }
-
- private Cache cache = new Cache();
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() throws ParserConfigurationException {
-
- // Create factories
- ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints();
- modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
- outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
-
- // Create composite processor
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- compositeProcessor = staxProcessors.getProcessor(Composite.class);
-
- // Create a document builder (used to pretty print XML)
- documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- }
-
- public Entry<String, Item>[] getAll() {
- logger.fine("getAll");
-
- // Return all the composites in the domain composite
- List<Entry<String, Item>> entries = new ArrayList<Entry<String, Item>>();
- Composite compositeCollection = readCompositeCollection();
- for (Composite composite: compositeCollection.getIncludes()) {
- String contributionURI = composite.getURI();
- QName qname = composite.getName();
- String key = compositeKey(contributionURI, qname);
- Item item;
- try {
- item = deployableCollection.get(key);
- } catch (NotFoundException e) {
- item = new Item();
- item.setTitle(compositeTitle(contributionURI, qname));
- item.setLink(compositeSourceLink(contributionURI, qname));
- item.setContents("<span id=\"problem\" style=\"color: red\">Problem: Composite not found</span>");
- }
- Entry<String, Item> entry = new Entry<String, Item>();
- entry.setKey(key);
- entry.setData(item);
- entries.add(entry);
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
- public Item get(String key) throws NotFoundException {
- logger.fine("get " + key);
-
- String contributionURI = contributionURI(key);
- QName qname = compositeQName(key);
-
- // Look for the specified composite in the domain composite
- List<Entry<String, Item>> entries = new ArrayList<Entry<String, Item>>();
- Composite compositeCollection = readCompositeCollection();
- for (Composite composite: compositeCollection.getIncludes()) {
- if (contributionURI.equals(composite.getURI()) && qname.equals(composite.getName())) {
- return deployableCollection.get(key);
- }
- }
- throw new NotFoundException(key);
- }
-
- public String post(String key, Item item) {
- logger.fine("post " + key);
-
- String contributionURI = contributionURI(key);
- QName qname = compositeQName(key);
-
- // Adds a new composite to the domain composite
- Composite compositeCollection = readCompositeCollection();
- Composite composite = assemblyFactory.createComposite();
- composite.setName(qname);
- composite.setURI(contributionURI);
- composite.setUnresolved(true);
- compositeCollection.getIncludes().add(composite);
-
- // Optionally, write the composite contents in a new composite file
- // under the deployment composites directory, if that directory is
- // configured on this component
- if (deploymentContributionDirectory != null && item.getContents() != null) {
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
-
- File directory = new File(rootDirectory + "/" + deploymentContributionDirectory);
- if (!directory.exists()) {
- directory.mkdirs();
- }
- File file = new File(directory, qname.getLocalPart() + ".composite");
- try {
- Writer w = new OutputStreamWriter(new FileOutputStream(file));
- w.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- w.write(item.getContents());
- w.close();
- } catch (IOException e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- // Write the composite collection
- writeCompositeCollection(compositeCollection);
-
- return key;
- }
-
- public void put(String key, Item item) throws NotFoundException {
- logger.fine("put " + key);
-
- String contributionURI = contributionURI(key);
- QName qname = compositeQName(key);
-
- // Update a composite already in the domain composite
- Composite compositeCollection = readCompositeCollection();
- Composite newComposite = assemblyFactory.createComposite();
- newComposite.setName(qname);
- newComposite.setURI(contributionURI);
- newComposite.setUnresolved(true);
- List<Composite> composites = compositeCollection.getIncludes();
- for (int i = 0, n = composites.size(); i < n; i++) {
- Composite composite = composites.get(i);
- if (contributionURI.equals(composite.getURI()) && qname.equals(composite.getName())) {
- composites.set(i, newComposite);
-
- // Write the domain composite
- writeCompositeCollection(compositeCollection);
-
- return;
- }
- }
- throw new NotFoundException(key);
- }
-
- public void delete(String key) throws NotFoundException {
- logger.fine("delete " + key);
-
- String contributionURI = contributionURI(key);
- QName qname = compositeQName(key);
-
- // Delete/stop the corresponding process, if any
- try {
- processCollection.delete(qname.getLocalPart());
- } catch (Exception e) {}
-
- // Delete a composite from the composite collection
- Composite compositeCollection = readCompositeCollection();
- List<Composite> composites = compositeCollection.getIncludes();
- Composite deleted = null;
- for (int i = 0, n = composites.size(); i < n; i++) {
- Composite composite = composites.get(i);
- if (contributionURI.equals(composite.getURI()) && qname.equals(composite.getName())) {
- composites.remove(i);
- deleted = composite;
-
- // Write the domain composite
- writeCompositeCollection(compositeCollection);
- break;
- }
- }
-
- // Delete the file too if it is in the deployment contribution directory
- if (deploymentContributionDirectory != null && contributionURI.equals(DEPLOYMENT_CONTRIBUTION_URI)) {
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
-
- File file = new File(rootDirectory + "/" + deploymentContributionDirectory, qname.getLocalPart() + ".composite");
- if (file.exists()) {
- file.delete();
- }
- }
-
- if (deleted == null) {
- throw new NotFoundException(key);
- }
- }
-
- public Entry<String, Item>[] query(String queryString) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Reads the domain composite.
- *
- * @return the domain composite
- * @throws ServiceRuntimeException
- */
- private Composite readCompositeCollection() throws ServiceRuntimeException {
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
-
- Composite compositeCollection;
- File file = new File(rootDirectory + "/" + compositeFile);
- if (file.exists()) {
-
- // Get composite collection from cache
- if (cache.compositeCollection != null && file.lastModified() == cache.compositeCollectionLastModified) {
- compositeCollection = cache.compositeCollection;
-
- } else {
-
- XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- try {
- FileInputStream is = new FileInputStream(file);
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- compositeCollection = compositeProcessor.read(reader);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
-
- // Cache composite collection
- cache.compositeCollectionLastModified = file.lastModified();
- cache.compositeCollection = compositeCollection;
- }
-
- } else {
- compositeCollection = assemblyFactory.createComposite();
- String name;
- int d = compositeFile.lastIndexOf('.');
- if (d != -1) {
- name = compositeFile.substring(0, d);
- } else {
- name = compositeFile;
- }
- compositeCollection.setName(new QName(Constants.SCA10_TUSCANY_NS, name));
-
- // Cache composite collection
- cache.compositeCollectionLastModified = 0;
- cache.compositeCollection = compositeCollection;
- }
- return compositeCollection;
- }
-
- /**
- * Write the domain composite back to disk.
- *
- * @param compositeCollection
- */
- private void writeCompositeCollection(Composite compositeCollection) {
- try {
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
-
- // First write to a byte stream
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(bos);
- compositeProcessor.write(compositeCollection, writer);
-
- // Parse again to pretty format the document
- Document document = documentBuilder.parse(new ByteArrayInputStream(bos.toByteArray()));
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
- format.setIndent(2);
-
- // Write to domain.composite
- File file = new File(rootDirectory + "/" + compositeFile);
- FileOutputStream os = new FileOutputStream(file);
- XMLSerializer serializer = new XMLSerializer(os, format);
- serializer.serialize(document);
-
- // Cache composite collection
- cache.compositeCollection = compositeCollection;
- cache.compositeCollectionLastModified = file.lastModified();
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerConfiguration.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerConfiguration.java
deleted file mode 100644
index 1831728f07..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerConfiguration.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.domain.manager.impl;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-
-/**
- * Domain manager configuration service interface.
- *
- * @version $Rev$ $Date$
- */
-public interface DomainManagerConfiguration {
-
- /**
- * Sets the domain manager root directory.
- *
- * @param rootDirectory
- */
- void setRootDirectory(String rootDirectory);
-
- /**
- * Returns the domain manager root directory.
- *
- * @return the domain manager root directory
- */
- String getRootDirectory();
-
- /**
- * Returns the extension point registry used in the
- * domain manager.
- *
- * @return
- */
- ExtensionPointRegistry getExtensionPoints();
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerConfigurationImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerConfigurationImpl.java
deleted file mode 100644
index a5ce6e12d6..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerConfigurationImpl.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.domain.manager.impl;
-
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint;
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a domain manager configuration component.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(DomainManagerConfiguration.class)
-public class DomainManagerConfigurationImpl implements DomainManagerConfiguration {
-
- private String rootDirectory = ".";
- private ExtensionPointRegistry extensionPoints;
-
- @Init
- public void initialize() {
-
- // Create extension point registry
- extensionPoints = new DefaultExtensionPointRegistry();
-
- // Initialize module activators
- ModuleActivatorExtensionPoint moduleActivators = extensionPoints.getExtensionPoint(ModuleActivatorExtensionPoint.class);
- for (ModuleActivator activator: moduleActivators.getModuleActivators()) {
- try {
- activator.start(extensionPoints);
- } catch (Exception e) {
- //FIXME fix the module activators that have cross module dependencies
- // and currently fail when the whole runtime is not present
- }
- }
- }
-
- @Destroy
- public void destroy() {
- ModuleActivatorExtensionPoint moduleActivators = extensionPoints.getExtensionPoint(ModuleActivatorExtensionPoint.class);
- for (ModuleActivator activator: moduleActivators.getModuleActivators()) {
- try {
- activator.stop(extensionPoints);
- } catch (Exception e) {
- //FIXME fix the module activators that have cross module dependencies
- // and currently fail when the whole runtime is not present
- }
- }
- }
-
- public String getRootDirectory() {
- return rootDirectory;
- }
-
- public void setRootDirectory(String rootDirectory) {
- this.rootDirectory = rootDirectory;
- }
-
- public ExtensionPointRegistry getExtensionPoints() {
- return extensionPoints;
- }
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java
deleted file mode 100644
index bd330322e5..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.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.domain.manager.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-
-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.Composite;
-import org.apache.tuscany.sca.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.core.context.ServiceReferenceImpl;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.osoa.sca.ServiceReference;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * Common functions and constants used by the admin components.
- *
- * @version $Rev$ $Date$
- */
-public final class DomainManagerUtil {
-
- static final String DEPLOYMENT_CONTRIBUTION_URI = "http://tuscany.apache.org/cloud";
-
- /**
- * Extracts a qname from a key expressed as contributionURI;namespace;localpart.
- * @param key
- * @return
- */
- static QName compositeQName(String key) {
- int i = key.indexOf(';');
- key = key.substring(i + 1);
- i = key.indexOf(';');
- return new QName(key.substring(0, i), key.substring(i + 1));
- }
-
- /**
- * Returns a composite title expressed as contributionURI - namespace;localpart.
- * @param qname
- * @return
- */
- static String compositeTitle(String uri, QName qname) {
- if (uri.equals(DEPLOYMENT_CONTRIBUTION_URI)) {
- return qname.getLocalPart();
- } else {
- return uri + " - " + qname.getNamespaceURI() + ";" + qname.getLocalPart();
- }
- }
-
- /**
- * Extracts a contribution uri from a key expressed as contributionURI;namespace;localpart.
- * @param key
- * @return
- */
- static String contributionURI(String key) {
- int i = key.indexOf(';');
- return key.substring("composite:".length(), i);
- }
-
- /**
- * Returns a composite key expressed as contributionURI;namespace;localpart.
- * @param qname
- * @return
- */
- static String compositeKey(String uri, QName qname) {
- return "composite:" + uri + ';' + qname.getNamespaceURI() + ';' + qname.getLocalPart();
- }
-
- /**
- * Returns a link to the source of a composite
- * @param contributionURI
- * @param qname
- * @return
- */
- static String compositeSourceLink(String contributionURI, QName qname) {
- return "/composite-source/" + compositeKey(contributionURI, qname);
- }
-
- /**
- * Returns a composite title expressed as contributionURI - namespace;localpart.
- * @param qname
- * @return
- */
- static String compositeSimpleTitle(String uri, QName qname) {
- if (uri.equals(DomainManagerUtil.DEPLOYMENT_CONTRIBUTION_URI)) {
- return qname.getLocalPart();
- } else {
- return qname.getNamespaceURI() + ";" + qname.getLocalPart();
- }
- }
-
- /**
- * Returns a URL from a location string.
- * @param location
- * @return
- * @throws MalformedURLException
- */
- static URL locationURL(String location) throws MalformedURLException {
- URI uri = URI.create(location);
- String scheme = uri.getScheme();
- if (scheme == null) {
- File file = new File(location);
- return file.toURI().toURL();
- } else if (scheme.equals("file")) {
- File file = new File(location.substring(5));
- return file.toURI().toURL();
- } else {
- return uri.toURL();
- }
- }
-
- /**
- * Returns a link to a deployable composite.
- *
- * If the containing contribution is a local directory, return the URI of the local composite file
- * inside the contribution.
- *
- * If the containing contribution is a local or remote file, return a URI of the form:
- * jar: contribution URI !/ composite URI.
- *
- * @param contributionLocation
- * @param deployableURI
- * @return
- */
- static String compositeAlternateLink(String contributionLocation, String deployableURI) {
- if (deployableURI == null) {
- return null;
- }
- URI u = URI.create(contributionLocation);
- String uri;
- if ("file".equals(u.getScheme())) {
- String path = u.toString().substring(5);
- File file = new File(path);
- if (file.isDirectory()) {
- if (contributionLocation.endsWith("/")) {
- uri = contributionLocation + deployableURI;
- } else {
- uri = contributionLocation + "/" + deployableURI;
- }
- } else {
- uri = contributionLocation + "!/" + deployableURI;
- }
- } else {
- uri = contributionLocation + "!/" + deployableURI;
- }
- int e = uri.indexOf("!/");
- if (e != -1) {
- int s = uri.lastIndexOf('/', e - 2) +1;
- if (uri.substring(s, e).contains(".")) {
- uri = "jar:" + uri;
- } else {
- uri = uri.substring(0, e) + uri.substring(e + 1);
- }
- }
- return uri;
- }
-
- /**
- * Extract a node URI from an ATOM entry content.
- *
- * @param content
- * @return
- */
- static String nodeURI(String content) {
- if (content != null) {
- int bs = content.indexOf("<span id=\"nodeURI\">");
- if (bs != -1) {
- content = content.substring(bs + 19);
- int es = content.indexOf("</span>");
- if (es != -1) {
- return content.substring(0, es);
- }
- }
- }
- return null;
- }
-
- /**
- * Create a new service reference dynamically.
- *
- * @param <B>
- * @param businessInterface
- * @param binding
- * @param assemblyFactory
- * @param compositeActivator
- * @return
- */
- static <B> ServiceReference<B> dynamicReference(Class<B> businessInterface, Binding binding, AssemblyFactory assemblyFactory, CompositeActivator compositeActivator) {
- try {
-
- Composite composite = assemblyFactory.createComposite();
- composite.setName(new QName("http://tempuri.org", "default"));
- RuntimeComponent component = (RuntimeComponent)assemblyFactory.createComponent();
- component.setName("default");
- component.setURI("default");
- compositeActivator.configureComponentContext(component);
- composite.getComponents().add(component);
- RuntimeComponentReference reference = (RuntimeComponentReference)assemblyFactory.createComponentReference();
- reference.setName("default");
- JavaInterfaceFactory javaInterfaceFactory = compositeActivator.getJavaInterfaceFactory();
- InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(businessInterface));
- reference.setInterfaceContract(interfaceContract);
- component.getReferences().add(reference);
- reference.setComponent(component);
- reference.getBindings().add(binding);
-
- ProxyFactory proxyFactory = compositeActivator.getProxyFactory();
- return new ServiceReferenceImpl<B>(businessInterface, component, reference, binding, proxyFactory, compositeActivator);
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * Returns the last modified time of the content at the given URL.
- *
- * @param url
- * @return
- * @throws IOException
- */
- static long lastModified(URL url) throws IOException {
-
- if (url.getProtocol() == null || "file".equals(url.getProtocol())) {
- return lastModified(new File(url.getPath()));
- } else {
- URLConnection connection = url.openConnection();
- long lastModified = connection.getLastModified();
- return lastModified;
- }
- }
-
- /**
- * Returns the last modified time of the given file or directory.
- *
- * @param file
- * @return
- */
- static long lastModified(File file) {
- if (file.isDirectory()) {
- long lastModified = file.lastModified();
-
- for (File child: file.listFiles()) {
- long m = lastModified(child);
- if (m > lastModified) {
- lastModified = m;
- }
- }
- return lastModified;
-
- } else {
- return file.lastModified();
- }
- }
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/FileCollectionImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/FileCollectionImpl.java
deleted file mode 100644
index a53250515a..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/FileCollectionImpl.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.domain.manager.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.ItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Property;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a file collection service component.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(ItemCollection.class)
-public class FileCollectionImpl implements ItemCollection {
-
- private static final Logger logger = Logger.getLogger(FileCollectionImpl.class.getName());
-
- @Property
- public String directoryName;
-
- @Reference
- public DomainManagerConfiguration domainManagerConfiguration;
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() throws IOException {
- }
-
- public Entry<String, Item>[] getAll() {
- logger.fine("getAll");
-
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
-
- // Return all the files
- List<Entry<String, Item>> entries = new ArrayList<Entry<String, Item>>();
- File directory = new File(rootDirectory + "/" + directoryName);
- if (directory.exists()) {
- for (File file: directory.listFiles()) {
- if (file.getName().startsWith(".")) {
- continue;
- }
- entries.add(entry(file.getName()));
- }
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
- public Item get(String key) throws NotFoundException {
- logger.fine("get " + key);
- return item(key);
- }
-
- public String post(String key, Item item) {
- throw new UnsupportedOperationException();
- }
-
- public void put(String key, Item item) throws NotFoundException {
- throw new UnsupportedOperationException();
- }
-
- public void delete(String key) throws NotFoundException {
- logger.fine("delete " + key);
-
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
- File directory = new File(rootDirectory + "/" + directoryName);
- File file = new File(directory, key);
- if (file.exists()) {
- file.delete();
- } else {
- throw new NotFoundException(key);
- }
- }
-
- public Entry<String, Item>[] query(String queryString) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns an entry representing a file.
- *
- * @param fileName
- * @return
- */
- private static Entry<String, Item> entry(String fileName) {
- Entry<String, Item> entry = new Entry<String, Item>();
- entry.setKey(fileName);
- entry.setData(item(fileName));
- return entry;
- }
-
- /**
- * Returns an item representing a file.
- *
- * @param fileName
- * @return
- */
- private static Item item(String fileName) {
- Item item = new Item();
- item.setTitle(fileName);
- item.setLink("/files/" + fileName);
- return item;
- }
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/FileServiceImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/FileServiceImpl.java
deleted file mode 100644
index 2adb623876..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/FileServiceImpl.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.domain.manager.impl;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URLConnection;
-import java.net.URLDecoder;
-import java.util.List;
-import java.util.logging.Logger;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.fileupload.FileItem;
-import org.apache.commons.fileupload.disk.DiskFileItemFactory;
-import org.apache.commons.fileupload.servlet.ServletFileUpload;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Property;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a servlet component supporting file upload/download.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(Servlet.class)
-public class FileServiceImpl extends HttpServlet {
- private static final long serialVersionUID = -4560385595481971616L;
-
- private static final Logger logger = Logger.getLogger(FileServiceImpl.class.getName());
-
- @Property
- public String directoryName;
-
- @Reference
- public DomainManagerConfiguration domainManagerConfiguration;
-
- private ServletFileUpload upload;
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() throws IOException {
- upload = new ServletFileUpload(new DiskFileItemFactory());
- }
-
- @Override
- public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
-
- // Upload files
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
- try {
- for (FileItem item: (List<FileItem>)upload.parseRequest(request)) {
- if (!item.isFormField()) {
- File directory = new File(rootDirectory + "/" + directoryName);
- if (!directory.exists()) {
- directory.mkdirs();
- }
- logger.fine("post " + item.getName());
- item.write(new File(directory, item.getName()));
- }
- }
-
- // Redirect to the admin page
- response.sendRedirect("/ui/files");
- }
- catch (Exception e) {
- throw new IOException(e.toString());
- }
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // Download a file
- String requestURI = URLDecoder.decode(request.getRequestURI(), "UTF-8");
- String path = requestURI.substring(request.getServletPath().length());
- if (path.startsWith("/")) {
- path = path.substring(1);
- }
- logger.fine("get " + path);
-
- try {
-
- // Analyze the given path
- URI uri = URI.create(path);
- String scheme = uri.getScheme();
- if (scheme == null) {
-
- // If no scheme is specified then the path identifies file
- // inside our directory
- String rootDirectory = domainManagerConfiguration.getRootDirectory();
- uri = new File(rootDirectory + "/" + directoryName, path).toURI();
-
- } else if (!scheme.equals("file")) {
-
- // If the scheme does not identify a local file, just redirect to the server
- // hosting the file
- response.sendRedirect(path);
- }
-
- // Read the file and write to response
- URLConnection connection = uri.toURL().openConnection();
- connection.setUseCaches(false);
- connection.connect();
- InputStream is = connection.getInputStream();
- ServletOutputStream os = response.getOutputStream();
- byte[] buffer = new byte[4096];
- for (;;) {
- int n = is.read(buffer);
- if (n < 0) {
- break;
- }
- os.write(buffer, 0, n);
- }
- is.close();
- os.flush();
-
- } catch (FileNotFoundException e) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeConfigurationServiceImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeConfigurationServiceImpl.java
deleted file mode 100644
index 06d28b0502..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeConfigurationServiceImpl.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.domain.manager.impl;
-
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeQName;
-
-import java.io.IOException;
-import java.net.URLDecoder;
-import java.util.logging.Logger;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a service that returns a node configuration.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(Servlet.class)
-public class NodeConfigurationServiceImpl extends HttpServlet implements Servlet {
- private static final long serialVersionUID = 6913769467386954463L;
-
- private static final Logger logger = Logger.getLogger(NodeConfigurationServiceImpl.class.getName());
-
- @Reference
- public LocalItemCollection contributionCollection;
-
- @Reference
- public LocalItemCollection cloudCollection;
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- String key = path.startsWith("/")? path.substring(1) : path;
- logger.fine("get " + key);
-
- // The key contains a node name, redirect
- // to the corresponding composite config
-
- // Get the collection of cloud composites
- Entry<String, Item>[] cloudEntries = cloudCollection.getAll();
-
- // Find the specified node
- for (Entry<String, Item> cloudEntry: cloudEntries) {
- QName qname = compositeQName(cloudEntry.getKey());
- if (qname.getLocalPart().equals(key)) {
-
- // Found the specified node
- String related = cloudEntry.getData().getRelated();
- int i = related.indexOf("composite:");
- if (i != -1) {
-
- // Redirect to its composite config
- String compositeConfiguration = "/composite-config/?composite=" + related.substring(i);
- response.sendRedirect(compositeConfiguration);
- return;
- }
- }
- }
-
- // Node not found
- response.sendError(HttpServletResponse.SC_NOT_FOUND, key);
- return;
- }
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java
deleted file mode 100644
index d68cfa3786..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.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.domain.manager.impl;
-
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeQName;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.nodeURI;
-
-import java.net.URI;
-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.binding.atom.AtomBindingFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.ItemCollection;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.osoa.sca.ServiceRuntimeException;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a node process collection service.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(interfaces={ItemCollection.class, LocalItemCollection.class})
-public class NodeProcessCollectionFacadeImpl implements ItemCollection, LocalItemCollection {
-
- private static final Logger logger = Logger.getLogger(NodeProcessCollectionFacadeImpl.class.getName());
-
- @Reference
- public LocalItemCollection cloudCollection;
-
- @Reference
- public ItemCollection processCollection;
-
- @Reference
- public DomainManagerConfiguration domainManagerConfiguration;
-
- private AssemblyFactory assemblyFactory;
- private AtomBindingFactory atomBindingFactory;
- private CompositeActivator compositeActivator;
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() {
-
- // Get its composite activator
- //FIXME
- //compositeActivator = runtime.getCompositeActivator();
-
- // Get the model factories
- ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints();
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- atomBindingFactory = modelFactories.getFactory(AtomBindingFactory.class);
- }
-
- public Entry<String, Item>[] getAll() {
- logger.fine("getAll");
-
- // Get the collection of nodes
- Entry<String, Item>[] nodeEntries = cloudCollection.getAll();
-
- // Dispatch to the hosts hosting these nodes
- List<Entry<String, Item>> entries = new ArrayList<Entry<String,Item>>();
- for (String host: hosts(nodeEntries)) {
- ItemCollection processCollection = processCollection(host);
- for (Entry<String, Item> remoteEntry: processCollection.getAll()) {
- entries.add(remoteEntry);
- }
- break;
- }
-
- return entries.toArray(new Entry[entries.size()]);
- }
-
- public Item get(String key) throws NotFoundException {
- logger.fine("get " + key);
-
- // Get the host hosting the given node
- String host = host(key);
-
- // Dispatch the request to that host
- ItemCollection processCollection = processCollection(host);
- return processCollection.get(key);
- }
-
- public String post(String key, Item item) {
- logger.fine("post " + key);
-
- // Get the host hosting the given node
- String host;
- try {
- host = host(key);
- } catch (NotFoundException e) {
- throw new ServiceRuntimeException(e);
- }
-
- // Dispatch the request to that host
- ItemCollection processCollection = processCollection(host);
- return processCollection.post(key, item);
- }
-
- public void put(String key, Item item) throws NotFoundException {
- throw new UnsupportedOperationException();
- }
-
- public void delete(String key) throws NotFoundException {
- logger.fine("delete " + key);
-
- // Get the host hosting the given node
- String host = host(key);
-
- // Dispatch the request to that host
- ItemCollection processCollection = processCollection(host);
- processCollection.delete(key);
- }
-
- public Entry<String, Item>[] query(String queryString) {
- logger.fine("query " + queryString);
-
- if (queryString.startsWith("node=")) {
- String key = queryString.substring(queryString.indexOf('=') + 1);
-
- // Get the host hosting the given node
- String host;
- try {
- host = host(key);
- } catch (NotFoundException e) {
- return new Entry[0];
- }
-
- // Dispatch the request to that host
- ItemCollection processCollection = processCollection(host);
- return processCollection.query(queryString);
-
- } else {
- throw new UnsupportedOperationException();
- }
- }
-
- private String host(String nodeName) throws NotFoundException {
-
- // Get the entry representing the given node
- Entry<String, Item> nodeEntry = nodeEntry(cloudCollection.getAll(), nodeName);
- if (nodeEntry == null) {
- throw new NotFoundException(nodeName);
- }
-
- // Get the host hosting it
- return host(nodeEntry.getData());
- }
-
- /**
- * Returns the entry representing the given node.
- *
- * @param entries
- * @param name
- * @return
- */
- private static Entry<String, Item> nodeEntry(Entry<String, Item>[] entries, String name) {
- for (Entry<String, Item> entry: entries) {
- QName qname = compositeQName(entry.getKey());
- if (qname.getLocalPart().equals(name)) {
- return entry;
- }
- }
- return null;
- }
-
- /**
- * Returns the lists of hosts hosting the nodes in the given entries.
- *
- * @param entries
- * @return
- */
- private static List<String> hosts(Entry<String, Item>[] entries) {
- List<String> hosts = new ArrayList<String>();
- for (Entry<String, Item> entry: entries) {
- String host = host(entry.getData());
- if (!hosts.contains(host)) {
- hosts.add(host);
- }
- }
- return hosts;
- }
-
- /**
- * Returns the host of the node represented by the given item.
- *
- * @param item
- * @return
- */
- private static String host(Item item) {
- String uri = nodeURI(item.getContents());
- if (uri != null) {
- return URI.create(uri).getHost();
- } else {
- return null;
- }
- }
-
- /**
- * Returns a proxy to the process collection service on the specified
- * host.
- *
- * @param host
- * @return
- */
- private ItemCollection processCollection(String host) {
- return processCollection;
-
-//FIXME
-// AtomBinding binding = atomBindingFactory.createAtomBinding();
-// binding.setURI("http://" + host + ":9990/node/processes");
-// ServiceReference<ItemCollection> reference = dynamicReference(ItemCollection.class, binding, assemblyFactory, compositeActivator);
-// return reference.getService();
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java
deleted file mode 100644
index 23c506446f..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.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.domain.manager.impl;
-
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeKey;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.compositeQName;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.contributionURI;
-import static org.apache.tuscany.sca.domain.manager.impl.DomainManagerUtil.nodeURI;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URLDecoder;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a component that provides a quick start path for a
- * composite in a contribution.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(interfaces={Servlet.class})
-public class QuickStartServiceImpl extends HttpServlet {
- private static final long serialVersionUID = -3477992129462720901L;
-
- private static final Logger logger = Logger.getLogger(QuickStartServiceImpl.class.getName());
-
- @Reference
- public LocalItemCollection contributionCollection;
-
- @Reference
- public LocalItemCollection deployableCollection;
-
- @Reference
- public LocalItemCollection domainCompositeCollection;
-
- @Reference
- public LocalItemCollection cloudCollection;
-
- @Reference
- public LocalItemCollection processCollection;
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() throws ParserConfigurationException {
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- try {
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.startsWith("/")) {
- path = path.substring(1);
- }
-
- // Get the request parameters
- String contributionURI = request.getParameter("contribution");
- String contributionLocation = request.getParameter("location");
- String compositeURI = request.getParameter("composite");
- String start = request.getParameter("start");
-
- logger.fine("Composite Quick Start.");
- logger.fine("Contribution URI: " + contributionURI);
- logger.fine("Contribution location: " + contributionLocation);
- logger.fine("Composite URI: " + compositeURI);
-
- // Look for the contribution in the workspace
- Entry<String, Item>[] contributionEntries = contributionCollection.getAll();
- Entry<String, Item> contributionEntry = null;
- for (Entry<String, Item> entry: contributionEntries) {
- if (contributionURI.equals(entry.getKey())) {
- contributionEntry = entry;
- break;
- }
- }
-
- // Add the contribution if necessary
- if (contributionEntry == null) {
- Item item = new Item();
- item.setLink(contributionLocation);
- contributionCollection.post(contributionURI, item);
- }
-
- // Look for the specified deployable composite in the contribution
- String compositeKey = null;
- Entry<String, Item>[] deployableEntries = deployableCollection.query("contribution=" + contributionURI);
- for (Entry<String, Item> entry: deployableEntries) {
- Item item = entry.getData();
- if (contributionURI.equals(contributionURI(entry.getKey())) && item.getAlternate().endsWith(compositeURI)) {
- compositeKey = entry.getKey();
- break;
- }
- }
-
- if (compositeKey == null) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, compositeURI);
- return;
- }
-
- // Look for the deployable composite in the domain composite
- try {
- domainCompositeCollection.get(compositeKey);
- } catch (NotFoundException e) {
-
- // Add the deployable composite to the domain composite
- Item item = new Item();
- domainCompositeCollection.post(compositeKey, item);
- }
-
- // Check if the deployable composite is already assigned a node
- Entry<String, Item>[] nodeEntries = cloudCollection.getAll();
- String nodeName = null;
- for (Entry<String, Item> entry: nodeEntries) {
- Item item = entry.getData();
- String related = item.getRelated();
- if (related != null) {
- int c = related.indexOf("composite:");
- related = related.substring(c);
- if (compositeKey.equals(related)) {
- nodeName = compositeQName(entry.getKey()).getLocalPart();
- }
- }
- }
-
- // Create a new node for the composite if necessary
- if (nodeName == null) {
-
- // Construct node name and key
- QName compositeName = compositeQName(compositeKey);
- nodeName = compositeName.getLocalPart() + "Node";
- String nodeKey = compositeKey("http://tuscany.apache.org/cloud", new QName("http://tuscany.apache.org/cloud", nodeName));
-
- // Find a free node port
- Set<Integer> nodePorts = new HashSet<Integer>();
- for (Entry<String, Item> entry: nodeEntries) {
- Item item = entry.getData();
- String uri = nodeURI(item.getContents());
- if (uri != null) {
- URI u = URI.create(uri);
- int port = u.getPort();
- if (port != -1) {
- nodePorts.add(port);
- }
- }
- }
- String nodeURI = null;
- for (int port = 8100; port<8200; port++) {
- if (!nodePorts.contains(port)) {
- nodeURI = "http://localhost:" + port;
- break;
- }
- }
- if (nodeURI == null) {
- throw new RuntimeException("Couldn't find a free port for new node: " + nodeName);
- }
-
- // Build the entry describing the node
- Item item = new Item();
- String content =
- "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"\n" +
- " xmlns:t=\"http://tuscany.apache.org/xmlns/sca/1.0\"\n" +
- " targetNamespace=\"http://tuscany.apache.org/cloud\"\n" +
- " xmlns:c=\"" + compositeName.getNamespaceURI() + "\"\n" +
- " name=\"" + nodeName + "\">\n" +
- "\n" +
- " <component name=\"" + nodeName + "\">\n" +
- " <t:implementation.node uri=\"" + contributionURI + "\" composite=\"c:" + compositeName.getLocalPart() + "\"/>\n" +
- " <service name=\"Node\">\n" +
- " <binding.ws uri=\"" + nodeURI + "\"/>\n" +
- " <t:binding.http uri=\"" + nodeURI + "\"/>\n" +
- " <t:binding.jsonrpc uri=\"" + nodeURI + "\"/>\n" +
- " <t:binding.atom uri=\"" + nodeURI + "\"/>\n" +
- " </service>\n" +
- " </component>\n" +
- "</composite>";
- item.setContents(content);
-
- // Create the new node
- cloudCollection.post(nodeKey, item);
- }
-
- // Finally, start the node
- if ("true".equals(start)) {
- processCollection.post(nodeName, new Item());
- }
-
- response.getWriter().print("<html><body>Node <span id=\"node\">" + nodeName + "</span> OK.</body></html>");
-
- } catch (Exception e) {
- logger.log(Level.SEVERE, "Could not start composite", e);
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
- }
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java b/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java
deleted file mode 100644
index f96e19ed72..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.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.domain.manager.launcher;
-
-import org.apache.tuscany.sca.domain.manager.impl.DomainManagerConfiguration;
-import org.apache.tuscany.sca.node.SCAClient;
-import org.apache.tuscany.sca.node.SCANode;
-import org.apache.tuscany.sca.node.SCANodeFactory;
-
-/**
- * Bootstrap class for the SCA domain manager.
- *
- * @version $Rev$ $Date$
- */
-public class DomainManagerLauncherBootstrap {
- private SCANode node;
-
- /**
- * A node wrappering an instance of a domain manager.
- */
- public static class NodeFacade implements SCANode {
- private ClassLoader threadContextClassLoader;
- private ClassLoader runtimeClassLoader;
- private SCANode node;
- private String rootDirectory;
-
- private NodeFacade(String rootDirectory) {
- this.rootDirectory = rootDirectory;
- runtimeClassLoader = Thread.currentThread().getContextClassLoader();
- }
-
- public void start() {
- threadContextClassLoader = Thread.currentThread().getContextClassLoader();
- boolean started = false;
- try {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- SCANodeFactory factory = SCANodeFactory.newInstance();
- node = factory.createSCANodeFromClassLoader("DomainManager.composite", getClass().getClassLoader());
- node.start();
-
- // Set the domain manager's root directory
- DomainManagerConfiguration domainManagerConfiguration = ((SCAClient) node).getService(DomainManagerConfiguration.class, "DomainManagerConfigurationComponent");
- domainManagerConfiguration.setRootDirectory(rootDirectory);
-
- started = true;
- } finally {
- if (!started) {
- Thread.currentThread().setContextClassLoader(threadContextClassLoader);
- }
- }
- }
-
- public void stop() {
- try {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- node.stop();
- } finally {
- Thread.currentThread().setContextClassLoader(threadContextClassLoader);
- }
- }
- }
-
- /**
- * Constructs a new domain manager bootstrap.
- */
- public DomainManagerLauncherBootstrap(String rootDirectory) throws Exception {
- node = new NodeFacade(rootDirectory);
- }
-
- /**
- * Returns the node representing the domain manager.
- * @return
- */
- public SCANode getNode() {
- return node;
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/DomainManager.composite b/branches/sca-android/modules/domain-manager/src/main/resources/DomainManager.composite
deleted file mode 100644
index ba57ea45d1..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/DomainManager.composite
+++ /dev/null
@@ -1,281 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 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:t="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
- name="DomainManager">
-
- <component name="HomePage">
- <t:implementation.widget location="home.html"/>
- <service name="Widget">
- <t:binding.http uri="http://localhost:9990/ui/home"/>
- </service>
- </component>
-
- <component name="HomeGadget">
- <t:implementation.widget location="home-gadget.html"/>
- <service name="Widget">
- <t:binding.http uri="http://localhost:9990/ui/home-gadget"/>
- </service>
- </component>
-
- <component name="WorkspacePage">
- <t:implementation.widget location="workspace.html"/>
- <service name="Widget">
- <t:binding.http uri="http://localhost:9990/ui/workspace"/>
- </service>
- </component>
-
- <component name="WorkspaceGadget">
- <t:implementation.widget location="workspace-gadget.html"/>
- <service name="Widget">
- <t:binding.http uri="http://localhost:9990/ui/workspace-gadget"/>
- </service>
- <reference name="workspace" target="ContributionCollectionComponent/ItemCollection">
- <t:binding.atom/>
- </reference>
- </component>
-
- <component name="FilesPage">
- <t:implementation.widget location="files.html"/>
- <service name="Widget">
- <t:binding.http uri="http://localhost:9990/ui/files"/>
- </service>
- </component>
-
- <component name="FilesGadget">
- <t:implementation.widget location="files-gadget.html"/>
- <service name="Widget">
- <t:binding.http uri="http://localhost:9990/ui/files-gadget"/>
- </service>
- <reference name="files" target="FileCollectionComponent">
- <t:binding.atom/>
- </reference>
- </component>
-
- <component name="DomainCompositePage">
- <t:implementation.widget location="composite.html"/>
- <service name="Widget">
- <t:binding.http uri="http://localhost:9990/ui/composite"/>
- </service>
- </component>
-
- <component name="DomainCompositeGadget">
- <t:implementation.widget location="composite-gadget.html"/>
- <service name="Widget">
- <t:binding.http uri="http://localhost:9990/ui/composite-gadget"/>
- </service>
- <reference name="domainComposite" target="DomainCompositeCollectionComponent/ItemCollection">
- <t:binding.atom/>
- </reference>
- <reference name="workspace" target="ContributionCollectionComponent/ItemCollection">
- <t:binding.atom/>
- </reference>
- </component>
-
- <component name="CloudPage">
- <t:implementation.widget location="cloud.html"/>
- <service name="Widget">
- <t:binding.http uri="http://localhost:9990/ui/cloud"/>
- </service>
- </component>
-
- <component name="CloudGadget">
- <t:implementation.widget location="cloud-gadget.html"/>
- <service name="Widget">
- <t:binding.http uri="http://localhost:9990/ui/cloud-gadget"/>
- </service>
- <reference name="cloudComposite" target="CloudCollectionComponent/ItemCollection">
- <t:binding.atom/>
- </reference>
- <reference name="domainComposite" target="DomainCompositeCollectionComponent/ItemCollection">
- <t:binding.atom/>
- </reference>
- <reference name="processCollection" target="NodeProcessCollectionFacadeComponent/ItemCollection">
- <t:binding.atom/>
- </reference>
- </component>
-
- <component name="ContributionCollectionComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.ContributionCollectionImpl"/>
- <property name="workspaceFile">workspace.xml</property>
- <property name="deploymentContributionDirectory">cloud</property>
- <service name="ItemCollection">
- <t:binding.atom uri="http://localhost:9990/workspace" title="Contributions"/>
- </service>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- </component>
-
- <component name="ContributionServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.ContributionServiceImpl"/>
- <service name="Servlet">
- <t:binding.http uri="http://localhost:9990/contribution"/>
- </service>
- <reference name="contributionCollection" target="ContributionCollectionComponent/LocalItemCollection"/>
- </component>
-
- <component name="FileCollectionComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.FileCollectionImpl"/>
- <property name="directoryName">files</property>
- <service name="ItemCollection">
- <t:binding.atom uri="http://localhost:9990/feed/files" title="Files"/>
- </service>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- </component>
-
- <component name="FileServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.FileServiceImpl"/>
- <property name="directoryName">files</property>
- <service name="Servlet">
- <t:binding.http uri="http://localhost:9990/files"/>
- </service>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- </component>
-
- <component name="DomainCompositeCollectionComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.DeployedCompositeCollectionImpl"/>
- <property name="compositeFile">domain.composite</property>
- <service name="ItemCollection">
- <t:binding.atom uri="http://localhost:9990/composite" title="Domain Composite"/>
- </service>
- <reference name="deployableCollection" target="DeployableCompositeCollectionComponent/LocalItemCollection"/>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- </component>
-
- <component name="DeployableCompositeServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.DeployableCompositeServiceImpl"/>
- <service name="Servlet">
- <t:binding.http uri="http://localhost:9990/composite-source"/>
- </service>
- <reference name="deployableCollection" target="DeployableCompositeCollectionComponent/LocalItemCollection"/>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- </component>
-
- <component name="DeployableCompositeCollectionComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.DeployableCompositeCollectionImpl"/>
- <service name="ItemCollection">
- <t:binding.atom uri="http://localhost:9990/deployable" title="Deployable Composites"/>
- </service>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- <reference name="contributionCollection" target="ContributionCollectionComponent/LocalItemCollection"/>
- </component>
-
- <component name="CompositeGeneratorServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.CompositeGeneratorServiceImpl"/>
- <service name="Servlet">
- <t:binding.http uri="http://localhost:9990/composite-generated"/>
- </service>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- <reference name="contributionCollection" target="ContributionCollectionComponent/LocalItemCollection"/>
- </component>
-
- <component name="CompositeConfigurationServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.CompositeConfigurationServiceImpl"/>
- <service name="Servlet">
- <t:binding.http uri="http://localhost:9990/composite-resolved"/>
- </service>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- <reference name="contributionCollection" target="ContributionCollectionComponent/LocalItemCollection"/>
- <reference name="domainCompositeCollection" target="DomainCompositeCollectionComponent/LocalItemCollection"/>
- <reference name="cloudCollection" target="CloudCollectionComponent/LocalItemCollection"/>
- </component>
-
- <component name="CloudCollectionComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.DeployedCompositeCollectionImpl"/>
- <property name="compositeFile">cloud.composite</property>
- <property name="deploymentContributionDirectory">cloud</property>
- <service name="ItemCollection">
- <t:binding.atom uri="http://localhost:9990/cloud" title="Cloud"/>
- </service>
- <reference name="deployableCollection" target="DeployableCompositeCollectionComponent/LocalItemCollection"/>
- <reference name="processCollection" target="NodeProcessCollectionFacadeComponent/LocalItemCollection"/>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- </component>
-
- <component name="CloudCompositeServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.DeployableCompositeServiceImpl"/>
- <service name="Servlet">
- <t:binding.http uri="http://localhost:9990/cloud-source"/>
- </service>
- <reference name="deployableCollection" target="DeployableCompositeCollectionComponent/LocalItemCollection"/>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- </component>
-
- <component name="CompositeConfigurationCollectionComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.CompositeConfigurationCollectionImpl"/>
- <service name="ItemCollection">
- <t:binding.atom uri="http://localhost:9990/composite-config" title="Node Configuration"/>
- </service>
- <reference name="contributionCollection" target="ContributionCollectionComponent/LocalItemCollection"/>
- <reference name="cloudCollection" target="CloudCollectionComponent/LocalItemCollection"/>
- </component>
-
- <component name="NodeConfigurationServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.NodeConfigurationServiceImpl"/>
- <service name="Servlet">
- <t:binding.http uri="http://localhost:9990/node-config"/>
- </service>
- <reference name="contributionCollection" target="ContributionCollectionComponent/LocalItemCollection"/>
- <reference name="cloudCollection" target="CloudCollectionComponent/LocalItemCollection"/>
- </component>
-
- <component name="QuickStartServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.QuickStartServiceImpl"/>
- <service name="Servlet">
- <t:binding.http uri="http://localhost:9990/quickstart"/>
- </service>
- <reference name="contributionCollection" target="ContributionCollectionComponent/LocalItemCollection"/>
- <reference name="deployableCollection" target="DeployableCompositeCollectionComponent/LocalItemCollection"/>
- <reference name="domainCompositeCollection" target="DomainCompositeCollectionComponent/LocalItemCollection"/>
- <reference name="cloudCollection" target="CloudCollectionComponent/LocalItemCollection"/>
- <reference name="processCollection" target="NodeProcessCollectionComponent/LocalItemCollection"/>
- </component>
-
- <component name="NodeProcessCollectionFacadeComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.NodeProcessCollectionFacadeImpl"/>
- <service name="ItemCollection">
- <t:binding.atom uri="http://localhost:9990/processes" title="Log"/>
- </service>
- <reference name="domainManagerConfiguration" target="DomainManagerConfigurationComponent"/>
- <reference name="cloudCollection" target="CloudCollectionComponent/LocalItemCollection"/>
- <reference name="processCollection" target="NodeProcessCollectionComponent/ItemCollection">
- <t:binding.atom/>
- </reference>
- </component>
-
- <component name="NodeProcessCollectionComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.node.manager.NodeProcessCollectionImpl"/>
- <service name="ItemCollection">
- <t:binding.atom uri="http://localhost:9990/node/processes" title="Log"/>
- </service>
- </component>
-
- <component name="PingServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.node.manager.PingServiceImpl"/>
- <service name="Servlet">
- <t:binding.http uri="http://localhost:9990/ping"/>
- </service>
- </component>
-
- <component name="DomainManagerConfigurationComponent">
- <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.DomainManagerConfigurationImpl"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/cloud-gadget.html b/branches/sca-android/modules/domain-manager/src/main/resources/cloud-gadget.html
deleted file mode 100644
index 619df54ede..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/cloud-gadget.html
+++ /dev/null
@@ -1,408 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<html>
-<head>
-<title>SCA Domain - Cloud</title>
-
-<script type="text/javascript" src="../cloud-gadget/cloud-gadget.js"></script>
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="cloudComposite">
-
- <form id="cloudCompositeForm">
- <div id="composites" ></div>
- <br>
- &gt;<a href="" id="addNodeLink">Add</a>
- &nbsp;<a href="" id="deleteNodeLink">Delete</a>
- &nbsp;&nbsp;
- <a href="" id="startNodeLink">Start</a>
- &nbsp;<a href="" id="stopNodeLink">Stop</a>
- </form>
-
- <div id="newNode" style="visibility: hidden;">
- <form id="newNodeForm">
- <table width="100%">
- <tr><th>Add a Node</th></tr>
- <tr><td>Add a node to the cloud. The node will run the SCA components declared in the specified composite.</td></tr>
- </table>
- <br>
- <table>
- <tr><td>Node name:</td><td><input type="text" name="nodeName" size="50"/></td><td>e.g. YourNode</td></tr>
- <tr><td>Node URI:</td><td><input type="text" name="nodeURI" size="50"/></td></td><td>e.g. http://yourhost:8080</td></tr>
- <tr><td>Composite namespace:</td><td><input type="text" name="compositeNamespace" size="50"/></td></td><td>e.g. http://your/namespace</td></tr>
- <tr><td>Composite name:</td><td><input type="text" name="compositeName" size="50"/></td></td><td>e.g. yourcomposite</td></tr>
- <tr><td>Contribution URI:</td><td><input type="text" name="contributionURI" size="50"/></td></td><td>e.g. yourcontrib, http://yourcontrib</td></tr>
- </table>
- <input id="addNodeButton" type="button" value="Add" />
- </form>
- </div>
-
- </div>
-</body>
-
-<script type="text/javascript">
-
- //@Reference
- var cloudComposite = new Reference("cloudComposite");
-
- //@Reference
- var domainComposite = new Reference("domainComposite");
-
- //@Reference
- var processCollection = new Reference("processCollection");
-
- var gadget = gadget(window, document);
- if (gadget.showStatus == null) {
- gadget.showStatus = true;
- }
- if (gadget.showConfigurations == null) {
- gadget.showConfigurations = true;
- }
-
- var cloudCompositeForm = elementByID(gadget, 'cloudCompositeForm');
- var compositesElement = elementByID(gadget, 'composites');
- var newNodeElement = elementByID(gadget, 'newNode');
- var newNodeForm = elementByID(gadget, 'newNodeForm');
-
- var nodeNames;
- var deployedComposites = new Array();
-
- function getNodes() {
- cloudComposite.get("", getNodesResponse);
- }
-
- function contributionURI(id) {
- var i = id.indexOf(';');
- return id.substring(10, i);
- }
-
- function compositeName(id) {
- var i = id.indexOf(';');
- return id.substring(i + 1);
- }
-
- function compositeLocalName(id) {
- name = compositeName(id);
- var i = name.indexOf(';');
- return name.substring(i + 1);
- }
-
- function getNodesResponse(feed) {
- nodeNames = new Array();
- if (feed != null) {
- var entries = feed.getElementsByTagName("entry");
- var composites = "";
- composites += '<table width="100%">';
- composites += '<tr><th>Node</th>';
- if (gadget.showStatus) {
- composites += '<th>Status</th>';
- }
- if (gadget.showComposites) {
- composites += '<th>Composite</th>';
- }
- if (gadget.showContributions) {
- composites += '<th>Contribution</th>';
- }
- if (gadget.showConfigurations) {
- composites += '<th>Node Config</th>';
- }
- composites += '</tr>';
-
- for (var i=0; i<entries.length; i++) {
- var nodeId = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
- var links = entries[i].getElementsByTagName("link");
- var nodeLink = undefined;
- var compositeLink = undefined;
- var compositeId = "composite:undefined;undefined;undefined";
- var uri = '<span style="color: red">unknown</span>';
- var qname = undefined;
- for (var l = 0; l < links.length; l++) {
- var a = links[l].getAttribute('rel');
- if (a == undefined) {
- nodeLink = links[l].getAttribute('href');
- } else if (a == 'related') {
- compositeLink = links[l].getAttribute('href');
- var c = compositeLink.indexOf('composite:');
- compositeId = compositeLink.substring(c);
- uri = contributionURI(compositeId);
- qname = compositeName(compositeId);
- }
- }
-
- var nodeName = compositeLocalName(nodeId);
- nodeNames[i] = nodeName;
-
- var content = "";
- if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
- content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
- }
-
- composites += '<tr>'
- if (content.indexOf('<span id="problem"') != -1) {
- composites += '<td><input name="composites" type="checkbox" value="' + nodeId + '">' +
- '<a href=\"' + nodeLink + '\">' + nodeName + '</a></td>';
- if (gadget.showStatus) {
- composites += '<td><span id="status_' + nodeName + '">unknown</span></td>';
- }
- if (gadget.showComposites) {
- composites += '<td>' + content + '</td>';
- }
- if (gadget.showContributions) {
- composites += '<td>' + uri + '</td>';
- }
- } else {
- composites += '<td><input name="composites" type="checkbox" value="' + nodeId + '">' +
- '<a href=\"' + nodeLink + '\">' + nodeName + '</a></td>';
- if (gadget.showStatus) {
- composites += '<td><span id="status_' + nodeName + '">unknown</span></td>';
- }
- if (gadget.showComposites) {
- composites += '<td><a href=\"' + compositeLink + '\">' + qname + '</a></td>';
- }
- if (gadget.showContributions) {
- composites += '<td><a href="/contribution/' + uri + '">' + uri + '</a></td>';
- }
- }
- if (gadget.showConfigurations) {
- composites += '<td><a href="/node-config/' + nodeName + '"><img src="icons/feed-icon.png" border="0"></a></td>';
- }
- composites += '</tr>';
- }
- composites += '</table>';
- compositesElement.innerHTML = composites;
-
- processCollection.get("", getProcessesResponse);
- }
- }
-
- function getProcessesResponse(feed) {
- if (feed != null) {
- var nodeStatus = new Array();
-
- var entries = feed.getElementsByTagName("entry");
- for (var i=0; i<entries.length; i++) {
- var nodeName = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
- nodeStatus[nodeName] = 'started';
- }
-
- if (gadget.showStatus) {
- for (var i = 0; i < nodeNames.length; i++) {
- var element = elementByID(gadget, 'status_' + nodeNames[i]);
- var nodeName = nodeNames[i];
- if (nodeStatus[nodeName] == null) {
- element.innerHTML = '<span>stopped</span>';
- } else {
- element.innerHTML = '<span><a style="color: green" href="/processes/?node=' + nodeName + '">started</a></span>';
- }
- }
- }
- }
- }
-
- function deleteNode() {
- var composites = array(cloudCompositeForm.composites);
- for (var i = 0; i < composites.length; i++) {
- if (composites[i].checked) {
- var id = composites[i].value;
- cloudComposite.del(id, deleteNodeResponse);
- }
- }
- return false;
- }
-
- function deleteNodeResponse() {
- getNodes();
- }
-
- function addNode() {
- var nodeName = newNodeForm.nodeName.value;
- var nodeURI = newNodeForm.nodeURI.value;
- var compositeNamespace = newNodeForm.compositeNamespace.value;
- var compositeName = newNodeForm.compositeName.value;
- var contributionURI = newNodeForm.contributionURI.value;
- var id = 'composite:' +
- 'http://tuscany.apache.org/cloud' + ';' +
- 'http://tuscany.apache.org/cloud' + ';' +
- nodeName;
-
- var entry = '<entry xmlns="http://www.w3.org/2005/Atom">\n' +
- '<id>' + id + '</id>\n' +
- '<content type="text/xml">\n' +
- '<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"\n' +
- ' xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"\n' +
- ' targetNamespace="http://tuscany.apache.org/cloud"\n' +
- ' xmlns:c="' + compositeNamespace + '"\n' +
- ' name="' + nodeName + '">\n' +
- '\n' +
- ' <component name="' + nodeName + '">\n' +
- ' <t:implementation.node uri="' + contributionURI + '" composite="c:' + compositeName + '"/>\n' +
- ' <service name="Node">\n' +
- ' <binding.ws uri="' + nodeURI + '"/>\n' +
- ' <t:binding.http uri="' + nodeURI + '"/>\n' +
- ' <t:binding.jsonrpc uri="' + nodeURI + '"/>\n' +
- ' <t:binding.atom uri="' + nodeURI + '"/>\n' +
- ' </service>\n' +
- ' </component>\n' +
- '</composite>' +
- '</content>' +
- '</entry>';
- cloudComposite.post(entry, addNodeResponse);
- }
-
- function addNodeResponse() {
- newNodeForm.nodeName.value = "";
- newNodeForm.nodeURI.value = "";
- newNodeForm.compositeNamespace.value = "";
- newNodeForm.compositeName.value = "";
- newNodeForm.contributionURI.value = "";
- getNodes();
- }
-
- function startNode() {
- var composites = array(cloudCompositeForm.composites);
- for (var i = 0; i < composites.length; i++) {
- if (composites[i].checked) {
- var id = nodeNames[i];
-
- var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
- '<id>' + id + '</id>' +
- '</entry>';
- processCollection.post(entry, startNodeResponse);
- }
- }
- return false;
- }
-
- function startNodeResponse() {
- processCollection.get("", getProcessesResponse);
-
- var composites = array(cloudCompositeForm.composites);
- for (var i = 0; i < composites.length; i++) {
- if (composites[i].checked) {
- composites[i].checked = false;
- }
- }
- }
-
- function stopNode() {
- var composites = array(cloudCompositeForm.composites);
- for (var i = 0; i < composites.length; i++) {
- if (composites[i].checked) {
- var id = nodeNames[i];
- processCollection.del(id, stopNodeResponse);
- }
- }
- return false;
- }
-
- function stopNodeResponse() {
- processCollection.get("", getProcessesResponse);
-
- var composites = array(cloudCompositeForm.composites);
- for (var i = 0; i < composites.length; i++) {
- if (composites[i].checked) {
- composites[i].checked = false;
- }
- }
- }
-
- function getComposites() {
- domainComposite.get("", getCompositesResponse);
- }
-
- function getCompositesResponse(feed) {
- if (feed != null) {
- var entries = feed.getElementsByTagName("entry");
- for (var i=0; i<entries.length; i++) {
- var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
- deployedComposites[id] = id;
- }
- }
- }
-
- function suggestCompositeNamespaces() {
- var namespaces = new Array();
- for (var uri in deployedComposites) {
- var qname = compositeName(uri);
- var ns = qname.substring(0, qname.indexOf(';'));
- namespaces[ns] = ns;
- }
- return array(namespaces);
- }
-
- function suggestCompositeNames() {
- var inputns = newNodeForm.compositeNamespace.value;
- var names = new Array();
- for (var uri in deployedComposites) {
- var qname = compositeName(uri);
- var sc = qname.indexOf(';');
- var ns = qname.substring(0, sc);
- var name = qname.substring(sc + 1);
- if (ns == inputns || inputns == "") {
- names[name] = name;
- }
- }
- return array(names);
- }
-
- function suggestContributionURIs() {
- var inputns = newNodeForm.compositeNamespace.value;
- var inputname = newNodeForm.compositeName.value;
- var uris = new Array();
- for (var uri in deployedComposites) {
- var qname = compositeName(uri);
- var sc = qname.indexOf(';');
- var ns = qname.substring(0, sc);
- var name = qname.substring(sc + 1);
- if ((ns == inputns || inputns == "") && (name == inputname || inputname == "")) {
- var curi = contributionURI(uri);
- uris[curi] = curi;
- }
- }
- return array(uris);
- }
-
- function toggleNewNode() {
- var visibility = newNodeElement.style.visibility;
- if (visibility == 'hidden') {
- newNodeElement.style.visibility = 'visible';
- } else {
- newNodeElement.style.visibility = 'hidden';
- }
- return false;
- }
-
- elementByID(gadget, 'deleteNodeLink').onclick = deleteNode;
- elementByID(gadget, 'addNodeLink').onclick = toggleNewNode;
- elementByID(gadget, 'startNodeLink').onclick = startNode;
- elementByID(gadget, 'stopNodeLink').onclick = stopNode;
- elementByID(gadget, 'addNodeButton').onclick = addNode;
-
- getNodes();
- getComposites();
- suggest(newNodeForm.compositeNamespace, suggestCompositeNamespaces);
- suggest(newNodeForm.compositeName, suggestCompositeNames);
- suggest(newNodeForm.contributionURI, suggestContributionURIs);
-
-</script>
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/cloud.html b/branches/sca-android/modules/domain-manager/src/main/resources/cloud.html
deleted file mode 100644
index d661d5d38b..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/cloud.html
+++ /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.
--->
-<html>
-<head>
-<title>SCA Domain - Cloud</title>
-
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="toolbarGadgetDiv"></div>
- <br>
-
- <span class=hd1>
- SCA Domain<br><br>
- Cloud</b>&nbsp;<a href="/cloud/"><img src="icons/feed-icon.png" border="0"></a>
- </span>
- <br>
- Here is the list of SCA nodes configured in your SCA domain cloud.
- <br><br>
-
- <div id="cloudGadgetDiv"></div>
-
- <iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
- <iframe id="cloudGadget" src="cloud-gadget.html"></iframe>
-</body>
-
-<script type="text/javascript">
- var toolbarGadgetDiv = elementByID(document, 'toolbarGadgetDiv');
- var cloudGadgetDiv = elementByID(document, 'cloudGadgetDiv');
-
- var toolbarGadget = elementByID(document, 'toolbarGadget');
- var cloudGadget = elementByID(document, 'cloudGadget');
-
- function ongadget(win, doc) {
- if (doc == content(toolbarGadget)) {
- toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
- return toolbarGadgetDiv;
- } else if (doc == content(cloudGadget)) {
- cloudGadgetDiv.innerHTML = doc.body.innerHTML;
- cloudGadgetDiv.showStatus = true;
- cloudGadgetDiv.showComposites = true;
- cloudGadgetDiv.showContributions = true;
- cloudGadgetDiv.showConfigurations = true;
- return cloudGadgetDiv;
- }
- return document;
- }
-</script>
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/composite-gadget.html b/branches/sca-android/modules/domain-manager/src/main/resources/composite-gadget.html
deleted file mode 100644
index 82855a410a..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/composite-gadget.html
+++ /dev/null
@@ -1,277 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<html>
-<head>
-<title>SCA Domain - Domain Composite</title>
-
-<script type="text/javascript" src="../composite-gadget/composite-gadget.js"></script>
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="domainComposite">
-
- <form id="domainCompositeForm">
- <div id="composites" ></div>
- <br>
- &gt;<a href="" id="addCompositeLink">Add</a>
- &nbsp;<a href="" id="deleteCompositeLink">Delete</a>
- </form>
-
- <div id="newComposite" style="visibility: hidden;">
- <form id="newCompositeForm">
- <table width="100%">
- <tr><th>Add Composite</th></tr>
- <tr><td>Add an SCA composite describing your SCA service components.</td></tr>
- </table>
- <br>
- <table>
- <tr><td>Composite namespace:</td><td><input type="text" name="compositeNamespace" size="50"/></td><td>e.g. http://your/namespace</td></tr>
- <tr><td>Composite name:</td><td><input type="text" name="compositeName" size="50"/></td><td>e.g. yourcomposite</td></tr>
- <tr><td>Contribution URI:</td><td><input type="text" name="contributionURI" size="50"/></td><td>e.g. yourcontrib, http://yourcontrib</td></tr>
- </table>
- <input id="addCompositeButton" type="button" value="Add" />
- </form>
- </div>
-
- </div>
-</body>
-
-<script type="text/javascript">
- //@Reference
- var domainComposite = new Reference("domainComposite");
-
- //@Reference
- var workspace = new Reference("workspace");
-
- var gadget = gadget(window, document);
- if (gadget.showContributions == null) {
- gadget.showContributions = true;
- }
-
- var domainCompositeForm = elementByID(gadget, 'domainCompositeForm');
- var compositesElement = elementByID(gadget, 'composites');
- var newCompositeElement = elementByID(gadget, 'newComposite');
- var newCompositeForm = elementByID(gadget, 'newCompositeForm');
-
- var contributedComposites = new Array();
-
- function getComposites() {
- domainComposite.get("", getCompositesResponse);
- }
-
- function contributionURI(id) {
- var i = id.indexOf(';');
- return id.substring(10, i);
- }
-
- function compositeName(id) {
- var i = id.indexOf(';');
- return id.substring(i + 1);
- }
-
- function getCompositesResponse(feed) {
- if (feed != null) {
- var entries = feed.getElementsByTagName("entry");
- var composites = "";
- composites += '<table width="100%">';
- composites += '<tr><th>Composite</th>';
- if (gadget.showContributions) {
- composites += '<th>Contribution</th>';
- }
- if (gadget.showComponents) {
- composites += '<th>Components</th>';
- }
- composites += '</tr>';
- //'<th>Composite Configuration</th>' +
-
- for (var i=0; i<entries.length; i++) {
- var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
- var link = entries[i].getElementsByTagName("link")[0].getAttribute("href");
- var uri = contributionURI(id);
- var qname = compositeName(id);
-
- var content = "";
- if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
- content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
- }
- var components = '';
- var bs = content.indexOf('<span id="components">');
- if (bs != -1) {
- var es = content.indexOf('</span>', bs);
- components = content.substring(bs, es + 7);
- } else {
- bs = content.indexOf('<span id="problem"');
- if (bs != -1) {
- var es = content.indexOf('</span>', bs);
- components = content.substring(bs, es + 7);
- }
- }
-
- composites += '<tr>'
- composites += '<td><input name="composites" type="checkbox" value="' + id + '">';
- composites += '<a href=\"' + link + '\">' + qname + '</a></td>';
- if (gadget.showContributions) {
- composites += '<td><a href="/contribution/' + uri + '">' + uri + '</a></td>';
- }
- if (gadget.showComponents) {
- composites += '<td class=tdw>' + components + '</td>';
- }
- //composites += '<td><a href="/composite-config/?composite=' + id + '"><img src="icons/feed-icon.png" border="0"></a></td>';
- composites += '</tr>';
- }
- composites += '</table>';
- compositesElement.innerHTML = composites;
- }
- }
-
- function deleteComposite() {
- var composites = array(domainCompositeForm.composites);
- for (var i = 0; i < composites.length; i++) {
- if (composites[i].checked) {
- var id = composites[i].value;
- domainComposite.del(id, deleteCompositeResponse);
- }
- }
- return false;
- }
-
- function deleteCompositeResponse() {
- getComposites();
- }
-
- function addComposite() {
- var id = 'composite:' +
- newCompositeForm.contributionURI.value + ';' +
- newCompositeForm.compositeNamespace.value + ';' +
- newCompositeForm.compositeName.value;
- var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
- '<title>' + id +'</title>' +
- '<id>' + id + '</id>' +
- '</entry>';
- domainComposite.post(entry, addCompositeResponse);
- }
-
- function addCompositeResponse() {
- newCompositeForm.compositeNamespace.value = "";
- newCompositeForm.compositeName.value = "";
- newCompositeForm.contributionURI.value = "";
- getComposites();
- }
-
- function getContributions() {
- workspace.get("", getContributionsResponse);
- }
-
- function getContributionsResponse(feed) {
- if (feed != null) {
- contributedComposites = new Array();
- var entries = feed.getElementsByTagName("entry");
- for (var i=0; i<entries.length; i++) {
- if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
- var content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
- var bs = content.indexOf('<span id="deployables">');
- if (bs != -1) {
- var es = content.indexOf('</span>', bs);
- content = content.substring(bs, es + 7);
- for (;;) {
- var bc = content.indexOf('composite:');
- if (bc == -1) {
- break;
- }
- var ec = content.indexOf('">', bc);
- if (ec == -1) {
- break;
- }
- var uri = content.substring(bc, ec);
- contributedComposites[uri] = uri;
- content = content.substring(ec +1);
- }
- }
- }
- }
- }
- }
-
- function suggestCompositeNamespaces() {
- var namespaces = new Array();
- for (var uri in contributedComposites) {
- var qname = compositeName(uri);
- var ns = qname.substring(0, qname.indexOf(';'));
- namespaces[ns] = ns;
- }
- return array(namespaces);
- }
-
- function suggestCompositeNames() {
- var inputns = newCompositeForm.compositeNamespace.value;
- var names = new Array();
- for (var uri in contributedComposites) {
- var qname = compositeName(uri);
- var sc = qname.indexOf(';');
- var ns = qname.substring(0, sc);
- var name = qname.substring(sc + 1);
- if (ns == inputns || inputns == "") {
- names[name] = name;
- }
- }
- return array(names);
- }
-
- function suggestContributionURIs() {
- var inputns = newCompositeForm.compositeNamespace.value;
- var inputname = newCompositeForm.compositeName.value;
- var uris = new Array();
- for (var uri in contributedComposites) {
- var qname = compositeName(uri);
- var sc = qname.indexOf(';');
- var ns = qname.substring(0, sc);
- var name = qname.substring(sc + 1);
- if ((ns == inputns || inputns == "") && (name == inputname || inputname == "")) {
- var curi = contributionURI(uri);
- uris[curi] = curi;
- }
- }
- return array(uris);
- }
-
- function toggleNewComposite() {
- var visibility = newCompositeElement.style.visibility;
- if (visibility == 'hidden') {
- newCompositeElement.style.visibility = 'visible';
- } else {
- newCompositeElement.style.visibility = 'hidden';
- }
- return false;
- }
-
- elementByID(gadget, 'deleteCompositeLink').onclick = deleteComposite;
- elementByID(gadget, 'addCompositeLink').onclick = toggleNewComposite;
- elementByID(gadget, 'addCompositeButton').onclick = addComposite;
-
- getComposites();
- getContributions();
- suggest(newCompositeForm.compositeNamespace, suggestCompositeNamespaces);
- suggest(newCompositeForm.compositeName, suggestCompositeNames);
- suggest(newCompositeForm.contributionURI, suggestContributionURIs);
-
-</script>
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/composite.html b/branches/sca-android/modules/domain-manager/src/main/resources/composite.html
deleted file mode 100644
index b0631e1d66..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/composite.html
+++ /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.
--->
-<html>
-<head>
-<title>SCA Domain - Domain Composite</title>
-
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="toolbarGadgetDiv"></div>
- <br>
-
- <span class=hd1>
- SCA Domain<br><br>
- Domain Composite&nbsp;<a href="/composite/"><img src="icons/feed-icon.png" border="0"></a>
- </span>
- <br>
- Here is the list of SCA composites currently included as top-level composites in your SCA domain.
- <br><br>
-
- <div id="compositeGadgetDiv"></div>
-
- <iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
- <iframe id="compositeGadget" src="composite-gadget.html"></iframe>
-</body>
-
-<script type="text/javascript">
- var toolbarGadgetDiv = elementByID(document, 'toolbarGadgetDiv');
- var compositeGadgetDiv = elementByID(document, 'compositeGadgetDiv');
-
- var toolbarGadget = elementByID(document, 'toolbarGadget');
- var compositeGadget = elementByID(document, 'compositeGadget');
-
- function ongadget(win, doc) {
- if (doc == content(toolbarGadget)) {
- toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
- return toolbarGadgetDiv;
- } else if (doc == content(compositeGadget)) {
- compositeGadgetDiv.innerHTML = doc.body.innerHTML;
- compositeGadgetDiv.showContributions = true;
- compositeGadgetDiv.showComponents = true;
- return compositeGadgetDiv;
- }
- return document;
- }
-</script>
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/files-gadget.html b/branches/sca-android/modules/domain-manager/src/main/resources/files-gadget.html
deleted file mode 100644
index 83315a1957..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/files-gadget.html
+++ /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.
--->
-<html>
-<head>
-<title>SCA Domain - Contribution File Server</title>
-
-<script type="text/javascript" src="../files-gadget/files-gadget.js"></script>
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="fileServer">
-
- <form id="filesForm">
- <div id="files" ></div>
- <br>
- &gt;<a href="" id="uploadFileLink">Upload</a>
- &nbsp;<a href="" id="deleteFileLink">Delete</a>
- </form>
-
- <div id="uploadFile" style="visibility: hidden;">
- <form method="post" id="uploadFileForm" enctype='multipart/form-data' action='/files'>
- <table width="100%">
- <tr><th>Upload File</th></tr>
- <tr><td>Upload a file to the server.</td></tr>
- </table>
- <br>
- <table border="0">
- <tr><td>File:</td><td><input type="file" name="file" size="50"/></td></tr>
- </table>
- <br/>
- <input id="uploadFileButton" type="button" value="Upload" />
- </form>
- </div>
-
- </div>
-</body>
-
-<script type="text/javascript">
- //@Reference
- var files = new Reference("files");
-
- var gadget = gadget(window, document);
-
- var filesForm = elementByID(gadget, "filesForm");
- var filesElement = elementByID(gadget, 'files');
- var uploadFileElement = elementByID(gadget, 'uploadFile');
- var uploadFileForm = elementByID(gadget, 'uploadFileForm');
-
- function getFiles() {
- files.get("", getFilesResponse);
- }
-
- function getFilesResponse(feed) {
- if (feed != null) {
- var entries = feed.getElementsByTagName("entry");
- var list = '<table width="100%"><tr><th>Files</th></tr>';
- for (var i=0; i<entries.length; i++) {
- var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
- var location = entries[i].getElementsByTagName("link")[0].getAttribute("href");
- list += '<tr><td><input name="files" type="checkbox" value="' + id + '">' +
- '<a href=\"' + location + '\">' + id + '</a></td></tr>';
- }
- list += "</table>";
- filesElement.innerHTML = list;
- }
- }
-
- function deleteFile() {
- var list = array(filesForm.files);
- for (var i=0; i < list.length; i++) {
- if (list[i].checked) {
- var id = list[i].value;
- files.del(id, deleteFileResponse);
- }
- }
- return false;
- }
-
- function deleteFileResponse() {
- getFiles();
- }
-
- function uploadFile() {
- uploadFileForm.submit();
- return false;
- }
-
- function toggleUploadFile() {
- var visibility = uploadFileElement.style.visibility;
- if (visibility == 'hidden') {
- uploadFileElement.style.visibility = 'visible';
- } else {
- uploadFileElement.style.visibility = 'hidden';
- }
- return false;
- }
-
- elementByID(gadget, 'deleteFileLink').onclick = deleteFile;
- elementByID(gadget, 'uploadFileLink').onclick = toggleUploadFile;
- elementByID(gadget, 'uploadFileButton').onclick = uploadFile;
-
- getFiles();
-
-</script>
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/files.html b/branches/sca-android/modules/domain-manager/src/main/resources/files.html
deleted file mode 100644
index 37d89e7665..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/files.html
+++ /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.
--->
-<html>
-<head>
-<title>SCA Domain - Contribution File Server</title>
-
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="toolbarGadgetDiv"></div>
- <br>
-
- <span class=hd1>
- SCA Domain<br><br>
- File Server&nbsp;<a href="/feed/files/"><img src="icons/feed-icon.png" border="0"></a>
- </span>
- <br>
- This is a simple ATOM-based file server useful to share files if you don't have an FTP, SVN or Maven repository.
- <br><br>
-
- <div id="filesGadgetDiv"></div>
-
- <iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
- <iframe id="filesGadget" src="files-gadget.html"></iframe>
-</body>
-
-<script type="text/javascript">
- var toolbarGadgetDiv = elementByID(document, 'toolbarGadgetDiv');
- var filesGadgetDiv = elementByID(document, 'filesGadgetDiv');
-
- var toolbarGadget = elementByID(document, 'toolbarGadget');
- var filesGadget = elementByID(document, 'filesGadget');
-
- function ongadget(win, doc) {
- if (doc == content(toolbarGadget)) {
- toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
- return toolbarGadgetDiv;
- } else if (doc == content(filesGadget)) {
- filesGadgetDiv.innerHTML = doc.body.innerHTML;
- return filesGadgetDiv;
- }
- return document;
- }
-</script>
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/home-gadget.html b/branches/sca-android/modules/domain-manager/src/main/resources/home-gadget.html
deleted file mode 100644
index 05e262e4df..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/home-gadget.html
+++ /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.
--->
-<html>
-<head>
-<title>SCA Domain - Home</title>
-
-<script type="text/javascript" src="../home-gadget/home-gadget.js"></script>
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="home">
-
- <form>
- <table border="0" align="center">
- <tr><td valign="top"><span style="font-size:150%; color: blue">Search:</span></td><td><input type="text" name="search" size="50"/></td></tr>
- <tr><td></td><td align="center"><input type="button" name="search" value="Search" /></td></tr>
- </table>
- </form>
-
- </div>
-</body>
-
-<script type="text/javascript">
- var gadget = gadget(window, document);
-</script>
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/home.html b/branches/sca-android/modules/domain-manager/src/main/resources/home.html
deleted file mode 100644
index aad1856621..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/home.html
+++ /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.
--->
-<html>
-<head>
-<title>SCA Domain - Home</title>
-
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="toolbarGadgetDiv"></div>
- <br>
-
- <span class=hd1>
- SCA Domain
- </span>
- <br><br><br><br><br><br>
-
- <div id="homeGadgetDiv"></div>
-
- <br><br><br><br><br><br><br>
- <center>This page is under construction, searching the domain is not implemented yet.</center>
-
- <iframe id="toolbarGadget" src="toolbar-gadget.html" style="visibility: hidden;"></iframe>
- <iframe id="homeGadget" src="home-gadget.html" style="visibility: hidden;"></iframe>
-</body>
-
-<script type="text/javascript">
- var toolbarGadgetDiv = elementByID(document, 'toolbarGadgetDiv');
- var homeGadgetDiv = elementByID(document, 'homeGadgetDiv');
-
- var toolbarGadget = elementByID(document, 'toolbarGadget');
- var homeGadget = elementByID(document, 'homeGadget');
-
- function ongadget(win, doc) {
- if (doc == content(toolbarGadget)) {
- toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
- return toolbarGadgetDiv;
- } else if (doc == content(homeGadget)) {
- homeGadgetDiv.innerHTML = doc.body.innerHTML;
- return homeGadgetDiv;
- }
- return document;
- }
-</script>
-
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/icons/feed-icon.png b/branches/sca-android/modules/domain-manager/src/main/resources/icons/feed-icon.png
deleted file mode 100644
index a59728b2ad..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/icons/feed-icon.png
+++ /dev/null
Binary files differ
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/manager.css b/branches/sca-android/modules/domain-manager/src/main/resources/manager.css
deleted file mode 100644
index e080ff1d87..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/manager.css
+++ /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.
- */
-
-body {
- white-space: nowrap; margin: 2px;
-}
-
-table {
- border: 1px; border-collapse: separate
-}
-
-th {
- font-weight: bold; white-space: nowrap; background-color: #e5ecf9; color: #598edd;
- text-align: left; padding-left: 2px; padding-right: 20px; padding-top: 2px; padding-bottom: 2px; vertical-align: text-top;
- border-top: 1px; border-bottom: 1px; border-left: 0px; border-right: 0px;
- border-style: solid; border-top-color: #a2bae7; border-bottom-color: #d1d3d4
-}
-
-td {
- padding-left: 2px; padding-top: 2px; padding-right: 20px; white-space: nowrap; vertical-align: text-top
-}
-
-iframe {
- visibility: hidden;
-}
-
-input {
- vertical-align: middle
-}
-
-a:link {
- color: blue
-}
-
-a:visited {
- color: blue
-}
-
-.tdw {
- padding-left: 2px; padding-top: 2px; padding-right: 20px; white-space: normal; vertical-align: text-top
-}
-
-.hd1 {
- font-size:150%; font-weight: bold
-}
-
-.tbar {
- margin: 0px;
- padding-top: 0px; padding-left: 0px; padding-right: 0px; padding-bottom: 3px;
- border-bottom: 1px solid #a2bae7
-}
-
-.ltbar {
- padding-left: 0px; padding-top: 0px; padding-right: 20px; white-space: nowrap; vertical-align: top
-}
-
-.rtbar {
- padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: nowrap; vertical-align: top;
- text-align: right
-}
-
-.suggest {
- background-color: #e5ecf9; color: #598edd;
- border-top: 1px; border-bottom: 1px; border-left: 1px; border-right: 1px;
- border-style: solid; border-top-color: #a2bae7; border-bottom-color: #d1d3d4;
- border-left-color: #d1d3d4; border-right-color: #d1d3d4;
- position: absolute;
- overflow: auto; overflow-x: hidden;
- cursor: default;
- padding: 0px; margin: 0px;
-}
-
-suggestTable {
- border: 0px; border-collapse: separate;
- padding-left: 5px; padding-right: 5px; padding-top: 2px; padding-bottom: 2px;
- margin: 0px;
-}
-
-.suggestItem {
- padding-left: 2px; padding-top: 0px; padding-bottom: 0px; padding-right: 2px; white-space: nowrap; vertical-align: text-top;
- background-color: #e5ecf9; color: #598edd;
-}
-
-.suggestHilighted {
- padding-left: 2px; padding-top: 0px; padding-bottom: 0px; padding-right: 2px; white-space: nowrap; vertical-align: text-top;
- background-color: #598edd; color: #e5ecf9;
-}
-
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/toolbar-gadget.html b/branches/sca-android/modules/domain-manager/src/main/resources/toolbar-gadget.html
deleted file mode 100644
index c9389affc3..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/toolbar-gadget.html
+++ /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.
--->
-<html>
-<head>
-<title>SCA Domain - Toolbar</title>
-
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="toolbar"></div>
-</body>
-
-<script type="text/javascript">
- var gadget = gadget(window, document);
-
- var tools = new Array();
- tools[0] = new Tool("Contributions", "../workspace");
- tools[1] = new Tool("Composites", "../composite");
- tools[2] = new Tool("Cloud", "../cloud");
- tools[3] = new Tool("Files", "../files");
-
- var home = new Tool("Home", "../home");
-
- var toolbarDiv = elementByID(gadget, 'toolbar');
- toolbarDiv.innerHTML = toolbar(home, tools);
-
-</script>
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/utils.js b/branches/sca-android/modules/domain-manager/src/main/resources/utils.js
deleted file mode 100644
index 77ed807e85..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/utils.js
+++ /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.
- */
-
-/**
- * Autocomplete / suggest support for input fields
- *
- * To use it declare a 'suggest' function as follows:
- * function suggestItems() {
- * return new Array('abc', 'def', 'ghi');
- * }
- *
- * then hook it to an input field as follows:
- * suggest(document.yourForm.yourInputField, suggestItems);
- */
-function selectSuggestion(node, value) {
- for (;;) {
- node = node.parentNode;
- if (node.tagName.toLowerCase() == 'div') {
- break;
- }
- }
- node.selectSuggestion(value);
-}
-
-function hilightSuggestion(node, over) {
- if (over) {
- node.className = 'suggestHilighted';
- } else {
- node.className = 'suggestItem';
- }
-}
-
-function suggest(input, suggestFunction) {
-
- input.suggest = suggestFunction;
-
- input.selectSuggestion = function(value) {
- this.hideSuggestDiv();
- this.value = value;
- }
-
- input.hideSuggestDiv = function() {
- if (this.suggestDiv != null) {
- this.suggestDiv.style.visibility = 'hidden';
- }
- }
-
- input.showSuggestDiv = function() {
- if (this.suggestDiv == null) {
- this.suggestDiv = document.createElement('div');
- this.suggestDiv.input = this;
- this.suggestDiv.className = 'suggest';
- input.parentNode.insertBefore(this.suggestDiv, input);
- this.suggestDiv.style.visibility = 'hidden';
- this.suggestDiv.style.zIndex = '99';
-
- this.suggestDiv.selectSuggestion = function(value) {
- this.input.selectSuggestion(value);
- }
- }
-
- var values = this.suggest();
- var items = "";
- for (var i = 0; i < values.length; i++) {
- if (values[i].indexOf(this.value) == -1) {
- continue;
- }
- if (items.length == 0) {
- items += '<table class=suggestTable>';
- }
- items += '<tr><td class="suggestItem" ' +
- 'onmouseover="hilightSuggestion(this, true)" onmouseout="hilightSuggestion(this, false)" ' +
- 'onmousedown="selectSuggestion(this, \'' + values[i] + '\')">' + values[i] + '</td></tr>';
- }
- if (items.length != 0) {
- items += '</table>';
- }
- this.suggestDiv.innerHTML = items;
-
- if (items.length != 0) {
- var node = input;
- var left = 0;
- var top = 0;
- for (;;) {
- left += node.offsetLeft;
- top += node.offsetTop;
- node = node.offsetParent;
- if (node.tagName.toLowerCase() == 'body') {
- break;
- }
- }
- this.suggestDiv.style.left = left;
- this.suggestDiv.style.top = top + input.offsetHeight;
- this.suggestDiv.style.visibility = 'visible';
- } else {
- this.suggestDiv.style.visibility = 'hidden';
- }
- }
-
- input.onkeydown = function(event) {
- this.showSuggestDiv();
- };
-
- input.onkeyup = function(event) {
- this.showSuggestDiv();
- };
-
- input.onmousedown = function(event) {
- this.showSuggestDiv();
- };
-
- input.onblur = function(event) {
- setTimeout(function() { input.hideSuggestDiv(); }, 50);
- };
-}
-
-/**
- * A Toolbar class
- */
-function Tool(name, href) {
- this.name = name;
- this.href = href;
-}
-
-Tool.prototype.print = function() {
- var loc = '' + location;
- if (loc.match(this.href) == null) {
- return '<a href="' + this.href + '" target="_parent">' + this.name + '</a>';
- } else {
- return '<span>' + this.name + '</span>';
- }
-}
-
-/**
- * Initialize the toolbar
- */
-function toolbar(home, tools) {
- var toolbar = '<table width="100%" cellpadding="0" cellspacing="0" class=tbar><tr>' +
- '<td class=ltbar><table border="0" cellspacing="0" cellpadding="0"><tr>';
-
- for (var i = 0; i < tools.length; i++) {
- toolbar = toolbar + '<td class=ltbar>' +tools[i].print() + '</td>'
- }
-
- toolbar = toolbar + '</tr></table></td>' +
- '<td class=rtbar><table border="0" cellpadding="0" cellspacing="0" align="right"><tr>' +
- '<td class=rtbar>' + home.print() + '</td></tr></table></td>' +
- '</tr></table>';
-
- return toolbar;
-}
-
-/**
- * Return an non-sparse array from an array or an object.
- */
-function array(obj) {
- if (obj.length == undefined) {
- var a = new Array();
- a[0] = obj;
- return a;
- }
- else {
- var a = new Array();
- var n = 0;
- for (var i in obj) {
- a[n++] = obj[i];
- }
- return a;
- }
-}
-
-/**
- * Dump a Javascript object to the console
- */
-function dump(o) {
- for (f in o) {
- try {
- console.log(f + '=' + o[f]);
- } catch (e) {}
- }
-}
-
-/**
- * Return the content document of the given window.
- */
-function content(win) {
- if (win.document != 'undefined' && win.document != null) {
- return win.document;
- } else if (win.contentDocument != 'undefined' && win.contentDocument != null) {
- return win.contentDocument;
- } else {
- return null;
- }
-}
-
-/**
- * Returns a child element with the given id.
- */
-function elementByID(node, id) {
- for (var i in node.childNodes) {
- var child = node.childNodes[i];
- if (child.id == id) {
- return child;
- } else {
- child = elementByID(child, id);
- if (child != null) {
- return child;
- }
- }
- }
- return null;
-}
-
-/**
- * Install a gadget.
- */
-function gadget(win, doc) {
- var ongadget = null;
- try {
- if (win.parent.ongadget != null && win.parent.ongadget != 'undefined') {
- ongadget = win.parent.ongadget;
- }
- } catch (e) {
- }
- if (ongadget != null) {
- return ongadget(win, doc);
- } else {
- return doc;
- }
-}
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/workspace-gadget.html b/branches/sca-android/modules/domain-manager/src/main/resources/workspace-gadget.html
deleted file mode 100644
index a4589b42e6..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/workspace-gadget.html
+++ /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.
--->
-<html>
-<head>
-<title>SCA Domain - Contributions</title>
-
-<script type="text/javascript" src="../workspace-gadget/workspace-gadget.js"></script>
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="workspace">
-
- <form id="workspaceForm">
- <div id="contributions" ></div>
- <br>
- &gt;<a href="" id="addContributionLink">Add</a>
- &nbsp;<a href="" id="deleteContributionLink">Delete</a>
- </form>
-
- <div id="newContribution" style="visibility: hidden;">
- <form id="newContributionForm">
- <table width="100%">
- <tr><th>Add Contribution</th></tr>
- <tr><td>Add an SCA contribution containing your application artifacts to the SCA domain.</td></tr>
- </table>
- <br>
- <table>
- <tr><td>Contribution URI:</td><td><input type="text" name="contributionID" size="50"/></td></td><td>e.g. yourcontrib, http://yourcontrib</td></tr>
- <tr><td>Location:</td><td><input type="text" name="contributionLocation" size="50"/></td></td><td>e.g. http://host/yourjar.jar, file:/yourdir, file:/yourjar.jar</td></tr>
- </table>
- <input id="addContributionButton" type="button" value="Add" />
- </form>
- </div>
-
- </div>
-</body>
-
-<script type="text/javascript">
-
- //@Reference
- var workspace = new Reference("workspace");
-
- var gadget = gadget(window, document);
- if (gadget.showDependencies == null) {
- gadget.showDependencies = true;
- }
-
- var workspaceForm = elementByID(gadget, 'workspaceForm');
- var contributionsElement = elementByID(gadget, 'contributions');
- var newContributionElement = elementByID(gadget, 'newContribution');
- var newContributionForm = elementByID(gadget, 'newContributionForm');
-
- var suggestedContributions = new Array();
-
- function getContributions() {
- workspace.get("", getContributionsResponse);
- }
-
- function getContributionsResponse(feed) {
- if (feed != null) {
- var entries = feed.getElementsByTagName("entry");
- var contributions = "";
- contributions += '<table width="100%">';
- contributions += '<tr><th>Contribution</th>';
- if (gadget.showDependencies) {
- contributions += '<th>Dependencies</td>';
- }
- if (gadget.showDeployables) {
- contributions += '<th>Deployable Composites</th>';
- }
- contributions += '</tr>';
- for (var i=0; i<entries.length; i++) {
- var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
- var location = entries[i].getElementsByTagName("link")[0].getAttribute("href");
- var content = '';
- if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
- content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
- }
-
- contributions += '<tr>';
- contributions += '<td><input name="contributions" type="checkbox" value="' + id + '">' +
- '<a href=\"' + location + '\">' + id + '</a></td>';
-
- var dependencies = '';
- var bs = content.indexOf('<span id="dependencies">');
- if (bs != -1) {
- var es = content.indexOf('</span>', bs);
- dependencies = content.substring(bs, es + 7);
- }
-
- var deployables = '';
- var bs = content.indexOf('<span id="deployables">');
- if (bs != -1) {
- var es = content.indexOf('</span>', bs);
- deployables = content.substring(bs, es + 7);
- }
-
- var problems = "";
- var bs = content.indexOf('<span id="problems" ');
- if (bs != -1) {
- var es = content.indexOf('</span>', bs);
- if (dependencies.length != 0) {
- problems = '<br>';
- }
- problems += content.substring(bs, es + 7);
- }
-
- if (gadget.showDependencies) {
- contributions += '<td class=tdw>' + dependencies + problems + ' </td>';
- }
- if (gadget.showDeployables) {
- contributions += '<td class=tdw>' + deployables + '</td>';
- }
- contributions += '</tr>';
- }
- contributions += '</table>';
- contributionsElement.innerHTML = contributions;
- }
- }
-
- function getSuggestedContributions() {
- workspace.get("?suggestions=true", getSuggestedContributionsResponse);
- }
-
- function getSuggestedContributionsResponse(feed) {
- suggestedContributions = new Array();
- if (feed != null) {
- var entries = feed.getElementsByTagName("entry");
- for (var i=0; i<entries.length; i++) {
- var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
- var location = entries[i].getElementsByTagName("link")[1].getAttribute("href");
- suggestedContributions[i] = id + ':' + location;
- }
- }
- }
-
- function deleteContribution() {
- var contributions = array(workspaceForm.contributions);
- for (var i=0; i < contributions.length; i++) {
- if (contributions[i].checked) {
- var id = contributions[i].value;
- alert("hey " + id);
- workspace.del(id, deleteContributionResponse);
- }
- }
- return false;
- }
-
- function deleteContributionResponse() {
- getContributions();
- }
-
- function addContribution() {
- var id = newContributionForm.contributionID.value;
- var location = newContributionForm.contributionLocation.value;
- var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
- '<title>Contribution - ' + id +'</title>' +
- '<id>' + id + '</id>' +
- '<link href="' + location + '" />' +
- '</entry>';
- workspace.post(entry, addContributionResponse);
- }
-
- function addContributionResponse() {
- newContributionForm.contributionID.value = "";
- newContributionForm.contributionLocation.value = "";
- getContributions();
- }
-
- function suggestContributionIDs() {
- var ids = new Array();
- for (var i=0; i<suggestedContributions.length; i++) {
- var uri = suggestedContributions[i];
- var id = uri.substring(0, uri.indexOf(':'));
- ids[id] = id;
- }
- return array(ids);
- }
-
- function suggestContributionLocations() {
- var locations = new Array();
- for (var i=0; i<suggestedContributions.length; i++) {
- var uri = suggestedContributions[i];
- var id = uri.substring(0, uri.indexOf(':'));
- if (id == newContributionForm.contributionID.value) {
- var location = uri.substring(uri.indexOf(':') +1);
- locations[location] = location;
- }
- }
- return array(locations);
- }
-
- function toggleNewContribution() {
- var visibility = newContributionElement.style.visibility;
- if (visibility == 'hidden') {
- newContributionElement.style.visibility = 'visible';
- } else {
- newContributionElement.style.visibility = 'hidden';
- }
- return false;
- }
-
- elementByID(gadget, 'deleteContributionLink').onclick = deleteContribution;
- elementByID(gadget, 'addContributionLink').onclick = toggleNewContribution;
- elementByID(gadget, 'addContributionButton').onclick = addContribution;
-
- getContributions();
- getSuggestedContributions();
- suggest(newContributionForm.contributionID, suggestContributionIDs);
- suggest(newContributionForm.contributionLocation, suggestContributionLocations);
-
-</script>
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/main/resources/workspace.html b/branches/sca-android/modules/domain-manager/src/main/resources/workspace.html
deleted file mode 100644
index 36c02ab1e6..0000000000
--- a/branches/sca-android/modules/domain-manager/src/main/resources/workspace.html
+++ /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.
--->
-<html>
-<head>
-<title>SCA Domain - Contributions</title>
-
-<script type="text/javascript" src="utils.js"></script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body>
- <div id="toolbarGadgetDiv"></div>
- <br>
-
- <span class=hd1>
- SCA Domain<br><br>
- Contributions</b>&nbsp;<a href="/workspace/"><img src="icons/feed-icon.png" border="0"></a> </span>
- <br>
- Here is the list of SCA contributions currently available in your SCA domain.
- <br><br>
-
- <div id="workspaceGadgetDiv"></div>
-
- <iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
- <iframe id="workspaceGadget" src="workspace-gadget.html"></iframe>
-</body>
-
-<script type="text/javascript">
- var toolbarGadgetDiv = elementByID(document, 'toolbarGadgetDiv');
- var workspaceGadgetDiv = elementByID(document, 'workspaceGadgetDiv');
-
- var toolbarGadget = elementByID(document, 'toolbarGadget');
- var workspaceGadget = elementByID(document, 'workspaceGadget');
-
- function ongadget(win, doc) {
- if (doc == content(toolbarGadget)) {
- toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
- return toolbarGadgetDiv;
- } else if (doc == content(workspaceGadget)) {
- workspaceGadgetDiv.innerHTML = doc.body.innerHTML;
- workspaceGadgetDiv.showDependencies = true;
- workspaceGadgetDiv.showDeployables = true;
- return workspaceGadgetDiv;
- }
- return document;
- }
-</script>
-</html>
diff --git a/branches/sca-android/modules/domain-manager/src/test/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerTestCase.java b/branches/sca-android/modules/domain-manager/src/test/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerTestCase.java
deleted file mode 100644
index 5e76556a14..0000000000
--- a/branches/sca-android/modules/domain-manager/src/test/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerTestCase.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.domain.manager.impl;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-
-/**
- * Test case for the workspace admin services.
- *
- * @version $Rev$ $Date$
- */
-public class DomainManagerTestCase extends TestCase {
-
- private ContributionCollectionImpl contributionCollection;
- private DeployableCompositeCollectionImpl deployableCollection;
- private DomainManagerConfigurationImpl domainManagerConfiguration;
-
- private static final String WORKSPACE_XML =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<workspace xmlns=\"http://tuscany.apache.org/xmlns/sca/1.0\" " +
- "xmlns:ns1=\"http://tuscany.apache.org/xmlns/sca/1.0\">\n" +
- "</workspace>";
-
- @Override
- protected void setUp() throws Exception {
- ClassLoader cl = getClass().getClassLoader();
-
- // Make sure we start with a clean workspace.xml file
- URL url = cl.getResource("workspace.xml");
- FileOutputStream os = new FileOutputStream(new File(url.toURI()));
- Writer writer = new OutputStreamWriter(os);
- writer.write(WORKSPACE_XML);
- writer.flush();
- writer.close();
-
- // Create a workspace collection component
- domainManagerConfiguration = new DomainManagerConfigurationImpl();
- domainManagerConfiguration.initialize();
- String root = url.getFile();
- root = root.substring(0, root.lastIndexOf('/'));
- domainManagerConfiguration.setRootDirectory(root);
-
- contributionCollection = new ContributionCollectionImpl();
- contributionCollection.domainManagerConfiguration = domainManagerConfiguration;
- contributionCollection.workspaceFile = "workspace.xml";
- contributionCollection.deploymentContributionDirectory = "cloud";
- contributionCollection.domainManagerConfiguration = domainManagerConfiguration;
- deployableCollection = new DeployableCompositeCollectionImpl();
- deployableCollection.domainManagerConfiguration = domainManagerConfiguration;
- deployableCollection.contributionCollection = contributionCollection;
- contributionCollection.initialize();
- deployableCollection.initialize();
-
- // Populate the workspace with test data
- Item item = new Item();
- item.setLink(cl.getResource("contributions/store").toString());
- contributionCollection.post("store", item);
- item.setLink(cl.getResource("contributions/assets").toString());
- contributionCollection.post("assets", item);
- }
-
- public void testGetAll() {
- Entry<String, Item>[] entries = contributionCollection.getAll();
- assertEquals(2, entries.length);
- assertEquals(entries[0].getKey(), "store");
- }
-
- public void testGet() throws NotFoundException {
- Item item = contributionCollection.get("assets");
- assertTrue(item.getAlternate().endsWith("contributions/assets/"));
- }
-
- public void testDependencies1() {
- Entry<String, Item>[] entries = contributionCollection.query("alldependencies=store");
- assertEquals(2, entries.length);
- }
-
- public void testDependencies2() {
- Entry<String, Item>[] entries = contributionCollection.query("alldependencies=assets");
- assertEquals(1, entries.length);
- assertEquals("assets", entries[0].getKey());
- }
-
- public void testDeployables() throws NotFoundException {
- Entry<String, Item>[] entries = deployableCollection.getAll();
- assertEquals(1, entries.length);
- assertEquals("composite:store;http://store;store", entries[0].getKey());
- }
-
-}
diff --git a/branches/sca-android/modules/domain-manager/src/test/resources/contributions/assets/META-INF/sca-contribution.xml b/branches/sca-android/modules/domain-manager/src/test/resources/contributions/assets/META-INF/sca-contribution.xml
deleted file mode 100644
index 4eab6dd5e7..0000000000
--- a/branches/sca-android/modules/domain-manager/src/test/resources/contributions/assets/META-INF/sca-contribution.xml
+++ /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.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://assets">
- <export.java package="services"/>
- <export.java package="services.merger"/>
- <export.java package="services.db"/>
- <import.java package="org.apache.tuscany.sca.data.collection"/>
- <import.java package="org.apache.derby.*"/>
-</contribution> \ No newline at end of file
diff --git a/branches/sca-android/modules/domain-manager/src/test/resources/contributions/store/META-INF/sca-contribution.xml b/branches/sca-android/modules/domain-manager/src/test/resources/contributions/store/META-INF/sca-contribution.xml
deleted file mode 100644
index 48d4be2d6e..0000000000
--- a/branches/sca-android/modules/domain-manager/src/test/resources/contributions/store/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://store"
- xmlns:s="http://store">
- <deployable composite="s:store"/>
- <import.java package="services"/>
-</contribution> \ No newline at end of file
diff --git a/branches/sca-android/modules/domain-manager/src/test/resources/workspace.xml b/branches/sca-android/modules/domain-manager/src/test/resources/workspace.xml
deleted file mode 100644
index e6ac7d7701..0000000000
--- a/branches/sca-android/modules/domain-manager/src/test/resources/workspace.xml
+++ /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.
--->
-<workspace xmlns="http://tuscany.apache.org/xmlns/sca/1.0" xmlns:ns1="http://tuscany.apache.org/xmlns/sca/1.0">
-</workspace>
diff --git a/branches/sca-android/modules/extensibility-equinox/LICENSE b/branches/sca-android/modules/extensibility-equinox/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/extensibility-equinox/META-INF/README b/branches/sca-android/modules/extensibility-equinox/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/extensibility-equinox/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/extensibility-equinox/NOTICE b/branches/sca-android/modules/extensibility-equinox/NOTICE
deleted file mode 100644
index 65c52d01c7..0000000000
--- a/branches/sca-android/modules/extensibility-equinox/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-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/branches/sca-android/modules/extensibility-equinox/pom.xml b/branches/sca-android/modules/extensibility-equinox/pom.xml
deleted file mode 100644
index 9547e92f34..0000000000
--- a/branches/sca-android/modules/extensibility-equinox/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>1.4-SNAPSHOT</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>1.4-SNAPSHOT</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>
- <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.extensibility.equinox</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Bundle-Activator>org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator</Bundle-Activator>
- <Export-Package>org.apache.tuscany.sca.extensibility.equinox*</Export-Package>
- <Eclipse-LazyStart>true</Eclipse-LazyStart>
- <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
- <DynamicImport-Package>*</DynamicImport-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/branches/sca-android/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java b/branches/sca-android/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java
deleted file mode 100644
index 5ab5a66077..0000000000
--- a/branches/sca-android/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.Arrays;
-import java.util.Collections;
-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;
-
-/**
- * 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);
- }
- });
- }
-
- 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();
- }
-
- }
-
- public static void init() {
- // Empty static method to trigger the activation of this bundle
- }
-
- 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 Set<ServiceDeclaration> discover(String serviceName, boolean firstOnly) {
- 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) {
- // Skip system bundle as it has access to the application classloader
- continue;
- }
- Enumeration<URL> urls = null;
- try {
- // Use getResources to find resources on the classpath of the bundle
- // Please note if there is an DynamicImport-Package=*, and another bundle
- // exports the resource package, there is a possiblity that it doesn't
- // find the containing entry
- urls = bundle.getResources(serviceName);
- if (urls == null) {
- URL entry = bundle.getEntry(serviceName);
- if (entry != null) {
- 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);
- if (firstOnly) {
- return descriptors;
- }
- }
- }
- } 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/branches/sca-android/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java b/branches/sca-android/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
deleted file mode 100644
index 1cb1d09f8d..0000000000
--- a/branches/sca-android/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.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.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 Logger logger = Logger.getLogger(EquinoxServiceDiscoveryActivator.class.getName());
-
- public void start(BundleContext context) throws Exception {
- logger.info("Installing service discovery");
- EquinoxServiceDiscoverer discoverer = new EquinoxServiceDiscoverer(context);
- ServiceDiscovery.getInstance().setServiceDiscoverer(discoverer);
- logger.info("Installed service discovery");
- }
-
- public void stop(BundleContext context) throws Exception {
- }
-
-}
diff --git a/branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java b/branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java
deleted file mode 100644
index 7602b02488..0000000000
--- a/branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.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.extensibility.equinox;
-
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import junit.framework.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/branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java b/branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java
deleted file mode 100644
index 3126365748..0000000000
--- a/branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.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.extensibility.equinox;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-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 junit.framework.Assert;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.junit.AfterClass;
-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() {
- Set<ServiceDeclaration> descriptors =
- discoverer.discover("test.TestService", false);
- Assert.assertEquals(1, descriptors.size());
- descriptors = discoverer.discover("notthere", false);
- Assert.assertEquals(0, descriptors.size());
- }
-
- @Test
- public void testDiscoveryFirst() {
- Set<ServiceDeclaration> descriptors =
- discoverer.discover("test.TestService", true);
- Assert.assertEquals(1, descriptors.size());
- descriptors = discoverer.discover("notthere", true);
- Assert.assertEquals(0, descriptors.size());
- }
-
-
-}
diff --git a/branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java b/branches/sca-android/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java
deleted file mode 100644
index e000faa447..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/extensibility-equinox/src/test/resources/test-bundle.jar b/branches/sca-android/modules/extensibility-equinox/src/test/resources/test-bundle.jar
deleted file mode 100644
index afee051f61..0000000000
--- a/branches/sca-android/modules/extensibility-equinox/src/test/resources/test-bundle.jar
+++ /dev/null
Binary files differ
diff --git a/branches/sca-android/modules/extension-helper/LICENSE b/branches/sca-android/modules/extension-helper/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/extension-helper/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/extension-helper/META-INF/README b/branches/sca-android/modules/extension-helper/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/extension-helper/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/extension-helper/NOTICE b/branches/sca-android/modules/extension-helper/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/extension-helper/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/branches/sca-android/modules/extension-helper/pom.xml b/branches/sca-android/modules/extension-helper/pom.xml
deleted file mode 100644
index e35504caab..0000000000
--- a/branches/sca-android/modules/extension-helper/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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-extension-helper</artifactId>
- <name>Apache Tuscany SCA Extension Helper</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</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.extension.helper</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.extension*</Export-Package>
- <DynamicImport-Package>org.apache.tuscany.sca.host.http</DynamicImport-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/BindingActivator.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/BindingActivator.java
deleted file mode 100644
index e117e952c7..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/BindingActivator.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.extension.helper;
-
-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 BindingActivator adds an SCA binding type to the Tuscany runtime.
- *
- * The SCDL XML used for the binding is derived from the name of the
- * class returned from the getBindingClass method - the package name and
- * any trailing "Binding" string is removed, leading upper case characters
- * are converted to lowercase, and the suffix "binding." is added.
- * For example if getBindingClass returns a class named "mypkg.FooBinding"
- * then the SCDL for the binding will be <binding.foo>.
- *
- * Attributes of the <binding.foo> SCDL are based on the getters/setters of
- * the binding class. So if FooBinding had getBar/setBar then there
- * would be an attribute name 'bar', for example, <binding.foo bar="xxx">.
- *
- * BindingActivator implementations may use constructor arguments to have
- * Tuscany ExtensionPointRegistry objects passed in on their constructor.
- * For example:
- *
- * public class MyBindingActivator implements BindingActivator {
- * ServletHost servletHost;
- * public MyBindingActivator(ServletHost servletHost) {
- * this.servletHost = servletHost;
- * }
- * ...
- * }
- *
- * BindingActivator implementations are discovered by the Tuscany runtime
- * using the J2SE jar file extensions for service provider discovery. All
- * that means is packaging the new binding type in a jar which contains a
- * file META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator and
- * that file lists the BindingActivator implementation class name.
- *
- * @version $Rev$ $Date$
- */
-public interface BindingActivator<B> {
-
- Class<B> getBindingClass();
-
- InvokerFactory createInvokerFactory(RuntimeComponent rc, RuntimeComponentReference rcr, Binding b, B pojoBinding);
-
- ComponentLifecycle createService(RuntimeComponent rc, RuntimeComponentService rcs, Binding b, B pojoBinding);
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/ComponentLifecycle.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/ComponentLifecycle.java
deleted file mode 100644
index 92b6e4191f..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/ComponentLifecycle.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.extension.helper;
-
-/**
- * Interface that defines the Component Lifecycle methods.
- *
- * @version $Rev$ $Date$
- */
-public interface ComponentLifecycle {
-
- void start();
- void stop();
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/ImplementationActivator.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/ImplementationActivator.java
deleted file mode 100644
index 7d2a9c3d2d..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/ImplementationActivator.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.extension.helper;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * An ImplementationActivator adds an SCA implementation type to the Tuscany runtime.
- *
- * The SCDL XML used for the implementation is derived from the name of the
- * class returned from the getImplementationClass method - the package name and
- * any trailing "Implementation" string is removed, leading upper case characters
- * are converted to lowercase, and the suffix "implementation." is added. For
- * example if getImplementationClass returns a class named "mypkg.FooImplementation"
- * then the SCDL for the implementation will be <implementation.foo>.
- *
- * Attributes of the <implementation.foo> SCDL are based on the getters/setters of
- * the Implementation class. So if FooImplementation had getBar/setBar then there
- * would be an attribute name 'bar', for example, <implementation.foo bar="xxx">.
- *
- * BindingActivator implementations may use constructor arguments to have
- * Tuscany ExtensionPointRegistry objects passed in on their constructor.
- * For example:
- *
- * public class MyImplementationActivator implements ImplementationActivator {
- * ServletHost servletHost;
- * public MyImplementationActivator(ServletHost servletHost) {
- * this.servletHost = servletHost;
- * }
- * ...
- * }
- *
- * ImplementationActivator implementations are discovered by the Tuscany runtime
- * using the J2SE jar file extensions for service provider discovery. All
- * that means is packaging the new binding type in a jar which contains a
- * file META-INF/services/org.apache.tuscany.sca.extension.helper.ImplementationActivator and
- * that file lists the ImplementationActivator implementation class name.
- *
- * @version $Rev$ $Date$
- */
-public interface ImplementationActivator<T> {
-
- Class<T> getImplementationClass();
-
- InvokerFactory createInvokerFactory(RuntimeComponent rc, ComponentType ct, T implementation);
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/InvokerFactory.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/InvokerFactory.java
deleted file mode 100644
index c51a7267cc..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/InvokerFactory.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.extension.helper;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-
-/**
- * Interface that defines the methods for an Invoker Factory.
- *
- * @version $Rev$ $Date$
- */
-public interface InvokerFactory {
-
- Invoker createInvoker(Operation operation);
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/BindingSCDLProcessor.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/BindingSCDLProcessor.java
deleted file mode 100644
index 8a83f630e9..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/BindingSCDLProcessor.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.extension.helper.impl;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.NamespaceContext;
-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.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.extension.helper.utils.AbstractBinding;
-
-/**
- * An SCDL ArtifactProcessor which uses the Binding class getters/setters
- * to define the SCDL attributes.
- *
- * TODO: merge this with SCDLProcessor
- *
- * @version $Rev$ $Date$
- */
-public class BindingSCDLProcessor implements StAXArtifactProcessor {
-
- protected QName scdlQName;
- protected Class<Binding> bindingClass;
-
- protected Map<String, Method> attributeSetters;
- protected Method elementTextSetter;
-
- public BindingSCDLProcessor(QName scdlQName, Class<Binding> implementationClass) {
- this.scdlQName = scdlQName;
- this.bindingClass = implementationClass;
- initAttributes();
- }
-
- protected void initAttributes() {
- attributeSetters = new HashMap<String, Method>();
- Set<Method> methods = new HashSet<Method>(Arrays.asList(bindingClass.getMethods()));
- methods.removeAll(Arrays.asList(AbstractBinding.class.getMethods()));
- for (Method m : methods) {
- if ("setElementText".equals(m.getName())) {
- elementTextSetter = m;
- } else if ((m.getName().startsWith("set"))) {
- attributeSetters.put(getFieldName(m), m);
- }
- }
- }
-
- /**
- * Remove get/set from method name, set 1st char to lowercase and
- * remove any trailing underscore character
- */
- protected String getFieldName(Method m) {
- StringBuilder sb = new StringBuilder(m.getName().substring(3));
- sb.setCharAt(0, Character.toLowerCase(sb.charAt(0)));
- String name = sb.toString();
- if (name.endsWith("_")) {
- name = name.substring(0,name.length()-1);
- }
- return name;
- }
-
- public QName getArtifactType() {
- return scdlQName;
- }
-
- public Class getModelType() {
- //FIXME Having two different bindings, PojoBinding wrapping
- // the real binding is pretty confusing, looks like if you don't return
- // PojoBinding here, the write and resolve methods will never be
- // called, returning PojoBinding.class seems to fix that issue without
- // breaking anything else
- return PojoBinding.class;
- }
-
- public Binding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- Object impl;
- try {
- impl = bindingClass.newInstance();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- for (String attribute : attributeSetters.keySet()) {
- String value = reader.getAttributeValue(null, attribute);
- if (value != null && value.length() > 0) {
- try {
- attributeSetters.get(attribute).invoke(impl, new Object[] {value});
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- //FIXME: none of the attributes of Binding seem to be working with PojoBinding
- // For now at least read the binding URI
- String uri = reader.getAttributeValue(null, "uri");
-
- if (elementTextSetter != null) {
- try {
- String value = reader.getElementText();
- if (value != null && value.length() > 0) {
- elementTextSetter.invoke(impl, value);
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- while (!(reader.getEventType() == END_ELEMENT && scdlQName.equals(reader.getName())) && reader.hasNext()) {
- reader.next();
- }
-
- if (!(impl instanceof Binding)) {
- impl = new PojoBinding(impl);
-
- //FIXME: none of the attributes of Binding seem to be working with PojoBinding
- // For now at least read the binding URI
- if (uri != null) {
- ((PojoBinding)impl).setURI(uri);
- }
- }
- return (Binding)impl;
- }
-
- public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException {
- }
-
- public void write(Object model, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- //FIXME: none of the attributes of Binding seem to be working with PojoBinding
- // For now at least write the binding URI
-
- // Find a namespace prefix and write the element
- String prefix = writer.getPrefix(scdlQName.getNamespaceURI());
- if (prefix == null) {
- NamespaceContext nsc = writer.getNamespaceContext();
- for (int i=1; ; i++) {
- prefix = "ns" + i;
- if (nsc.getNamespaceURI(prefix) == null) {
- break;
- }
- }
- writer.setPrefix(prefix, scdlQName.getNamespaceURI());
- }
- writer.writeStartElement(scdlQName.getNamespaceURI(), scdlQName.getLocalPart());
-
- // Write the binding URI attribute
- String uri;
- try {
- uri = (String)model.getClass().getMethod("getURI").invoke(model);
- } catch (Exception e) {
- uri = null;
- }
- if (uri != null) {
- writer.writeAttribute("uri", uri);
- }
-
- writer.writeEndElement();
-
- }
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/BindingsActivator.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/BindingsActivator.java
deleted file mode 100644
index bca1dac0ed..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/BindingsActivator.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.extension.helper.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.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.ModuleActivator;
-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.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ProviderFactory;
-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.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class BindingsActivator implements ModuleActivator {
-
- protected List<BindingActivator> bindingActivators;
- protected AssemblyFactory assemblyFactory;
- protected Map<Class, BindingActivator> bindingActivatorMap = new HashMap<Class, BindingActivator>();
-
- public void start(ExtensionPointRegistry registry) {
-
- ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
- this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
-
-
- this.bindingActivators =
- DiscoveryUtils.discoverActivators(BindingActivator.class, registry);
-
- StAXArtifactProcessorExtensionPoint staxProcessors =
- registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-
- ProviderFactoryExtensionPoint providerFactories =
- registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
-
- for (final BindingActivator bindingActivator : bindingActivators) {
- Class bindingClass = bindingActivator.getBindingClass();
- bindingActivatorMap.put(bindingClass, bindingActivator);
- QName scdlQName = getBindingQName(bindingClass);
- staxProcessors.addArtifactProcessor(new BindingSCDLProcessor(scdlQName, bindingClass));
-
- // Check if the binding extends from Binding interface
- if (Binding.class.isAssignableFrom(bindingClass)) {
- // Add provider factory against the binding class
- providerFactories.addProviderFactory(new DelegatingBindingProviderFactory(bindingClass));
- }
-
- }
-
- // Add a generic provider factory against PojoBinding.class
- providerFactories.addProviderFactory(new DelegatingBindingProviderFactory(PojoBinding.class));
- }
-
- public void stop(ExtensionPointRegistry registry) {
- StAXArtifactProcessorExtensionPoint staxProcessors =
- registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- ProviderFactoryExtensionPoint providerFactories =
- registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
-
- for (final BindingActivator bindingActivator : bindingActivators) {
-
- // Remove the binding SCDL processor from the runtime
- if (staxProcessors != null) {
- StAXArtifactProcessor processor =
- staxProcessors.getProcessor(getBindingQName(bindingActivator.getBindingClass()));
- if (processor != null) {
- staxProcessors.removeArtifactProcessor(processor);
- }
- }
-
- // Remove the ProviderFactory from the runtime
- if (providerFactories != null && bindingActivator.getBindingClass() != null) {
- ProviderFactory factory = providerFactories.getProviderFactory(bindingActivator.getBindingClass());
- if (factory != null) {
- providerFactories.removeProviderFactory(factory);
- }
- }
- }
- if (providerFactories != null) {
- ProviderFactory factory = providerFactories.getProviderFactory(PojoBinding.class);
- if (factory != null) {
- providerFactories.removeProviderFactory(factory);
- }
- }
- }
-
- protected QName getBindingQName(Class bindingClass) {
- String localName = bindingClass.getName();
- if (localName.lastIndexOf('.') > -1) {
- localName = localName.substring(localName.lastIndexOf('.') + 1);
- }
- if (localName.endsWith("Binding")) {
- localName = localName.substring(0, localName.length() - 7);
- }
- StringBuilder sb = new StringBuilder(localName);
- for (int i = 0; i < sb.length(); i++) {
- if (Character.isUpperCase(sb.charAt(i))) {
- sb.setCharAt(i, Character.toLowerCase(sb.charAt(i)));
- } else {
- break;
- }
- }
- return new QName(Constants.SCA10_TUSCANY_NS, "binding." + sb.toString());
- }
-
- private final class DelegatingBindingProviderFactory implements BindingProviderFactory {
- private Class modelType;
-
- public DelegatingBindingProviderFactory(Class modelType) {
- super();
- this.modelType = modelType;
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(final RuntimeComponent rc,
- final RuntimeComponentReference rcr,
- final Binding b) {
- final Object realBinding;
- if (b instanceof PojoBinding) {
- realBinding = ((PojoBinding)b).getUserBinding();
- } else {
- realBinding = b;
- }
- final BindingActivator bindingActivator = bindingActivatorMap.get(realBinding.getClass());
- return new ReferenceBindingProvider() {
- List<InvokerProxy> invokers = new ArrayList<InvokerProxy>();
- private InvokerFactory factory;
-
- public Invoker createInvoker(Operation operation) {
- InvokerProxy invoker = new InvokerProxy(factory, operation);
- invokers.add(invoker);
- return invoker;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return null;
- }
-
- public void start() {
- if (b instanceof PojoBinding) {
- factory = bindingActivator.createInvokerFactory(rc, rcr, b, ((PojoBinding)b).getUserBinding());
- } else {
- factory = bindingActivator.createInvokerFactory(rc, rcr, b, b);
- }
- if ( (factory != null) && (factory instanceof ComponentLifecycle)) {
- ((ComponentLifecycle)factory).start();
- }
-// for (InvokerProxy invoker : invokers) {
-// invoker.start(factory);
-// }
- }
-
- public void stop() {
- if (factory instanceof ComponentLifecycle) {
- ((ComponentLifecycle)factory).stop();
- }
- }
- };
- }
-
- public ServiceBindingProvider createServiceBindingProvider(final RuntimeComponent rc,
- final RuntimeComponentService rcs,
- final Binding b) {
- final Object realBinding;
- if (b instanceof PojoBinding) {
- realBinding = ((PojoBinding)b).getUserBinding();
- } else {
- realBinding = b;
- }
- final BindingActivator bindingActivator = bindingActivatorMap.get(realBinding.getClass());
- return new ServiceBindingProvider() {
- ComponentLifecycle listener = bindingActivator.createService(rc, rcs, b, realBinding);
-
- public InterfaceContract getBindingInterfaceContract() {
- return null;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- listener.start();
- }
-
- public void stop() {
- listener.stop();
- }
- };
- }
-
- public Class getModelType() {
- return modelType;
- }
- }
-
-}
-
-class InvokerProxy implements Invoker {
- InvokerFactory factory;
- Invoker invoker;
- Operation op;
-
- InvokerProxy(InvokerFactory factory, Operation op) {
- this.factory = factory;
- this.op = op;
- this.invoker = factory.createInvoker(op);
- }
-
- public Message invoke(Message arg0) {
- return invoker.invoke(arg0);
- }
-
-// public void start(InvokerFactory factory) {
-// invoker = factory.createInvoker(op);
-// }
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/DiscoveryUtils.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/DiscoveryUtils.java
deleted file mode 100644
index 720d409a44..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/DiscoveryUtils.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.extension.helper.impl;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-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;
-
-/**
- * Discovers Activators in the classpath using the J2SE
- * jar file extensions for Service Provider discovery
- *
- * @version $Rev$ $Date$
- */
-public class DiscoveryUtils {
-
- @SuppressWarnings("unchecked")
- public static <T> List<T> discoverActivators(Class<T> activatorClass, ExtensionPointRegistry registry) {
- List<T> activators;
- try {
- Set<ServiceDeclaration> activatorClasses =
- ServiceDiscovery.getInstance().getServiceDeclarations(activatorClass);
- activators = new ArrayList<T>();
- for (ServiceDeclaration declaration : activatorClasses) {
- try {
- Class<T> c = (Class<T>)declaration.loadClass();
- activators.add(c.cast(instantiateActivator(c, registry)));
- } catch (Throwable e) {
- e.printStackTrace(); // TODO: log
- }
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- return activators;
- }
-
- static Object instantiateActivator(Class activator, ExtensionPointRegistry registry) {
- Constructor[] cs = activator.getConstructors();
- if (cs.length != 1) {
- throw new RuntimeException("Activator must have only one constructors");
- }
-
- Class<?>[] paramTypes = cs[0].getParameterTypes();
- Object[] extensions = new Object[paramTypes.length];
-
- for (int i = 0; i < paramTypes.length; i++) {
- if ("org.apache.tuscany.sca.host.http.ServletHost".equals(paramTypes[i].getName())) {
- extensions[i] = getServletHost(registry);
- } else {
- extensions[i] = registry.getExtensionPoint(paramTypes[i]);
- }
- }
-
- try {
-
- return cs[0].newInstance(extensions);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- private static Object getServletHost(ExtensionPointRegistry registry) {
- try {
-
- Class<?> servletHostEPClass = Class.forName("org.apache.tuscany.sca.host.http.ServletHostExtensionPoint");
- Object servletHostEP = registry.getExtensionPoint(servletHostEPClass);
- Class<?> extensibleServletHost = Class.forName("org.apache.tuscany.sca.host.http.ExtensibleServletHost");
- return extensibleServletHost.getConstructor(new Class[] {servletHostEPClass}).newInstance(servletHostEP);
-
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (SecurityException e) {
- throw new RuntimeException(e);
- } catch (InstantiationException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e);
- } catch (NoSuchMethodException e) {
- throw new RuntimeException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/ImplementationImplementationProvider.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/ImplementationImplementationProvider.java
deleted file mode 100644
index f7c65acb3d..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/ImplementationImplementationProvider.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.extension.helper.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.extension.helper.ImplementationActivator;
-import org.apache.tuscany.sca.extension.helper.InvokerFactory;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * The ImplementationProvider createInvoker method is called before the start method
- * but the runtime isn't properly setup until the start method is called. This means
- * that Invoker's can't initialize things like the services, references and properties
- * until start is called. This class tries to get around that by using an Invoker
- * proxy that delays creating the real Invoker till start is called.
- *
- * @version $Rev$ $Date$
- */
-public class ImplementationImplementationProvider implements ImplementationProvider {
-
- ImplementationActivator implementationActivator;
- RuntimeComponent runtimeComponent;
- Implementation impl;
- Object userImpl;
- InvokerFactory factory;
-
- List<InvokerProxy> invokers = new ArrayList<InvokerProxy>();
-
- public ImplementationImplementationProvider(ImplementationActivator implementationActivator,
- RuntimeComponent rc,
- Implementation impl,
- Object userImpl) {
- this.implementationActivator = implementationActivator;
- this.runtimeComponent = rc;
- this.impl = impl;
- this.userImpl = userImpl;
- }
-
- public Invoker createInvoker(RuntimeComponentService arg0, final Operation op) {
- InvokerProxy invoker = new InvokerProxy(op);
- return invoker;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- factory = implementationActivator.createInvokerFactory(runtimeComponent, impl, userImpl);
- }
-
- public void stop() {
- }
-
- class InvokerProxy implements Invoker {
- Invoker invoker;
- Operation op;
-
- InvokerProxy(Operation op) {
- this.op = op;
- }
-
- public Message invoke(Message msg) {
- init();
- return invoker.invoke(msg);
- }
-
- public synchronized void init() {
- if (invoker == null) {
- invoker = factory.createInvoker(op);
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/ImplementationsActivator.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/ImplementationsActivator.java
deleted file mode 100644
index d156d835ad..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/ImplementationsActivator.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.extension.helper.impl;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.ModuleActivator;
-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.extension.helper.ImplementationActivator;
-import org.apache.tuscany.sca.extension.helper.utils.DefaultPropertyValueObjectFactory;
-import org.apache.tuscany.sca.extension.helper.utils.PropertyValueObjectFactory;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * A Tuscany ModuleActivator which activates all the ImplementationActivators
- *
- * @version $Rev$ $Date$
- */
-public class ImplementationsActivator implements ModuleActivator {
-
- protected List<ImplementationActivator> implementationActivators;
-
- public void start(ExtensionPointRegistry registry) {
-
- ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
-
- DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class);
- TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class);
- MediatorImpl mediator = new MediatorImpl(dataBindings, transformers);
-
- //FIXME Pass this factory differently as it's not an extension point
- PropertyValueObjectFactory propertyFactory = new DefaultPropertyValueObjectFactory(mediator);
- registry.addExtensionPoint(propertyFactory);
-
- this.implementationActivators = DiscoveryUtils.discoverActivators(ImplementationActivator.class, registry);
-
- StAXArtifactProcessorExtensionPoint staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- ProviderFactoryExtensionPoint providerFactories = registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
-
- for (final ImplementationActivator implementationActivator : implementationActivators) {
-
- Class<Implementation> implClass = implementationActivator.getImplementationClass();
- QName scdlQName = getSCDLQName(implClass);
- staxProcessors.addArtifactProcessor(new SCDLProcessor(assemblyFactory, scdlQName, implClass, registry, factories));
-
- if (implementationActivator.getImplementationClass() != null && providerFactories != null) {
- addImplementationProvider(implementationActivator, providerFactories);
- }
- }
- }
-
- public void stop(ExtensionPointRegistry registry) {
- StAXArtifactProcessorExtensionPoint staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-
- for (final ImplementationActivator implementationActivator : implementationActivators) {
- if (staxProcessors != null) {
- StAXArtifactProcessor processor = staxProcessors.getProcessor(getSCDLQName(implementationActivator.getImplementationClass()));
- if (processor != null) {
- staxProcessors.removeArtifactProcessor(processor);
- }
- }
- }
- }
-
- private void addImplementationProvider(final ImplementationActivator implementationActivator, ProviderFactoryExtensionPoint providerFactories) {
-
- providerFactories.addProviderFactory(new ImplementationProviderFactory() {
- public ImplementationProvider createImplementationProvider(final RuntimeComponent rc, final Implementation impl) {
- if (impl instanceof PojoImplementation) {
- return new ImplementationImplementationProvider(implementationActivator, rc, impl, ((PojoImplementation)impl).getUserImpl());
- } else {
- return new ImplementationImplementationProvider(implementationActivator, rc, impl, impl);
- }
- }
- public Class getModelType() {
- Class c = implementationActivator.getImplementationClass();
-
- if (Implementation.class.isAssignableFrom(c)) {
- return c;
- } else {
- return PojoImplementation.class;
- }
- }
- });
- }
-
- protected QName getSCDLQName(Class implementationClass) {
- String localName = implementationClass.getName();
- if (localName.lastIndexOf('.') > -1) {
- localName = localName.substring(localName.lastIndexOf('.') + 1);
- }
- if (localName.endsWith("Implementation")) {
- localName = localName.substring(0, localName.length() - 14);
- }
- StringBuilder sb = new StringBuilder(localName);
- for (int i=0; i<sb.length(); i++) {
- if (Character.isUpperCase(sb.charAt(i))) {
- sb.setCharAt(i, Character.toLowerCase(sb.charAt(i)));
- } else {
- break;
- }
- }
- return new QName(Constants.SCA10_TUSCANY_NS, "implementation." + sb.toString());
- }
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/PojoBinding.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/PojoBinding.java
deleted file mode 100644
index de9a5bfbb1..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/PojoBinding.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.extension.helper.impl;
-
-import org.apache.tuscany.sca.extension.helper.utils.AbstractBinding;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class PojoBinding extends AbstractBinding {
-
- Object userBinding;
-
- public PojoBinding(Object userImpl) {
- this.userBinding = userImpl;
- }
-
- public Object getUserBinding() {
- return userBinding;
- }
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/PojoImplementation.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/PojoImplementation.java
deleted file mode 100644
index a59733aced..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/PojoImplementation.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.extension.helper.impl;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.extension.helper.utils.DynamicImplementation;
-
-/**
- * Enables Implementation extensions to use a simple POJO
- * for the implementation object instead of requiring
- * implementing the Implementation interface.
- *
- * @version $Rev$ $Date$
- */
-public class PojoImplementation<Implementation> extends DynamicImplementation {
-
- Object userImpl;
-
- public PojoImplementation(Object userImpl) {
- this.userImpl = userImpl;
- }
-
- public Object getUserImpl() {
- return userImpl;
- }
-
- public void resolve(ModelResolver resolver) {
-
- try {
- Method resolveMethod;
- if (userImpl != null &&
- (resolveMethod = userImpl.getClass().getMethod("resolve", ModelResolver.class)) != null) {
- resolveMethod.invoke(userImpl, resolver);
- }
- } catch (Exception e) {
- }
- }
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/SCDLProcessor.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/SCDLProcessor.java
deleted file mode 100644
index c91618c24d..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/impl/SCDLProcessor.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extension.helper.impl;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-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 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.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.extension.helper.utils.AbstractStAXArtifactProcessor;
-import org.apache.tuscany.sca.extension.helper.utils.DynamicImplementation;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * An SCDL ArtifactProcessor which uses the Implementation class getters/setters
- * to define the SCDL attributes.
- *
- * @version $Rev$ $Date$
- */
-public class SCDLProcessor extends AbstractStAXArtifactProcessor<Implementation> {
-
- protected QName scdlQName;
- protected Class<Implementation> implementationClass;
- protected ExtensionPointRegistry registry;
- protected ModelFactoryExtensionPoint factories;
-
- protected Map<String, Method> attributeSetters;
- protected Method elementTextSetter;
-
- public SCDLProcessor(AssemblyFactory assemblyFactory, QName scdlQName, Class<Implementation> implementationClass, ExtensionPointRegistry registry, ModelFactoryExtensionPoint factories) {
- super(assemblyFactory);
- this.scdlQName = scdlQName;
- this.implementationClass = implementationClass;
- this.registry = registry;
- this.factories = factories;
- initAttributes();
- }
-
- protected void initAttributes() {
- attributeSetters = new HashMap<String, Method>();
- Set<Method> methods = new HashSet<Method>(Arrays.asList(implementationClass.getMethods()));
- methods.removeAll(Arrays.asList(DynamicImplementation.class.getMethods()));
- for (Method m : methods) {
- if ("setElementText".equals(m.getName())) {
- elementTextSetter = m;
- } else if ((m.getName().startsWith("set"))) {
- attributeSetters.put(getFieldName(m), m);
- }
- }
- }
-
- /**
- * Remove get/set from method name, set 1st char to lowercase and
- * remove any trailing underscore character
- */
- protected String getFieldName(Method m) {
- StringBuilder sb = new StringBuilder(m.getName().substring(3));
- sb.setCharAt(0, Character.toLowerCase(sb.charAt(0)));
- String name = sb.toString();
- if (name.endsWith("_")) {
- name = name.substring(0,name.length()-1);
- }
- return name;
- }
-
- private Object[] getImplConstrArgs() {
- Constructor[] cs = implementationClass.getConstructors();
- if (cs.length != 1) {
- throw new IllegalArgumentException("Implementation class must have a single constructor: "+ implementationClass.getName());
- }
- List args = new ArrayList();
- for (Class c : cs[0].getParameterTypes()) {
- Object o = factories.getFactory(c);
- if (o == null) {
- o = registry.getExtensionPoint(c);
- }
- args.add(o);
- }
- return args.toArray();
- }
-
-
- public QName getArtifactType() {
- return scdlQName;
- }
-
- public Class<Implementation> getModelType() {
- Class clazz;
- if (Implementation.class.isAssignableFrom(implementationClass)) {
- clazz = implementationClass;
- } else {
- clazz = PojoImplementation.class;
- }
- return clazz;
- }
-
- public Implementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- Object impl;
- try {
- impl = implementationClass.getConstructors()[0].newInstance(getImplConstrArgs());
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- for (String attribute : attributeSetters.keySet()) {
- String value = reader.getAttributeValue(null, attribute);
- if (value != null && value.length() > 0) {
- try {
- attributeSetters.get(attribute).invoke(impl, new Object[] {value});
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- if (elementTextSetter != null) {
- try {
- String value = reader.getElementText();
- if (value != null && value.length() > 0) {
- elementTextSetter.invoke(impl, value);
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- while (!(reader.getEventType() == END_ELEMENT && scdlQName.equals(reader.getName())) && reader.hasNext()) {
- reader.next();
- }
-
- if (!(impl instanceof Implementation)) {
- impl = new PojoImplementation(impl);
- }
-
- return (Implementation)impl;
- }
-
- public void write(Implementation arg0, XMLStreamWriter arg1) throws ContributionWriteException, XMLStreamException {
- }
-
- @Override
- protected void addSideFileComponentType(String name, Implementation impl, ModelResolver resolver) {
-// protected void addSideFileComponentType(Implementation impl, ModelResolver resolver) {
-
- ComponentType componentType;
- try {
- componentType = getComponentType(resolver, impl);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
-
- if (componentType != null && !componentType.isUnresolved()) {
- for (Reference reference : componentType.getReferences()) {
- impl.getReferences().add(reference);
- }
- for (Service service : componentType.getServices()) {
- impl.getServices().add(service);
- }
- for (Property property : componentType.getProperties()) {
- impl.getProperties().add(property);
- }
- if (componentType.getConstrainingType() != null) {
- impl.setConstrainingType(componentType.getConstrainingType());
- }
- }
- }
-
- ComponentType getComponentType(ModelResolver resolver, Implementation impl) throws IllegalArgumentException, IllegalAccessException,
- InvocationTargetException {
- for (Method m : getGetters()) {
- Object io;
- if (impl instanceof PojoImplementation) {
- io = ((PojoImplementation) impl).getUserImpl();
- } else {
- io = impl;
- }
- String value = (String) m.invoke(io, new Object[] {});
- if (value != null) {
- value = value.substring(0, value.lastIndexOf('.'));
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setUnresolved(true);
- componentType.setURI(value + ".componentType");
- componentType = resolver.resolveModel(ComponentType.class, componentType);
- if (!componentType.isUnresolved()) {
- return componentType;
- }
- }
- }
- return null;
- }
-
- private List<Method> getGetters() {
- List<Method> ms = new ArrayList<Method>();
- for (Method setter : attributeSetters.values()) {
- String s = getFieldName(setter);
- for (Method m : implementationClass.getMethods()) {
- String name = m.getName();
- if (name.length() > 3 && name.startsWith("get")) {
- if (s.endsWith(name.substring(4))) {
- ms.add(m);
- }
- }
- }
- }
- return ms;
- }
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractBinding.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractBinding.java
deleted file mode 100644
index 112fb09f2a..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractBinding.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.extension.helper.utils;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-/**
- * Helper for implementing Bindings, implements all the
- * standard getters and setters on the binding interface.
- *
- * @version $Rev$ $Date$
- */
-public class AbstractBinding implements Binding {
-
- private String name;
- private String uri;
- private List<Object> extensions;
- private boolean unresolved;
-
- 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 unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractImplementation.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractImplementation.java
deleted file mode 100644
index 0e658cfd1e..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractImplementation.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.extension.helper.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Helper for implementing Implementations, implements all the
- * standard getters and setters on the Implementation interface.
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractImplementation implements Implementation {
-
- private List<Service> services = new ArrayList<Service>();
- private List<Reference> references = new ArrayList<Reference>();
- private List<Property> properties = new ArrayList<Property>();
- private ConstrainingType constrainingType;
- private String uri;
- private boolean unresolved = true;
- private List<ConfiguredOperation> configuredOperations = new ArrayList<ConfiguredOperation>();
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private IntentAttachPointType type = null;
-
- public AbstractImplementation() {
- }
-
- public List<Property> getProperties() {
- return properties;
- }
-
- public List<Reference> getReferences() {
- return references;
- }
-
- public List<Service> getServices() {
- return services;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public ConstrainingType getConstrainingType() {
- return constrainingType;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- this.constrainingType = constrainingType;
- }
-
- public List<Object> getExtensions() {
- // TODO what is this for?
- return null;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public Service getService(String name) {
- for (Service service : getServices()) {
- if (service.getName().equals(name)) {
- return service;
- }
- }
- return null;
- }
-
- public Reference getReference(String name) {
- for (Reference reference : getReferences()) {
- if (reference.getName().equals(name)) {
- return reference;
- }
- }
- return null;
- }
-
- public Property getProptery(String name) {
- for (Property property : getProperties()) {
- if (property.getName().equals(name)) {
- return property;
- }
- }
- return null;
- }
-
- public List<ConfiguredOperation> getConfiguredOperations() {
- return configuredOperations;
- }
-
- // public void setConfiguredOperations(List<ConfiguredOperation> configuredOperations) {
- // this.configuredOperations = configuredOperations;
- // }
-
- 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/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractStAXArtifactProcessor.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractStAXArtifactProcessor.java
deleted file mode 100644
index 9a521b5b79..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/AbstractStAXArtifactProcessor.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.extension.helper.utils;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-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.impl.InterfaceContractImpl;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceImpl;
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-
-/**
- * TODO: couldn't something like this class be provided by the runtime?
- * Each impl shouldn't have to have their own .componentType merging code
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractStAXArtifactProcessor<I extends Implementation> implements StAXArtifactProcessor<I> {
-
- protected AssemblyFactory assemblyFactory;
-
- public AbstractStAXArtifactProcessor(AssemblyFactory assemblyFactory) {
- this.assemblyFactory = assemblyFactory;
- }
-
- public void resolve(I model, ModelResolver resolver) throws ContributionResolveException {
-
- addSideFileComponentType(model.getURI(), model, resolver);
-
- if (model instanceof DynamicImplementation) {
- // if no services have been defined then add a dynamic one
- if (model.getServices().size() < 1) {
- Service dynamicService = createDynamicService();
- model.getServices().add(dynamicService);
- }
- }
-
- // Allow implementation classes to resolve themselves
- try {
- Method resolveMethod;
- if ((resolveMethod = model.getClass().getMethod("resolve", ModelResolver.class)) != null) {
- resolveMethod.invoke(model, resolver);
- }
- } catch (Exception e) {
- }
-
- model.setUnresolved(false);
- }
-
- protected void addSideFileComponentType(String name, Implementation impl, ModelResolver resolver) {
- if (name == null) {
- return;
- }
- int lastDot = name.lastIndexOf('.');
- if (lastDot < 0) {
- return;
- }
- String sideFileName = name.substring(0, lastDot) + ".componentType";
-
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setURI(sideFileName);
- componentType.setUnresolved(true);
-
- componentType = resolver.resolveModel(ComponentType.class, componentType);
-
- if (!componentType.isUnresolved()) {
- for (Reference reference : componentType.getReferences()) {
- impl.getReferences().add(reference);
- }
- for (Service service : componentType.getServices()) {
- impl.getServices().add(service);
- }
- for (Property property : componentType.getProperties()) {
- impl.getProperties().add(property);
- }
- if (componentType.getConstrainingType() != null) {
- impl.setConstrainingType(componentType.getConstrainingType());
- }
- }
- }
-
- protected Service createDynamicService() {
- Service dynamicService = assemblyFactory.createService();
- dynamicService.setName("$dynamic$");
- InterfaceContract dynamicInterfaceContract = new InterfaceContractImpl() {};
- Interface dynamicInterface = new DynamicInterfaceImpl();
- Operation dynamicOperation = new OperationImpl();
- dynamicOperation.setDynamic(true);
- dynamicInterface.getOperations().add(dynamicOperation);
- dynamicInterfaceContract.setInterface(dynamicInterface);
- dynamicService.setInterfaceContract(dynamicInterfaceContract);
-
- return dynamicService;
- }
-
- private static class DynamicInterfaceImpl extends InterfaceImpl {
- @Override
- public boolean isDynamic() {
- return true;
- }
-
- }
-
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/DefaultPropertyValueObjectFactory.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/DefaultPropertyValueObjectFactory.java
deleted file mode 100644
index 550498d7b1..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/DefaultPropertyValueObjectFactory.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.extension.helper.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-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.Mediator;
-import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * TODO: Shouldn't this class be provided by the runtime?
- *
- * @version $Rev$ $Date$
- */
-public class DefaultPropertyValueObjectFactory implements PropertyValueObjectFactory {
- // protected DataBindingRegistry dbRegistry = new DataBindingRegistryImpl();
- protected Mediator mediator = null;
- protected SimpleTypeMapper simpleTypeMapper = new SimpleTypeMapperImpl();
- boolean isSimpleType;
-
- public DefaultPropertyValueObjectFactory(Mediator mediator) {
- this.mediator = mediator;
- }
-
- /* (non-Javadoc)
- * @see org.apache.tuscany.sca.extension.helper.utils.PVOF#createValueFactory(org.apache.tuscany.sca.assembly.Property)
- */
- public ObjectFactory createValueFactory(Property property) {
- isSimpleType = isSimpleType(property);
- Document doc = (Document)property.getValue();
- Element rootElement = doc.getDocumentElement();
-
- //FIXME : since scripts use dynamic types we need to generate a dynamic java type using the
- //XML structure of the property value. Should this be done in the JavaBeansDataBinding...
- Class javaType = null;
-
- 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 {
- Object value = getComplexPropertyValues(doc).get(0);
- return new ObjectFactoryImpl(property,
- value,
- isSimpleType,
- javaType);
- }
-
- }
- }
-
- private 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() == Node.TEXT_NODE) {
- return true;
- }
- }
- }
- return false;
- }
-
- private 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;
- }
-
- private List<Node> getComplexPropertyValues(Document document) {
- Element rootElement = document.getDocumentElement();
- List<Node> propValues = new ArrayList<Node>();
- for (int count = 0 ; count < rootElement.getChildNodes().getLength() ; ++count) {
- if (rootElement.getChildNodes().item(count).getNodeType() == Node.ELEMENT_NODE) {
- propValues.add(rootElement.getChildNodes().item(count));
- }
- }
- return propValues;
- }
-
- public 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;
- //FIXME : fix this when we have managed to generate dynamic java types
- /*sourceDataType =
- new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class,
- new XMLType(null, this.property.getXSDType()));
- TypeInfo typeInfo = null;
- if (this.property.getXSDType() != null) {
- if (SimpleTypeMapperExtension.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.getDataBindingRegistry().introspectType(targetDataType, null);
- }*/
- }
- }
-
- public class ObjectFactoryImpl extends ObjectFactoryImplBase {
- public ObjectFactoryImpl(Property property, Object propertyValue, boolean isSimpleType, Class javaType) {
- super(property, propertyValue, isSimpleType, javaType);
- }
-
- @SuppressWarnings("unchecked")
- public Object getInstance() throws ObjectCreationException {
- if (isSimpleType) {
- return simpleTypeMapper.toJavaObject(property.getXSDType(), (String)propertyValue, null);
- } else {
- return mediator.mediate(propertyValue, sourceDataType, targetDataType, null);
- //return null;
- }
- }
- }
-
- public 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) {
- values.add(simpleTypeMapper.toJavaObject(property.getXSDType(), aValue, null));
- }
- return values;
- } else {
- List instances = new ArrayList();
- for (Node aValue : (List<Node>)propertyValue) {
- instances.add(mediator.mediate(aValue,
- sourceDataType,
- targetDataType,
- null));
- }
- return instances;
- }
- }
- }
-}
- \ No newline at end of file
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/DynamicImplementation.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/DynamicImplementation.java
deleted file mode 100644
index dbfb9d089f..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/DynamicImplementation.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.extension.helper.utils;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.ComponentPreProcessor;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DynamicImplementation extends AbstractImplementation implements ComponentPreProcessor {
-
- public void preProcess(Component component) {
- RuntimeComponent rtc = (RuntimeComponent) component;
-
- for (Service service : rtc.getServices()) {
- if (getService(service.getName()) == null) {
- getServices().add(createService(service));
- }
- }
-
- Service dynamicService = getService("$dynamic$");
- if (dynamicService != null && getServices().size() > 1) {
- getServices().remove(dynamicService);
- dynamicService = null;
- }
-
- for (Reference reference : rtc.getReferences()) {
- if (getReference(reference.getName()) == null) {
- getReferences().add(createReference(reference));
- }
- }
-
- for (Property property : rtc.getProperties()) {
- if (getProptery(property.getName()) == null) {
- getProperties().add(createProperty(property));
- }
- }
-
- // TODO: support properties
- }
-
- protected Service createService(Service service) {
- Service newService;
- try {
- newService = (Service)service.clone();
- } catch (CloneNotSupportedException e) {
- throw new AssertionError(e); // should not ever happen
- }
-
- return newService;
- }
-
- protected Reference createReference(Reference reference) {
- Reference newReference;
- try {
- newReference = (Reference)reference.clone();
- } catch (CloneNotSupportedException e) {
- throw new AssertionError(e); // should not ever happen
- }
- return newReference;
- }
-
- protected Property createProperty(Property property) {
- Property newProperty;
- try {
- newProperty = (Property)property.clone();
- } catch (CloneNotSupportedException e) {
- throw new AssertionError(e); // should not ever happen
- }
- return newProperty;
- }
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/PropertyValueObjectFactory.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/PropertyValueObjectFactory.java
deleted file mode 100644
index f209825679..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/PropertyValueObjectFactory.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.extension.helper.utils;
-
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public interface PropertyValueObjectFactory {
-
- ObjectFactory createValueFactory(Property property);
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/ResourceHelper.java b/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/ResourceHelper.java
deleted file mode 100644
index 4e7965ce60..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/java/org/apache/tuscany/sca/extension/helper/utils/ResourceHelper.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.extension.helper.utils;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URL;
-import java.net.URLConnection;
-
-/**
- * TODO: Shouldn't this be using the contribution service?
- *
- * @version $Rev$ $Date$
- */
-public class ResourceHelper {
-
- public static String readResource(URL scriptSrcUrl) {
-
- InputStream is;
- try {
- URLConnection connection = scriptSrcUrl.openConnection();
- connection.setUseCaches(false);
- is = connection.getInputStream();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-
- try {
-
- Reader reader = new InputStreamReader(is, "UTF-8");
- char[] buffer = new char[1024];
- StringBuilder source = new StringBuilder();
- int count;
- while ((count = reader.read(buffer)) > 0) {
- source.append(buffer, 0, count);
- }
-
- return source.toString();
-
- } catch (IOException e) {
- throw new RuntimeException(e);
- } finally {
- try {
- is.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/extension-helper/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-android/modules/extension-helper/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index a408b0d061..0000000000
--- a/branches/sca-android/modules/extension-helper/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
+++ /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 ExtensionActivator
-org.apache.tuscany.sca.extension.helper.impl.ImplementationsActivator
-org.apache.tuscany.sca.extension.helper.impl.BindingsActivator
diff --git a/branches/sca-android/modules/host-corba-jee/LICENSE b/branches/sca-android/modules/host-corba-jee/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/host-corba-jee/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/host-corba-jee/META-INF/README b/branches/sca-android/modules/host-corba-jee/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-corba-jee/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-corba-jee/NOTICE b/branches/sca-android/modules/host-corba-jee/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/host-corba-jee/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/branches/sca-android/modules/host-corba-jee/pom.xml b/branches/sca-android/modules/host-corba-jee/pom.xml
deleted file mode 100644
index f17870ca8c..0000000000
--- a/branches/sca-android/modules/host-corba-jee/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>1.4-SNAPSHOT</version>
- </parent>
- <artifactId>tuscany-host-corba-jee</artifactId>
- <name>Apache Tuscany SCA JEE environment CORBA Host</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba-jse</artifactId>
- <version>1.4-SNAPSHOT</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.host.corba.jdk</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.corba.jdk*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-corba-jee/src/main/java/org/apache/tuscany/sca/host/corba/jee/CorbaRuntimeModuleActivator.java b/branches/sca-android/modules/host-corba-jee/src/main/java/org/apache/tuscany/sca/host/corba/jee/CorbaRuntimeModuleActivator.java
deleted file mode 100644
index b5fe9f5d0f..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/main/java/org/apache/tuscany/sca/host/corba/jee/CorbaRuntimeModuleActivator.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.host.corba.jee;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.host.corba.CorbaHostExtensionPoint;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CorbaRuntimeModuleActivator implements ModuleActivator {
-
- private JEECorbaHost server;
-
- public void start(ExtensionPointRegistry extensionPointRegistry) {
-
- // Register our Corba host
- CorbaHostExtensionPoint corbaHosts = extensionPointRegistry.getExtensionPoint(CorbaHostExtensionPoint.class);
-
- server = new JEECorbaHost();
- try {
- server.start();
- corbaHosts.addCorbaHost(server);
- } catch (Exception e) {
-
- }
- }
-
- public void stop(ExtensionPointRegistry registry) {
- if (server != null) {
- server.stop();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jee/src/main/java/org/apache/tuscany/sca/host/corba/jee/JEECorbaHost.java b/branches/sca-android/modules/host-corba-jee/src/main/java/org/apache/tuscany/sca/host/corba/jee/JEECorbaHost.java
deleted file mode 100644
index 7e714c1ca5..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/main/java/org/apache/tuscany/sca/host/corba/jee/JEECorbaHost.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.host.corba.jee;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.rmi.PortableRemoteObject;
-
-import org.apache.tuscany.sca.host.corba.CorbaHost;
-import org.apache.tuscany.sca.host.corba.CorbaHostException;
-import org.apache.tuscany.sca.host.corba.CorbaHostUtils;
-import org.apache.tuscany.sca.host.corba.CorbanameURL;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.Object;
-import org.omg.CosNaming.NameComponent;
-import org.omg.CosNaming.NamingContext;
-import org.omg.CosNaming.NamingContextExt;
-import org.omg.CosNaming.NamingContextExtHelper;
-import org.omg.CosNaming.NamingContextHelper;
-import org.omg.CosNaming.NamingContextPackage.InvalidName;
-import org.omg.CosNaming.NamingContextPackage.NotFound;
-
-/**
- * @version $Rev$ $Date$
- * Implementation of JEE CORBA host
- */
-public class JEECorbaHost implements CorbaHost {
-
- public static final String ORB_NAME = "java:comp/ORB";
-
- private List<String> registeredServants = Collections.synchronizedList(new ArrayList<String>());
- private ORB orb;
-
- private void registerURI(String uri) {
- registeredServants.add(uri);
- }
-
- private void removeURI(String uri) {
- registeredServants.remove(uri);
- }
-
- private NamingContextExt getNamingContext(String nameService) throws Exception {
- org.omg.CORBA.Object objRef = orb.resolve_initial_references(nameService);
- return NamingContextExtHelper.narrow(objRef);
- }
-
- private void handleException(Exception e) throws CorbaHostException {
- // The cause of the Exception is JDK specific
- if (e instanceof NotFound) {
- throw new CorbaHostException(CorbaHostException.NO_SUCH_OBJECT, e);
- } else if (e instanceof InvalidName) {
- throw new CorbaHostException(e);
- } else {
- throw new CorbaHostException(e);
- }
- }
-
- public void registerServant(String uri, Object servantObject) throws CorbaHostException {
- CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
- try {
- NamingContext namingCtx = getNamingContext(details.getNameService());
- for (int i = 0; i < details.getNamePath().size() - 1; i++) {
- NameComponent nc = new NameComponent(details.getNamePath().get(i), "");
- NameComponent[] path = new NameComponent[] {nc};
- try {
- namingCtx = NamingContextHelper.narrow(namingCtx.resolve(path));
- } catch (Exception e) {
- namingCtx = namingCtx.bind_new_context(path);
- }
- }
- NameComponent finalName =
- new NameComponent(details.getNamePath().get(details.getNamePath().size() - 1), "");
- try {
- namingCtx.resolve(new NameComponent[] {finalName});
- // no exception means that some object is already registered
- // under this name, we need to crash here
- throw new CorbaHostException(CorbaHostException.BINDING_IN_USE);
- } catch (NotFound e) {
- namingCtx.bind(new NameComponent[] {finalName}, servantObject);
- registerURI(uri);
- }
- } catch (CorbaHostException e) {
- throw e;
- } catch (Exception e) {
- handleException(e);
- }
- }
-
- public void unregisterServant(String uri) throws CorbaHostException {
- CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
- try {
- NamingContextExt namingCtx = getNamingContext(details.getNameService());
- namingCtx.unbind(namingCtx.to_name(details.getName()));
- removeURI(uri);
- } catch (Exception e) {
- handleException(e);
- }
- }
-
- public Object lookup(String uri) throws CorbaHostException {
- Object result = null;
- try {
- CorbanameURL url = new CorbanameURL(uri);
- NamingContextExt context = getNamingContext(url.getNameService());
- result = context.resolve_str(url.getName());
- } catch (Exception e) {
- // e.printStackTrace();
- handleException(e);
- }
- if (result == null) {
- throw new CorbaHostException(CorbaHostException.NO_SUCH_OBJECT);
- }
- return result;
- }
-
- // obtain ORB from environment
- public void start() throws CorbaHostException {
- Context ctx;
- try {
- ctx = new InitialContext();
- orb = (ORB)PortableRemoteObject.narrow(ctx.lookup(ORB_NAME), org.omg.CORBA.ORB.class);
- } catch (Exception e) {
- throw new CorbaHostException(e);
- }
- }
-
- // unregister registered servants
- public void stop() {
- // use copy because unregisterServant(...) method removes from
- // registeredServants collection
- List<String> rsCopy = new ArrayList<String>(registeredServants);
- for (String servantURI : rsCopy) {
- try {
- unregisterServant(servantURI);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jee/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-android/modules/host-corba-jee/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index 3762550c01..0000000000
--- a/branches/sca-android/modules/host-corba-jee/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.host.corba.jee.CorbaRuntimeModuleActivator
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/JEECorbaHostTestCase.java b/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/JEECorbaHostTestCase.java
deleted file mode 100644
index fd952a02c7..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/JEECorbaHostTestCase.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.host.corba.jee.testing;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import javax.naming.Context;
-
-import org.apache.tuscany.sca.host.corba.CorbaHostException;
-import org.apache.tuscany.sca.host.corba.jee.JEECorbaHost;
-import org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface;
-import org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterfaceHelper;
-import org.apache.tuscany.sca.host.corba.jee.testing.servants.TestInterfaceServant;
-import org.apache.tuscany.sca.host.corba.naming.TransientNameServer;
-import org.apache.tuscany.sca.host.corba.naming.TransientNameService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * General tests for JEECorbaHost. Uses host-corba-jdk as mock for JEE
- * environment ORB.
- */
-public class JEECorbaHostTestCase {
-
- public static final String LOCALHOST = "localhost";
- public static final int DEFAULT_PORT = 11100;
- private static JEECorbaHost host;
- private static TransientNameServer server;
- private static String factoryClassName;
-
- private String createCorbanameURI(String name) {
- return "corbaname:#" + name;
- }
-
- @BeforeClass
- public static void start() {
- try {
- server = new TransientNameServer(LOCALHOST, DEFAULT_PORT, TransientNameService.DEFAULT_SERVICE_NAME);
- Thread t = server.start();
- if (t == null) {
- fail("The naming server cannot be started");
- }
- factoryClassName = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
- System.setProperty(Context.INITIAL_CONTEXT_FACTORY, TestInitialContextFactory.class.getName());
- host = new JEECorbaHost();
- host.start();
- } catch (Throwable e) {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
-
- @AfterClass
- public static void stop() {
- server.stop();
- if (factoryClassName != null) {
- System.setProperty(Context.INITIAL_CONTEXT_FACTORY, factoryClassName);
- } else {
- System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
- }
- }
-
- /**
- * Tests registering and lookup CORBA services
- */
- @Test
- public void test_registerServant() {
- try {
- String uri = createCorbanameURI("Nested/Test");
- TestInterface servant = new TestInterfaceServant();
- host.registerServant(uri, servant);
- TestInterface ref = TestInterfaceHelper.narrow(host.lookup(uri));
- assertEquals(2, ref.getInt(2));
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests unregistering servants
- */
- @Test
- public void test_unregisterServant() {
- try {
- String uri = createCorbanameURI("Unregistering/Test");
- TestInterface servant = new TestInterfaceServant();
-
- // creating and releasing using corbaname URI
- host.registerServant(uri, servant);
- host.unregisterServant(uri);
- host.registerServant(uri, servant);
- host.unregisterServant(uri);
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests situation when name is already registered
- */
- @Test
- public void test_nameAlreadyRegistered() {
- // test using URI
- try {
- TestInterface servant = new TestInterfaceServant();
- String uri = createCorbanameURI("AlreadyRegisteredTest2");
- host.registerServant(uri, servant);
- host.registerServant(uri, servant);
- fail();
- } catch (CorbaHostException e) {
- assertTrue(e.getMessage().equals(CorbaHostException.BINDING_IN_USE));
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests getting non existing reference
- */
- @Test
- public void test_getNonExistingObject() {
- // try to fetch object with corbaname URI
- try {
- host.lookup(createCorbanameURI("NonExistingOne"));
- fail();
- } catch (CorbaHostException e) {
- // The message is JDK-specific
- // assertTrue(e.getMessage().equals(CorbaHostException.NO_SUCH_OBJECT));
- } catch (Exception e) {
- // e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests unregistering non existing reference
- */
- @Test
- public void test_unregisterNonExistentObject() {
- // test using URI
- try {
- String uri = createCorbanameURI("NonExistingReference1");
- host.unregisterServant(uri);
- fail();
- } catch (CorbaHostException e) {
- assertTrue(e.getMessage().equals(CorbaHostException.NO_SUCH_OBJECT));
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests unregistering servants on host stop
- */
- @Test
- public void test_unregisterOnStop() {
- try {
- String uri1 = createCorbanameURI("TempService1");
- String uri2 = createCorbanameURI("TempService2");
- JEECorbaHost innerHost = new JEECorbaHost();
- innerHost.start();
- TestInterfaceServant servant = new TestInterfaceServant();
- innerHost.registerServant(uri1, servant);
- innerHost.registerServant(uri2, servant);
- innerHost.stop();
- try {
- innerHost.lookup(uri1);
- fail();
- } catch (CorbaHostException e) {
- assertEquals(CorbaHostException.NO_SUCH_OBJECT, e.getMessage());
- }
- try {
- innerHost.lookup(uri2);
- fail();
- } catch (CorbaHostException e) {
- assertEquals(CorbaHostException.NO_SUCH_OBJECT, e.getMessage());
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/TestContext.java b/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/TestContext.java
deleted file mode 100644
index a0b9b7c514..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/TestContext.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.host.corba.jee.testing;
-
-import java.util.Hashtable;
-
-import javax.naming.Binding;
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NameClassPair;
-import javax.naming.NameParser;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-
-import org.apache.tuscany.sca.host.corba.jee.JEECorbaHost;
-import org.omg.CORBA.ORB;
-
-/**
- * Mock implementation of javax.naming.Context interface.
- */
-public class TestContext implements Context {
-
- private ORB orb;
-
- public Object addToEnvironment(String propName, Object propVal) throws NamingException {
- return null;
- }
-
- public void bind(Name name, Object obj) throws NamingException {
-
- }
-
- public void bind(String name, Object obj) throws NamingException {
-
- }
-
- public void close() throws NamingException {
-
- }
-
- public Name composeName(Name name, Name prefix) throws NamingException {
- return null;
- }
-
- public String composeName(String name, String prefix) throws NamingException {
- return null;
- }
-
- public Context createSubcontext(Name name) throws NamingException {
- return null;
- }
-
- public Context createSubcontext(String name) throws NamingException {
- return null;
- }
-
- public void destroySubcontext(Name name) throws NamingException {
-
- }
-
- public void destroySubcontext(String name) throws NamingException {
-
- }
-
- public Hashtable<?, ?> getEnvironment() throws NamingException {
- return null;
- }
-
- public String getNameInNamespace() throws NamingException {
- return null;
- }
-
- public NameParser getNameParser(Name name) throws NamingException {
- return null;
- }
-
- public NameParser getNameParser(String name) throws NamingException {
- return null;
- }
-
- public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
- return null;
- }
-
- public NamingEnumeration<NameClassPair> list(String name) throws NamingException {
- return null;
- }
-
- public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {
- return null;
- }
-
- public NamingEnumeration<Binding> listBindings(String name) throws NamingException {
- return null;
- }
-
- public Object lookup(Name name) throws NamingException {
- return null;
- }
-
- public Object lookup(String name) throws NamingException {
- try {
- if (name.equals(JEECorbaHost.ORB_NAME)) {
- if (orb == null) {
- // get ORB which was spawned under host and port declared in
- // test class
- String[] args =
- {"-ORBInitialHost", JEECorbaHostTestCase.LOCALHOST, "-ORBInitialPort",
- "" + JEECorbaHostTestCase.DEFAULT_PORT};
- orb = ORB.init(args, null);
- }
- } else {
- throw new NamingException("Unknown name: " + name);
- }
- } catch (Exception e) {
- throw new NamingException(e.getMessage());
- }
- return orb;
- }
-
- public Object lookupLink(Name name) throws NamingException {
- return null;
- }
-
- public Object lookupLink(String name) throws NamingException {
- return null;
- }
-
- public void rebind(Name name, Object obj) throws NamingException {
-
- }
-
- public void rebind(String name, Object obj) throws NamingException {
-
- }
-
- public Object removeFromEnvironment(String propName) throws NamingException {
- return null;
- }
-
- public void rename(Name oldName, Name newName) throws NamingException {
-
- }
-
- public void rename(String oldName, String newName) throws NamingException {
-
- }
-
- public void unbind(Name name) throws NamingException {
-
- }
-
- public void unbind(String name) throws NamingException {
-
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/TestInitialContextFactory.java b/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/TestInitialContextFactory.java
deleted file mode 100644
index f480235fa8..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/TestInitialContextFactory.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.host.corba.jee.testing;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.spi.InitialContextFactory;
-
-/**
- * Factory for mock implementation of javax.naming.Context interface.
- */
-public class TestInitialContextFactory implements InitialContextFactory {
-
- public Context getInitialContext(Hashtable<?, ?> environment) throws NamingException {
- return new TestContext();
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterface.java b/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterface.java
deleted file mode 100644
index f9f3d4789e..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterface.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.host.corba.jee.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/TestInterface.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-public interface TestInterface extends TestInterfaceOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity {
-} // interface TestInterface
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceHelper.java b/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceHelper.java
deleted file mode 100644
index 9ed4c81248..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceHelper.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.host.corba.jee.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-abstract public class TestInterfaceHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/host/corba/testing/general/TestInterface:1.0";
-
- public static void insert(org.omg.CORBA.Any a,
- org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB
- .init()
- .create_interface_tc(org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterfaceHelper.id(),
- "TestInterface");
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface read(org.omg.CORBA.portable.InputStream istream) {
- return narrow(istream.read_Object(_TestInterfaceStub.class));
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface value) {
- ostream.write_Object((org.omg.CORBA.Object)value);
- }
-
- public static org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface)
- return (org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface)obj;
- else if (!obj._is_a(id()))
- throw new org.omg.CORBA.BAD_PARAM();
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.host.corba.jee.testing.general._TestInterfaceStub stub =
- new org.apache.tuscany.sca.host.corba.jee.testing.general._TestInterfaceStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface unchecked_narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface)
- return (org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface)obj;
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.host.corba.jee.testing.general._TestInterfaceStub stub =
- new org.apache.tuscany.sca.host.corba.jee.testing.general._TestInterfaceStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceHolder.java b/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceHolder.java
deleted file mode 100644
index 357c1eddb0..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceHolder.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.corba.jee.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-public final class TestInterfaceHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface value = null;
-
- public TestInterfaceHolder() {
- }
-
- public TestInterfaceHolder(org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterfaceHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterfaceHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterfaceHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceOperations.java b/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceOperations.java
deleted file mode 100644
index c2d4877791..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/TestInterfaceOperations.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.host.corba.jee.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-public interface TestInterfaceOperations {
- int getInt(int arg);
-} // interface TestInterfaceOperations
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/_TestInterfaceImplBase.java b/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/_TestInterfaceImplBase.java
deleted file mode 100644
index 9846748775..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/_TestInterfaceImplBase.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.host.corba.jee.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-public abstract class _TestInterfaceImplBase extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface, org.omg.CORBA.portable.InvokeHandler {
-
- // Constructors
- public _TestInterfaceImplBase() {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable();
- static {
- _methods.put("getInt", new java.lang.Integer(0));
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke(String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh) {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- switch (__method.intValue()) {
- case 0: // org/apache/tuscany/sca/host/corba/testing/general/TestInterface/getInt
- {
- int arg = in.read_long();
- int $result = (int)0;
- $result = this.getInt(arg);
- out = $rh.createReply();
- out.write_long($result);
- break;
- }
-
- default:
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/host/corba/testing/general/TestInterface:1.0"};
-
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
-} // class _TestInterfaceImplBase
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/_TestInterfaceStub.java b/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/_TestInterfaceStub.java
deleted file mode 100644
index cd722214ed..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/general/_TestInterfaceStub.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.host.corba.jee.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-public class _TestInterfaceStub extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface {
-
- public int getInt(int arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("getInt", true);
- $out.write_long(arg);
- $in = _invoke($out);
- int $result = $in.read_long();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return getInt(arg);
- } finally {
- _releaseReply($in);
- }
- } // getInt
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/host/corba/testing/general/TestInterface:1.0"};
-
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
- private void readObject(java.io.ObjectInputStream s) throws java.io.IOException {
- String str = s.readUTF();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props).string_to_object(str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- _set_delegate(delegate);
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init(args, props).object_to_string(this);
- s.writeUTF(str);
- }
-} // class _TestInterfaceStub
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/servants/TestInterfaceServant.java b/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/servants/TestInterfaceServant.java
deleted file mode 100644
index 6195f3af9c..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/java/org/apache/tuscany/sca/host/corba/jee/testing/servants/TestInterfaceServant.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.host.corba.jee.testing.servants;
-
-import org.apache.tuscany.sca.host.corba.jee.testing.general._TestInterfaceImplBase;
-
-/**
- * Testing servant
- */
-public class TestInterfaceServant extends _TestInterfaceImplBase {
-
- private static final long serialVersionUID = 1L;
-
- public int getInt(int arg) {
- return arg;
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jee/src/test/resources/general.idl b/branches/sca-android/modules/host-corba-jee/src/test/resources/general.idl
deleted file mode 100644
index 9194a37334..0000000000
--- a/branches/sca-android/modules/host-corba-jee/src/test/resources/general.idl
+++ /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.
- */
-
-/*
- * compile by
- * idlj -fall -oldImplBase general.idl
- */
-
-module org {
- module apache {
- module tuscany {
- module sca {
- module host {
- module corba {
- module jee {
- module testing {
- module general {
- interface TestInterface {
- long getInt(in long arg);
- };
- };
- };
- };
- };
- };
- };
- };
- };
-};
diff --git a/branches/sca-android/modules/host-corba-jse-tns/LICENSE b/branches/sca-android/modules/host-corba-jse-tns/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/host-corba-jse-tns/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/host-corba-jse-tns/META-INF/README b/branches/sca-android/modules/host-corba-jse-tns/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-corba-jse-tns/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-corba-jse-tns/NOTICE b/branches/sca-android/modules/host-corba-jse-tns/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/host-corba-jse-tns/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/branches/sca-android/modules/host-corba-jse-tns/pom.xml b/branches/sca-android/modules/host-corba-jse-tns/pom.xml
deleted file mode 100644
index 4c6f6af352..0000000000
--- a/branches/sca-android/modules/host-corba-jse-tns/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- </parent>
- <artifactId>tuscany-host-corba-jse-tns</artifactId>
- <name>Apache Tuscany SCA Transient Name Server CORBA Host</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba-jse</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-corba-runtime</artifactId>
- <version>1.4-SNAPSHOT</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.host.corba.jse.tns</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.corba.jse.tns*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-corba-jse-tns/src/main/java/org/apache/tuscany/sca/host/corba/jse/tns/CorbaRuntimeModuleActivator.java b/branches/sca-android/modules/host-corba-jse-tns/src/main/java/org/apache/tuscany/sca/host/corba/jse/tns/CorbaRuntimeModuleActivator.java
deleted file mode 100644
index 312d739c53..0000000000
--- a/branches/sca-android/modules/host-corba-jse-tns/src/main/java/org/apache/tuscany/sca/host/corba/jse/tns/CorbaRuntimeModuleActivator.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.host.corba.jse.tns;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.host.corba.CorbaHostExtensionPoint;
-import org.apache.tuscany.sca.host.corba.jse.DefaultCorbaHost;
-
-/**
- * @version $Rev: 683329 $ $Date: 2008-08-06 19:06:39 +0200 (śro, 06 sie 2008) $
- */
-public class CorbaRuntimeModuleActivator implements ModuleActivator {
- // private static final Logger logger =
- // Logger.getLogger(CorbaRuntimeModuleActivator.class.getName());
-
- private TnsDefaultCorbaHost server;
-
- public void start(ExtensionPointRegistry extensionPointRegistry) {
- // Register our Corba host
- CorbaHostExtensionPoint corbaHosts = extensionPointRegistry.getExtensionPoint(CorbaHostExtensionPoint.class);
- server = new TnsDefaultCorbaHost();
- if (corbaHosts.getCorbaHosts().size() > 0 && corbaHosts.getCorbaHosts().get(0) instanceof DefaultCorbaHost) {
- // Set TnsDefaultCorbaHost as default when DefaultCorbaHost was registered before
- corbaHosts.getCorbaHosts().add(0, server);
- } else {
- corbaHosts.getCorbaHosts().add(server);
- }
- }
-
- public void stop(ExtensionPointRegistry registry) {
- if (server != null) {
- server.stop();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse-tns/src/main/java/org/apache/tuscany/sca/host/corba/jse/tns/TnsDefaultCorbaHost.java b/branches/sca-android/modules/host-corba-jse-tns/src/main/java/org/apache/tuscany/sca/host/corba/jse/tns/TnsDefaultCorbaHost.java
deleted file mode 100644
index 2dc2c7ddd4..0000000000
--- a/branches/sca-android/modules/host-corba-jse-tns/src/main/java/org/apache/tuscany/sca/host/corba/jse/tns/TnsDefaultCorbaHost.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.host.corba.jse.tns;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.host.corba.CorbaHost;
-import org.apache.tuscany.sca.host.corba.CorbaHostException;
-import org.apache.tuscany.sca.host.corba.CorbanameURL;
-import org.apache.tuscany.sca.host.corba.SocketUtil;
-import org.apache.tuscany.sca.host.corba.jse.DefaultCorbaHost;
-import org.apache.tuscany.sca.host.corba.naming.TransientNameServer;
-import org.apache.tuscany.sca.host.corba.naming.TransientNameService;
-import org.omg.CORBA.Object;
-
-/**
- * @version $Rev$ $Date$
- * Default implementation of CORBA host
- */
-public class TnsDefaultCorbaHost implements CorbaHost {
-
- private static final Logger logger = Logger.getLogger(TnsDefaultCorbaHost.class.getName());
- private Map<Integer, TransientNameServer> localServers = new ConcurrentHashMap<Integer, TransientNameServer>();
- private Map<Integer, Integer> clientsCount = new ConcurrentHashMap<Integer, Integer>();
- private CorbaHost targetHost = new DefaultCorbaHost();
-
- public void registerServant(String uri, Object servantObject) throws CorbaHostException {
- CorbanameURL details = new CorbanameURL(uri);
- if (SocketUtil.isLocalhost(details.getHost())) {
- createLocalNameServer(details.getPort());
- }
- targetHost.registerServant(uri, servantObject);
- }
-
- public void unregisterServant(String uri) throws CorbaHostException {
- targetHost.unregisterServant(uri);
- CorbanameURL details = new CorbanameURL(uri);
- if (SocketUtil.isLocalhost(details.getHost())) {
- releaseLocalNameServer(details.getPort());
- }
- }
-
- public Object lookup(String uri) throws CorbaHostException {
- return targetHost.lookup(uri);
- }
-
- /**
- * Starts transient name server under given port. If TNS was previously
- * spawned it increments clients counter.
- */
- synchronized private void createLocalNameServer(int port) throws CorbaHostException {
- int useCount = clientsCount.containsKey(port) ? clientsCount.get(port) : 0;
- // no server previously spawned
- if (useCount == 0) {
- TransientNameServer server =
- new TransientNameServer("localhost", port, TransientNameService.DEFAULT_SERVICE_NAME);
- Thread thread = server.start();
- if (thread == null) {
- throw new CorbaHostException("TransientNameServer couldn't be started");
- } else {
- localServers.put(port, server);
- }
- }
- clientsCount.put(port, ++useCount);
- }
-
- /**
- * Stops transient name server if there is only one client left using such
- * TNS. Decrements clients counter if TNS is used by 2 or more clients.
- */
- synchronized private void releaseLocalNameServer(int port) throws CorbaHostException {
- int useCount = clientsCount.containsKey(port) ? clientsCount.get(port) : 0;
- if (useCount == 1) {
- // last client executed stop, cleaning up
- TransientNameServer server = localServers.get(port);
- if (server != null) {
- server.stop();
- clientsCount.remove(port);
- localServers.remove(port);
- } else {
- logger.warning("Local name server on port " + port + " was null!");
- }
- } else if (useCount > 1) {
- clientsCount.put(port, --useCount);
- } else {
- logger.warning("Tried to release non existing local name server on port " + port);
- }
-
- }
-
- public void stop() {
- for (TransientNameServer tns : localServers.values()) {
- tns.stop();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse-tns/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-android/modules/host-corba-jse-tns/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index 906ec4efce..0000000000
--- a/branches/sca-android/modules/host-corba-jse-tns/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.host.corba.jse.tns.CorbaRuntimeModuleActivator
diff --git a/branches/sca-android/modules/host-corba-jse-tns/src/test/java/org/apache/tuscany/sca/host/corba/testing/TnsDefaultCorbaHostTestCase.java b/branches/sca-android/modules/host-corba-jse-tns/src/test/java/org/apache/tuscany/sca/host/corba/testing/TnsDefaultCorbaHostTestCase.java
deleted file mode 100644
index 9f6be0f27d..0000000000
--- a/branches/sca-android/modules/host-corba-jse-tns/src/test/java/org/apache/tuscany/sca/host/corba/testing/TnsDefaultCorbaHostTestCase.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.host.corba.testing;
-
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import java.net.Socket;
-import java.net.SocketException;
-
-import org.apache.tuscany.sca.binding.corba.impl.service.DynaCorbaServant;
-import org.apache.tuscany.sca.host.corba.jse.tns.TnsDefaultCorbaHost;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- * General tests
- */
-public class TnsDefaultCorbaHostTestCase {
-
- private static TnsDefaultCorbaHost host;
-
- @BeforeClass
- public static void start() {
- try {
- host = new TnsDefaultCorbaHost();
- } catch (Throwable e) {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
-
- @AfterClass
- public static void stop() {
- host.stop();
- }
-
- /**
- * Test for creating and releasing local name server
- */
- @Test
- public void test_localNameServer() {
- int testPort = 5070;
- try {
- String testUri1 = "corbaname::localhost:" + testPort + "#Test1";
- String testUri2 = "corbaname::localhost:" + testPort + "#Test2";
- String testUri3 = "corbaname::localhost:" + testPort + "#Test3";
- DynaCorbaServant servant = new DynaCorbaServant(null, "IDL:org/apache/tuscany:1.0");
- host.registerServant(testUri1, servant);
- host.registerServant(testUri2, servant);
- host.registerServant(testUri3, servant);
- Thread.sleep(1000);
- // make test connection to name server
- Socket socket = new Socket("localhost", testPort);
- socket.close();
- // and stop server
- host.unregisterServant(testUri1);
- host.unregisterServant(testUri2);
- // after releasing 2 clients 3rd should still hold the server
- socket = new Socket("localhost", testPort);
- socket.close();
- host.unregisterServant(testUri3);
- Thread.sleep(1000);
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- try {
- // previously made 3rd stop so there should be no name server under
- // this port
- new Socket("localhost", testPort);
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof SocketException);
- }
- }
-}
-
diff --git a/branches/sca-android/modules/host-corba-jse/LICENSE b/branches/sca-android/modules/host-corba-jse/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/host-corba-jse/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/host-corba-jse/META-INF/README b/branches/sca-android/modules/host-corba-jse/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-corba-jse/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-corba-jse/NOTICE b/branches/sca-android/modules/host-corba-jse/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/host-corba-jse/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/branches/sca-android/modules/host-corba-jse/pom.xml b/branches/sca-android/modules/host-corba-jse/pom.xml
deleted file mode 100644
index d0c4c53900..0000000000
--- a/branches/sca-android/modules/host-corba-jse/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>1.4-SNAPSHOT</version>
- </parent>
- <artifactId>tuscany-host-corba-jse</artifactId>
- <name>Apache Tuscany SCA JSE built-in CORBA Host</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.host.corba.jse</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.corba.jse*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/jse/CorbaRuntimeModuleActivator.java b/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/jse/CorbaRuntimeModuleActivator.java
deleted file mode 100644
index 252a1512e4..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/jse/CorbaRuntimeModuleActivator.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.host.corba.jse;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.host.corba.CorbaHostExtensionPoint;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CorbaRuntimeModuleActivator implements ModuleActivator {
- // private static final Logger logger =
- // Logger.getLogger(CorbaRuntimeModuleActivator.class.getName());
-
- private DefaultCorbaHost server;
-
- public void start(ExtensionPointRegistry extensionPointRegistry) {
-
- // Register our Corba host
- CorbaHostExtensionPoint corbaHosts = extensionPointRegistry.getExtensionPoint(CorbaHostExtensionPoint.class);
- server = new DefaultCorbaHost();
- corbaHosts.addCorbaHost(server);
- }
-
- public void stop(ExtensionPointRegistry registry) {
- if (server != null) {
- server.stop();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/jse/DefaultCorbaHost.java b/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/jse/DefaultCorbaHost.java
deleted file mode 100644
index 015644e19d..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/jse/DefaultCorbaHost.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.sca.host.corba.jse;
-
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.host.corba.CorbaHost;
-import org.apache.tuscany.sca.host.corba.CorbaHostException;
-import org.apache.tuscany.sca.host.corba.CorbaHostUtils;
-import org.apache.tuscany.sca.host.corba.CorbanameURL;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.Object;
-import org.omg.CosNaming.NameComponent;
-import org.omg.CosNaming.NamingContext;
-import org.omg.CosNaming.NamingContextExt;
-import org.omg.CosNaming.NamingContextExtHelper;
-import org.omg.CosNaming.NamingContextHelper;
-import org.omg.CosNaming.NamingContextPackage.InvalidName;
-import org.omg.CosNaming.NamingContextPackage.NotFound;
-
-/**
- * @version $Rev$ $Date$
- * Default implementation of JSE CORBA host
- */
-public class DefaultCorbaHost implements CorbaHost {
- private static final Logger logger = Logger.getLogger(DefaultCorbaHost.class.getName());
-
- private Map<String, ORB> orbs = new ConcurrentHashMap<String, ORB>();
-
- private void validatePort(int port) throws IllegalArgumentException {
- if (port < 1) {
- throw new IllegalArgumentException("Port value should be > 0");
- }
- }
-
- private NamingContextExt getNamingContext(ORB orb, String nameService) throws Exception {
- org.omg.CORBA.Object objRef = orb.resolve_initial_references(nameService);
- return NamingContextExtHelper.narrow(objRef);
- }
-
- private void handleException(Exception e) throws CorbaHostException {
- // The cause of the Exception is JDK specific
- if (e instanceof NotFound) {
- throw new CorbaHostException(CorbaHostException.NO_SUCH_OBJECT, e);
- } else if (e instanceof InvalidName) {
- throw new CorbaHostException(e);
- } else {
- throw new CorbaHostException(e);
- }
- }
-
- public void registerServant(String uri, Object servantObject) throws CorbaHostException {
- CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
- ORB orb = createORB(details.getHost(), details.getPort(), false);
- try {
- NamingContext namingCtx = getNamingContext(orb, details.getNameService());
- for (int i = 0; i < details.getNamePath().size() - 1; i++) {
- NameComponent nc = new NameComponent(details.getNamePath().get(i), "");
- NameComponent[] path = new NameComponent[] {nc};
- try {
- namingCtx = NamingContextHelper.narrow(namingCtx.resolve(path));
- } catch (Exception e) {
- namingCtx = namingCtx.bind_new_context(path);
- }
- }
- NameComponent finalName =
- new NameComponent(details.getNamePath().get(details.getNamePath().size() - 1), "");
- try {
- namingCtx.resolve(new NameComponent[] {finalName});
- // no exception means that some object is already registered
- // under this name, we need to crash here
- throw new CorbaHostException(CorbaHostException.BINDING_IN_USE);
- } catch (NotFound e) {
- namingCtx.bind(new NameComponent[] {finalName}, servantObject);
- }
- } catch (CorbaHostException e) {
- throw e;
- } catch (Exception e) {
- handleException(e);
- }
- }
-
- public void unregisterServant(String uri) throws CorbaHostException {
- CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
- ORB orb = createORB(details.getHost(), details.getPort(), false);
- try {
- NamingContextExt namingCtx = getNamingContext(orb, details.getNameService());
- namingCtx.unbind(namingCtx.to_name(details.getName()));
- } catch (Exception e) {
- handleException(e);
- }
- }
-
- public Object lookup(String uri) throws CorbaHostException {
- Object result = null;
- try {
- CorbanameURL url = new CorbanameURL(uri);
- ORB orb = createORB(url.getHost(), url.getPort(), false);
- NamingContextExt context = getNamingContext(orb, url.getNameService());
- result = context.resolve_str(url.getName());
- } catch (Exception e) {
- handleException(e);
- }
- if (result == null) {
- throw new CorbaHostException(CorbaHostException.NO_SUCH_OBJECT);
- }
- return result;
- }
-
- public ORB createORB(String host, int port, boolean server) throws CorbaHostException {
- validatePort(port);
-
- String key = host + ":" + port;
- ORB orb = orbs.get(key);
- if (orb != null) {
- return orb;
- }
- // Create an ORB object
- Properties props = new Properties();
- props.putAll(System.getProperties());
-
- String portStr = String.valueOf(port);
- props.put("org.omg.CORBA.ORBServerId", "1000000");
- props.put("org.omg.CORBA.ORBInitialHost", host);
- props.put("org.omg.CORBA.ORBInitialPort", portStr);
-
- // STEP 1: Set ORBPeristentServerPort property
- // Set the proprietary property to open up a port to listen to
- // INS requests.
-
- if (server) {
- props.put("com.sun.CORBA.POA.ORBPersistentServerPort", portStr);
- props.put("com.ibm.CORBA.ListenerPort", portStr);
- props.put("gnu.CORBA.ListenerPort", portStr);
- // props.put("org.omg.CORBA.ORBClass",
- // "org.apache.yoko.orb.CORBA.ORB");
- // props.put("org.omg.CORBA.ORBSingletonClass",
- // "org.apache.yoko.orb.CORBA.ORBSingleton");
- props.put("yoko.orb.oa.endpoint", "iiop --host " + host + " --port " + port);
- props.put("yoko.orb.poamanager.TNameService.endpoint", "iiop --host " + host);
- }
-
- String[] args = {"-ORBInitialHost", host, "-ORBInitialPort", "" + port};
- orb = ORB.init(args, props);
- orbs.put(key, orb);
- return orb;
- }
-
- public void stop() {
- for (ORB orb : orbs.values()) {
- try {
- orb.shutdown(true);
- orb.destroy();
- } catch (Throwable e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/NamingContextBase.java b/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/NamingContextBase.java
deleted file mode 100644
index 59f0ce9a53..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/NamingContextBase.java
+++ /dev/null
@@ -1,863 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
- * @version $Rev$ $Date$
- */
-
-package org.apache.tuscany.sca.host.corba.naming;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.omg.CORBA.BAD_PARAM;
-import org.omg.CORBA.CompletionStatus;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.SystemException;
-import org.omg.CosNaming.BindingType;
-import org.omg.CosNaming.BindingTypeHolder;
-import org.omg.CosNaming.NameComponent;
-import org.omg.CosNaming.NamingContext;
-import org.omg.CosNaming.NamingContextExtPOA;
-import org.omg.CosNaming.NamingContextHelper;
-import org.omg.CosNaming.NamingContextExtPackage.InvalidAddress;
-import org.omg.CosNaming.NamingContextPackage.AlreadyBound;
-import org.omg.CosNaming.NamingContextPackage.InvalidName;
-import org.omg.CosNaming.NamingContextPackage.NotFound;
-import org.omg.CosNaming.NamingContextPackage.NotFoundReason;
-import org.omg.PortableServer.POA;
-
-public abstract class NamingContextBase extends NamingContextExtPOA {
- // the real logger backing instance. We use the interface class as the locator
- protected static final Logger logger = Logger.getLogger(NamingContext.class.getName());
-
- // set of URL characters that don't require escaping when encoded.
- protected final String nonEscaped = ";/?:@&=+$;-_.!~* ()";
- // the orb we're attached to
- protected ORB orb;
- // the poa we're associated with
- protected POA poa;
-
- /**
- * Create a new base NamingContext (super class constructor
- * for the derived classes).
- *
- * @param orb The ORB this is hosted on.
- *
- * @exception java.lang.Exception
- */
- public NamingContextBase(ORB orb, POA poa) throws java.lang.Exception {
- super();
- this.orb = orb;
- this.poa = poa;
- }
-
- /**
- * Bind an object to a given name.
- *
- * @param n An array of NameComponents that are the target name.
- * The last element in the array is binding name for the
- * object. The remainder of the array is the path
- * for resolving the naming context, relative to the
- * current context. All path contexts must already be
- * bound in the context tree.
- * @param obj The object to be bound.
- *
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
- */
- public void bind(org.omg.CosNaming.NameComponent[] n, org.omg.CORBA.Object obj)
- throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed,
- org.omg.CosNaming.NamingContextPackage.InvalidName, org.omg.CosNaming.NamingContextPackage.AlreadyBound {
- // perform various name validations
- validateName(n);
-
- logNameComponent("bind() name", n);
-
- // do we need to push through to a deeper naming context first?
- if (n.length > 1) {
- // resolve the top level name to a context, and have that context
- // resolve the rest.
- NamingContext context = resolveContext(n[0]);
- NameComponent[] subName = extractSubName(n);
-
- // now pass this along to the next context for the real bind operation.
- context.bind(subName, obj);
- } else {
- NameComponent name = n[0];
- // we need the resolveObject() and bindObject() calls to be consistent, so
- // synchronize on this
- synchronized (this) {
- // see if we have this bound already...can't replace these.
- BindingTypeHolder type = new BindingTypeHolder();
- if (resolveObject(name, type) != null) {
- throw new AlreadyBound();
- }
- type.value = BindingType.nobject;
- // ok, this is a new binding, go do it.
- bindObject(name, obj, type);
- }
- }
- }
-
- /**
- * Rebind an object to a given name. If an object is
- * already bound with this name, the new object replaces
- * the bound object's value. If no object has been
- * bound already, this is the same as a bind operation.
- *
- * @param n An array of NameComponents that are the target name.
- * The last element in the array is binding name for the
- * object. The remainder of the array is the path
- * for resolving the naming context, relative to the
- * current context. All path contexts must already be
- * bound in the context tree.
- * @param obj The new value for this binding.
- *
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
- */
- public void rebind(org.omg.CosNaming.NameComponent[] n, org.omg.CORBA.Object obj)
- throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed,
- org.omg.CosNaming.NamingContextPackage.InvalidName {
- // perform various name validations
- validateName(n);
-
- logNameComponent("rebind() name", n);
-
- // do we need to push through to a deeper naming context first?
- if (n.length > 1) {
- // resolve the top level name to a context, and have that context
- // resolve the rest.
- NamingContext context = resolveContext(n[0]);
- NameComponent[] subName = extractSubName(n);
-
- // now pass this along to the next context for the real bind operation.
- context.rebind(subName, obj);
- } else {
- NameComponent name = n[0];
- // we need the resolveObject() and bindObject() calls to be consistent, so
- // synchronize on this
- synchronized (this) {
- // see if we have this bound already...can't replace these.
- BindingTypeHolder type = new BindingTypeHolder();
- // for a rebind, we must have an object, and it must be a real object
- if (resolveObject(name, type) != null) {
- // it has to resolve to a real object. If it is a naming context,
- // then this is the wrong binding operation.
- if (type.value.value() == BindingType._ncontext) {
- throw new NotFound(NotFoundReason.not_object, n);
- }
- // safe to unbind
- unbindObject(name);
- }
- type.value = BindingType.nobject;
- // now bind this object
- bindObject(name, obj, type);
- }
- }
- }
-
- /**
- * Bind a new context to a given name.
- *
- * @param n An array of NameComponents that are the target name.
- * The last element in the array is binding name for the
- * object. The remainder of the array is the path
- * for resolving the naming context, relative to the
- * current context. All path contexts must already be
- * bound in the context tree.
- * @param nc The new naming context added to the tree.
- *
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
- */
- public void bind_context(org.omg.CosNaming.NameComponent[] n, org.omg.CosNaming.NamingContext nc)
- throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed,
- org.omg.CosNaming.NamingContextPackage.InvalidName, org.omg.CosNaming.NamingContextPackage.AlreadyBound {
- // perform various name validations
- validateName(n);
-
- logNameComponent("bind_context() name", n);
-
- // do we need to push through to a deeper naming context first?
- if (n.length > 1) {
- // resolve the top level name to a context, and have that context
- // resolve the rest.
- NamingContext context = resolveContext(n[0]);
- NameComponent[] subName = extractSubName(n);
-
- // now pass this along to the next context for the real bind operation.
- context.bind_context(subName, nc);
- } else {
- NameComponent name = n[0];
- // we need the resolveObject() and bindObject() calls to be consistent, so
- // synchronize on this
- synchronized (this) {
- // see if we have this bound already...can't replace these.
- BindingTypeHolder type = new BindingTypeHolder();
- if (resolveObject(name, type) != null) {
- throw new AlreadyBound();
- }
- type.value = BindingType.ncontext;
- // ok, this is a new binding, go do it.
- bindObject(name, nc, type);
- }
- }
- }
-
- /**
- * Rebind a context to a given name. If a context is
- * already bound with this name, the new context replaces
- * the existing context. If no context has been
- * bound already, this is the same as a bind operation.
- *
- * @param n An array of NameComponents that are the target name.
- * The last element in the array is binding name for the
- * object. The remainder of the array is the path
- * for resolving the naming context, relative to the
- * current context. All path contexts must already be
- * bound in the context tree.
- * @param nc The new context to be bound with the name.
- *
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
- */
- public void rebind_context(org.omg.CosNaming.NameComponent[] n, org.omg.CosNaming.NamingContext nc)
- throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed,
- org.omg.CosNaming.NamingContextPackage.InvalidName {
- // perform various name validations
- validateName(n);
-
- logNameComponent("rebind_context() name", n);
-
- // do we need to push through to a deeper naming context first?
- if (n.length > 1) {
- // resolve the top level name to a context, and have that context
- // resolve the rest.
- NamingContext context = resolveContext(n[0]);
- NameComponent[] subName = extractSubName(n);
-
- // now pass this along to the next context for the real bind operation.
- context.rebind_context(subName, nc);
- } else {
- NameComponent name = n[0];
- // we need the resolveObject() and bindObject() calls to be consistent, so
- // synchronize on this
- synchronized (this) {
- // see if we have this bound already...can't replace these.
- BindingTypeHolder type = new BindingTypeHolder();
- // for a rebind, we must have an object, and it must be a real object
- if (resolveObject(name, type) != null) {
- // it has to resolve to a real object. If it is a naming context,
- // then this is the wrong binding operation.
- if (type.value.value() != BindingType._ncontext) {
- throw new NotFound(NotFoundReason.not_context, n);
- }
- // safe to unbind
- unbindObject(name);
- }
- type.value = BindingType.ncontext;
- // now bind this object
- bindObject(name, nc, type);
- }
- }
- }
-
- /**
- * Resolve an an entry in the context tree. The
- * resolved object may be a bound object or another
- * NamingContext. If the named entry is not found,
- * a NotFound exception is thrown.
- *
- * @param n An array of NameComponents that are the target name.
- * The last element in the array is binding name for the
- * object. The remainder of the array is the path
- * for resolving the naming context, relative to the
- * current context. All path contexts must already be
- * bound in the context tree.
- *
- * @return The object bound at the indicated location.
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
- */
- public org.omg.CORBA.Object resolve(org.omg.CosNaming.NameComponent[] n)
- throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed,
- org.omg.CosNaming.NamingContextPackage.InvalidName {
- // perform various name validations
- validateName(n);
-
- logNameComponent("resolve() name", n);
-
- // do we need to push through to a deeper naming context first?
- if (n.length > 1) {
- // resolve the top level name to a context, and have that context
- // resolve the rest.
- NamingContext context = resolveContext(n[0]);
- NameComponent[] subName = extractSubName(n);
-
- // now pass this along to the next context for the real bind operation.
- return context.resolve(subName);
- } else {
- NameComponent name = n[0];
- // see if we have this bound already...can't replace these.
- BindingTypeHolder type = new BindingTypeHolder();
- org.omg.CORBA.Object obj = resolveObject(name, type);
- if (obj == null) {
- // Object was not found
- throw new NotFound(NotFoundReason.missing_node, n);
- }
- return obj;
- }
- }
-
- /**
- * Remove an entry from the context tree. The
- * target object may be a bound object or another
- * NamingContext. If the named entry is not found,
- * a NotFound exception is thrown.
- *
- * @param n An array of NameComponents that are the target name.
- * The last element in the array is binding name for the
- * object. The remainder of the array is the path
- * for resolving the naming context, relative to the
- * current context. All path contexts must already be
- * bound in the context tree.
- *
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
- */
- public void unbind(org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.NotFound,
- org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName {
- // perform various name validations
- validateName(n);
-
- logNameComponent("unbind() name", n);
-
- // do we need to push through to a deeper naming context first?
- if (n.length > 1) {
- // resolve the top level name to a context, and have that context
- // resolve the rest.
- NamingContext context = resolveContext(n[0]);
- NameComponent[] subName = extractSubName(n);
-
- // now pass this along to the next context for the real bind operation.
- context.unbind(subName);
- } else {
- NameComponent name = n[0];
- synchronized (this) {
- // see if we have this bound already...can't replace these.
- BindingTypeHolder type = new BindingTypeHolder();
- org.omg.CORBA.Object obj = unbindObject(name);
- if (obj == null) {
- // Object was not found
- throw new NotFound(NotFoundReason.missing_node, n);
- }
- }
- }
- }
-
- /**
- * Create a new context and bind it in at the target
- * location.
- *
- * @param n An array of NameComponents that are the target name.
- * The last element in the array is binding name for the
- * object. The remainder of the array is the path
- * for resolving the naming context, relative to the
- * current context. All path contexts must already be
- * bound in the context tree.
- *
- * @return The newly created context.
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
- */
- public synchronized org.omg.CosNaming.NamingContext bind_new_context(org.omg.CosNaming.NameComponent[] n)
- throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.AlreadyBound,
- org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName {
- logNameComponent("bind_new_context() name", n);
-
- NamingContext context = new_context();
- try {
- bind_context(n, context);
- NamingContext returnContext = context;
- // transfer this to another variable so the finally block doesn't try to destroy this.
- context = null;
- return returnContext;
- } finally {
- // if there is a bind failure on this, we need to ensure the context has
- // an opportunity to clean up any of its resources.
- if (context != null) {
- try {
- context.destroy();
- } catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e) {
- // new contexts should be empty.
- }
- }
- }
- }
-
- /**
- * Convert an array of NameComponents into the string
- * form of a context name.
- *
- * @param n The array of NameComponents to convert.
- *
- * @return The context name, in string form.
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- */
- public String to_string(org.omg.CosNaming.NameComponent[] n)
- throws org.omg.CosNaming.NamingContextPackage.InvalidName {
- validateName(n);
-
- logNameComponent("to_string() name", n);
-
- // convert the first part of the name
- StringBuffer value = new StringBuffer();
- ;
- // convert the first component, then build up from there.
- nameToString(n[0], value);
-
- // the remainder need to get a separator
- for (int i = 1; i < n.length; i++) {
- value.append('/');
- nameToString(n[i], value);
- }
- return value.toString();
- }
-
- /**
- * Perform the reverse operation of the to_string() method,
- * parsing a String context name into an array of
- * NameComponents.
- *
- * @param sn The string form of the name.
- *
- * @return An array of NameComponents parsed from the String name.
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- */
- public org.omg.CosNaming.NameComponent[] to_name(String sn)
- throws org.omg.CosNaming.NamingContextPackage.InvalidName {
- // must have a argument to parse
- if (sn == null || sn.length() == 0) {
- throw new InvalidName();
- }
-
- List components = new ArrayList();
-
- StringBuffer component = new StringBuffer();
-
- int index = 0;
- String id = null;
- String kind = null;
- while (index < sn.length()) {
- char ch = sn.charAt(index++);
-
- // found an escape character or a delimiter?
- if (ch == '\\') {
- // nothing after the escape? Trouble
- if (index >= sn.length()) {
- throw new InvalidName();
- }
- // get the next character
- ch = sn.charAt(index++);
- component.append(ch);
- }
- // we need to process the periods here, to avoid getting
- // mixed up with unescaped periods.
- else if (ch == '.') {
- // already seen a period while scanning? That's not allowed
- if (id != null) {
- throw new InvalidName();
- }
- // pull off the id piece and reset the buffer
- id = component.toString();
- component.setLength(0);
- }
- // found a component delimiter?
- else if (ch == '/') {
- // not seen a id/kind separator yet? This is an id with no kind
- if (id == null) {
- id = component.toString();
- kind = "";
- } else {
- // we have an id already, pull off the kind
- kind = component.toString();
- }
- // add the parsed name component
- components.add(new NameComponent(id, kind));
- // make sure these are all reset after pulling off a component
- component.setLength(0);
- id = null;
- kind = null;
- } else {
- component.append(ch);
- }
- }
-
- // parse the last section
- // not seen a id/kind separator yet? This is an id with no kind
- if (id == null) {
- id = component.toString();
- kind = "";
- } else {
- // we have an id already, pull off the kind
- kind = component.toString();
- }
- // add the parsed name component
- components.add(new NameComponent(id, kind));
-
- // and turn this into a component array
- return (NameComponent[])components.toArray(new NameComponent[components.size()]);
- }
-
- /**
- * Create a URL name for accessing a component by name. The
- * URL will have a corbaname: protocol.
- *
- * @param addr The address location for the naming service used
- * to resolve the object. This is in "host:port" form,
- * just line a corbaloc: URL.
- * @param sn The string mae of the target object.
- *
- * @return A URL for accessing this object, in String form.
- * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidAddress
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- */
- public String to_url(String addr, String sn) throws org.omg.CosNaming.NamingContextExtPackage.InvalidAddress,
- org.omg.CosNaming.NamingContextPackage.InvalidName {
- // basic validation
- if (addr == null || addr.length() == 0) {
- throw new InvalidAddress();
- }
-
- if (sn == null || sn.length() == 0) {
- throw new InvalidName();
- }
-
- // TODO: What validation, if any, needs to be done here?
- return "corbaname:" + addr + "#" + encodeRFC2396Name(sn);
- }
-
- /**
- * Resolve a bound object or context using a name
- * in String form.
- *
- * @param n The string name of the object context. This must
- * be a form parseable by to_name().
- *
- * @return The bound object or context.
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
- * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
- */
- public org.omg.CORBA.Object resolve_str(String n) throws org.omg.CosNaming.NamingContextPackage.NotFound,
- org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName {
- // this is just a simple convenience method
- return resolve(to_name(n));
- }
-
- // abstract methods that are part of the NamingContext interface that need to be
- // implemented by the subclasses.
-
- /**
- * Create a new context of the same type as the
- * calling context.
- *
- * @return A new NamingContext item.
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- * @exception SystemException
- */
- public abstract org.omg.CosNaming.NamingContext new_context() throws SystemException;
-
- /**
- * Destroy a context. This method should clean up
- * any backing resources associated with the context.
- *
- * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty
- */
- public abstract void destroy() throws org.omg.CosNaming.NamingContextPackage.NotEmpty;
-
- /**
- * Create a list of bound objects an contexts contained
- * within this context.
- *
- * @param how_many The count of elements to return as a BindingList.
- * @param bl A holder element for returning the source binding list.
- * @param bi A holder for returning a BindingIterator. Any extra
- * elements not returned in the BindingList are returned
- * in the BindingIterator.
- *
- * @exception SystemException
- */
- public abstract void list(int how_many,
- org.omg.CosNaming.BindingListHolder bl,
- org.omg.CosNaming.BindingIteratorHolder bi) throws SystemException;
-
- // abstract methods for the sub class to implement
-
- /**
- * Resolve an object in this context (single level
- * resolution).
- *
- * @param n The name of the target object.
- * @param type A type holder for returning the bound object type
- * information.
- *
- * @return The bound object. Returns null if the object does not
- * exist in the context.
- * @exception SystemException
- */
- protected abstract org.omg.CORBA.Object resolveObject(NameComponent n, BindingTypeHolder type)
- throws SystemException;
-
- /**
- * Bind an object into the current context. This can
- * be either an object or a naming context.
- *
- * @param n The single-level name of the target object.
- * @param obj The object or context to be bound.
- * @param type
- *
- * @exception SystemException
- */
- protected abstract void bindObject(NameComponent n, org.omg.CORBA.Object obj, BindingTypeHolder type)
- throws SystemException;
-
- /**
- * Unbind an object from the current context.
- *
- * @param n The name of the target object (single level).
- *
- * @return The object associated with the binding. Returns null
- * if there was no binding currently associated with this
- * name.
- * @exception SystemException
- */
- protected abstract org.omg.CORBA.Object unbindObject(NameComponent n) throws SystemException;
-
- // implementation specific routines
-
- /**
- * Resolve a name to a context object stored that has
- * already been stored in this context. Throws an exception
- * if the name cannot be resolved or if the resolved
- * object is not a naming context.
- *
- * @param name The target name.
- *
- * @return The resolved NamingContext object.
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- */
- protected synchronized NamingContext resolveContext(NameComponent name)
- throws org.omg.CosNaming.NamingContextPackage.NotFound {
- BindingTypeHolder type = new BindingTypeHolder();
- // Resolve this to an object. We must be able to resolve this.
- org.omg.CORBA.Object resolvedReference = resolveObject(name, type);
- if (resolvedReference == null) {
- throw new NotFound(NotFoundReason.missing_node, new NameComponent[] {name});
- }
-
- // it has to resolve to a naming context
- if (type.value.value() != BindingType._ncontext) {
- throw new NotFound(NotFoundReason.not_context, new NameComponent[] {name});
- }
-
- // in theory, this is a naming context. Narrow it an return. Any
- // errors just become a NotFound exception
- try {
- return NamingContextHelper.narrow(resolvedReference);
- } catch (org.omg.CORBA.BAD_PARAM ex) {
- throw new NotFound(NotFoundReason.not_context, new NameComponent[] {name});
- }
- }
-
- /**
- * Extract the tail portion of a name. This is used
- * to strip off the first name element so we can recurse
- * on the name resolutions with a resolved context.
- *
- * @param name The current name array (this MUST have 2 or more
- * elements).
- *
- * @return An array of NameComponent items that is one element
- * smaller than the argument array, with the elements
- * shifted over.
- */
- protected NameComponent[] extractSubName(NameComponent[] name) {
- NameComponent[] subName = new NameComponent[name.length - 1];
- System.arraycopy(name, 1, subName, 0, name.length - 1);
- return subName;
- }
-
- /**
- * Perform common name validity checking.
- *
- * @param n The NameComponent array to check.
- *
- * @exception InvalidName
- */
- protected void validateName(NameComponent[] n) throws InvalidName {
- // perform various name validations
- if (n == null) {
- throw new BAD_PARAM(27 | org.omg.CORBA.OMGVMCID.value, CompletionStatus.COMPLETED_NO);
- }
-
- // Valid name?
- if (n.length < 1) {
- throw new InvalidName();
- }
-
- // we have at least one name, so validate the toplevel item
- NameComponent name = n[0];
-
- // more name validation
- if (name.id.length() == 0 && name.kind.length() == 0) {
- throw new InvalidName();
- }
- }
-
- /**
- * Convert a NameComponent item into a string form,
- * appending it to a StringBuffer.
- *
- * @param name The source NameComponent.
- * @param out The StringBuffer location used to store the name
- * value (appended to the end).
- */
- protected void nameToString(NameComponent name, StringBuffer out) {
- // if the id is null, then we base off of the kind.
- if (name.id == null || name.id.length() == 0) {
- out.append(".");
- // true null name element? That displays as a "."
- if (name.kind != null && name.kind.length() != 0) {
- escapeName(name.kind, out);
- }
- } else {
- // escape the name
- escapeName(name.id, out);
- // have a kind qualifier to add on?
- if (name.kind != null && name.kind.length() != 0) {
- out.append(".");
- escapeName(name.kind, out);
- }
- }
- }
-
- /**
- * Process a name or kind element of a NameComponent,
- * adding escape characters for '.' or '/' characters
- * that might appear in the name.
- *
- * @param name The name element to process.
- * @param out The StringBuffer to copy the escaped name into.
- */
- protected void escapeName(String name, StringBuffer out) {
- // no characters requiring escapes (common)?
- // use this directly
- if (name.indexOf('.') == -1 && name.indexOf('/') == -1) {
- out.append(name);
- } else {
- // scan the string adding the escapes
- for (int i = 0; i < name.length(); i++) {
- char ch = name.charAt(i);
- if (ch == '.' || ch == '/') {
- out.append('/');
- }
- out.append(ch);
- }
- }
- }
-
- /**
- * Perform RFC 2396 escape encoding of a name value.
- *
- * @param name The input name value.
- *
- * @return An encoded name, with special characters converted
- * into a hex encoded value.
- */
- protected String encodeRFC2396Name(String name) {
- StringBuffer value = new StringBuffer();
-
- for (int i = 0; i < name.length(); i++) {
- char ch = name.charAt(i);
-
- // Alphanumerics and the "acceptable" set of special characters just get copied
- // without encoding.
- if (Character.isLetterOrDigit(ch) || nonEscaped.indexOf(ch) != -1) {
- value.append(ch);
- } else {
- // this gets converted into a hex value, marked by "%".
- value.append('%');
- value.append(Integer.toHexString((int)ch));
- }
- }
- return value.toString();
- }
-
- /**
- * Test if debug logging is currently available.
- *
- * @return True if debug level (FINE) logging is currently turned on.
- */
- protected boolean isDebugEnabled() {
- return logger.isLoggable(Level.FINE);
- }
-
- /**
- * Log a line of debug output
- *
- * @param message The message to log
- */
- protected void debug(String message) {
- logger.fine(message);
- }
-
- /**
- * Log the name components passed in for a request.
- *
- * @param message A message describing the request context.
- * @param n The array of name components.
- */
- protected void logNameComponent(String message, NameComponent[] n) {
- if (isDebugEnabled()) {
- debug(message);
- for (int i = 0; i < n.length; i++) {
- debug(" NameComponent " + i + " id=" + n[i].id + " kind=" + n[i].kind);
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameServer.java b/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameServer.java
deleted file mode 100644
index 599f5bca54..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameServer.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.
- */
-
-/**
- * @version $Rev$ $Date$
- */
-package org.apache.tuscany.sca.host.corba.naming;
-
-import org.omg.CORBA.ORB;
-
-/**
- * A stand-alone naming service launchable from a command line.
- */
-public class TransientNameServer {
- private final TransientNameService service;
- private final Object flag = new Object();
- private Boolean started;
-
- public TransientNameServer(String host, int port, String serviceName) {
- this.service = new TransientNameService(host, port, serviceName);
- }
-
- public ORB getORB() {
- return service.getORB();
- }
-
- public Thread start() {
- Thread t = new Thread() {
- public void run() {
- ORB orb = null;
- synchronized (flag) {
- try {
- service.run();
- orb = service.getORB();
- started = Boolean.TRUE;
- } catch (Throwable e) {
- started = Boolean.FALSE;
- throw new IllegalStateException(e);
- } finally {
- flag.notifyAll();
- }
- }
- // Wait for requests
- orb.run();
- }
- };
- t.setDaemon(true);
- t.start();
- checkState();
- return t.isAlive() ? t : null;
- }
-
- private Boolean checkState() {
- synchronized (flag) {
- while (started == null) {
- try {
- flag.wait();
- } catch (InterruptedException e) {
- return null;
- }
- }
- return started;
- }
- }
-
- public void stop() {
- if (started == Boolean.TRUE) {
- service.destroy();
- }
- }
-
- /**
- * Launch a name service as a stand alone process. The
- * Host, port, and service name are controlled using
- * program arguments.
- *
- * @param args The array of arguments for tailoring the service.
- *
- * @exception Exception
- */
- public static void main(String args[]) throws Exception {
- int port = TransientNameService.DEFAULT_SERVICE_PORT;
- String host = TransientNameService.DEFAULT_SERVICE_HOST;
- String serviceName = TransientNameService.DEFAULT_SERVICE_NAME;
-
- // see if we have
- for (int i = 0; i < args.length; i++) {
- if (args[i].equals("-ORBInitialPort")) {
- i++;
- if (i < args.length) {
- port = java.lang.Integer.parseInt(args[i]);
- } else {
- throw new IllegalArgumentException("Invalid -ORBInitialPort option");
- }
- } else if (args[i].equals("-ORBInitialHost")) {
- i++;
- if (i < args.length) {
- host = args[i];
- } else {
- throw new IllegalArgumentException("Invalid -ORBInitialHost option");
- }
- } else if (args[i].equals("-ORBServiceName")) {
- i++;
- if (i < args.length) {
- serviceName = args[i];
- } else {
- throw new IllegalArgumentException("Invalid -ORBServiceName option");
- }
- }
-
- }
- // create a services, and just spin it off. We wait forever after that.
- TransientNameServer server = new TransientNameServer(host, port, serviceName);
- server.start().join();
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameService.java b/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameService.java
deleted file mode 100644
index 77617a6c5c..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameService.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.
- */
-
-/**
- * @version $Rev$ $Date$
- */
-package org.apache.tuscany.sca.host.corba.naming;
-
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.Properties;
-
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.Policy;
-import org.omg.PortableServer.IdAssignmentPolicyValue;
-import org.omg.PortableServer.LifespanPolicyValue;
-import org.omg.PortableServer.POA;
-import org.omg.PortableServer.ServantRetentionPolicyValue;
-
-/**
- * A transient name service attached to an ORB. This
- * class manages all of the housekeeping for creating a
- * TransientNamingContext and a exposing it using an
- * ORB.
- */
-public class TransientNameService {
- // the default registered name service
- static public final String DEFAULT_SERVICE_NAME = "TNameService";
- // the default listening port
- static public final int DEFAULT_SERVICE_PORT = 900;
- // the default host name
- static public final String DEFAULT_SERVICE_HOST = "localhost";
-
- // the service root context
- protected TransientNamingContext initialContext;
- // initial listening port
- protected int port;
- // initial listening host
- protected String host;
- // the service name (used for registing for the corbaloc:: URL name
- protected String serviceName;
- // the orb instance we're running on
- protected ORB createdOrb;
-
- /**
- * Create a new TransientNameService, using all default
- * attributes.
- */
- public TransientNameService() {
- this(DEFAULT_SERVICE_HOST, DEFAULT_SERVICE_PORT, DEFAULT_SERVICE_NAME);
- }
-
- /**
- * Create a default-named name service using the specified
- * host and port parameters.
- *
- * @param host The host to expose this under.
- * @param port The initial listening port.
- */
- public TransientNameService(String host, int port) {
- this(host, port, DEFAULT_SERVICE_NAME);
- }
-
- /**
- * Create a specifically-named name service using the specified
- * host and port parameters.
- *
- * @param host The host to expose this under.
- * @param port The initial listening port.
- * @param name The name to register this service under using the
- * BootManager.
- */
- public TransientNameService(String host, int port, String name) {
- this.port = port;
- this.host = host;
- this.serviceName = name;
- }
-
- /**
- * Start up the name service, including creating an
- * ORB instance to expose it under.
- *
- * @exception TransientServiceException
- */
- public void run() throws TransientServiceException {
- // Create an ORB object
- Properties props = new Properties();
- props.putAll(System.getProperties());
-
- String portStr = String.valueOf(port);
- props.put("org.omg.CORBA.ORBServerId", "1000000");
- props.put("org.omg.CORBA.ORBInitialHost", host);
- props.put("org.omg.CORBA.ORBInitialPort", portStr);
-
- // STEP 1: Set ORBPeristentServerPort property
- // Set the proprietary property to open up a port to listen to
- // INS requests.
-
- props.put("com.sun.CORBA.POA.ORBPersistentServerPort", portStr);
- props.put("com.ibm.CORBA.ListenerPort", portStr);
- props.put("gnu.CORBA.ListenerPort", portStr);
- // props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB");
- // props.put("org.omg.CORBA.ORBSingletonClass", "org.apache.yoko.orb.CORBA.ORBSingleton");
- props.put("yoko.orb.oa.endpoint", "iiop --host " + host + " --port " + port);
- props.put("yoko.orb.poamanager.TNameService.endpoint", "iiop --host " + host);
-
- String[] args = {"-ORBInitialHost", host, "-ORBInitialPort", "" + port};
- createdOrb = ORB.init(args, props);
-
- // now initialize the service
- initialize(createdOrb);
-
- }
-
- /**
- * Initialize a transient name service on a specific
- * ORB.
- *
- * @param orb The ORB hosting the service.
- *
- * @exception TransientServiceException
- */
- public void initialize(ORB orb) throws TransientServiceException {
- try {
- // get the root POA. We're going to re
- POA rootPOA = (POA)orb.resolve_initial_references("RootPOA");
- rootPOA.the_POAManager().activate();
-
- // we need to create a POA to manage this named instance, and then activate
- // a context on it.
- Policy[] policy = new Policy[3];
- policy[0] = rootPOA.create_lifespan_policy(LifespanPolicyValue.TRANSIENT);
- policy[1] = rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.SYSTEM_ID);
- policy[2] = rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETAIN);
-
- POA nameServicePOA = rootPOA.create_POA("TNameService", null, policy);
- nameServicePOA.the_POAManager().activate();
-
- // create our initial context, and register that with the ORB as the name service
- initialContext = new TransientNamingContext(orb, nameServicePOA);
- org.omg.CORBA.Object context = initialContext.getRootContext();
- Method method =
- orb.getClass().getMethod("register_initial_reference", String.class, org.omg.CORBA.Object.class);
- method.invoke(orb, serviceName, context);
- method.invoke(orb, "NamingService", context);
- method.invoke(orb, "NameService", context);
- } catch (Exception e) {
- throw new TransientServiceException("Unable to initialize name service", e);
- }
- }
-
- /**
- * Destroy the created service.
- */
- public void destroy() {
- // only destroy this if we created the orb instance.
- if (createdOrb != null) {
- createdOrb.shutdown(false);
- createdOrb.destroy();
-
- try {
- // This is a workaround to close the sockets for SUN ORB
- Method m = createdOrb.getClass().getMethod("getTransportManager");
- Object tm = m.invoke(createdOrb);
- m = tm.getClass().getMethod("close");
- m.invoke(tm);
- m = tm.getClass().getMethod("getAcceptors");
- Collection acceptors = (Collection) m.invoke(tm);
- for(Object a: acceptors) {
- m = a.getClass().getMethod("close");
- m.invoke(a);
- }
- } catch (Throwable e) {
- // Ignore
- }
- createdOrb = null;
- }
- }
-
- public ORB getORB() {
- return createdOrb;
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNamingContext.java b/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNamingContext.java
deleted file mode 100644
index a7164e9ef3..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNamingContext.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
- * @version $Rev$ $Date$
- */
-
-package org.apache.tuscany.sca.host.corba.naming;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.omg.CORBA.INTERNAL;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.SystemException;
-import org.omg.CosNaming.Binding;
-import org.omg.CosNaming.BindingHolder;
-import org.omg.CosNaming.BindingIteratorHelper;
-import org.omg.CosNaming.BindingIteratorPOA;
-import org.omg.CosNaming.BindingType;
-import org.omg.CosNaming.BindingTypeHolder;
-import org.omg.CosNaming.NameComponent;
-import org.omg.CosNaming.NamingContext;
-import org.omg.CosNaming.NamingContextHelper;
-import org.omg.CosNaming.NamingContextPackage.NotEmpty;
-import org.omg.PortableServer.POA;
-
-public class TransientNamingContext extends NamingContextBase {
- // the bindings maintained by this context
- protected HashMap bindings = new HashMap();
- // the root context object
- protected org.omg.CORBA.Object rootContext = null;
-
- /**
- * Create a top-level naming context.
- *
- * @param orb The orb hosting this context.
- * @param poa The POA used to activate the object.
- *
- * @exception Exception
- */
- public TransientNamingContext(ORB orb, POA poa) throws Exception {
- this(orb, poa, null);
- // now get the initial root context as a corba object.
-
- byte[] objectId = poa.activate_object(this);
- rootContext = poa.id_to_reference(objectId);
-
- }
-
- /**
- * Construct a TransientNamingContext subcontext.
- *
- * @param orb The orb this context is associated with.
- * @param poa The POA the root context is activated under.
- * @param root The root context.
- *
- * @exception Exception
- */
- public TransientNamingContext(ORB orb, POA poa, org.omg.CORBA.Object root) throws Exception {
- super(orb, poa);
- // save the root context link.
- rootContext = root;
- }
-
- // abstract methods part of the interface contract that the implementation is required
- // to supply.
-
- /**
- * Create a new context of the same type as the
- * calling context.
- *
- * @return A new NamingContext item.
- * @exception org.omg.CosNaming.NamingContextPackage.NotFound
- * @exception SystemException
- */
- public NamingContext new_context() throws SystemException {
- try {
- // create a new context. Then we need to register this with the POA and activate it.
- TransientNamingContext newContext = new TransientNamingContext(orb, poa, rootContext);
-
- byte[] objectId = poa.activate_object(newContext);
- org.omg.CORBA.Object obj = poa.id_to_reference(objectId);
- return NamingContextHelper.narrow(obj);
- } catch (SystemException e) {
- // just propagate system exceptions
- throw e;
- } catch (Exception e) {
- throw (INTERNAL)(new INTERNAL("Unable to create new naming context").initCause(e));
- }
- }
-
- /**
- * Destroy a context. This method should clean up
- * any backing resources associated with the context.
- *
- * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty
- */
- public synchronized void destroy() throws org.omg.CosNaming.NamingContextPackage.NotEmpty {
- // still holding bound objects? Not allowed to destroy
- if (!bindings.isEmpty()) {
- throw new NotEmpty();
- }
-
- try {
- // now detach ourselves from the POA
- byte[] objectId = poa.servant_to_id(this);
- if (objectId != null) {
- poa.deactivate_object(objectId);
- }
- } catch (Exception e) {
- // ignore
- }
- }
-
- /**
- * Create a list of bound objects an contexts contained
- * within this context.
- *
- * @param how_many The count of elements to return as a BindingList.
- * @param bl A holder element for returning the source binding list.
- * @param bi A holder for returning a BindingIterator. Any extra
- * elements not returned in the BindingList are returned
- * in the BindingIterator.
- *
- * @exception SystemException
- */
- public synchronized void list(int how_many,
- org.omg.CosNaming.BindingListHolder bl,
- org.omg.CosNaming.BindingIteratorHolder bi) throws SystemException {
- TransientBindingIterator iterator = new TransientBindingIterator(poa, (HashMap)bindings.clone());
- // have the iterator fill in the entries here
- iterator.next_n(how_many, bl);
-
- // now it's necessary to activate this iterator with the poa. The value we pass
- // back is the narrowed activated object
- try {
- byte[] objectId = poa.activate_object(iterator);
- org.omg.CORBA.Object obj = poa.id_to_reference(objectId);
-
- bi.value = BindingIteratorHelper.narrow(obj);
- } catch (SystemException e) {
- // just propagate system exceptions
- throw e;
- } catch (Exception e) {
- throw (INTERNAL)(new INTERNAL("Unable to activate BindingIterator").initCause(e));
- }
- }
-
- // lower level functions that are used by the base class
-
- /**
- * Resolve an object in this context (single level
- * resolution).
- *
- * @param n The name of the target object.
- * @param type A type holder for returning the bound object type
- * information.
- *
- * @return The bound object. Returns null if the object does not
- * exist in the context.
- * @exception SystemException
- */
- protected org.omg.CORBA.Object resolveObject(NameComponent n, BindingTypeHolder type) throws SystemException {
- // special call to resolve the root context. This is the only one that goes backwards.
- if (n.id.length() == 0 && n.kind.length() == 0) {
- // this is a name context item, so set it properly.
- type.value = BindingType.ncontext;
- return rootContext;
- }
-
- BindingKey key = new BindingKey(n);
- BoundObject obj = (BoundObject)bindings.get(key);
- // if not in the table, just return null
- if (obj == null) {
- return null;
- }
- // update the type information and return the bound object reference.
- type.value = obj.type;
- return obj.boundObject;
- }
-
- /**
- * Bind an object into the current context. This can
- * be either an object or a naming context.
- *
- * @param n The single-level name of the target object.
- * @param obj The object or context to be bound.
- * @param type
- *
- * @exception SystemException
- */
- protected void bindObject(NameComponent n, org.omg.CORBA.Object obj, BindingTypeHolder type) throws SystemException {
- // fairly simple table put...
- bindings.put(new BindingKey(n), new BoundObject(n, obj, type.value));
- }
-
- /**
- * Unbind an object from the current context.
- *
- * @param n The name of the target object (single level).
- *
- * @return The object associated with the binding. Returns null
- * if there was no binding currently associated with this
- * name.
- * @exception SystemException
- */
- protected org.omg.CORBA.Object unbindObject(NameComponent n) throws SystemException {
- //remove the object from the hash table, returning the bound object if it exists.
- BindingKey key = new BindingKey(n);
- BoundObject obj = (BoundObject)bindings.remove(key);
-
- if (obj != null) {
- return obj.boundObject;
- }
- return null;
- }
-
- /**
- * Retrieve the rootContext for this NamingContext.
- *
- * @return The rootContext CORBA object associated with this context.
- */
- public org.omg.CORBA.Object getRootContext() {
- return rootContext;
- }
-
- /**
- * Internal class used for HashMap lookup keys.
- */
- class BindingKey {
- // the name component this is a HashMap key for.
- public NameComponent name;
- private int hashval = 0;
-
- /**
- * Create a new BindingKey for a NameComponent.
- *
- * @param n The lookup name.
- */
- public BindingKey(NameComponent n) {
- name = n;
- // create a hash value used for lookups
- if (name.id != null) {
- hashval += name.id.hashCode();
- }
- if (name.kind != null) {
- hashval += name.kind.hashCode();
- }
- }
-
- /**
- * Return the hashcode associated with this binding key. The
- * hashcode is created using the NameComponent id and
- * kind fields.
- *
- * @return The lookup hashvalue associated with this key.
- */
- public int hashCode() {
- return hashval;
- }
-
- /**
- * Compare two BindingKeys for equality (used for HashMap
- * lookups).
- *
- * @param other The comparison partner.
- *
- * @return True if the keys are equivalent, false otherwise.
- */
- public boolean equals(Object other) {
- // if not given or the wrong type, this is false.
- if (other == null || !(other instanceof BindingKey)) {
- return false;
- }
-
- BindingKey otherKey = (BindingKey)other;
-
- // verify first on the id name.
- if (name.id != null) {
- if (otherKey.name.id == null) {
- return false;
- }
- if (!name.id.equals(otherKey.name.id)) {
- return false;
- }
- } else {
- if (otherKey.name.id != null) {
- return false;
- }
- }
- // this is a match so far...now compare the kinds
- if (name.kind != null) {
- if (otherKey.name.kind == null) {
- return false;
- }
- if (!name.kind.equals(otherKey.name.kind)) {
- return false;
- }
- } else {
- if (otherKey.name.kind != null) {
- return false;
- }
- }
- return true;
- }
- }
-
- /**
- * Internal class used to store bound objects in the HashMap.
- */
- public class BoundObject {
- // the name this object is bound under.
- public NameComponent name;
- // the type of binding (either nobject or ncontext).
- public BindingType type;
- // the actual bound object.
- public org.omg.CORBA.Object boundObject;
-
- /**
- * Create a new object binding for our HashMap.
- *
- * @param name The bound object's name.
- * @param boundObject
- * The bound object (real object or NamingContext).
- * @param type The type information associated with this binding.
- */
- public BoundObject(NameComponent name, org.omg.CORBA.Object boundObject, BindingType type) {
- this.name = name;
- this.boundObject = boundObject;
- this.type = type;
- }
- }
-
- /**
- * Context implementation version of the BindingIterator
- * object used to return list items.
- */
- public class TransientBindingIterator extends BindingIteratorPOA {
- // the POA used to activate this object (required for destroy();
- private POA poa;
- // the binding set we're iterating over (this must be a snapshot copy)
- private HashMap bindings;
- // the iterator use to access the bindings
- private Iterator iterator;
-
- /**
- * Create a new BindingIterator hosted by the given POA and
- * iterating over the map of items.
- *
- * @param poa The hosting POA.
- * @param bindings The HashMap of bound objects.
- */
- public TransientBindingIterator(POA poa, HashMap bindings) {
- this.poa = poa;
- this.bindings = bindings;
- this.iterator = bindings.values().iterator();
- }
-
- /**
- * Return the next object in the iteration sequence.
- *
- * @param b The BindingHolder used to return the next item. If
- * we've reached the end of the sequence, an item
- * with an empty name is returned.
- *
- * @return true if there is another item, false otherwise.
- */
- public boolean next_one(org.omg.CosNaming.BindingHolder b) {
- if (iterator.hasNext()) {
- // return this as a Binding value.
- BoundObject obj = (BoundObject)iterator.next();
- b.value = new Binding(new NameComponent[] {obj.name}, obj.type);
- return true;
- } else {
- // return an empty element
- b.value = new Binding(new NameComponent[0], BindingType.nobject);
- return false;
- }
- }
-
- /**
- * Retrieve the next "n" items from the list, returned
- * as a BindingList.
- *
- * @param how_many The count of items to retrieve.
- * @param bl A holder for returning an array of Bindings for
- * the returned items.
- *
- * @return true if any items were returned, false if there's
- * nothing left to return.
- */
- public boolean next_n(int how_many, org.omg.CosNaming.BindingListHolder bl) {
- List accum = new ArrayList();
- BindingHolder holder = new BindingHolder();
- int i = 0;
- // Keep iterating as long as there are entries
- while (i < how_many && next_one(holder)) {
- accum.add(holder.value);
- i++;
- }
-
- // convert to an array and return whether we found anything.
- bl.value = (Binding[])accum.toArray(new Binding[accum.size()]);
- return accum.isEmpty();
- }
-
- /**
- * Destory this BindingIterator instance, which deativates
- * it from the hosting POA.
- */
- public void destroy() {
- try {
- // we need to deactivate this from the POA.
- byte[] objectId = poa.servant_to_id(this);
- if (objectId != null) {
- poa.deactivate_object(objectId);
- }
- } catch (Exception e) {
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientServiceException.java b/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientServiceException.java
deleted file mode 100644
index 444143f173..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientServiceException.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.
- */
-
-/**
- * @version $Rev$ $Date$
- */
-package org.apache.tuscany.sca.host.corba.naming;
-
-public class TransientServiceException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = -2611596914331994827L;
-
- public TransientServiceException() {
- super();
- }
-
- public TransientServiceException(String reason) {
- super(reason);
- }
-
- public TransientServiceException(String reason, Exception cause) {
- super(reason, cause);
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-android/modules/host-corba-jse/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index a96baed33e..0000000000
--- a/branches/sca-android/modules/host-corba-jse/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.host.corba.jse.CorbaRuntimeModuleActivator \ No newline at end of file
diff --git a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/DefaultCorbaHostTestCase.java b/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/DefaultCorbaHostTestCase.java
deleted file mode 100644
index 8084e39956..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/DefaultCorbaHostTestCase.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.host.corba.testing;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import java.net.ConnectException;
-import java.net.Socket;
-import java.net.SocketException;
-
-import org.apache.tuscany.sca.host.corba.CorbaHost;
-import org.apache.tuscany.sca.host.corba.CorbaHostException;
-import org.apache.tuscany.sca.host.corba.CorbaHostUtils;
-import org.apache.tuscany.sca.host.corba.jse.DefaultCorbaHost;
-import org.apache.tuscany.sca.host.corba.naming.TransientNameServer;
-import org.apache.tuscany.sca.host.corba.naming.TransientNameService;
-import org.apache.tuscany.sca.host.corba.testing.general.TestInterface;
-import org.apache.tuscany.sca.host.corba.testing.general.TestInterfaceHelper;
-import org.apache.tuscany.sca.host.corba.testing.servants.TestInterfaceServant;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * General tests
- */
-public class DefaultCorbaHostTestCase {
-
- private static final String LOCALHOST = "localhost";
- private static final int DEFAULT_PORT = 11100; // 1050;
-
- private static CorbaHost host;
-
- private static TransientNameServer server;
-
- @BeforeClass
- public static void start() {
- try {
- server = new TransientNameServer(LOCALHOST, DEFAULT_PORT, TransientNameService.DEFAULT_SERVICE_NAME);
- Thread t = server.start();
- if (t == null) {
- fail("The naming server cannot be started");
- }
- host = new DefaultCorbaHost();
- } catch (Throwable e) {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
-
- @AfterClass
- public static void stop() {
- server.stop();
- }
-
- /**
- * Tests registering and lookup CORBA services
- */
- @Test
- public void test_registerServant() {
- try {
- String uri = CorbaHostUtils.createCorbanameURI(LOCALHOST, DEFAULT_PORT, "Nested/Test");
- TestInterface servant = new TestInterfaceServant();
- host.registerServant(uri, servant);
- TestInterface ref = TestInterfaceHelper.narrow(host.lookup(uri));
- assertEquals(2, ref.getInt(2));
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests unregistering servants
- */
- @Test
- public void test_unregisterServant() {
- try {
- String objName = "Unregistering/Test";
- String uri = CorbaHostUtils.createCorbanameURI(LOCALHOST, DEFAULT_PORT, objName);
- TestInterface servant = new TestInterfaceServant();
-
- // creating and releasing using corbaname URI
- host.registerServant(uri, servant);
- host.unregisterServant(uri);
- host.registerServant(uri, servant);
- host.unregisterServant(uri);
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests situation when name is already registered
- */
- @Test
- public void test_nameAlreadyRegistered() {
- // test using URI
- try {
- TestInterface servant = new TestInterfaceServant();
- String uri = CorbaHostUtils.createCorbanameURI(LOCALHOST, DEFAULT_PORT, "AlreadyRegisteredTest2");
- host.registerServant(uri, servant);
- host.registerServant(uri, servant);
- fail();
- } catch (CorbaHostException e) {
- assertTrue(e.getMessage().equals(CorbaHostException.BINDING_IN_USE));
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests getting non existing reference
- */
- @Test
- public void test_getNonExistingObject() {
- // try to fetch object with corbaname URI
- try {
- host.lookup(CorbaHostUtils.createCorbanameURI("NonExistingOne", DEFAULT_PORT, LOCALHOST));
- fail();
- } catch (CorbaHostException e) {
- // The message is JDK-specific
- // assertTrue(e.getMessage().equals(CorbaHostException.NO_SUCH_OBJECT));
- } catch (Exception e) {
- // e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests unregistering non existing reference
- */
- @Test
- public void test_unregisterNonExistentObject() {
- // test using URI
- try {
- String uri = CorbaHostUtils.createCorbanameURI(LOCALHOST, DEFAULT_PORT, "NonExistingReference1");
- host.unregisterServant(uri);
- fail();
- } catch (CorbaHostException e) {
- assertTrue(e.getMessage().equals(CorbaHostException.NO_SUCH_OBJECT));
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- * Tests registering under invalid host
- */
- @Test
- public void test_invalidHost() {
- try {
- String url = CorbaHostUtils.createCorbanameURI("not_" + LOCALHOST, DEFAULT_PORT, "Name");
- TestInterface servant = new TestInterfaceServant();
- host.registerServant(url, servant);
- fail();
- } catch (CorbaHostException e) {
- // Expected
- } catch (Exception e) {
- // e.printStackTrace();
- fail(e.getMessage());
- }
- }
-
- /**
- * Tests registering under invalid port
- */
- @Test
- public void test_invalidPort() {
- try {
- String url = CorbaHostUtils.createCorbanameURI(LOCALHOST, DEFAULT_PORT + 1, "Name");
- TestInterface servant = new TestInterfaceServant();
- host.registerServant(url, servant);
- fail();
- } catch (CorbaHostException e) {
- // Expected
- } catch (Exception e) {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
-
- /**
- * Tests registering under invalid name
- */
- @Test
- @Ignore("SUN JDK 6 is happy with all kind of names")
- public void test_invalidBindingName() {
- try {
- TestInterface servant = new TestInterfaceServant();
- host.registerServant("---", servant);
- fail();
- } catch (CorbaHostException e) {
- assertTrue(e.getMessage().equals(CorbaHostException.WRONG_NAME));
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- /**
- *
- */
- @Test
- public void test_ensureORBStopped() {
- try {
- int innerORBPort = 11102;
- TransientNameServer innerServer =
- new TransientNameServer(LOCALHOST, innerORBPort, TransientNameService.DEFAULT_SERVICE_NAME);
- innerServer.start();
- innerServer.stop();
- try {
- Thread.sleep(500);
- } catch (Exception e) {
- }
- new Socket(LOCALHOST, innerORBPort);
- fail();
- } catch (Exception e) {
- if (e instanceof ConnectException) {
- assertTrue(true);
- } else {
- e.printStackTrace();
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterface.java b/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterface.java
deleted file mode 100644
index 8d1a9db9e9..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterface.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.host.corba.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/TestInterface.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-public interface TestInterface extends TestInterfaceOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity {
-} // interface TestInterface
diff --git a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHelper.java b/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHelper.java
deleted file mode 100644
index fe85dc7743..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHelper.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.host.corba.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHelper.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-abstract public class TestInterfaceHelper {
- private static String _id = "IDL:org/apache/tuscany/sca/host/corba/testing/general/TestInterface:1.0";
-
- public static void insert(org.omg.CORBA.Any a, org.apache.tuscany.sca.host.corba.testing.general.TestInterface that) {
- org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
- a.type(type());
- write(out, that);
- a.read_value(out.create_input_stream(), type());
- }
-
- public static org.apache.tuscany.sca.host.corba.testing.general.TestInterface extract(org.omg.CORBA.Any a) {
- return read(a.create_input_stream());
- }
-
- private static org.omg.CORBA.TypeCode __typeCode = null;
-
- synchronized public static org.omg.CORBA.TypeCode type() {
- if (__typeCode == null) {
- __typeCode =
- org.omg.CORBA.ORB.init()
- .create_interface_tc(org.apache.tuscany.sca.host.corba.testing.general.TestInterfaceHelper.id(),
- "TestInterface");
- }
- return __typeCode;
- }
-
- public static String id() {
- return _id;
- }
-
- public static org.apache.tuscany.sca.host.corba.testing.general.TestInterface read(org.omg.CORBA.portable.InputStream istream) {
- return narrow(istream.read_Object(_TestInterfaceStub.class));
- }
-
- public static void write(org.omg.CORBA.portable.OutputStream ostream,
- org.apache.tuscany.sca.host.corba.testing.general.TestInterface value) {
- ostream.write_Object((org.omg.CORBA.Object)value);
- }
-
- public static org.apache.tuscany.sca.host.corba.testing.general.TestInterface narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.host.corba.testing.general.TestInterface)
- return (org.apache.tuscany.sca.host.corba.testing.general.TestInterface)obj;
- else if (!obj._is_a(id()))
- throw new org.omg.CORBA.BAD_PARAM();
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.host.corba.testing.general._TestInterfaceStub stub =
- new org.apache.tuscany.sca.host.corba.testing.general._TestInterfaceStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
- public static org.apache.tuscany.sca.host.corba.testing.general.TestInterface unchecked_narrow(org.omg.CORBA.Object obj) {
- if (obj == null)
- return null;
- else if (obj instanceof org.apache.tuscany.sca.host.corba.testing.general.TestInterface)
- return (org.apache.tuscany.sca.host.corba.testing.general.TestInterface)obj;
- else {
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- org.apache.tuscany.sca.host.corba.testing.general._TestInterfaceStub stub =
- new org.apache.tuscany.sca.host.corba.testing.general._TestInterfaceStub();
- stub._set_delegate(delegate);
- return stub;
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHolder.java b/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHolder.java
deleted file mode 100644
index 305a4d7b97..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHolder.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.corba.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceHolder.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-public final class TestInterfaceHolder implements org.omg.CORBA.portable.Streamable {
- public org.apache.tuscany.sca.host.corba.testing.general.TestInterface value = null;
-
- public TestInterfaceHolder() {
- }
-
- public TestInterfaceHolder(org.apache.tuscany.sca.host.corba.testing.general.TestInterface initialValue) {
- value = initialValue;
- }
-
- public void _read(org.omg.CORBA.portable.InputStream i) {
- value = org.apache.tuscany.sca.host.corba.testing.general.TestInterfaceHelper.read(i);
- }
-
- public void _write(org.omg.CORBA.portable.OutputStream o) {
- org.apache.tuscany.sca.host.corba.testing.general.TestInterfaceHelper.write(o, value);
- }
-
- public org.omg.CORBA.TypeCode _type() {
- return org.apache.tuscany.sca.host.corba.testing.general.TestInterfaceHelper.type();
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceOperations.java b/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceOperations.java
deleted file mode 100644
index f557d3e020..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceOperations.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.host.corba.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/TestInterfaceOperations.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-public interface TestInterfaceOperations {
- int getInt(int arg);
-} // interface TestInterfaceOperations
diff --git a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceImplBase.java b/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceImplBase.java
deleted file mode 100644
index f993066dab..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceImplBase.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.host.corba.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceImplBase.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-public abstract class _TestInterfaceImplBase extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.host.corba.testing.general.TestInterface, org.omg.CORBA.portable.InvokeHandler {
-
- // Constructors
- public _TestInterfaceImplBase() {
- }
-
- private static java.util.Hashtable _methods = new java.util.Hashtable();
- static {
- _methods.put("getInt", new java.lang.Integer(0));
- }
-
- public org.omg.CORBA.portable.OutputStream _invoke(String $method,
- org.omg.CORBA.portable.InputStream in,
- org.omg.CORBA.portable.ResponseHandler $rh) {
- org.omg.CORBA.portable.OutputStream out = null;
- java.lang.Integer __method = (java.lang.Integer)_methods.get($method);
- if (__method == null)
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
-
- switch (__method.intValue()) {
- case 0: // org/apache/tuscany/sca/host/corba/testing/general/TestInterface/getInt
- {
- int arg = in.read_long();
- int $result = (int)0;
- $result = this.getInt(arg);
- out = $rh.createReply();
- out.write_long($result);
- break;
- }
-
- default:
- throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
- }
-
- return out;
- } // _invoke
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/host/corba/testing/general/TestInterface:1.0"};
-
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
-} // class _TestInterfaceImplBase
diff --git a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceStub.java b/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceStub.java
deleted file mode 100644
index 30a77deaf5..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceStub.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.host.corba.testing.general;
-
-/**
-* org/apache/tuscany/sca/host/corba/testing/general/_TestInterfaceStub.java .
-* Generated by the IDL-to-Java compiler (portable), version "3.2"
-* from general_tests.idl
-* ¶roda, 25 czerwiec 2008 16:19:44 CEST
-*/
-
-public class _TestInterfaceStub extends org.omg.CORBA.portable.ObjectImpl implements
- org.apache.tuscany.sca.host.corba.testing.general.TestInterface {
-
- public int getInt(int arg) {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request("getInt", true);
- $out.write_long(arg);
- $in = _invoke($out);
- int $result = $in.read_long();
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream();
- String _id = $ex.getId();
- throw new org.omg.CORBA.MARSHAL(_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return getInt(arg);
- } finally {
- _releaseReply($in);
- }
- } // getInt
-
- // Type-specific CORBA::Object operations
- private static String[] __ids = {"IDL:org/apache/tuscany/sca/host/corba/testing/general/TestInterface:1.0"};
-
- public String[] _ids() {
- return (String[])__ids.clone();
- }
-
- private void readObject(java.io.ObjectInputStream s) throws java.io.IOException {
- String str = s.readUTF();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props).string_to_object(str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate();
- _set_delegate(delegate);
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- String[] args = null;
- java.util.Properties props = null;
- String str = org.omg.CORBA.ORB.init(args, props).object_to_string(this);
- s.writeUTF(str);
- }
-} // class _TestInterfaceStub
diff --git a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/servants/TestInterfaceServant.java b/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/servants/TestInterfaceServant.java
deleted file mode 100644
index 0ebde8ef0d..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/test/java/org/apache/tuscany/sca/host/corba/testing/servants/TestInterfaceServant.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.host.corba.testing.servants;
-
-import org.apache.tuscany.sca.host.corba.testing.general._TestInterfaceImplBase;
-
-/**
- * Testing servant
- */
-public class TestInterfaceServant extends _TestInterfaceImplBase {
-
- private static final long serialVersionUID = 1L;
-
- public int getInt(int arg) {
- return arg;
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba-jse/src/test/resources/general.idl b/branches/sca-android/modules/host-corba-jse/src/test/resources/general.idl
deleted file mode 100644
index f67566deb8..0000000000
--- a/branches/sca-android/modules/host-corba-jse/src/test/resources/general.idl
+++ /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.
- */
-
-/*
- * compile by
- * idlj -fall -oldImplBase genera.idl
- */
-
-module org {
- module apache {
- module tuscany {
- module sca {
- module host {
- module corba {
- module testing {
- module general {
- interface TestInterface {
- long getInt(in long arg);
- };
- };
- };
- };
- };
- };
- };
- };
-};
diff --git a/branches/sca-android/modules/host-corba/LICENSE b/branches/sca-android/modules/host-corba/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/host-corba/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/host-corba/META-INF/README b/branches/sca-android/modules/host-corba/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-corba/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-corba/NOTICE b/branches/sca-android/modules/host-corba/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/host-corba/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/branches/sca-android/modules/host-corba/pom.xml b/branches/sca-android/modules/host-corba/pom.xml
deleted file mode 100644
index 2427fb9a05..0000000000
--- a/branches/sca-android/modules/host-corba/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>1.4-SNAPSHOT</version>
- </parent>
- <artifactId>tuscany-host-corba</artifactId>
- <name>Apache Tuscany SCA CORBA Host Extension Point</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.host.corba</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.corba*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHost.java b/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHost.java
deleted file mode 100644
index eb49f3f841..0000000000
--- a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHost.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.host.corba;
-
-import org.omg.CORBA.Object;
-
-/**
- * @version $Rev$ $Date$
- * CORBA Service hosting interface
- */
-public interface CorbaHost {
-
- /**
- * Registers servant in name server.
- *
- * @param uri corbaname URI
- * @param serviceObject
- * @throws CorbaHostException
- */
- void registerServant(String uri, Object serviceObject) throws CorbaHostException;
-
- /**
- * Removes servant from name server
- *
- * @param orb The ORB instance
- * @param name binding name
- * @throws CorbaHostException
- */
- void unregisterServant(String uri) throws CorbaHostException;
-
- /**
- * Gets reference to object
- *
- * @param name binding name
- * @return objects reference
- * @throws CorbaHostException
- */
- Object lookup(String uri) throws CorbaHostException;
-}
diff --git a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostException.java b/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostException.java
deleted file mode 100644
index 049bfdb6cd..0000000000
--- a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostException.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.host.corba;
-
-/**
- * @version $Rev$ $Date$
- * General exception for corba hosts operations
- */
-public class CorbaHostException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- public static final String BINDING_IN_USE = "Binding name is already in use";
- public static final String NO_SUCH_OBJECT = "There is no object under given location";
- public static final String NO_SUCH_HOST = "Couldn't find specified host";
- public static final String NO_SUCH_PORT = "Couldn't connect to specified port";
- public static final String WRONG_NAME = "Characters used in binding name are illegal";
-
- public CorbaHostException(String message) {
- super(message);
- }
-
- public CorbaHostException(Exception cause) {
- super(cause);
- }
-
- public CorbaHostException(String message, Exception cause) {
- super(message, cause);
- }
-}
diff --git a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostExtensionPoint.java b/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostExtensionPoint.java
deleted file mode 100644
index 067b9193c5..0000000000
--- a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostExtensionPoint.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.corba;
-
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- * An extension point for CORBA hostst
- */
-public interface CorbaHostExtensionPoint {
-
- /**
- * Removes CORBA host extension
- *
- * @param corbaHost
- */
- void addCorbaHost(CorbaHost corbaHost);
-
- /**
- * Removes CORBA host extension
- *
- * @param corbaHost
- */
- void removeCorbaHost(CorbaHost corbaHost);
-
- /**
- * Gets all CORBA host extensions
- *
- * @return
- */
- List<CorbaHost> getCorbaHosts();
-
-}
diff --git a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostUtils.java b/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostUtils.java
deleted file mode 100644
index b90fe9c78b..0000000000
--- a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHostUtils.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.corba;
-
-
-/**
- * @version $Rev$ $Date$
- * Various utilities for host-corba
- */
-public class CorbaHostUtils {
-
- /**
- * Tests if given URI is valid corbaname string
- * @param uri
- * @return
- */
- public static boolean isValidCorbanameURI(String uri) {
- return uri != null && uri.startsWith("corbaname:") && uri.contains("#") && uri.indexOf('#') < uri.length() - 1;
- }
-
- /**
- * Creates corbaname URI basing on given parameters
- * @param host
- * @param port
- * @param name
- *
- * @return
- */
- public static String createCorbanameURI(String host, int port, String name) {
- return new CorbanameURL(host, port, name).toString();
- }
-
- /**
- * Translates corbaname URI to CorbanameDetails instances
- *
- * @param uri
- * @return
- */
- public static CorbanameURL getServiceDetails(String uri) {
- CorbanameURL details = new CorbanameURL(uri);
- return details;
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbanameURL.java b/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbanameURL.java
deleted file mode 100644
index a380fd6d79..0000000000
--- a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbanameURL.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.host.corba;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- * Holds corbaname URI details
- */
-public class CorbanameURL {
- public static String DEFAULT_PROTOCOL = "iiop";
- public static String DEFAULT_VERSION = "";
- public static String DEFAULT_NAME_SERVICE = "NameService";
- public static String DEFAULT_HOST = "localhost";
- public static int DEFAULT_PORT = 2809;
-
- private String protocol = "";
- private String version = "";
- private String host;
- private int port;
- private String nameService;
- private List<String> namePath;
-
- public CorbanameURL(String host, int port, String namePath, String nameService) {
- super();
- this.host = host == null ? DEFAULT_HOST : host;
- this.port = port <= 0 ? DEFAULT_PORT : port;
- this.namePath = parseName(namePath);
- this.nameService = nameService == null ? DEFAULT_NAME_SERVICE : nameService;
- }
-
- public CorbanameURL(String host, int port, String namePath) {
- this(host, port, namePath, DEFAULT_NAME_SERVICE);
- }
-
- public CorbanameURL(String url) {
- if (url == null || (!url.startsWith("corbaname"))) {
- throw new IllegalArgumentException("Malformed corbaname URL: " + url);
- }
- try {
- url = URLDecoder.decode(url, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- throw new IllegalArgumentException(e);
- }
- String[] parts = url.split("#");
- if (parts.length == 2) {
- String serviceLocation = parts[0];
- String servicePath = parts[1];
- namePath = parseName(servicePath);
-
- parts = serviceLocation.split("/");
- if (parts.length == 2) {
- nameService = parts[1];
- } else {
- nameService = DEFAULT_NAME_SERVICE;
- }
-
- parts = parts[0].split(":");
-
- if (parts.length >= 2) {
- protocol = parts[1];
- }
- if (parts.length >= 3) {
- version = parts[2];
- String[] strs = version.split("@");
- if (strs.length == 2) {
- version = strs[0];
- host = strs[1];
- } else {
- version = "";
- host = strs[0];
- }
- }
- if (host == null || "".equals(host)) {
- host = DEFAULT_HOST;
- }
- if (parts.length >= 4 && !"".equals(parts[3])) {
- port = Integer.parseInt(parts[3]);
- } else {
- port = DEFAULT_PORT;
- }
- } else {
- throw new IllegalArgumentException("Malformed corbaname URL: " + url);
- }
- }
-
- private static List<String> parseName(String name) {
- try {
- name = URLDecoder.decode(name, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- throw new IllegalArgumentException(e);
- }
- String[] names = name.split("/");
- return Arrays.asList(names);
- }
-
- public String getProtocol() {
- return protocol;
- }
-
- public void setProtocol(String protocol) {
- this.protocol = protocol;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public String getHost() {
- return host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-
- public int getPort() {
- return port;
- }
-
- public void setPort(int port) {
- this.port = port;
- }
-
- public String getNameService() {
- return nameService;
- }
-
- public void setNameService(String nameService) {
- this.nameService = nameService;
- }
-
- public List<String> getNamePath() {
- return namePath;
- }
-
- public String getName() {
- if (namePath != null) {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < namePath.size(); i++) {
- buf.append(namePath.get(i));
- if (i < namePath.size() - 1) {
- buf.append("/");
- }
- }
- return buf.toString();
- }
- return null;
- }
-
- public void setNamePath(List<String> namePath) {
- this.namePath = namePath;
- }
-
- @Override
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("corbaname:");
- buf.append(protocol).append(":");
- if (version != null && !"".equals(version)) {
- buf.append(version).append("@");
- }
- buf.append(host).append(":").append(port);
- buf.append("/").append(nameService);
- buf.append("#");
- if (namePath != null) {
- for (int i = 0; i < namePath.size(); i++) {
- buf.append(namePath.get(i));
- if (i < namePath.size() - 1) {
- buf.append("/");
- }
- }
- }
- return buf.toString();
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/DefaultCorbaHostExtensionPoint.java b/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/DefaultCorbaHostExtensionPoint.java
deleted file mode 100644
index 438734086d..0000000000
--- a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/DefaultCorbaHostExtensionPoint.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.host.corba;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- * Default implementation of CorbaHostExtensionPoint
- */
-public class DefaultCorbaHostExtensionPoint implements CorbaHostExtensionPoint {
-
- private List<CorbaHost> corbaHosts = new ArrayList<CorbaHost>();
-
- public DefaultCorbaHostExtensionPoint() {
- }
-
- public void addCorbaHost(CorbaHost host) {
- corbaHosts.add(host);
- }
-
- public void removeCorbaHost(CorbaHost host) {
- corbaHosts.remove(host);
- }
-
- public List<CorbaHost> getCorbaHosts() {
- return corbaHosts;
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java b/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java
deleted file mode 100644
index 7e043667a9..0000000000
--- a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.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.host.corba;
-
-import org.omg.CORBA.Object;
-
-/**
- * @version $Rev$ $Date$
- * Default implementation of extensible CORBA host
- */
-public class ExtensibleCorbaHost implements CorbaHost {
-
- private CorbaHostExtensionPoint hosts;
-
- public ExtensibleCorbaHost(CorbaHostExtensionPoint chep) {
- this.hosts = chep;
- }
-
- public Object lookup(String uri) throws CorbaHostException {
- return getCorbaHost().lookup(uri);
- }
-
- public void registerServant(String uri, Object serviceObject) throws CorbaHostException {
- getCorbaHost().registerServant(uri, serviceObject);
- }
-
- public void unregisterServant(String uri) throws CorbaHostException {
- getCorbaHost().unregisterServant(uri);
- }
-
- protected CorbaHost getCorbaHost() throws CorbaHostException {
- if (hosts.getCorbaHosts().isEmpty()) {
- throw new CorbaHostException("No registered CORBA hosts");
- }
- return hosts.getCorbaHosts().get(0);
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/SocketUtil.java b/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/SocketUtil.java
deleted file mode 100755
index 6989b3ad06..0000000000
--- a/branches/sca-android/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/SocketUtil.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.corba;
-
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.net.UnknownHostException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @version $Rev$ $Date$
- * Class partially copied from eclipse wst project
- * (http://repo1.maven.org/maven2/org/eclipse/wst/server/core/1.0.205-v20070829b/).
- * Finally we should use jar from maven dependency. Problem described in
- * http://www.fornax-platform.org/cp/display/fornax/2.+Hello+World+Tutorial+(CSC)?replyToComment=2098#comment-2098
- * needs to be fixed.
- */
-public class SocketUtil {
-
- protected static final Object lock = new Object();
-
- private static Set<String> localHostCache;
- private static Set<String> notLocalHostCache = new HashSet<String>();
- private static Map<String, CacheThread> threadMap = new HashMap<String, CacheThread>();
-
- private static Set<InetAddress> addressCache;
-
- static class CacheThread extends Thread {
- private Set<InetAddress> currentAddresses;
- private Set<String> addressList;
- private String host;
- private Set<String> nonAddressList;
- private Map<String, CacheThread> threadMap2;
-
- public CacheThread(String host,
- Set<InetAddress> currentAddresses,
- Set<String> addressList,
- Set<String> nonAddressList,
- Map<String, CacheThread> threadMap2) {
- super("Caching localhost information");
- this.host = host;
- this.currentAddresses = currentAddresses;
- this.addressList = addressList;
- this.nonAddressList = nonAddressList;
- this.threadMap2 = threadMap2;
- }
-
- public void run() {
- if (currentAddresses != null) {
- Iterator<InetAddress> iter2 = currentAddresses.iterator();
- while (iter2.hasNext()) {
- InetAddress addr = iter2.next();
- String hostname = addr.getHostName();
- String hostname2 = addr.getCanonicalHostName();
- synchronized (lock) {
- if (hostname != null && !addressList.contains(hostname))
- addressList.add(hostname);
- if (hostname2 != null && !addressList.contains(hostname2))
- addressList.add(hostname2);
- }
- }
- }
-
- try {
- InetAddress[] addrs = InetAddress.getAllByName(host);
- int length = addrs.length;
- for (int j = 0; j < length; j++) {
- InetAddress addr = addrs[0];
- String hostname = addr.getHostName();
- String hostname2 = addr.getCanonicalHostName();
- synchronized (lock) {
- if (addr.isLoopbackAddress()) {
- if (hostname != null && !addressList.contains(hostname))
- addressList.add(hostname);
- if (hostname2 != null && !addressList.contains(hostname2))
- addressList.add(hostname2);
- } else {
- if (hostname != null && !nonAddressList.contains(hostname))
- nonAddressList.add(hostname);
- if (hostname2 != null && !nonAddressList.contains(hostname2))
- nonAddressList.add(hostname2);
- }
- }
- }
- } catch (UnknownHostException e) {
- synchronized (lock) {
- if (host != null && !nonAddressList.contains(host))
- nonAddressList.add(host);
- }
- }
- synchronized (lock) {
- threadMap2.remove(host);
- }
- }
- }
-
- public static boolean isLocalhost(final String host) {
- if (host == null || host.equals(""))
- return false;
-
- if ("localhost".equals(host) || "127.0.0.1".equals(host))
- return true;
-
- // check simple cases
- try {
- InetAddress localHostaddr = InetAddress.getLocalHost();
- if (localHostaddr.getHostName().equals(host) || host.equals(localHostaddr.getCanonicalHostName())
- || localHostaddr.getHostAddress().equals(host))
- return true;
- } catch (Exception e) {
-
- }
-
- // check for current thread and wait if necessary
- boolean currentThread = false;
- try {
- Thread t = null;
- synchronized (lock) {
- t = threadMap.get(host);
- }
- if (t != null && t.isAlive()) {
- currentThread = true;
- t.join(30);
- }
- } catch (Exception e) {
-
- }
-
- // check if cache is still ok
- boolean refreshedCache = false;
- try {
- // get network interfaces
- final Set<InetAddress> currentAddresses = new HashSet<InetAddress>();
- currentAddresses.add(InetAddress.getLocalHost());
- Enumeration<?> nis = NetworkInterface.getNetworkInterfaces();
- while (nis.hasMoreElements()) {
- NetworkInterface inter = (NetworkInterface)nis.nextElement();
- Enumeration<InetAddress> ias = inter.getInetAddresses();
- while (ias.hasMoreElements())
- currentAddresses.add(ias.nextElement());
- }
-
- // check if cache is empty or old and refill it if necessary
- if (addressCache == null || !addressCache.containsAll(currentAddresses)
- || !currentAddresses.containsAll(addressCache)) {
- CacheThread cacheThread = null;
- refreshedCache = true;
-
- synchronized (lock) {
- addressCache = currentAddresses;
- notLocalHostCache = new HashSet<String>();
- localHostCache = new HashSet<String>(currentAddresses.size() * 3);
-
- Iterator<InetAddress> iter = currentAddresses.iterator();
- while (iter.hasNext()) {
- InetAddress addr = iter.next();
- String a = addr.getHostAddress();
- if (a != null && !localHostCache.contains(a))
- localHostCache.add(a);
- }
-
- cacheThread = new CacheThread(host, currentAddresses, localHostCache, notLocalHostCache, threadMap);
- threadMap.put(host, cacheThread);
- cacheThread.setDaemon(true);
- cacheThread.setPriority(Thread.NORM_PRIORITY - 1);
- cacheThread.start();
- }
- cacheThread.join(200);
- }
- } catch (Exception e) {
- }
-
- synchronized (lock) {
- if (localHostCache.contains(host))
- return true;
- if (notLocalHostCache.contains(host))
- return false;
- }
-
- // if the cache hasn't been cleared, maybe we still need to lookup the
- // host
- if (!refreshedCache && !currentThread) {
- try {
- CacheThread cacheThread = null;
- synchronized (lock) {
- cacheThread = new CacheThread(host, null, localHostCache, notLocalHostCache, threadMap);
- threadMap.put(host, cacheThread);
- cacheThread.setDaemon(true);
- cacheThread.setPriority(Thread.NORM_PRIORITY - 1);
- cacheThread.start();
- }
- cacheThread.join(75);
-
- synchronized (lock) {
- if (localHostCache.contains(host))
- return true;
- }
- } catch (Exception e) {
- }
- }
- return false;
- }
-
-}
diff --git a/branches/sca-android/modules/host-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.corba.CorbaHostExtensionPoint b/branches/sca-android/modules/host-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.corba.CorbaHostExtensionPoint
deleted file mode 100644
index a72bed4ea8..0000000000
--- a/branches/sca-android/modules/host-corba/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.corba.CorbaHostExtensionPoint
+++ /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.corba.DefaultCorbaHostExtensionPoint
diff --git a/branches/sca-android/modules/host-corba/src/test/java/org/apache/tuscany/sca/host/corba/UtilsTestCase.java b/branches/sca-android/modules/host-corba/src/test/java/org/apache/tuscany/sca/host/corba/UtilsTestCase.java
deleted file mode 100644
index 4e076f9342..0000000000
--- a/branches/sca-android/modules/host-corba/src/test/java/org/apache/tuscany/sca/host/corba/UtilsTestCase.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.host.corba;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- * Tests for host utils
- */
-public class UtilsTestCase {
-
- private void assertDetailsAreOk(CorbanameURL details, String host, int port, String nameService, List<String> namePath) {
- assertTrue(details.getHost().equals(host));
- assertTrue(details.getNameService().equals(nameService));
- assertTrue(details.getPort() == port);
- assertTrue(details.getNamePath().size() == namePath.size());
- for (int i = 0; i < namePath.size(); i++) {
- assertTrue(details.getNamePath().get(i).equals(namePath.get(i)));
- }
- }
-
- /**
- * Tests if corbaname url is beeing processes properly
- */
- @Test
- public void test_validCorbaname() {
- String testUri = null;
- CorbanameURL details = null;
- List<String> namePath = null;
-
- testUri = "corbaname:ignore:host:1234/Service#Reference";
- details = CorbaHostUtils.getServiceDetails(testUri);
- namePath = new ArrayList<String>();
- namePath.add("Reference");
- assertDetailsAreOk(details, "host", 1234, "Service", namePath);
-
- testUri = "corbaname:ignore:host:/Service#Reference";
- details = CorbaHostUtils.getServiceDetails(testUri);
- namePath = new ArrayList<String>();
- namePath.add("Reference");
- assertDetailsAreOk(details, "host", CorbanameURL.DEFAULT_PORT, "Service", namePath);
-
- testUri = "corbaname:ignore:host/Service#Reference";
- details = CorbaHostUtils.getServiceDetails(testUri);
- namePath = new ArrayList<String>();
- namePath.add("Reference");
- assertDetailsAreOk(details, "host", CorbanameURL.DEFAULT_PORT, "Service", namePath);
-
- testUri = "corbaname:ignore:/Service#Reference";
- details = CorbaHostUtils.getServiceDetails(testUri);
- namePath = new ArrayList<String>();
- namePath.add("Reference");
- assertDetailsAreOk(details, CorbanameURL.DEFAULT_HOST, CorbanameURL.DEFAULT_PORT, "Service", namePath);
-
- testUri = "corbaname:ignore/Service#Reference";
- details = CorbaHostUtils.getServiceDetails(testUri);
- namePath = new ArrayList<String>();
- namePath.add("Reference");
- assertDetailsAreOk(details, CorbanameURL.DEFAULT_HOST, CorbanameURL.DEFAULT_PORT, "Service", namePath);
-
- testUri = "corbaname:/Service#Reference";
- details = CorbaHostUtils.getServiceDetails(testUri);
- namePath = new ArrayList<String>();
- namePath.add("Reference");
- assertDetailsAreOk(details, CorbanameURL.DEFAULT_HOST, CorbanameURL.DEFAULT_PORT, "Service", namePath);
-
- testUri = "corbaname/Service#Reference";
- details = CorbaHostUtils.getServiceDetails(testUri);
- namePath = new ArrayList<String>();
- namePath.add("Reference");
- assertDetailsAreOk(details, CorbanameURL.DEFAULT_HOST, CorbanameURL.DEFAULT_PORT, "Service", namePath);
-
- testUri = "corbaname#Reference";
- details = CorbaHostUtils.getServiceDetails(testUri);
- namePath = new ArrayList<String>();
- namePath.add("Reference");
- assertDetailsAreOk(details, CorbanameURL.DEFAULT_HOST, CorbanameURL.DEFAULT_PORT, CorbanameURL.DEFAULT_NAME_SERVICE, namePath);
-
- testUri = "corbaname#Parent/Mid/Reference";
- details = CorbaHostUtils.getServiceDetails(testUri);
- namePath = new ArrayList<String>();
- namePath.add("Parent");
- namePath.add("Mid");
- namePath.add("Reference");
- assertDetailsAreOk(details, CorbanameURL.DEFAULT_HOST, CorbanameURL.DEFAULT_PORT, CorbanameURL.DEFAULT_NAME_SERVICE, namePath);
- }
-
- /**
- * Test for invalid corbaname url
- */
- @Test
- public void test_invalidCorbaname() {
- String testUri = null;
-
- try {
- testUri = "this.string.should.not.appear.in.the.beggining:ignore:host:1234/Service#Reference";
- CorbaHostUtils.getServiceDetails(testUri);
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof IllegalArgumentException);
- }
-
- try {
- testUri = "corbaname:ignore:host:1234/Service#";
- CorbaHostUtils.getServiceDetails(testUri);
- fail();
- } catch (Exception e) {
- assertTrue(e instanceof IllegalArgumentException);
- }
- }
-
- /**
- * Test for creating corbaname url from host, port, name parameters
- */
- @Test
- public void test_creatingCorbanameURI() {
- String uri = CorbaHostUtils.createCorbanameURI("SomeHost", 1000, "SomeName");
- assertEquals("corbaname::SomeHost:1000/NameService#SomeName", uri);
- }
-}
diff --git a/branches/sca-android/modules/host-ejb/LICENSE b/branches/sca-android/modules/host-ejb/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/host-ejb/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/host-ejb/META-INF/README b/branches/sca-android/modules/host-ejb/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-ejb/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-ejb/NOTICE b/branches/sca-android/modules/host-ejb/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/host-ejb/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/branches/sca-android/modules/host-ejb/pom.xml b/branches/sca-android/modules/host-ejb/pom.xml
deleted file mode 100644
index 8fc42d6ee4..0000000000
--- a/branches/sca-android/modules/host-ejb/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-host-ejb</artifactId>
- <name>Apache Tuscany SCA EJB Host Extension Point</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.host.ejb</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.ejb*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/DefaultEJBHostExtensionPoint.java b/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/DefaultEJBHostExtensionPoint.java
deleted file mode 100644
index c0107cb316..0000000000
--- a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/DefaultEJBHostExtensionPoint.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.ejb;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Default implementation of an EJB host extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultEJBHostExtensionPoint implements EJBHostExtensionPoint {
-
- private List<EJBHost> ejbHosts = new ArrayList<EJBHost>();
-
- public void addEJBHost(EJBHost ejbHost) {
- ejbHosts.add(ejbHost);
- }
-
- public void removeEJBHost(EJBHost ejbHost) {
- ejbHosts.remove(ejbHost);
- }
-
- public List<EJBHost> getEJBHosts() {
- return ejbHosts;
- }
-}
diff --git a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHost.java b/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHost.java
deleted file mode 100644
index 842dd7a4f5..0000000000
--- a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHost.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.host.ejb;
-
-
-
-/**
- * Interface implemented by host environments that allow EJBs
- * to be registered.
- * <p/>
- * This interface allows a system service to register an EJB session
- * bean to handle inbound requests.
- *
- * @version $Rev$ $Date$
- */
-public interface EJBHost {
-
- /**
- * Add an EJB session bean.
- *
- * @param ejbName the EJB name
- * @param sessionBean the EJB session bean descriptor
- * @throws EJBRegistrationException
- */
- void addSessionBean(String ejbName, EJBSessionBean sessionBean) throws EJBRegistrationException;
-
- /**
- * Remove an EJB session bean.
- *
- * @param ejbName the EJB name
- * @return the EJB session bean descriptor that was registered under that name
- * @throws EJBRegistrationException
- */
- EJBSessionBean removeSessionBean(String ejbName) throws EJBRegistrationException;
-
- /**
- * Returns the EJB session bean descriptor registered under
- * the given EJB name.
- *
- * @param ejbName the EJB name
- * @return the EJB session bean descriptor
- * @throws EJBRegistrationException
- */
- EJBSessionBean getSessionBean(String ejbName) throws EJBRegistrationException;
-
-}
diff --git a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHostExtensionPoint.java b/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHostExtensionPoint.java
deleted file mode 100644
index 75912dcc45..0000000000
--- a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHostExtensionPoint.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.ejb;
-
-import java.util.List;
-
-/**
- * An extension point for EJB hosts.
- *
- * @version $Rev$ $Date$
- */
-public interface EJBHostExtensionPoint {
-
- /**
- * Adds an EJB host extension.
- *
- * @param ejbHost
- */
- void addEJBHost(EJBHost ejbHost);
-
- /**
- * Removes an EJB host extension.
- *
- * @param ejbHost
- */
- void removeEJBHost(EJBHost ejbHost);
-
- /**
- * Returns a list of EJB host extensions.
- *
- * @return
- */
- List<EJBHost> getEJBHosts();
-
-}
diff --git a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBRegistrationException.java b/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBRegistrationException.java
deleted file mode 100644
index a50e701766..0000000000
--- a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBRegistrationException.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.ejb;
-
-/**
- * Indicates an exception while registering an EJB.
- *
- * @version $Rev$ $Date$
- */
-public class EJBRegistrationException extends RuntimeException {
- private static final long serialVersionUID = 1L;
-
- public EJBRegistrationException() {
- super();
- }
-
- public EJBRegistrationException(String message) {
- super(message);
- }
-
- public EJBRegistrationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public EJBRegistrationException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBSessionBean.java b/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBSessionBean.java
deleted file mode 100644
index f9967bdd8a..0000000000
--- a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBSessionBean.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.ejb;
-
-/**
- * Represents an EJB session bean.
- *
- * @version $Rev: $ $Date: $
- */
-public class EJBSessionBean {
-
- private Class<?> implementationClass;
- private Class<?> remoteInterface;
-
- public EJBSessionBean(Class<?> implementationClass, Class<?> remoteInterface) {
- this.implementationClass = implementationClass;
- this.remoteInterface = remoteInterface;
- }
-
- public Class<?> getImplementationClass() {
- return implementationClass;
- }
-
- public Class<?> getRemoteInterface() {
- return remoteInterface;
- }
-
-}
diff --git a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/ExtensibleEJBHost.java b/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/ExtensibleEJBHost.java
deleted file mode 100644
index fab408c7c0..0000000000
--- a/branches/sca-android/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/ExtensibleEJBHost.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.host.ejb;
-
-
-/**
- * Default implementation of an extensible EJB host.
- *
- * @version $Rev$ $Date$
- */
-public class ExtensibleEJBHost implements EJBHost {
-
- private EJBHostExtensionPoint ejbHosts;
-
- public ExtensibleEJBHost(EJBHostExtensionPoint ejbHosts) {
- this.ejbHosts = ejbHosts;
- }
-
- public void addSessionBean(String ejbName, EJBSessionBean ejbClass) throws EJBRegistrationException {
- if (ejbHosts.getEJBHosts().isEmpty()) {
- throw new EJBRegistrationException("No EJB host available");
- }
-
- // TODO implement selection of the correct EJB host based on the mapping
- // For now just select the first one
- getDefaultEJBHost().addSessionBean(ejbName, ejbClass);
- }
-
- public EJBSessionBean removeSessionBean(String ejbName) throws EJBRegistrationException {
- if (ejbHosts.getEJBHosts().isEmpty()) {
- throw new EJBRegistrationException("No EJB host available");
- }
-
- // TODO implement selection of the correct EJB host based on the mapping
- // For now just select the first one
- return getDefaultEJBHost().removeSessionBean(ejbName);
- }
-
- public EJBSessionBean getSessionBean(String ejbName) throws EJBRegistrationException {
- if (ejbHosts.getEJBHosts().isEmpty()) {
- throw new EJBRegistrationException("No EJB host available");
- }
-
- // TODO implement selection of the correct EJB host based on the mapping
- // For now just select the first one
- return getDefaultEJBHost().getSessionBean(ejbName);
- }
-
- private EJBHost getDefaultEJBHost() {
- return ejbHosts.getEJBHosts().get(0);
- }
-}
diff --git a/branches/sca-android/modules/host-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.ejb.EJBHostExtensionPoint b/branches/sca-android/modules/host-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.ejb.EJBHostExtensionPoint
deleted file mode 100644
index c42791f598..0000000000
--- a/branches/sca-android/modules/host-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.ejb.EJBHostExtensionPoint
+++ /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.ejb.DefaultEJBHostExtensionPoint
diff --git a/branches/sca-android/modules/host-http/LICENSE b/branches/sca-android/modules/host-http/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-http/META-INF/README b/branches/sca-android/modules/host-http/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-http/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-http/NOTICE b/branches/sca-android/modules/host-http/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/host-http/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/branches/sca-android/modules/host-http/pom.xml b/branches/sca-android/modules/host-http/pom.xml
deleted file mode 100644
index 258770c20b..0000000000
--- a/branches/sca-android/modules/host-http/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>1.4-SNAPSHOT</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>1.4-SNAPSHOT</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>
- </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.host.http</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.http*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultResourceServlet.java b/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultResourceServlet.java
deleted file mode 100644
index 3de0b9f5a7..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java b/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java
deleted file mode 100644
index 5e6de0b29b..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java b/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java
deleted file mode 100644
index 4be5de4100..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java b/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java
deleted file mode 100644
index e5dbd59a07..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostExtensionPoint.java b/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostExtensionPoint.java
deleted file mode 100644
index fbd085ba2b..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletMappingException.java b/branches/sca-android/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletMappingException.java
deleted file mode 100644
index ae66c44c3e..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.ServletHostExtensionPoint b/branches/sca-android/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.ServletHostExtensionPoint
deleted file mode 100644
index 44f4550b40..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-jetty/LICENSE b/branches/sca-android/modules/host-jetty/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-jetty/META-INF/README b/branches/sca-android/modules/host-jetty/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-jetty/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-jetty/NOTICE b/branches/sca-android/modules/host-jetty/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/host-jetty/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/branches/sca-android/modules/host-jetty/pom.xml b/branches/sca-android/modules/host-jetty/pom.xml
deleted file mode 100644
index 1a4c19b69a..0000000000
--- a/branches/sca-android/modules/host-jetty/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>1.4-SNAPSHOT</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>1.4-SNAPSHOT</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>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </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.host.jetty</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.http.jetty*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyDefaultServlet.java b/branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyDefaultServlet.java
deleted file mode 100644
index 4f5bfb3c62..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyLogger.java b/branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyLogger.java
deleted file mode 100644
index 1ecf1bca1b..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java b/branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java
deleted file mode 100644
index dfb34f11a5..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/module/JettyRuntimeModuleActivator.java b/branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/module/JettyRuntimeModuleActivator.java
deleted file mode 100644
index 884c8a4cce..0000000000
--- a/branches/sca-android/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/module/JettyRuntimeModuleActivator.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.http.jetty.module;
-
-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.http.jetty.JettyServer;
-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/branches/sca-android/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-android/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index f61708de90..0000000000
--- a/branches/sca-android/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.module.JettyRuntimeModuleActivator
diff --git a/branches/sca-android/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java b/branches/sca-android/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java
deleted file mode 100644
index 020dd4af0e..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-jetty/src/test/resources/content/test.html b/branches/sca-android/modules/host-jetty/src/test/resources/content/test.html
deleted file mode 100644
index f4b79d7f01..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-jetty/src/test/resources/tuscany.keyStore b/branches/sca-android/modules/host-jetty/src/test/resources/tuscany.keyStore
deleted file mode 100644
index 7ea23f7ff4..0000000000
--- a/branches/sca-android/modules/host-jetty/src/test/resources/tuscany.keyStore
+++ /dev/null
Binary files differ
diff --git a/branches/sca-android/modules/host-openejb/LICENSE b/branches/sca-android/modules/host-openejb/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/host-openejb/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/host-openejb/META-INF/README b/branches/sca-android/modules/host-openejb/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-openejb/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-openejb/NOTICE b/branches/sca-android/modules/host-openejb/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/host-openejb/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/branches/sca-android/modules/host-openejb/pom.xml b/branches/sca-android/modules/host-openejb/pom.xml
deleted file mode 100644
index 396d847f15..0000000000
--- a/branches/sca-android/modules/host-openejb/pom.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-host-openejb</artifactId>
- <name>Apache Tuscany SCA OpenEJB Host Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-ejb</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-openejb</artifactId>
- <version>2.1.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-connector</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-persistence-jpa10</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-javaagent</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- </exclusion>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm-commons</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm-all</artifactId>
- <version>3.1</version>
- <scope>runtime</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.host.openejb</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.openejb*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBRuntimeModuleActivator.java b/branches/sca-android/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBRuntimeModuleActivator.java
deleted file mode 100644
index 70bba08789..0000000000
--- a/branches/sca-android/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBRuntimeModuleActivator.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.host.openejb;
-
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.host.ejb.EJBHostExtensionPoint;
-
-/**
- * @version $Rev$ $Date$
- */
-public class OpenEJBRuntimeModuleActivator implements ModuleActivator {
- private static final Logger logger = Logger.getLogger(OpenEJBRuntimeModuleActivator.class.getName());
-
- private OpenEJBServer server;
-
- public void start(ExtensionPointRegistry extensionPointRegistry) {
-
- // Register our EJB host
- EJBHostExtensionPoint ejbHosts =
- extensionPointRegistry.getExtensionPoint(EJBHostExtensionPoint.class);
-
- server = new OpenEJBServer();
- ejbHosts.addEJBHost(server);
- }
-
- public void stop(ExtensionPointRegistry registry) {
- if (server != null) {
- server.stop();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBServer.java b/branches/sca-android/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBServer.java
deleted file mode 100644
index 0da02c284d..0000000000
--- a/branches/sca-android/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBServer.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.apache.tuscany.sca.host.openejb;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.apache.openejb.OpenEJB;
-import org.apache.openejb.OpenEJBException;
-import org.apache.openejb.assembler.classic.Assembler;
-import org.apache.openejb.assembler.classic.StatelessSessionContainerInfo;
-import org.apache.openejb.config.ConfigurationFactory;
-import org.apache.openejb.core.ServerFederation;
-import org.apache.openejb.jee.EjbJar;
-import org.apache.openejb.jee.StatelessBean;
-import org.apache.openejb.loader.SystemInstance;
-import org.apache.openejb.server.ServiceDaemon;
-import org.apache.openejb.server.ServiceException;
-import org.apache.openejb.server.ejbd.EjbServer;
-import org.apache.tuscany.sca.host.ejb.EJBHost;
-import org.apache.tuscany.sca.host.ejb.EJBRegistrationException;
-import org.apache.tuscany.sca.host.ejb.EJBSessionBean;
-
-/**
- * OpenEJB-based EJB host implementation.
- *
- * @version $Rev: $ $Date: $
- */
-public class OpenEJBServer implements EJBHost {
-
- private boolean started;
- private EjbServer ejbServer;
- private ServiceDaemon serviceDaemon;
- private ConfigurationFactory config;
- private Assembler assembler;
-
- public void addSessionBean(String ejbName, EJBSessionBean sessionBean) throws EJBRegistrationException {
- if (!started) {
- start();
- }
-
- try {
- StatelessBean bean = new StatelessBean(ejbName, sessionBean.getImplementationClass());
- bean.addBusinessRemote(sessionBean.getRemoteInterface().getName());
- bean.addPostConstruct("init");
- bean.addPreDestroy("destroy");
-
- EjbJar ejbJar = new EjbJar();
- ejbJar.addEnterpriseBean(bean);
-
- assembler.createApplication(config.configureApplication(ejbJar));
-
- } catch (NamingException e) {
- throw new EJBRegistrationException(e);
- } catch (IOException e) {
- throw new EJBRegistrationException(e);
- } catch (OpenEJBException e) {
- throw new EJBRegistrationException(e);
- }
- }
-
- public EJBSessionBean getSessionBean(String ejbName) throws EJBRegistrationException {
- // TODO Auto-generated method stub
- return null;
- }
-
- public EJBSessionBean removeSessionBean(String ejbName) throws EJBRegistrationException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * Start the OpenEJB server.
- *
- * @throws EJBRegistrationException
- */
- private void start() throws EJBRegistrationException {
- try {
- Properties properties = new Properties();
- properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
- properties.put(Context.PROVIDER_URL, "ejbd://localhost:2888");
- SystemInstance.init(properties);
-
- ejbServer = new EjbServer();
- SystemInstance.get().setComponent(EjbServer.class, ejbServer);
- OpenEJB.init(properties, new ServerFederation());
- ejbServer.init(properties);
-
- serviceDaemon = new ServiceDaemon(ejbServer, 2888, "localhost");
- serviceDaemon.start();
-
- config = new ConfigurationFactory();
- assembler = (Assembler)SystemInstance.get().getComponent(org.apache.openejb.spi.Assembler.class);
-
- // containers
- StatelessSessionContainerInfo statelessContainerInfo = config.configureService(StatelessSessionContainerInfo.class);
- statelessContainerInfo.properties.setProperty("TimeOut", "10");
- statelessContainerInfo.properties.setProperty("PoolSize", "0");
- statelessContainerInfo.properties.setProperty("StrictPooling", "false");
- assembler.createContainer(statelessContainerInfo);
-
- } catch (OpenEJBException e) {
- throw new EJBRegistrationException(e);
- } catch (Exception e) {
- throw new EJBRegistrationException(e);
- }
-
- started = true;
- }
-
- /**
- * Stop the OpenEJB server.
- */
- void stop() {
- if (started) {
- try {
- serviceDaemon.stop();
- } catch (ServiceException e) {
- throw new EJBRegistrationException(e);
- }
- }
- SystemInstance.get().removeComponent(EjbServer.class);
- OpenEJB.destroy();
- }
-
-}
diff --git a/branches/sca-android/modules/host-openejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-android/modules/host-openejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index 9247f40913..0000000000
--- a/branches/sca-android/modules/host-openejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
+++ /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 ModuleActivator
-org.apache.tuscany.sca.host.openejb.OpenEJBRuntimeModuleActivator
diff --git a/branches/sca-android/modules/host-openejb/src/test/java/org/apache/tuscany/sca/host/openejb/OpenEJBServerTestCase.java b/branches/sca-android/modules/host-openejb/src/test/java/org/apache/tuscany/sca/host/openejb/OpenEJBServerTestCase.java
deleted file mode 100644
index 7d2301a770..0000000000
--- a/branches/sca-android/modules/host-openejb/src/test/java/org/apache/tuscany/sca/host/openejb/OpenEJBServerTestCase.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.openejb;
-
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.ejb.EJBSessionBean;
-
-/**
- * @version $Rev$ $Date$
- */
-public class OpenEJBServerTestCase extends TestCase {
-
- public interface TestRemote {
- String test(String s);
- }
-
- public static class TestImpl implements TestRemote {
-
- public TestImpl() {
- }
-
- public String test(String s) {
- return s.toUpperCase();
- }
-
- public void init() {
- }
-
- public void destroy() {
- }
- }
-
- private OpenEJBServer server;
-
- @Override
- protected void setUp() throws Exception {
- server = new OpenEJBServer();
- }
-
- @Override
- protected void tearDown() throws Exception {
- server.stop();
- }
-
- /**
- * Verifies registration and invocation of a session bean
- */
- public void testStatelessSessionBean() throws Exception {
- server.addSessionBean("TestBean", new EJBSessionBean(TestImpl.class, TestRemote.class));
-
- Properties properties = new Properties(System.getProperties());
- //properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, InitContextFactory.class.getName());
- properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
- properties.put(Context.PROVIDER_URL, "ejbd://localhost:2888");
- InitialContext ctx = new InitialContext(properties);
- Object object = ctx.lookup("TestBeanRemote");
- assertTrue(object instanceof TestRemote);
-
- TestRemote testRemote = (TestRemote)object;
- String s = testRemote.test("test");
- assertEquals("TEST", s);
- }
-
-}
diff --git a/branches/sca-android/modules/host-rmi/LICENSE b/branches/sca-android/modules/host-rmi/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-rmi/META-INF/README b/branches/sca-android/modules/host-rmi/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-rmi/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-rmi/NOTICE b/branches/sca-android/modules/host-rmi/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/host-rmi/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/branches/sca-android/modules/host-rmi/pom.xml b/branches/sca-android/modules/host-rmi/pom.xml
deleted file mode 100644
index 8700f1de85..0000000000
--- a/branches/sca-android/modules/host-rmi/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-host-rmi</artifactId>
- <name>Apache Tuscany SCA RMI Host Extension Point</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.host.rmi</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.rmi*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHost.java b/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHost.java
deleted file mode 100644
index 8985c508fc..0000000000
--- a/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHost.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.host.rmi;
-
-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 serviceName, int port, Remote serviceObject) throws RMIHostException,
- RMIHostRuntimeException {
- Registry registry;
- try {
- registry = rmiRegistries.get(Integer.toString(port));
- if (registry == null) {
- try {
- registry = LocateRegistry.getRegistry(port);
- registry.list();
- } catch (RemoteException e) {
- registry = LocateRegistry.createRegistry(port);
- }
- rmiRegistries.put(Integer.toString(port), registry);
- }
- registry.bind(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 registerService(String serviceName, Remote serviceObject) throws RMIHostException,
- RMIHostRuntimeException {
- registerService(serviceName, RMI_DEFAULT_PORT, serviceObject);
- }
-
- public void unregisterService(String serviceName, int port) throws RMIHostException, RMIHostRuntimeException {
- Registry registry;
-
- try {
- registry = rmiRegistries.get(Integer.toString(port));
- if (registry == null) {
- registry = LocateRegistry.getRegistry(port);
- rmiRegistries.put(Integer.toString(port), registry);
- }
- registry.unbind(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 void unregisterService(String serviceName) throws RMIHostException, RMIHostRuntimeException {
- unregisterService(serviceName, RMI_DEFAULT_PORT);
-
- }
-
- public Remote findService(String host, String port, String svcName) throws RMIHostException,
- RMIHostRuntimeException {
- Registry registry;
- Remote remoteService = null;
- host = (host == null || host.length() <= 0) ? "localhost" : host;
- int portNumber = (port == null || port.length() <= 0) ? RMI_DEFAULT_PORT : Integer.decode(port);
-
- try {
- // Requires permission java.net.SocketPermission "host:port", "connect,accept,resolve"
- // in security policy.
- registry = LocateRegistry.getRegistry(host, portNumber);
-
- if (registry != null) {
- remoteService = registry.lookup(svcName);
- }
- } 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;
- }
-
-}
diff --git a/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHostExtensionPoint.java b/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHostExtensionPoint.java
deleted file mode 100644
index 3ac086a2ee..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java b/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java
deleted file mode 100644
index 32fe6c2deb..0000000000
--- a/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.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.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 serviceName, int port, Remote serviceObject) throws RMIHostException, RMIHostRuntimeException {
- if (rmiHosts.getRMIHosts().isEmpty()) {
- throw new RMIHostException("No RMI host available");
- }
- rmiHosts.getRMIHosts().get(0).registerService(serviceName, port, serviceObject);
- }
-
- public Remote findService(String host, String port, String svcName) throws RMIHostException, RMIHostRuntimeException {
- if (rmiHosts.getRMIHosts().isEmpty()) {
- throw new RMIHostException("No RMI host available");
- }
- return rmiHosts.getRMIHosts().get(0).findService(host, port, svcName);
- }
-
- public void registerService(String serviceName, Remote serviceObject) throws RMIHostException, RMIHostRuntimeException {
- if (rmiHosts.getRMIHosts().isEmpty()) {
- throw new RMIHostException("No RMI host available");
- }
- rmiHosts.getRMIHosts().get(0).registerService(serviceName, serviceObject);
- }
-
- public void unregisterService(String serviceName) throws RMIHostException, RMIHostRuntimeException {
- if (rmiHosts.getRMIHosts().isEmpty()) {
- throw new RMIHostException("No RMI host available");
- }
- rmiHosts.getRMIHosts().get(0).unregisterService(serviceName);
- }
-
- public void unregisterService(String serviceName, int port) throws RMIHostException, RMIHostRuntimeException {
- if (rmiHosts.getRMIHosts().isEmpty()) {
- throw new RMIHostException("No RMI host available");
- }
- rmiHosts.getRMIHosts().get(0).unregisterService(serviceName, port);
- }
-
-}
diff --git a/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHost.java b/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHost.java
deleted file mode 100644
index 59377de22a..0000000000
--- a/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHost.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.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 serviceName against which the server is to be registered
- * @param port the port against which the server is to be registered
- * @param serviceObject the server object to be registered
- * @throws RMIHostException
- * @throws RMIHostRuntimeException
- */
- void registerService(String serviceName, int port, Remote serviceObject) throws RMIHostException,
- RMIHostRuntimeException;
-
- /**
- * Register an RMI service with the given name and default port (1099)
- *
- * @param serviceName serviceName against which the server is to be registered
- * @param serviceObject the server object to be registered
- * @throws RMIHostException
- * @throws RMIHostRuntimeException
- */
- void registerService(String serviceName, Remote serviceObject) throws RMIHostException,
- RMIHostRuntimeException;
-
- /**
- * Unregister a service registered under the given service name and port number
- *
- * @param serviceName serviceName against which the server is to be registered
- * @param port the port against which the server is to be registered
- * @throws RMIHostException
- * @throws RMIHostRuntimeException
- */
- void unregisterService(String serviceName, int port) throws RMIHostException,
- RMIHostRuntimeException;
-
- /**
- * Unregister a service registered under the given service name and default port number (1099)
- *
- * @param serviceName the name of the service that has to be unregistered
- * @throws RMIHostException
- * @throws RMIHostRuntimeException
- */
- void unregisterService(String serviceName) throws RMIHostException,
- RMIHostRuntimeException;
-
-
- /**
- * find a remote service hosted on the given host, port and service name
- *
- * @param host the name of the host on which the RMI service to be unregistered is running
- * @param port the port against which the server is to be unregistered is running
- * @param svcName serviceName against which the server is to be unregistered is running
- * @return the RMI server object
- * @throws RMIHostException
- * @throws RMIHostRuntimeException
- */
- Remote findService(String host, String port, String svcName) throws RMIHostException,
- RMIHostRuntimeException;
-
-}
diff --git a/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java b/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java
deleted file mode 100644
index 959eb72f6e..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostExtensionPoint.java b/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostExtensionPoint.java
deleted file mode 100644
index 40d6013940..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java b/branches/sca-android/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java
deleted file mode 100644
index 998287f998..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint b/branches/sca-android/modules/host-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint
deleted file mode 100644
index 014c5391b8..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java b/branches/sca-android/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java
deleted file mode 100644
index 04d4d0f3cb..0000000000
--- a/branches/sca-android/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(null, "9994", "$BAD$");
- fail();
- } catch (RMIHostRuntimeException e) {
- // expected
- }
- }
-
- public void testRegisterService1() throws RMIHostRuntimeException, RMIHostException {
- DefaultRMIHost host = new DefaultRMIHost();
- host.registerService("foo1", 9996, new MockRemote());
- host.unregisterService("foo1", 9996);
- }
-
- public void testExistingRegistry() throws RMIHostRuntimeException, RMIHostException {
- DefaultRMIHost host1 = new DefaultRMIHost();
- host1.registerService("foo1", 9995, new MockRemote());
- DefaultRMIHost host2 = new DefaultRMIHost();
- host2.registerService("foo2", 9995, new MockRemote());
- host2.unregisterService("foo1", 9995);
- host2.unregisterService("foo2", 9995);
- }
-
- public void testRegisterService2() throws RMIHostRuntimeException, RMIHostException {
- DefaultRMIHost host = new DefaultRMIHost();
- host.registerService("bar1", 9999, new MockRemote());
- host.unregisterService("bar1", 9999);
- }
-
- public void testRegisterServiceAlreadyBound() throws RMIHostRuntimeException, RMIHostException {
- DefaultRMIHost host = new DefaultRMIHost();
- host.registerService("bar2", 9997, new MockRemote());
- try {
- host.registerService("bar2", 9997, new MockRemote());
- } catch (RMIHostException e) {
- // expected
- host.unregisterService("bar2", 9997);
- }
- }
-
- public void testUnRegisterService() throws RMIHostRuntimeException, RMIHostException {
- DefaultRMIHost host = new DefaultRMIHost();
- try {
- host.unregisterService("bar3", 9998);
- fail();
- } catch (RMIHostRuntimeException e) {
- // expected
- }
- }
-
- private static class MockRemote implements Remote, Serializable {
- }
-}
diff --git a/branches/sca-android/modules/host-tomcat/LICENSE b/branches/sca-android/modules/host-tomcat/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/host-tomcat/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/host-tomcat/META-INF/README b/branches/sca-android/modules/host-tomcat/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-tomcat/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-tomcat/NOTICE b/branches/sca-android/modules/host-tomcat/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/host-tomcat/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/branches/sca-android/modules/host-tomcat/pom.xml b/branches/sca-android/modules/host-tomcat/pom.xml
deleted file mode 100644
index 58032e137d..0000000000
--- a/branches/sca-android/modules/host-tomcat/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-host-tomcat</artifactId>
- <name>Apache Tuscany SCA Tomcat Servlet Host Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>catalina</artifactId>
- <version>6.0.14</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>coyote</artifactId>
- <version>6.0.14</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </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.host.tomcat</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.http.tomcat*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/ServletWrapper.java b/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/ServletWrapper.java
deleted file mode 100644
index a0b384d554..0000000000
--- a/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/ServletWrapper.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.http.tomcat;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-
-import org.apache.catalina.core.StandardWrapper;
-
-/**
- * A Servlet wrapper.
- *
- * @version $Rev$ $Date$
- */
-public class ServletWrapper extends StandardWrapper {
- private static final long serialVersionUID = 1L;
-
- private final Servlet servlet;
-
- public ServletWrapper(Servlet servlet) {
- this.servlet = servlet;
- }
-
- @Override
- public synchronized Servlet loadServlet() {
- return servlet;
- }
-
- @Override
- public Servlet getServlet() {
- return servlet;
- }
-
- public void initServlet() throws ServletException {
- servlet.init(facade);
- }
-
- public void destroyServlet() {
- servlet.destroy();
- }
-
-}
diff --git a/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/TomcatDefaultServlet.java b/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/TomcatDefaultServlet.java
deleted file mode 100644
index 5d9b65503a..0000000000
--- a/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/TomcatDefaultServlet.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.http.tomcat;
-
-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.Hashtable;
-
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
-import javax.naming.directory.DirContext;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.catalina.servlets.DefaultServlet;
-import org.apache.naming.resources.FileDirContext;
-import org.apache.naming.resources.ProxyDirContext;
-import org.apache.naming.resources.Resource;
-
-/**
- * DefaultServlet implementation for Tomcat.
- *
- * @version $Rev$ $Date$
- */
-public class TomcatDefaultServlet extends DefaultServlet {
- private static final long serialVersionUID = -7503581551326796573L;
-
- private String documentRoot;
- private ProxyDirContext proxyDirContext;
-
- public TomcatDefaultServlet(String servletPath, String documentRoot) {
- this.documentRoot = documentRoot;
-
- DirContext dirContext;
- URI uri = URI.create(documentRoot);
- if (!"file".equals(uri.getScheme())) {
-
- dirContext = new FileDirContext() {
- @Override
- public Attributes getAttributes(String name) throws NamingException {
- return new BasicAttributes();
- }
-
- @Override
- public Object lookup(String name) throws NamingException {
-
- try {
- final URL url = new URL(TomcatDefaultServlet.this.documentRoot + name);
- return new Resource() {
- @Override
- public InputStream streamContent() throws IOException {
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- return connection.getInputStream();
- }
- };
- } catch (MalformedURLException e) {
- throw new NamingException(e.toString());
- }
- }
- };
-
- } else {
- dirContext = new FileDirContext();
- ((FileDirContext)dirContext).setDocBase(uri.getPath());
- }
- proxyDirContext = new ProxyDirContext(new Hashtable(), dirContext);
- resources = proxyDirContext;
- }
-
- @Override
- public void init() throws ServletException {
- super.init();
- resources = proxyDirContext;
- }
-
- @Override
- public void init(ServletConfig servletConfig) throws ServletException {
- super.init(servletConfig);
- resources = proxyDirContext;
- }
-
- @Override
- protected String getRelativePath(HttpServletRequest request) {
- String path = request.getPathInfo();
- if (path == null || path.length() == 0) {
- path = "/";
- }
- return path;
- }
-}
diff --git a/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/TomcatServer.java b/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/TomcatServer.java
deleted file mode 100644
index 5ea1701c05..0000000000
--- a/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/TomcatServer.java
+++ /dev/null
@@ -1,653 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.tomcat;
-
-import java.beans.PropertyChangeListener;
-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.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-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.Map.Entry;
-import java.util.concurrent.Executor;
-import java.util.logging.Logger;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-
-import org.apache.catalina.Container;
-import org.apache.catalina.Context;
-import org.apache.catalina.Lifecycle;
-import org.apache.catalina.LifecycleException;
-import org.apache.catalina.Loader;
-import org.apache.catalina.connector.Connector;
-import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.core.StandardEngine;
-import org.apache.catalina.core.StandardHost;
-import org.apache.catalina.startup.ContextConfig;
-import org.apache.coyote.http11.Http11Protocol;
-import org.apache.tomcat.util.buf.MessageBytes;
-import org.apache.tomcat.util.http.mapper.MappingData;
-import org.apache.tomcat.util.net.JIoEndpoint;
-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;
-
-/**
- * A Tomcat based implementation of ServletHost.
- *
- * @version $Rev$ $Date$
- */
-@SuppressWarnings("deprecation")
-public class TomcatServer implements ServletHost {
- private static final Logger logger = Logger.getLogger(TomcatServer.class.getName());
-
- private int defaultPortNumber = 8080;
-
- private final class TuscanyLoader implements Loader {
- private final ClassLoader tccl;
- private boolean delegate;
- private boolean reloadable;
- private Container container;
- private List<String> repos = new ArrayList<String>();
- private List<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
-
- private TuscanyLoader(ClassLoader tccl) {
- this.tccl = tccl;
- }
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- listeners.add(listener);
- }
-
- public void addRepository(String repository) {
- repos.add(repository);
- }
-
- public void backgroundProcess() {
- }
-
- public String[] findRepositories() {
- return repos.toArray(new String[repos.size()]);
- }
-
- public Container getContainer() {
- return container;
- }
-
- public boolean getDelegate() {
- return delegate;
- }
-
- public String getInfo() {
- return "Tuscany Loader for Embedded Tomcat";
- }
-
- public boolean getReloadable() {
- return reloadable;
- }
-
- public boolean modified() {
- return false;
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- listeners.remove(listener);
- }
-
- public void setContainer(Container container) {
- this.container = container;
- }
-
- public void setDelegate(boolean delegate) {
- this.delegate = delegate;
- }
-
- public void setReloadable(boolean reloadable) {
- this.reloadable = reloadable;
- }
-
- public ClassLoader getClassLoader() {
- return tccl;
- }
- }
-
- /**
- * Represents a port and the server that serves it.
- */
- private class Port {
- private StandardEngine engine;
- private StandardHost host;
- private Connector connector;
-
- private Port(StandardEngine engine, StandardHost host, Connector connector) {
- this.engine = engine;
- this.host = host;
- this.connector = connector;
- }
-
- public StandardEngine getEngine() {
- return engine;
- }
-
- public StandardHost getHost() {
- return host;
- }
-
- public Connector getConnector() {
- return connector;
- }
- }
-
- private Map<Integer, Port> ports = new HashMap<Integer, Port>();
-
- private WorkScheduler workScheduler;
-
- private String contextPath = "/";
-
- /**
- * Constructs a new embedded Tomcat server.
- *
- * @param workScheduler the WorkScheduler to use to process requests.
- */
- public TomcatServer(WorkScheduler workScheduler) {
- this.workScheduler = workScheduler;
- }
-
- public void setDefaultPort(int port) {
- defaultPortNumber = port;
- }
-
- public int getDefaultPort() {
- return defaultPortNumber;
- }
-
- /**
- * Stop all the started servers.
- */
- public void stop() throws ServletMappingException {
- if (!ports.isEmpty()) {
- try {
- Set<Entry<Integer, Port>> entries = new HashSet<Entry<Integer, Port>>(ports.entrySet());
- for (Entry<Integer, Port> entry : entries) {
- Port port = entry.getValue();
- port.getConnector().stop();
- port.getEngine().stop();
- ports.remove(entry.getKey());
- }
- } catch (Exception e) {
- throw new ServletMappingException(e);
- }
- }
- }
-
- public void addServletMapping(String suri, Servlet servlet) {
- URI uri = URI.create(suri);
-
- // Get the URI scheme and port
- String scheme = uri.getScheme();
- if (scheme == null) {
- scheme = "http";
- }
- final int portNumber = (uri.getPort() == -1 ? defaultPortNumber : uri.getPort());
-
- // Get the port object associated with the given port number
- Port port = ports.get(portNumber);
- if (port == null) {
-
- // Create an engine
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- final StandardEngine engine = AccessController.doPrivileged(new PrivilegedAction<StandardEngine>() {
- public StandardEngine run() {
- return new StandardEngine();
- }
- });
-
- engine.setBaseDir("");
- engine.setDefaultHost("localhost");
- engine.setName("engine/" + portNumber);
-
- // Create a host
- final StandardHost host = new StandardHost();
- host.setAppBase("");
- host.setName("localhost");
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- engine.addChild(host);
- return null;
- }
- });
-
- // Create the root context
- StandardContext context = new StandardContext();
- final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- context.setLoader(new TuscanyLoader(tccl));
- // context.setParentClassLoader(tccl.getParent());
- context.setDocBase("");
- context.setPath("");
- ContextConfig config = new ContextConfig();
- ((Lifecycle)context).addLifecycleListener(config);
- host.addChild(context);
-
- // Install an HTTP connector
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws LifecycleException {
- engine.start();
- return null;
- }
- });
- } catch (PrivilegedActionException e) {
- // throw (LifecycleException)e.getException();
- throw new ServletMappingException(e);
- }
- Connector connector;
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- try {
- final String protocol = scheme;
- connector = AccessController.doPrivileged(new PrivilegedExceptionAction<CustomConnector>() {
- public CustomConnector run() throws Exception {
- CustomConnector customConnector = new CustomConnector();
- customConnector.setPort(portNumber);
- customConnector.setContainer(engine);
-
- if ("https".equalsIgnoreCase(protocol)) {
- configureSSL(customConnector);
- ((Http11Protocol) customConnector.getProtocolHandler()).setSSLEnabled(true);
- }
- customConnector.initialize();
- customConnector.start();
- return customConnector;
- }
-
- private void configureSSL(CustomConnector customConnector) {
- String trustStore = System.getProperty("javax.net.ssl.trustStore");
- String trustStorePass = System.getProperty("javax.net.ssl.trustStorePassword");
- String keyStore = System.getProperty("javax.net.ssl.keyStore");
- String keyStorePass = System.getProperty("javax.net.ssl.keyStorePassword");
-
- customConnector.setProperty("protocol", "TLS");
-
- customConnector.setProperty("keystore", keyStore);
- customConnector.setProperty("keypass", keyStorePass);
- String keyStoreType =
- System.getProperty("javax.net.ssl.keyStoreType", KeyStore.getDefaultType());
- String trustStoreType =
- System.getProperty("javax.net.ssl.trustStoreType", KeyStore.getDefaultType());
- customConnector.setProperty("keytype", keyStoreType);
- customConnector.setProperty("trusttype", trustStoreType);
- customConnector.setProperty("truststore", trustStore);
- customConnector.setProperty("trustpass", trustStorePass);
-
- customConnector.setProperty("clientauth", "false");
- customConnector.setProtocol("HTTP/1.1");
- customConnector.setScheme(protocol);
- customConnector.setProperty("backlog", "10");
- customConnector.setSecure(true);
- }
- });
- } catch (Exception e) {
- throw new ServletMappingException(e);
- }
- // Keep track of the running server
- port = new Port(engine, host, connector);
- ports.put(portNumber, port);
- }
-
- // Register the Servlet mapping
- String path = uri.getPath();
-
- if (!path.startsWith("/")) {
- path = '/' + path;
- }
-
- if (!path.startsWith(contextPath)) {
- path = contextPath + path;
- }
-
- ServletWrapper wrapper;
- if (servlet instanceof DefaultResourceServlet) {
- String defaultServletPath = path;
-
- // Optimize the handling of resource requests, use the Tomcat default Servlet
- // instead of our default resource Servlet
- if (defaultServletPath.endsWith("*")) {
- defaultServletPath = defaultServletPath.substring(0, defaultServletPath.length() - 1);
- }
- if (defaultServletPath.endsWith("/")) {
- defaultServletPath = defaultServletPath.substring(0, defaultServletPath.length() - 1);
- }
- DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
- TomcatDefaultServlet defaultServlet =
- new TomcatDefaultServlet(defaultServletPath, resourceServlet.getDocumentRoot());
- wrapper = new ServletWrapper(defaultServlet);
-
- } else {
- wrapper = new ServletWrapper(servlet);
- }
- Context context = port.getHost().map(path);
- wrapper.setName(path);
- wrapper.addMapping(path);
- context.addChild(wrapper);
- context.addServletMapping(path, path);
- port.getConnector().getMapper().addWrapper("localhost", "", path, wrapper);
-
- // Initialize the Servlet
- try {
- wrapper.initServlet();
- } catch (ServletException e) {
- throw new ServletMappingException(e);
- }
-
- // 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 = 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 (!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 = defaultPortNumber;
- }
-
- // Get the port object associated with the given port number
- Port port = ports.get(portNumber);
- if (port == null) {
- return null;
- }
-
- String mapping = uri.getPath();
-
- if (!mapping.startsWith("/")) {
- mapping = '/' + mapping;
- }
-
- if (!mapping.startsWith(contextPath)) {
- mapping = contextPath + mapping;
- }
-
- final Context context = port.getHost().map(mapping);
- final MappingData md = new MappingData();
- final MessageBytes mb = MessageBytes.newInstance();
- mb.setString(mapping);
- try {
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws Exception {
- context.getMapper().map(mb, md);
- return null;
- }
- });
- } catch (Exception e) {
- return null;
- }
- if (md.wrapper instanceof ServletWrapper) {
- ServletWrapper servletWrapper = (ServletWrapper)md.wrapper;
- return servletWrapper.getServlet();
- } else {
- return null;
- }
- }
-
- public Servlet removeServletMapping(String suri) {
- URI uri = URI.create(suri);
-
- // Get the URI port
- int portNumber = uri.getPort();
- if (portNumber == -1) {
- portNumber = defaultPortNumber;
- }
-
- // 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);
- }
-
- String mapping = uri.getPath();
-
- if (!mapping.startsWith("/")) {
- mapping = '/' + mapping;
- }
-
- if (!mapping.startsWith(contextPath)) {
- mapping = contextPath + mapping;
- }
-
- final Context context = port.getHost().map(mapping);
- final MappingData md = new MappingData();
- final MessageBytes mb = MessageBytes.newInstance();
- mb.setString(mapping);
- try {
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws Exception {
- context.getMapper().map(mb, md);
- return null;
- }
- });
- } catch (Exception e) {
- return null;
- }
- if (md.wrapper instanceof ServletWrapper) {
- ServletWrapper servletWrapper = (ServletWrapper)md.wrapper;
-
- port.getConnector().getMapper().removeWrapper("localhost", "", mapping);
-
- try {
- context.removeServletMapping(mapping);
- } catch (NegativeArraySizeException e) {
- // JIRA TUSCANY-1599
- // FIXME Looks like a bug in Tomcat when removing the last
- // Servlet in the list, catch the exception for now as it doesn't
- // seem harmful, will find a better solution for the next release
- }
- context.removeChild(servletWrapper);
- try {
- servletWrapper.destroyServlet();
- } catch (Exception ex) {
- // Hack to handle destruction of Servlets without Servlet context
- }
-
- logger.info("Removed Servlet mapping: " + suri);
-
- // Stop the port if there's no servlets on it anymore
- String[] contextNames = port.getConnector().getMapper().getContextNames();
- if (contextNames == null || contextNames.length == 0) {
- try {
- port.getConnector().stop();
- port.getEngine().stop();
- ports.remove(portNumber);
- } catch (LifecycleException e) {
- throw new IllegalStateException(e);
- }
- }
-
- return servletWrapper.getServlet();
- } else {
- logger.warning("Trying to Remove servlet mapping: " + mapping + " where mapping is not registered");
- return null;
- }
- }
-
- public RequestDispatcher getRequestDispatcher(String suri) throws ServletMappingException {
- //FIXME implement this later
- return null;
- }
-
- public String getContextPath() {
- return contextPath;
- }
-
- /**
- * A custom connector that uses our WorkScheduler to schedule
- * worker threads.
- */
- private class CustomConnector extends Connector {
-
- private class CustomHttpProtocolHandler extends Http11Protocol {
-
- /**
- * An Executor wrapping our WorkScheduler
- */
- private class WorkSchedulerExecutor implements Executor {
- public void execute(Runnable command) {
- workScheduler.scheduleWork(command);
- }
- }
-
- /**
- * A custom Endpoint that waits for its acceptor thread to
- * terminate before stopping.
- */
- private class CustomEndpoint extends JIoEndpoint {
- private Thread acceptorThread;
-
- private class CustomAcceptor extends Acceptor {
- CustomAcceptor() {
- super();
- }
- }
-
- @Override
- public void start() throws Exception {
- if (!initialized)
- init();
- if (!running) {
- running = true;
- paused = false;
- acceptorThread = new Thread(new CustomAcceptor(), getName() + "-Acceptor-" + 0);
- acceptorThread.setPriority(threadPriority);
- acceptorThread.setDaemon(daemon);
- acceptorThread.start();
- }
- }
-
- @Override
- public void stop() {
- super.stop();
- try {
- acceptorThread.join();
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public int getCurrentThreadsBusy() {
- return 0;
- }
- }
-
- CustomHttpProtocolHandler() {
- endpoint = new CustomEndpoint();
- endpoint.setExecutor(new WorkSchedulerExecutor());
- }
- }
-
- CustomConnector() throws Exception {
- protocolHandler = new CustomHttpProtocolHandler();
- }
- }
-
- public void setContextPath(String path) {
- this.contextPath = path;
- }
-
-}
diff --git a/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/module/TomcatRuntimeModuleActivator.java b/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/module/TomcatRuntimeModuleActivator.java
deleted file mode 100644
index 070dffdce6..0000000000
--- a/branches/sca-android/modules/host-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/module/TomcatRuntimeModuleActivator.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.http.tomcat.module;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-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.http.tomcat.TomcatServer;
-import org.apache.tuscany.sca.work.WorkScheduler;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TomcatRuntimeModuleActivator implements ModuleActivator {
-
- private TomcatServer server;
-
- public void start(ExtensionPointRegistry extensionPointRegistry) {
-
- // Register a Tomcat 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.
- server = AccessController.doPrivileged(new PrivilegedAction<TomcatServer>() {
- public TomcatServer run() {
- return new TomcatServer(workScheduler);
- }
- });
- servletHosts.addServletHost(server);
- }
- }
-
- 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/branches/sca-android/modules/host-tomcat/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-android/modules/host-tomcat/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index f0f4e17507..0000000000
--- a/branches/sca-android/modules/host-tomcat/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.tomcat.module.TomcatRuntimeModuleActivator
diff --git a/branches/sca-android/modules/host-tomcat/src/test/java/org/apache/tuscany/sca/http/tomcat/TomcatServerTestCase.java b/branches/sca-android/modules/host-tomcat/src/test/java/org/apache/tuscany/sca/http/tomcat/TomcatServerTestCase.java
deleted file mode 100644
index afbec52cd9..0000000000
--- a/branches/sca-android/modules/host-tomcat/src/test/java/org/apache/tuscany/sca/http/tomcat/TomcatServerTestCase.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.tomcat;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-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 TomcatServerTestCase extends TestCase {
-
- private static final String REQUEST1_HEADER =
- "GET /foo 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 {
- TomcatServer service = new TomcatServer(workScheduler);
- TestServlet servlet = new TestServlet();
- service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo", 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);
- }
-
- /**
- * Verifies requests are properly routed according to the Servlet mapping
- */
- public void testRegisterServletMappingSSL() throws Exception {
- System.setProperty("javax.net.ssl.keyStore", "target/test-classes/tuscany.keyStore");
- System.setProperty("javax.net.ssl.keyStorePassword", "apache");
- TomcatServer service = new TomcatServer(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.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 {
- TomcatServer service = new TomcatServer(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 {
- TomcatServer service = new TomcatServer(workScheduler);
- TestServlet servlet = new TestServlet();
- service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo", servlet);
- service.removeServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo");
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
- read(client);
- service.stop();
- assertFalse(servlet.invoked);
-
- }
-
- public void testRegisterUnregisterMapping() throws Exception {
- TomcatServer service = new TomcatServer(workScheduler);
- TestServlet servlet = new TestServlet();
- service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo", servlet);
- {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
- read(client);
- }
- assertTrue(servlet.invoked);
- service.removeServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo");
- {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
- read(client);
- }
- servlet = new TestServlet();
- service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo", servlet);
- {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
- read(client);
- }
- assertTrue(servlet.invoked);
- service.stop();
- }
-
- public void testRequestSession() throws Exception {
- TomcatServer service = new TomcatServer(workScheduler);
- TestServlet servlet = new TestServlet();
- service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo", 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 {
- TomcatServer service = new TomcatServer(workScheduler);
- service.stop();
- service.stop();
- }
-
- public void testNoMappings() throws Exception {
- TomcatServer service = new TomcatServer(workScheduler);
- Exception ex = null;
- try {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
- } catch (Exception e) {
- ex = e;
- }
- assertNotNull(ex);
- service.stop();
- }
-
- public void testResourceServlet() throws Exception {
- TomcatServer service = new TomcatServer(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 {
- TomcatServer service = new TomcatServer(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/branches/sca-android/modules/host-tomcat/src/test/resources/content/test.html b/branches/sca-android/modules/host-tomcat/src/test/resources/content/test.html
deleted file mode 100644
index f4b79d7f01..0000000000
--- a/branches/sca-android/modules/host-tomcat/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/branches/sca-android/modules/host-tomcat/src/test/resources/tuscany.keyStore b/branches/sca-android/modules/host-tomcat/src/test/resources/tuscany.keyStore
deleted file mode 100644
index 7ea23f7ff4..0000000000
--- a/branches/sca-android/modules/host-tomcat/src/test/resources/tuscany.keyStore
+++ /dev/null
Binary files differ
diff --git a/branches/sca-android/modules/host-webapp-junit/LICENSE b/branches/sca-android/modules/host-webapp-junit/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/host-webapp-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/branches/sca-android/modules/host-webapp-junit/META-INF/README b/branches/sca-android/modules/host-webapp-junit/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-webapp-junit/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-webapp-junit/NOTICE b/branches/sca-android/modules/host-webapp-junit/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/host-webapp-junit/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/branches/sca-android/modules/host-webapp-junit/pom.xml b/branches/sca-android/modules/host-webapp-junit/pom.xml
deleted file mode 100644
index 27c8359414..0000000000
--- a/branches/sca-android/modules/host-webapp-junit/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-host-webapp-junit</artifactId>
- <name>Apache Tuscany SCA Webapp JUnit Host</name>
-
- <dependencies>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</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>
-
- </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.host.webapp.junit</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.webapp.junit*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-webapp-junit/src/main/java/org/apache/tuscany/sca/host/webapp/junit/JUnitServletFilter.java b/branches/sca-android/modules/host-webapp-junit/src/main/java/org/apache/tuscany/sca/host/webapp/junit/JUnitServletFilter.java
deleted file mode 100644
index b2d3d0abf1..0000000000
--- a/branches/sca-android/modules/host-webapp-junit/src/main/java/org/apache/tuscany/sca/host/webapp/junit/JUnitServletFilter.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.host.webapp.junit;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-import java.util.logging.Logger;
-import java.util.regex.Pattern;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-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 junit.framework.AssertionFailedError;
-
-import org.junit.runner.JUnitCore;
-import org.junit.runner.Request;
-import org.junit.runner.Result;
-import org.junit.runner.notification.Failure;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JUnitServletFilter implements Filter {
- private static final Logger logger = Logger.getLogger(JUnitServletFilter.class.getName());
-
- private static final String JUNIT_TESTS_PATTERN = "junit.tests.pattern";
- private static final String JUNIT_TESTS_PATH = "junit.tests.path";
- private static final String JUNIT_ENABLED = "junit.enabled";
- private static final String TESTCASE_PATTERN = ".*TestCase";
- private static final String TESTS_JAR = "/WEB-INF/test-lib/junit-tests.jar";
-
- private FilterConfig config;
- private boolean junitEnabled = true;
- private Set<String> allTestCases;
- private ClassLoader testClassLoader;
-
- private Set<String> findTestCases(String testJarPath) throws IOException {
- Pattern pattern = getTestCasePattern();
- if (testJarPath.endsWith(".jar")) {
- return findTestCasesInJar(testJarPath, pattern);
- } else {
- return findTestCasesInDir(testJarPath, pattern);
- }
- }
-
- /**
- * Search test cases in a JAR
- * @param testJarPath
- * @param pattern
- * @return
- * @throws IOException
- */
- private Set<String> findTestCasesInJar(String testJarPath, Pattern pattern) throws IOException {
- InputStream in = config.getServletContext().getResourceAsStream(testJarPath);
- Set<String> tests = new HashSet<String>();
- if (in != null) {
- JarInputStream jar = new JarInputStream(in);
- try {
- JarEntry entry = null;
-
- while ((entry = jar.getNextJarEntry()) != null) {
- String name = entry.getName();
-
- if (name.endsWith(".class")) {
- String className = name.substring(0, name.length() - 6).replace('/', '.');
- if (pattern.matcher(className).matches()) {
- tests.add(className);
- }
- }
- }
- } catch (EOFException e) {
- } finally {
- if (jar != null) {
- try {
- jar.close();
- } catch (IOException e) {
- }
- }
- }
-
- }
- return tests;
- }
-
- private Pattern getTestCasePattern() {
- String filter = config.getInitParameter(JUNIT_TESTS_PATTERN);
- if (filter == null) {
- filter = TESTCASE_PATTERN;
- }
- Pattern pattern = Pattern.compile(filter);
- return pattern;
- }
-
- public void destroy() {
- }
-
- private void init() throws IOException {
- testClassLoader = Thread.currentThread().getContextClassLoader();
- allTestCases = new HashSet<String>();
- String testsPath = config.getInitParameter(JUNIT_TESTS_PATH);
- if (testsPath == null) {
- testsPath = TESTS_JAR;
- }
- URL url = config.getServletContext().getResource(testsPath);
- if (url != null) {
- allTestCases = findTestCases(testsPath);
- if (!(testsPath.startsWith("/WEB-INF/lib/") || testsPath.startsWith("/WEB-INF/classes/"))) {
- // Create a new ClassLoader to load the test jar
- testClassLoader = new URLClassLoader(new URL[] {url}, testClassLoader);
- }
- }
- }
-
- /**
- * Search test cases in a directory
- * @param classesPath
- * @param pattern
- * @return
- */
- private Set<String> findTestCasesInDir(String classesPath, Pattern pattern) {
- ServletContext context = config.getServletContext();
- Set<String> tests = new HashSet<String>();
- String dir = classesPath;
- findResources(context, pattern, tests, classesPath, dir);
- return tests;
- }
-
- @SuppressWarnings("unchecked")
- private void findResources(ServletContext context, Pattern pattern, Set<String> tests, String root, String dir) {
- Set<String> paths = context.getResourcePaths(dir);
- if (paths != null) {
- for (String name : paths) {
- if (name.endsWith("/")) {
- findResources(context, pattern, tests, root, name);
- }
- if (name.endsWith(".class")) {
- String className = name.substring(root.length(), name.length() - 6).replace('/', '.');
- if (pattern.matcher(className).matches()) {
- tests.add(className);
- }
- }
- }
- }
- }
-
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
- ServletException {
-
- if (!junitEnabled) {
- chain.doFilter(request, response);
- return;
- }
-
- HttpServletRequest req = (HttpServletRequest)request;
- HttpServletResponse resp = (HttpServletResponse)response;
-
- if (!req.getRequestURI().equals(req.getContextPath() + "/junit")) {
- // Intercept the /junit call
- chain.doFilter(request, response);
- return;
- }
-
- String query = req.getQueryString();
- PrintStream ps = new PrintStream(response.getOutputStream());
-
- Set<String> testCases = null;
- // ClassLoader cl = Thread.currentThread().getContextClassLoader();
- String op = req.getParameter("op");
- if (query == null || op == null || "list".equalsIgnoreCase(op)) {
- response.setContentType("text/html");
- resp.setStatus(HttpServletResponse.SC_OK);
- ps.println("<html><body>");
- ps.println("<h2>Available Test Cases</h2><p>");
- ps.println("<form method=\"get\" action=\"junit\">");
- ps.println("<table border=\"1\">");
- for (String s : this.allTestCases) {
- ps.print("<tr><td>");
- ps.print("<input type=\"checkbox\" name=\"test\" value=\"" + s
- + "\"/><a href=\"junit?op=runSelected&test="
- + s
- + "\">"
- + s
- + "</a>");
- ps.println("</td></tr>");
- }
- ps.println("</table>");
- ps.println("<p><input type=\"submit\" name=\"op\" value=\"RunSelected\"/>");
- ps.println("<input type=\"submit\" name=\"op\" value=\"RunAll\"/>");
- ps.println("</form></body></html>");
- resp.flushBuffer();
- return;
- } else {
- if ("runAll".equalsIgnoreCase(op)) {
- testCases = this.allTestCases;
- } else {
- String[] tests = req.getParameterValues("test");
- if (tests == null) {
- tests = new String[0];
- }
- testCases = new HashSet<String>(Arrays.asList(tests));
- }
- }
-
- response.setContentType("application/xml");
- ps.println("<?xml version=\"1.0\" encoding=\"" + "UTF-8" + "\"?>");
-
- ServletContext context = config.getServletContext();
- Object domain = context.getAttribute("org.apache.tuscany.sca.SCADomain");
- URL contribution = context.getResource("/META-INF/sca-contribution.xml");
-
- long duration = 0L;
- int errors = 0;
- int failures = 0;
- int runs = 0;
- List<Class<?>> testClasses = new ArrayList<Class<?>>();
- List<Result> results = new ArrayList<Result>();
- for (String testClass : testCases) {
- Class<?> test = null;
- try {
- test = Class.forName(testClass, false, testClassLoader);
- if (domain != null && contribution != null) {
- // Inject the SCADomain
- inject(test, domain);
- }
- testClasses.add(test);
- } catch (ClassNotFoundException e) {
- String st = XMLFormatter.exceptionToString(e);
- st = XMLFormatter.escape(st);
- ps.println(st);
- // ps.close();
- throw new ServletException(e);
- }
-
- JUnitCore core = new JUnitCore();
- Result result = core.run(Request.aClass(test));
- results.add(result);
-
- duration += result.getRunTime();
- runs += result.getRunCount();
-
- for (Failure f : result.getFailures()) {
- if (f.getException() instanceof AssertionFailedError) {
- failures++;
- } else {
- errors++;
- }
- }
- }
-
- ps.println("<" + XMLFormatter.TESTSUITE
- + " "
- + XMLFormatter.ATTR_TESTS
- + "=\""
- + runs
- + "\" "
- + XMLFormatter.ATTR_FAILURES
- + "=\""
- + failures
- + "\" "
- + XMLFormatter.ATTR_ERRORS
- + "=\""
- + errors
- + "\" "
- + XMLFormatter.ATTR_TIME
- + "=\""
- + XMLFormatter.getDurationAsString(duration)
- + "\">");
- for (int i = 0; i < testClasses.size(); i++) {
- ps.println(XMLFormatter.toXML(results.get(i), testClasses.get(i)));
- }
- ps.println("</" + XMLFormatter.TESTSUITE + ">");
-
- resp.addIntHeader("junit.errors", errors);
- resp.addIntHeader("junit.failures", failures);
- resp.addIntHeader("junit.runs", runs);
- resp.setStatus(HttpServletResponse.SC_OK);
- resp.flushBuffer();
-
- ps.close();
- }
-
- private boolean inject(Class<?> cls, Object target) {
- for (Field f : cls.getDeclaredFields()) {
- if (Modifier.isStatic(f.getModifiers()) && f.getType().isInstance(target)) {
- f.setAccessible(true);
- try {
- f.set(null, target);
- return true;
- } catch (IllegalArgumentException e) {
- return false;
- } catch (IllegalAccessException e) {
- return false;
- }
- }
- }
- return false;
- }
-
- public void init(FilterConfig config) throws ServletException {
- this.config = config;
- // Check if the /junit path should be allowed
- String param = config.getInitParameter(JUNIT_ENABLED);
- if (param != null && param.trim().equals("false")) {
- junitEnabled = false;
- return;
- }
- try {
- init();
- } catch (IOException e) {
- throw new ServletException(e);
- }
- }
-
- public boolean isJunitEnabled() {
- return junitEnabled;
- }
-
-}
diff --git a/branches/sca-android/modules/host-webapp-junit/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java b/branches/sca-android/modules/host-webapp-junit/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java
deleted file mode 100644
index 72ec478cd6..0000000000
--- a/branches/sca-android/modules/host-webapp-junit/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * ========================================================================
- *
- * Copyright 2001-2005 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.host.webapp.junit;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.text.NumberFormat;
-import java.util.Locale;
-
-import junit.framework.AssertionFailedError;
-
-import org.junit.runner.Result;
-import org.junit.runner.notification.Failure;
-
-/**
- * Format the test results in XML.
- *
- * @version $Id: XMLFormatter.java 239169 2005-05-05 09:21:54Z vmassol $
- */
-public class XMLFormatter {
- /**
- * Errors attribute for TestSuite elements
- */
- public static final String ATTR_ERRORS = "errors";
-
- /**
- * Failures attribute for TestSuite elements
- */
- public static final String ATTR_FAILURES = "failures";
-
- /**
- * Message attribute for failure elements (message of the exception)
- */
- public static final String ATTR_MESSAGE = "message";
-
- /**
- * Name attribute for property, TestCase and TestSuite elements
- */
- public static final String ATTR_NAME = "name";
-
- /**
- * Tests attribute for TestSuite elements (number of tests executed)
- */
- public static final String ATTR_TESTS = "tests";
-
- /**
- * Time attribute for TestCase and TestSuite elements
- */
- public static final String ATTR_TIME = "time";
-
- /**
- * Type attribute for failure and error elements
- */
- public static final String ATTR_TYPE = "type";
-
- /**
- * Default stack filter patterns.
- */
- private static final String[] DEFAULT_STACK_FILTER_PATTERNS =
- new String[] {"junit.framework.TestCase", "junit.framework.TestResult", "junit.framework.TestSuite",
- "junit.framework.Assert.", // don't filter AssertionFailure
- "java.lang.reflect.Method.invoke("};
-
- /**
- * The number format used to convert durations into strings. Don't use the
- * default locale for that, because the resulting string needs to use
- * dotted decimal notation for an XSLT transformation to work correctly.
- */
- private static NumberFormat durationFormat = NumberFormat.getInstance(Locale.US);
-
- /**
- * The error element (for a test case)
- */
- public static final String ERROR = "error";
-
- /**
- * The failure element (for a test case)
- */
- public static final String FAILURE = "failure";
-
- /**
- * A single TestCase element
- */
- public static final String TESTCASE = "testcase";
-
- /**
- * A single test suite results.
- */
- public static final String TESTSUITE = "testsuite";
-
- /**
- * Escapes reserved XML characters.
- *
- * @param theString the string to escape
- * @return the escaped string
- */
- public static String escape(String theString) {
- String newString;
-
- // It is important to replace the "&" first as the other replacements
- // also introduces "&" chars ...
- newString = theString.replace("&", "&amp;");
-
- newString = newString.replace("<", "&lt;");
- newString = newString.replace(">", "&gt;");
- newString = newString.replace("\"", "&quot;");
-
- return newString;
- }
-
- /**
- * Returns the stack trace of an exception as String.
- *
- * @param theThrowable the exception from which to extract the stack trace
- * as a String
- * @return the exception stack trace as a String
- */
- public static String exceptionToString(Throwable theThrowable) {
- return exceptionToString(theThrowable, null);
- }
-
- /**
- * Returns the stack trace of an exception as String, optionally filtering
- * out line from the stack trace
- *
- * @param theThrowable the exception from which to extract the stack trace
- * as a String
- * @param theFilterPatterns Array containing a list of patterns to filter
- * out from the stack trace
- * @return the exception stack trace as a String
- */
- public static String exceptionToString(Throwable theThrowable, String[] theFilterPatterns) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- theThrowable.printStackTrace(pw);
- String stackTrace = sw.toString();
- return filterStackTrace(stackTrace, theFilterPatterns);
- }
-
- /**
- *
- *
- * @param theLine The line to check
- * @param theFilterPatterns The patterns to filter out
- * @return boolean Whether the specified line should be filtered from the
- * stack trace
- */
- public static boolean filterLine(String theLine, String[] theFilterPatterns) {
- for (int i = 0; i < theFilterPatterns.length; i++) {
- if (theLine.indexOf(theFilterPatterns[i]) > 0) {
- return true;
- }
- }
- return false;
- }
-
- /**
- *
- *
- * @param theStackTrace The original, unfiltered stack trace
- * @param theFilterPatterns The patterns to filter out
- * @return The filtered stack trace
- */
- static String filterStackTrace(String theStackTrace, String[] theFilterPatterns) {
- if ((theFilterPatterns == null) || (theFilterPatterns.length == 0) || (theStackTrace == null)) {
- return theStackTrace;
- }
-
- StringWriter stringWriter = new StringWriter();
- PrintWriter printWriter = new PrintWriter(stringWriter);
- StringReader stringReader = new StringReader(theStackTrace);
- BufferedReader bufferedReader = new BufferedReader(stringReader);
-
- String line;
- try {
- while ((line = bufferedReader.readLine()) != null) {
- if (!filterLine(line, theFilterPatterns)) {
- printWriter.println(line);
- }
- }
- } catch (IOException e) {
- return theStackTrace;
- }
- return stringWriter.toString();
- }
-
- /**
- * Convert a duration expressed as a long into a string.
- *
- * @param theDuration the duration to convert to string
- * @return the total duration as a string
- */
- public static String getDurationAsString(long theDuration) {
- return durationFormat.format((double)theDuration / 1000);
- }
-
- public static String toXML(Failure failure) {
- StringBuffer xml = new StringBuffer();
- Throwable ex = failure.getException();
- String tag = (ex instanceof AssertionFailedError) ? FAILURE : ERROR;
- xml.append("<" + tag
- + " "
- + ATTR_MESSAGE
- + "=\""
- + escape(ex.getMessage())
- + "\" "
- + ATTR_TYPE
- + "=\""
- + ex.getClass().getName()
- + "\">");
- xml.append(escape(exceptionToString(ex, DEFAULT_STACK_FILTER_PATTERNS)));
- xml.append("</" + tag + ">");
-
- return xml.toString();
- }
-
- /**
- * Formats the test result as an XML string.
- *
- * @param result the test result object
- * @return the XML string representation of the test results
- */
- public static String toXML(Result result, Class<?> cls) {
- int failures = 0, errors = 0;
- for (Failure f : result.getFailures()) {
- if (f.getException() instanceof AssertionFailedError) {
- failures++;
- } else {
- errors++;
- }
- }
- StringBuffer xml = new StringBuffer();
-
- xml.append("<" + TESTCASE
- + " "
- + ATTR_NAME
- + "=\""
- + cls.getName()
- + "\" "
- + ATTR_TESTS
- + "=\""
- + result.getRunCount()
- + "\" "
- + ATTR_FAILURES
- + "=\""
- + failures
- + "\" "
- + ATTR_ERRORS
- + "=\""
- + errors
- + "\" "
- + ATTR_TIME
- + "=\""
- + getDurationAsString(result.getRunTime())
- + "\">");
-
- for (Failure f : result.getFailures()) {
- xml.append(toXML(f));
- }
-
- xml.append("</" + TESTCASE + ">");
-
- return xml.toString();
- }
-}
diff --git a/branches/sca-android/modules/host-webapp/LICENSE b/branches/sca-android/modules/host-webapp/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/host-webapp/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/host-webapp/META-INF/README b/branches/sca-android/modules/host-webapp/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/host-webapp/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/host-webapp/NOTICE b/branches/sca-android/modules/host-webapp/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/host-webapp/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/branches/sca-android/modules/host-webapp/pom.xml b/branches/sca-android/modules/host-webapp/pom.xml
deleted file mode 100644
index 67d7791be3..0000000000
--- a/branches/sca-android/modules/host-webapp/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>1.4-SNAPSHOT</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-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</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>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jsp_2.1_spec</artifactId>
- <version>1.0</version>
- <scope>provided</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.host.webapp</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.webapp*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/HotUpdateContextListener.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/HotUpdateContextListener.java
deleted file mode 100644
index d7ff73e31f..0000000000
--- a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/HotUpdateContextListener.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.io.File;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-
-import org.apache.tuscany.sca.host.embedded.impl.HotUpdatableSCADomain;
-
-/**
- * A WebApp ContextListener that starts a Tuscany runtime supporting multiple
- * SCA contribution jars. All contribution jars found in the repository
- * directory named "sca-contributions" will be contributed to the SCA
- * domain. Any changes to the contributions in the repository will be
- * automatically detected and the SCADomain updated accordingly.
- *
- * @version $Rev$ $Date$
- */
-public class HotUpdateContextListener extends TuscanyContextListener {
-
- public static final String REPOSITORY_FOLDER_NAME = "sca-contributions";
-
- @Override
- public void contextInitialized(ServletContextEvent event) {
- ServletContext servletContext = event.getServletContext();
-
- // TODO better domaiURI, maybe based on webapp name?
- String domainURI = "http://localhost/" + servletContext.getServletContextName().replace(' ', '.');
-
- File repository = new File(servletContext.getRealPath(REPOSITORY_FOLDER_NAME));
- HotUpdatableSCADomain scaDomain = new HotUpdatableSCADomain(domainURI, repository, 2000);
-
- servletContext.setAttribute(SCADomainHelper.SCA_DOMAIN_ATTRIBUTE, scaDomain);
-
- super.contextInitialized(event);
- }
-
-}
diff --git a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/SCADomainHelper.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/SCADomainHelper.java
deleted file mode 100644
index 2dbd7e9aa1..0000000000
--- a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/SCADomainHelper.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.host.webapp;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.servlet.ServletContext;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * Utility class to initialize the SCADomian associated with a webapp
- *
- * @version $Rev$ $Date$
- * @deprecated Not necessary anymore with TuscanyServletFilter
- */
-@Deprecated
-public class SCADomainHelper {
-
- static final String SCA_DOMAIN_ATTRIBUTE = "org.apache.tuscany.sca.SCADomain";
-
- /**
- * Initializes the SCADomian associated with a webapp context. If a SCADomain
- * doesn't exist already then one is create based on the webapp config.
- */
- static SCADomain initSCADomain(ServletContext servletContext) {
- SCADomain scaDomain = (SCADomain)servletContext.getAttribute(SCA_DOMAIN_ATTRIBUTE);
-
- String domainURI = "http://localhost/" + servletContext.getServletContextName().replace(' ', '.');
- String contributionRoot = null;
-
- try {
- URL rootURL = servletContext.getResource("/");
- if (rootURL.getProtocol().equals("jndi")) {
- //this is Tomcat case, we should use getRealPath
- File warRootFile = new File(servletContext.getRealPath("/"));
- contributionRoot = warRootFile.toURL().toString();
- } else {
- //this is Jetty case
- contributionRoot = rootURL.toString();
- }
- } catch(MalformedURLException mf) {
- //ignore, pass null
- }
-
-
- if (scaDomain == null) {
- scaDomain = SCADomain.newInstance(domainURI, contributionRoot);
- servletContext.setAttribute(SCA_DOMAIN_ATTRIBUTE, scaDomain);
- }
- return scaDomain;
- }
-}
diff --git a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyContextListener.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyContextListener.java
deleted file mode 100644
index 593073b068..0000000000
--- a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyContextListener.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.host.webapp;
-
-import java.util.Enumeration;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.ServletException;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * A ServletContextListener to create and close the SCADomain
- * when the webapp is initialized or destroyed.
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyContextListener implements ServletContextListener {
-
- public void contextInitialized(ServletContextEvent event) {
- final ServletContext servletContext = event.getServletContext();
- try {
- WebAppServletHost.getInstance().init(new ServletConfig() {
- public String getInitParameter(String name) {
- return servletContext.getInitParameter(name);
- }
-
- public Enumeration getInitParameterNames() {
- return servletContext.getInitParameterNames();
- }
-
- public ServletContext getServletContext() {
- return servletContext;
- }
-
- public String getServletName() {
- return null;
- }
- });
- } catch (ServletException e) {
- throw new RuntimeException(e);
- }
- }
-
- public void contextDestroyed(ServletContextEvent event) {
- ServletContext servletContext = event.getServletContext();
- SCADomain scaDomain = (SCADomain) servletContext.getAttribute(WebAppServletHost.SCA_DOMAIN_ATTRIBUTE);
- if (scaDomain != null) {
- scaDomain.close();
- }
- }
-
-}
diff --git a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServlet.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServlet.java
deleted file mode 100644
index 559fef73cc..0000000000
--- a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServlet.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.host.webapp;
-
-import java.io.IOException;
-
-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.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * A Servlet that forwards requests to the Servlets registered with the Tuscany
- * ServletHost.
- *
- * @version $Rev$ $Date$
- * @deprecated Not needed anymore, TuscanyServletFilter is sufficient
- */
-@Deprecated
-public class TuscanyServlet extends HttpServlet {
- private static final long serialVersionUID = 1L;
-
- private transient WebAppServletHost servletHost;
-
- @Override
- public void init(ServletConfig config) throws ServletException {
- ServletContext servletContext = config.getServletContext();
- SCADomainHelper.initSCADomain(servletContext);
-
- // TODO: must be a better way to get this than using a static
- servletHost = WebAppServletHost.getInstance();
- servletHost.init(config);
- }
-
- @Override
- public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
- String path = ((HttpServletRequest)req).getPathInfo();
- RequestDispatcher dispatcher = servletHost.getRequestDispatcher(path);
- if (dispatcher == null) {
- throw new IllegalStateException("No servlet registered for path: " + path);
- }
-
- dispatcher.forward(req, res);
- }
-
-}
diff --git a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java
deleted file mode 100644
index a5a3745d7f..0000000000
--- a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.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.host.webapp;
-
-import java.io.IOException;
-import java.util.Enumeration;
-
-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;
-
-/**
- * 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 WebAppServletHost servletHost;
-
- public void init(final FilterConfig config) throws ServletException {
- // TODO: must be a better way to get this than using a static
- servletHost = WebAppServletHost.getInstance();
-
- // 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() {
- WebAppServletHost.getInstance().destroy();
- }
-
- 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/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppModuleActivator.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppModuleActivator.java
deleted file mode 100644
index dbe8a523f9..0000000000
--- a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppModuleActivator.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.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();
- if (isRunningInWebapp()) {
- if (hosts.size() > 0) {
- hosts.removeAll(hosts);
- }
- servletHosts.addServletHost(WebAppServletHost.getInstance());
- }
- }
-
- public void stop(ExtensionPointRegistry registry) {
- }
-
- /**
- * TODO: this seems a bit of a hacky way to find if its running in a webapp
- * is there a better way?
- */
- private boolean isRunningInWebapp() {
- for (StackTraceElement ste : new Exception().getStackTrace()) {
- if (ste.getClassName().equals(WebSCADomain.class.getName())) {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppRequestDispatcher.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppRequestDispatcher.java
deleted file mode 100644
index f14dfac58b..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
deleted file mode 100644
index 599afc541c..0000000000
--- a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.embedded.SCADomain;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletMappingException;
-
-/**
- * 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_DOMAIN_ATTRIBUTE = "org.apache.tuscany.sca.SCADomain";
-
- private static final WebAppServletHost instance = new WebAppServletHost();
-
- private Map<String, Servlet> servlets;
- private SCADomain scaDomain;
- private String contextPath = "/";
- private int defaultPortNumber = 8080;
- private String contributionRoot;
-
- private ServletContext servletContext;
-
- private 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_DOMAIN_ATTRIBUTE) == null) {
- initContextPath(config);
- String domainURI = "http://localhost/" + contextPath;
- contributionRoot = getContributionRoot(servletContext);
- // logger.info("Contribution: " + contributionRoot);
- System.setProperty(SCADomain.class.getName(), WebSCADomain.class.getName());
- this.scaDomain = SCADomain.newInstance(domainURI, contributionRoot);
- servletContext.setAttribute(SCA_DOMAIN_ATTRIBUTE, scaDomain);
- }
-
- // 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.toURL().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 (scaDomain != null) {
- scaDomain.close();
- if (scaDomain instanceof WebSCADomain) {
- ((WebSCADomain)scaDomain).destroy();
- }
- }
- }
-
- 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/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebSCADomain.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebSCADomain.java
deleted file mode 100644
index be35733220..0000000000
--- a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebSCADomain.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.host.webapp;
-
-import org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WebSCADomain extends DefaultSCADomain {
-
- /**
- * @param runtimeClassLoader
- * @param applicationClassLoader
- * @param domainURI
- * @param contributionLocation
- * @param composites
- */
- public WebSCADomain(ClassLoader runtimeClassLoader,
- ClassLoader applicationClassLoader,
- String domainURI,
- String contributionLocation,
- String... composites) {
- super(runtimeClassLoader, applicationClassLoader, domainURI, contributionLocation, composites);
- }
-
- @Override
- public void close() {
- // Disable the close() as a hack to keep the WebSCADomain open
- }
-
- public void destroy() {
- super.close();
- }
-
-}
diff --git a/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTEI.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTEI.java
deleted file mode 100644
index 6e1b187a48..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTag.java b/branches/sca-android/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTag.java
deleted file mode 100644
index b7eb93222e..0000000000
--- a/branches/sca-android/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.embedded.SCADomain;
-import org.apache.tuscany.sca.host.webapp.WebAppServletHost;
-import org.osoa.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.osoa.sca.ComponentContext");
- SCADomain scaDomain = null;
- if (componentContext == null) {
- scaDomain = (SCADomain)servletContext.getAttribute(WebAppServletHost.SCA_DOMAIN_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/branches/sca-android/modules/host-webapp/src/main/resources/META-INF/sca.tld b/branches/sca-android/modules/host-webapp/src/main/resources/META-INF/sca.tld
deleted file mode 100644
index 22a9dc3414..0000000000
--- a/branches/sca-android/modules/host-webapp/src/main/resources/META-INF/sca.tld
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version = '1.0' encoding = 'ISO-8859-1'?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- -->
-
-<!DOCTYPE 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>
- <type>java.lang.String</type>
- </attribute>
-
- <attribute>
- <name>type</name>
- <required>true</required>
- <type>java.lang.String</type>
- </attribute>
-
- <attribute>
- <name>scope</name>
- <required>false</required>
- <type>java.lang.Integer</type>
- </attribute>
-
- <body-content>empty</body-content>
-
- </tag>
-
-</taglib>
diff --git a/branches/sca-android/modules/host-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-android/modules/host-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index d99fdf257e..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/implementation-bpel-jbpm/LICENSE b/branches/sca-android/modules/implementation-bpel-jbpm/LICENSE
deleted file mode 100644
index 4b5ab74408..0000000000
--- a/branches/sca-android/modules/implementation-bpel-jbpm/LICENSE
+++ /dev/null
@@ -1,251 +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 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.
-
-=================================================================================================================
diff --git a/branches/sca-android/modules/implementation-bpel-jbpm/META-INF/README b/branches/sca-android/modules/implementation-bpel-jbpm/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-bpel-jbpm/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-bpel-jbpm/NOTICE b/branches/sca-android/modules/implementation-bpel-jbpm/NOTICE
deleted file mode 100644
index a3c65715e5..0000000000
--- a/branches/sca-android/modules/implementation-bpel-jbpm/NOTICE
+++ /dev/null
@@ -1,17 +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/).
-
-Unless otherwise indicated, all distribution made available by the Apache Software Foundation
-is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
-A copy of the AL is provided with this distribution as the LICENSE file present in the
-root directory, and is also available at http://www.apache.org/licenses/.
-
-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.
diff --git a/branches/sca-android/modules/implementation-bpel-jbpm/pom.xml b/branches/sca-android/modules/implementation-bpel-jbpm/pom.xml
deleted file mode 100644
index 465a631a68..0000000000
--- a/branches/sca-android/modules/implementation-bpel-jbpm/pom.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-bpel-jbpm</artifactId>
- <name>Apache Tuscany SCA BPEL jBPM Implementation Extension</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-impl</artifactId>
- <version>1.1.1</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</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.implementation.bpel.jbpm</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.bpel.jbpm*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/branches/sca-android/modules/implementation-bpel-jbpm/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-android/modules/implementation-bpel-jbpm/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index 61d74d4c37..0000000000
--- a/branches/sca-android/modules/implementation-bpel-jbpm/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
+++ /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.
-
-# Implementation class for the implementation extension
-#
-#
-# ==> Change this for JBPM
-#org.apache.tuscany.sca.implementation.bpel.ode.provider.BPELImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.bpel.BPELImplementation
diff --git a/branches/sca-android/modules/implementation-bpel-ode/LICENSE b/branches/sca-android/modules/implementation-bpel-ode/LICENSE
deleted file mode 100644
index baba9ca048..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/LICENSE
+++ /dev/null
@@ -1,251 +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 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.
-
-=================================================================================================================
diff --git a/branches/sca-android/modules/implementation-bpel-ode/META-INF/README b/branches/sca-android/modules/implementation-bpel-ode/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-bpel-ode/NOTICE b/branches/sca-android/modules/implementation-bpel-ode/NOTICE
deleted file mode 100644
index a2f696be26..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/NOTICE
+++ /dev/null
@@ -1,17 +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/).
-
-Unless otherwise indicated, all distribution made available by the Apache Software Foundation
-is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
-A copy of the AL is provided with this distribution as the LICENSE file present in the
-root directory, and is also available at http://www.apache.org/licenses/.
-
-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.
diff --git a/branches/sca-android/modules/implementation-bpel-ode/pom.xml b/branches/sca-android/modules/implementation-bpel-ode/pom.xml
deleted file mode 100644
index bd829fc33f..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/pom.xml
+++ /dev/null
@@ -1,441 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-bpel-ode</artifactId>
- <name>Apache Tuscany SCA BPEL ODE Implementation Extension</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-impl</artifactId>
- <version>1.1.1</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- <!-- ODE Jars -->
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-epr</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-store</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-dao</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-dao</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
- <version>1.1.1</version>
- <type>zip</type>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-runtime</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-api</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-scheduler-simple</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-utils</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-compiler</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-schemas</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-obj</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-jacob</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-jacob-ap</artifactId>
- <version>1.1.1</version>
- </dependency>
-
- <!-- ODE Dependencies -->
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-kernel</artifactId>
- <version>1.2-beta</version>
- <exclusions>
- <exclusion>
- <groupId>mx4j</groupId>
- <artifactId>mx4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xpp3</groupId>
- <artifactId>xpp3</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xstream</groupId>
- <artifactId>xstream</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-transaction</artifactId>
- <version>1.2-beta</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-ejb_2.1_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ognl</groupId>
- <artifactId>ognl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-ejb_3.0_spec</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-connector</artifactId>
- <version>1.2-beta</version>
- <exclusions>
- <exclusion>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- </exclusion>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.3.1.4</version>
- </dependency>
- <dependency>
- <groupId>tranql</groupId>
- <artifactId>tranql-connector</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-all</artifactId>
- <version>0.9.7-incubating</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-lib</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-kernel</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-kernel-5</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-jdbc</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-jdbc-5</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-persistence-jdbc</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-xmlstore</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.serp</groupId>
- <artifactId>serp</artifactId>
- <version>1.12.0</version>
- </dependency>
- <dependency>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- <version>1.1.1</version>
- <exclusions>
- <exclusion>
- <groupId>xom</groupId>
- <artifactId>xom</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.0</version>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.8.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlbeans</groupId>
- <artifactId>xmlbeans</artifactId>
- <version>2.3.0</version>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon</artifactId>
- <version>8.7</version>
- <!--version>9.0.0.2</version-->
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-dom</artifactId>
- <version>8.7</version>
- <!--version>9.0.0.2</version-->
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-xpath</artifactId>
- <version>8.7</version>
- <!--version>9.0.0.2</version-->
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.13</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <!-- http://jira.codehaus.org/browse/SUREFIRE-322 -->
- <version>2.3.1</version>
- <configuration>
- <useFile>false</useFile>
- <trimStackTrace>false</trimStackTrace>
- <useSystemClassLoader>true</useSystemClassLoader>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
- <version>1.1.1</version>
- <type>zip</type>
- <overWrite>true</overWrite>
- <outputDirectory>${project.build.directory}/test-classes/</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <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.implementation.bpel.ode</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.bpel.ode*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/BPELODEDeployFile.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/BPELODEDeployFile.java
deleted file mode 100644
index 0b0cd98a66..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/BPELODEDeployFile.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.bpel.ode;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.Reference;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.io.IOException;
-import java.io.FileOutputStream;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import java.util.List;
-
-/**
- * A class that handles the deploy.xml file required for each BPEL process by the ODE runtime
- * @author Mike Edwards
- *
- * An explanation of the structure of the ODE deploy file:
- *
- * <deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
- * xmlns:tns="http://helloworld"
- * xmlns:tus="http://tuscany.apache.org">
- *
- * <process name="tns:HelloWorld">
- * <active>true</active>
- * <provide partnerLink="helloPartnerLink">
- * <service name="tus:helloPartnerLink" port="HelloWorld"/>
- * </provide>
- * <invoke partnerLink="greetingsPartnerLink">
- * <service name="tus:greetingsPartnerLink" port="Greetings"/>
- * </invoke>
- * </process>
- * </deploy>
- *
- * For SCA purposes:
- *
- * a) Each partner link in the BPEL process is declared using either a <provide.../>
- * (for a service) or using a <invoke.../> (for a reference).
- *
- * b) Each <provide/> and <invoke/> must use the partnerLink name, as declared in the
- * BPEL process.
- *
- * c) The <provide/> and <invoke/> elements each have a single child <service/> element.
- * The <service/> elements have name and port attributes. The NAME attribute MUST be set
- * to the same name as the partnerLink and MUST be prefixed by a prefix which references
- * the namespace "http://tuscany.apache.org" ("tus" in the example above).
- * The port attribute can be set to any name (it must be present but it is not actually
- * used for anything significant).
- *
- * When SCA loads a BPEL process to the ODE server, this file is read by the ODE server to
- * characterize the process. When SCA interacts with ODE at later points - either when a
- * service is being invoked or the process invokes a reference - it is the service @name
- * attribute that identifies the service or reference involved.
- *
- * @version
- */
-public class BPELODEDeployFile {
- private final Log __log = LogFactory.getLog(getClass());
-
- static final String DEPLOY_ELEMENT_START = "<deploy xmlns=\"http://www.apache.org/ode/schemas/dd/2007/03\"";
- static final String DEPLOY_ENDELEMENT = "</deploy>";
- static final String PROCESS_NAMESPACE_DECL = "xmlns:tns=";
- static final String SERVICE_NAMESPACE = "xmlns:tus=\"http://tuscany.apache.org\"";
- static final String PROCESS_ELEMENT_START = "<process name=\"tns:";
- static final String PROCESS_ELEMENT_END = "\">";
- static final String PROCESS_ENDELEMENT = "</process>";
- static final String ACTIVE_ELEMENT = "<active>true</active>";
- static final String PROVIDE_ELEMENT_START = "<provide partnerLink=\"";
- static final String PROVIDE_ELEMENT_END = "\">";
- static final String PROVIDE_ENDELEMENT = "</provide>";
- static final String SERVICE_ELEMENT_START = "<service name=\"tus:";
- static final String SERVICE_ELEMENT_PORT = "\" port=\"";
- static final String SERVICE_ELEMENT_END = "Port\"/>";
- static final String INVOKE_ELEMENT_START = "<invoke partnerLink=\"";
- static final String INVOKE_ELEMENT_END = "\">";
- static final String INVOKE_ENDELEMENT = "</invoke>";
-
- static final String DEPLOY_FILENAME = "deploy.xml";
-
- private BPELImplementation implementation;
-
- /**
- * Constructor - requires a BPELImplementation as a parameter
- * The ODE deploy.xml file is for this supplied BPELImplementation
- * @param theImplementation
- */
- public BPELODEDeployFile( BPELImplementation theImplementation ) {
-
- implementation = theImplementation;
-
- } // end BPELODEDeployFile constructor
-
- /**
- * Writes the deploy file into the same directory as the BPEL process file, with the name
- * "deploy.xml"
- */
- public void writeDeployfile() throws IOException {
-
- File theDirectory = getDirectory();
-
- File deployFile = new File( theDirectory, DEPLOY_FILENAME );
- new FileOutputStream( deployFile );
- //if( !deployFile.canWrite() ) throw new IOException( "Unable to write to deploy file" +
- // deployFile.getPath() );
-
- // Create a stream for the data and write the data to the file
- PrintStream theStream = new PrintStream( new FileOutputStream( deployFile ) );
- try {
- constructDeployXML( theStream );
- if( theStream.checkError() ) throw new IOException();
- } catch (Exception e) {
- throw new IOException( "Unable to write data to deploy file" +
- deployFile.getPath() );
- } finally {
- theStream.close();
- } // end try
-
- } // end writeDeployFile
-
- /**
- * Creates the deploy.xml data and writes it to a supplied PrintStream
- * @param stream
- */
- public void constructDeployXML( PrintStream stream ) {
-
- // <deploy + namespace...
- stream.println( DEPLOY_ELEMENT_START );
- // namespace of the BPEL process
- QName process = implementation.getProcess();
- String processNamespace = process.getNamespaceURI();
- stream.println( PROCESS_NAMESPACE_DECL + "\"" + processNamespace + "\"" );
- // namespace for the service name elements
- stream.println( SERVICE_NAMESPACE + ">" );
-
- // <process> element
- stream.println( PROCESS_ELEMENT_START + process.getLocalPart() +
- PROCESS_ELEMENT_END );
-
- // <active/> element
- stream.println( ACTIVE_ELEMENT );
-
- ComponentType componentType = implementation.getComponentType();
- List<Service> theServices = componentType.getServices();
- // Loop over the <provide/> elements - one per service
- for ( Service service : theServices ) {
- String serviceName = service.getName();
- // Provide element...
- stream.println( PROVIDE_ELEMENT_START + serviceName + PROVIDE_ELEMENT_END );
- // Child service element...
- stream.println( SERVICE_ELEMENT_START + serviceName +
- SERVICE_ELEMENT_PORT + serviceName + SERVICE_ELEMENT_END );
- stream.println( PROVIDE_ENDELEMENT );
- } // end for
-
- // Loop over the <invoke/> elements - one per reference
- List<Reference> theReferences = componentType.getReferences();
- for ( Reference reference : theReferences ) {
- String referenceName = reference.getName();
- stream.println( INVOKE_ELEMENT_START + referenceName + INVOKE_ELEMENT_END );
- // Child service element...
- stream.println( SERVICE_ELEMENT_START + referenceName +
- SERVICE_ELEMENT_PORT + referenceName + SERVICE_ELEMENT_END );
- stream.println( INVOKE_ENDELEMENT );
-
- } // end for
-
- // </process> element
- stream.println( PROCESS_ENDELEMENT );
-
- // </deploy>
- stream.println( DEPLOY_ENDELEMENT );
-
- } // end constructDeployXML
-
- /**
- * Gets the directory containing the BPEL process
- * @return
- */
- private File getDirectory() {
- File theDir = getBPELFile().getParentFile();
- return theDir;
- } // end getDirectory
-
- /**
- * Gets the File containing the BPEL process definition
- * @return - the File object containing the BPEL process
- */
- private File getBPELFile() {
- try {
- File theProcess = new File(URI.create(implementation.getProcessDefinition().getLocation()));
- return theProcess;
- } catch( Exception e ) {
- if(__log.isDebugEnabled()) {
- __log.debug("Exception converting BPEL file URL to an URI: " + e );
- }
- } // end try
- return null;
- } // end getBPELFile
-
-
-
-} // end class BPELODEDeployFile
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java
deleted file mode 100644
index 84c40defd9..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.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.implementation.bpel.ode;
-
-import java.io.File;
-import java.net.URL;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import javax.transaction.TransactionManager;
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.dao.BpelDAOConnectionFactoryJDBC;
-import org.apache.ode.bpel.engine.BpelServerImpl;
-import org.apache.ode.bpel.engine.CountLRUDehydrationPolicy;
-import org.apache.ode.bpel.iapi.ProcessConf;
-import org.apache.ode.bpel.iapi.ProcessStore;
-import org.apache.ode.bpel.iapi.ProcessStoreEvent;
-import org.apache.ode.bpel.iapi.ProcessStoreListener;
-import org.apache.ode.bpel.iapi.Scheduler;
-import org.apache.ode.bpel.memdao.BpelDAOConnectionFactoryImpl;
-import org.apache.ode.il.config.OdeConfigProperties;
-import org.apache.ode.il.dbutil.Database;
-import org.apache.ode.scheduler.simple.JdbcDelegate;
-import org.apache.ode.scheduler.simple.SimpleScheduler;
-import org.apache.ode.store.ProcessStoreImpl;
-import org.apache.ode.utils.GUID;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-//-------------- Added by Mike Edwards 16/05/2008
-import org.apache.ode.bpel.iapi.Endpoint;
-import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
-//-------------- End of Mike Edwards additions
-
-/**
- * Embedded ODE process server
- *
- * @version $Rev$ $Date$
- */
-public class EmbeddedODEServer {
- protected final Log __log = LogFactory.getLog(getClass());
-
- private boolean _initialized;
-
- private OdeConfigProperties _config;
-
- private TransactionManager _txMgr;
-
- private Database _db;
-
- private File _workRoot;
-
- private BpelDAOConnectionFactoryJDBC _daoCF;
-
- private BpelServerImpl _bpelServer;
-
- private Scheduler _scheduler;
-
- protected ExecutorService _executorService;
-
- private Map<QName, RuntimeComponent> tuscanyRuntimeComponents = new ConcurrentHashMap<QName, RuntimeComponent>();
-
- public EmbeddedODEServer(TransactionManager txMgr) {
- _txMgr = txMgr;
- }
-
- public void init() throws ODEInitializationException {
- Properties p = System.getProperties();
- p.put("derby.system.home", "target");
-
- Properties confProps = new Properties();
- confProps.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=false)");
- _config = new OdeConfigProperties(confProps, "ode-sca");
-
- // Setting work root as the directory containing our database (wherever in the classpath)
- URL dbLocation = getClass().getClassLoader().getResource("jpadb");
- if (dbLocation == null)
- throw new ODEInitializationException("Couldn't find database in the classpath");
- _workRoot = new File(dbLocation.getFile()).getParentFile();
-
- initTxMgr();
- initPersistence();
- initBpelServer();
-
- try {
- _bpelServer.start();
- } catch (Exception ex) {
- String errmsg = "An error occured during the ODE BPEL server startup.";
- __log.error(errmsg, ex);
- throw new ODEInitializationException(errmsg, ex);
- }
-
- __log.info("ODE BPEL server started.");
- _initialized = true;
- }
-
- private void initTxMgr() {
- if(_txMgr == null) {
- try {
- GeronimoTxFactory txFactory = new GeronimoTxFactory();
- _txMgr = txFactory.getTransactionManager();
- } catch (Exception e) {
- __log.fatal("Couldn't initialize a transaction manager using Geronimo's transaction factory.", e);
- throw new ODEInitializationException("Couldn't initialize a transaction manager using " + "Geronimo's transaction factory.", e);
- }
- }
- }
-
- private void initPersistence() {
- _db = new Database(_config);
- _db.setTransactionManager(_txMgr);
- _db.setWorkRoot(_workRoot);
-
- try {
- _db.start();
- _daoCF = _db.createDaoCF();
- } catch (Exception ex) {
- String errmsg = "Error while configuring ODE persistence.";
- __log.error(errmsg, ex);
- throw new ODEInitializationException(errmsg, ex);
- }
- }
-
- private void initBpelServer() {
- if (__log.isDebugEnabled()) {
- __log.debug("ODE initializing");
- }
-
- //FIXME: externalize the configuration for ThreadPoolMaxSize
- _executorService = Executors.newCachedThreadPool();
-
- _bpelServer = new BpelServerImpl();
- _scheduler = createScheduler();
- _scheduler.setJobProcessor(_bpelServer);
-
- _bpelServer.setDaoConnectionFactory(_daoCF);
- _bpelServer.setInMemDaoConnectionFactory(new BpelDAOConnectionFactoryImpl(_scheduler));
- // _bpelServer.setEndpointReferenceContext(new EndpointReferenceContextImpl(this));
- _bpelServer.setMessageExchangeContext(new ODEMessageExchangeContext(this));
- _bpelServer.setBindingContext(new ODEBindingContext());
- _bpelServer.setScheduler(_scheduler);
- if (_config.isDehydrationEnabled()) {
- CountLRUDehydrationPolicy dehy = new CountLRUDehydrationPolicy();
- _bpelServer.setDehydrationPolicy(dehy);
- }
-
- _bpelServer.init();
- } // end InitBpelServer
-
- public void stop() throws ODEShutdownException {
- if(_bpelServer != null) {
- try {
- __log.debug("Stopping BPEL Embedded server");
- _bpelServer.shutdown();
- _bpelServer = null;
- } catch (Exception ex) {
- __log.debug("Error stopping BPEL server");
- }
- }
-
- if(_scheduler != null) {
- try {
- __log.debug("Stopping scheduler");
- _scheduler.shutdown();
- _scheduler = null;
- } catch (Exception ex) {
- __log.debug("Error stopping scheduler");
- }
- }
-
- if(_daoCF != null) {
- try {
- __log.debug("Stopping DAO");
- _daoCF.shutdown();
- _daoCF = null;
- } catch (Exception ex) {
- __log.debug("Error stopping DAO");
- }
- }
-
- if(_db != null) {
- try {
- __log.debug("Stopping DB");
- _db.shutdown();
- _db = null;
- } catch (Exception ex) {
- __log.debug("Error stopping DB");
- }
- }
-
- if(_txMgr != null) {
- try {
- __log.debug("Stopping Transaction Manager");
- _txMgr = null;
- } catch (Exception ex) {
- __log.debug("Error stopping Transaction Manager");
- }
- }
- }
-
- protected Scheduler createScheduler() {
- SimpleScheduler scheduler = new SimpleScheduler(new GUID().toString(),new JdbcDelegate(_db.getDataSource()));
- scheduler.setTransactionManager(_txMgr);
-
- return scheduler;
- }
-
- public boolean isInitialized() {
- return _initialized;
- }
-
- public BpelServerImpl getBpelServer() {
- return _bpelServer;
- }
-
- public Scheduler getScheduler() {
- return _scheduler;
- }
-
- public ExecutorService getExecutor() {
- return _executorService;
- }
-
- // Updated by Mike Edwards, 23/05/2008
- public void deploy(ODEDeployment d, BPELImplementation implementation) {
- try {
- TuscanyProcessConfImpl processConf = new TuscanyProcessConfImpl( implementation );
- _bpelServer.register(processConf);
- System.out.println("Completed calling new Process deployment code...");
- } catch (Exception ex) {
- String errMsg = ">>> DEPLOY: Unexpected exception: " + ex.getMessage();
- __log.debug(errMsg, ex);
- throw new ODEDeploymentException(errMsg,ex);
- }
- }
-
- public void undeploy(ODEDeployment d) {
- //TODO
- }
-
- public void registerTuscanyRuntimeComponent(QName processName,RuntimeComponent componentContext) {
- tuscanyRuntimeComponents.put(processName, componentContext);
- }
-
- public RuntimeComponent getTuscanyRuntimeComponent(QName processName) {
- return tuscanyRuntimeComponents.get(processName);
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/GeronimoTxFactory.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/GeronimoTxFactory.java
deleted file mode 100644
index 11af0f8b50..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/GeronimoTxFactory.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.bpel.ode;
-
-import javax.transaction.TransactionManager;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Geronimo transaction factory
- *
- * @version $Rev$ $Date$
- */
-public class GeronimoTxFactory {
- private static final Log __log = LogFactory.getLog(GeronimoTxFactory.class);
-
- /* Public no-arg constructor is required */
- public GeronimoTxFactory() {
- }
-
- public TransactionManager getTransactionManager() {
- __log.info("Using embedded Geronimo transaction manager");
- try {
- Object obj = new org.apache.geronimo.transaction.manager.GeronimoTransactionManager();
- return (TransactionManager) obj;
- } catch (Exception except) {
- throw new IllegalStateException("Unable to instantiate Geronimo Transaction Manager", except);
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEBindingContext.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEBindingContext.java
deleted file mode 100644
index 3f2db7b244..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEBindingContext.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.bpel.ode;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.iapi.BindingContext;
-import org.apache.ode.bpel.iapi.Endpoint;
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.bpel.iapi.PartnerRoleChannel;
-
-/**
- * Binding Context information
- *
- * @version $Rev$ $Date$
- */
-public class ODEBindingContext implements BindingContext {
- protected final Log __log = LogFactory.getLog(getClass());
-
- public ODEBindingContext() {
-
- }
-
- public EndpointReference activateMyRoleEndpoint(QName pid, Endpoint endpoint) {
- // This will be needed when we support callBacks
- if (__log.isDebugEnabled()) {
- __log.debug("Activating MyRole Endpoint : " + pid + " - " + endpoint.serviceName);
- }
-
- QName processName = getProcessName(pid);
-
- return new TuscanyEPR(processName, endpoint);
- }
-
- public void deactivateMyRoleEndpoint(Endpoint endpoint) {
- if (__log.isDebugEnabled()) {
- __log.debug("Deactivate MyRole Endpoint : " + endpoint.serviceName);
- }
-
- }
-
- public PartnerRoleChannel createPartnerRoleChannel(QName pid, PortType portType, Endpoint endpoint) {
- if (__log.isDebugEnabled()) {
- __log.debug("Create PartnerRole channel : " + pid + " - " + portType.getQName() + " - "+ endpoint.serviceName);
- }
-
- QName processName = getProcessName(pid);
- return new TuscanyPRC(processName, pid, portType, endpoint);
- }
-
- /**
- * Helper method to retrieve the BPEL process name from a processID (where processID have version concatenated to it)
- * @param pid
- * @return QName the BPEL process name
- */
- private static QName getProcessName(QName pid) {
- String processName = pid.getLocalPart().substring(0, pid.getLocalPart().lastIndexOf("-"));
- return new QName(pid.getNamespaceURI(), processName);
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEDeployment.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEDeployment.java
deleted file mode 100644
index a6428f6984..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEDeployment.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.bpel.ode;
-
-import java.io.File;
-
-/**
- * Deployment information
- *
- * @version $Rev$ $Date$
- */
-public class ODEDeployment {
- /** The directory containing the deploy.xml and artifacts. */
- public File deployDir;
-
- /** If non-null the type of exception we expect to get when we deploy. */
- public Class expectedException = null;
-
- public ODEDeployment(File deployDir) {
- this.deployDir = deployDir;
- }
-
- @Override
- public String toString() {
- return "Deployment#" + deployDir;
- }
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEDeploymentException.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEDeploymentException.java
deleted file mode 100644
index b03f69d9aa..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEDeploymentException.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.bpel.ode;
-
-/**
- * Thrown when ODE failed to shutdown.
- *
- * @version $Rev$ $Date$
- */
-public class ODEDeploymentException extends RuntimeException {
- private static final long serialVersionUID = -2869674556330744215L;
-
- public ODEDeploymentException(Throwable cause) {
- super(cause);
- }
-
- public ODEDeploymentException(String message) {
- super(message);
- }
-
- public ODEDeploymentException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java
deleted file mode 100644
index 15e9229601..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.bpel.ode;
-
-import java.util.concurrent.Callable;
-
-import javax.wsdl.Part;
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MessageExchange;
-import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
-import org.apache.ode.bpel.iapi.Scheduler;
-import org.apache.ode.utils.DOMUtils;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Helper Class to handle invocation to Tuscany Component References
- *
- * @version $Rev$ $Date$
- */
-public class ODEExternalService {
- protected final Log __log = LogFactory.getLog(getClass());
-
- private EmbeddedODEServer _server;
- private Scheduler _sched;
-
- public ODEExternalService(EmbeddedODEServer server) {
- this._server = server;
- this._sched = _server.getScheduler();
- }
-
-
- public void invoke(final PartnerRoleMessageExchange partnerRoleMessageExchange) {
- boolean isTwoWay =
- partnerRoleMessageExchange.getMessageExchangePattern() == org.apache.ode.bpel.iapi.MessageExchange.MessageExchangePattern.REQUEST_RESPONSE;
-
- if (isTwoWay) {
- // Defer the invoke until the transaction commits.
- _sched.registerSynchronizer(new Scheduler.Synchronizer() {
- public void beforeCompletion() {
-
- }
-
- public void afterCompletion(boolean success) {
- // If the TX is rolled back, then we don't send the request.
- if (!success)
- return;
-
- // The invocation must happen in a separate thread, holding
- // on the afterCompletion
- // blocks other operations that could have been listed there
- // as well.
- _server.getExecutor().submit(new Callable<Object>() {
- public Object call() throws Exception {
- try {
- // do execution
- if(! (partnerRoleMessageExchange.getChannel() instanceof TuscanyPRC)) {
- throw new IllegalArgumentException("Channel should be an instance of TuscanyPRC");
- }
-
- TuscanyPRC channel = (TuscanyPRC) partnerRoleMessageExchange.getChannel();
- RuntimeComponent tuscanyRuntimeComponent = _server.getTuscanyRuntimeComponent(channel.getProcessName());
-
- RuntimeComponentReference runtimeComponentReference =
- (RuntimeComponentReference)tuscanyRuntimeComponent.getReferences().get(0);
- RuntimeWire runtimeWire =
- runtimeComponentReference.getRuntimeWire(runtimeComponentReference.getBindings().get(0));
-
- // convert operations
- Operation operation =
- findOperation(partnerRoleMessageExchange.getOperation().getName(), runtimeComponentReference);
-
-
- /*
- This is how a request looks like (payload is wrapped with extra info)
- <?xml version="1.0" encoding="UTF-8"?>
- <message>
- <parameters>
- <getGreetings xmlns="http://greetings">
- <message xmlns="http://helloworld">Luciano</message>
- </getGreetings>
- </parameters>
- </message>
- */
- Element msg = partnerRoleMessageExchange.getRequest().getMessage();
- if (msg != null) {
- String xml = DOMUtils.domToString(msg);
-
- String payload =
- DOMUtils.domToString(getPayload(partnerRoleMessageExchange.getRequest()));
-
- if(__log.isDebugEnabled()) {
- __log.debug("Starting invocation of SCA Reference");
- __log.debug(">>> Original message: " + xml);
- __log.debug(">>> Payload: " + payload);
- }
-
- Object[] args = new Object[] {getPayload(partnerRoleMessageExchange.getRequest())};
-
- Object result = null;
- boolean success = false;
-
- try {
- result = runtimeWire.invoke(operation, args);
- success = true;
- } catch (Exception e) {
- partnerRoleMessageExchange.replyWithFailure(MessageExchange.FailureType.OTHER,
- e.getMessage(),
- null);
- }
-
-
- if(__log.isDebugEnabled()) {
- __log.debug("SCA Reference invocation finished");
- __log.debug(">>> Result : " + DOMUtils.domToString((Element)result));
- }
-
- if (!success) {
- return null;
- }
-
- // two way invocation
- // process results based on type of message
- // invocation
-
- // Message response =
- // createResponseMessage(partnerRoleMessageExchange,
- // (Element) result);
- // partnerRoleMessageExchange.reply(response);
- replyTwoWayInvocation(partnerRoleMessageExchange.getMessageExchangeId(),
- operation,
- (Element)result);
- }
-
- } catch (Throwable t) {
- // some error
- String errmsg =
- "Error sending message (mex=" + partnerRoleMessageExchange + "): " + t.getMessage();
- __log.error(errmsg, t);
- /*replyWithFailure(partnerRoleMessageExchange.getMessageExchangeId(),
- MessageExchange.FailureType.COMMUNICATION_ERROR,
- errmsg,
- null);*/
- }
- return null;
- }
- });
-
- }
- });
- partnerRoleMessageExchange.replyAsync();
-
- } else {
- /** one-way case * */
- _server.getExecutor().submit(new Callable<Object>() {
- public Object call() throws Exception {
- // do reply
- // operationClient.execute(false);
- return null;
- }
- });
- partnerRoleMessageExchange.replyOneWayOk();
- }
- }
-
-
- /**
- * Find the SCA Reference operation
- *
- * @param operationName
- * @param runtimeComponentReference
- * @return
- */
- private Operation findOperation(String operationName, RuntimeComponentReference runtimeComponentReference) {
- Operation reseultOperation = null;
-
- for(Operation operation : runtimeComponentReference.getInterfaceContract().getInterface().getOperations()) {
- if (operationName.equalsIgnoreCase(operation.getName())) {
- reseultOperation = operation;
- break;
- }
- }
- return reseultOperation;
- }
-
- /**
- * Get paylod from a given ODEMessage
- * @param odeMessage
- * @return
- */
- private Element getPayload(Message odeMessage) {
- Element payload = null;
- Element parameters = odeMessage.getPart("parameters");
-
- if (parameters != null && parameters.hasChildNodes()) {
- payload = (Element)parameters.getFirstChild();
- }
-
- return payload;
- }
-
-
- private void replyTwoWayInvocation(final String odeMexId, final Operation operation, final Element result) {
- // ODE MEX needs to be invoked in a TX.
- try {
- _server.getScheduler().execIsolatedTransaction(new Callable<Void>() {
- public Void call() throws Exception {
- PartnerRoleMessageExchange odeMex = null;
- try {
- odeMex = (PartnerRoleMessageExchange)_server.getBpelServer().getEngine().getMessageExchange(odeMexId);
- if (odeMex != null) {
- Message response = createResponseMessage(odeMex, operation, (Element)result);
- odeMex.reply(response);
- }
- } catch (Exception ex) {
- String errmsg = "Unable to process response: " + ex.getMessage();
- if (odeMex != null) {
- odeMex.replyWithFailure(MessageExchange.FailureType.OTHER, errmsg, null);
- }
- }
-
- return null;
- }
- });
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- }
-
- private Message createResponseMessage(PartnerRoleMessageExchange partnerRoleMessageExchange,
- Operation operation,
- Element invocationResult) {
- Document dom = DOMUtils.newDocument();
-
- String operationName = operation.getName();
- Part bpelOperationOutputPart =
- (Part)((WSDLInterface)operation.getInterface()).getPortType().getOperation(operationName, null, null)
- .getOutput().getMessage().getParts().values().iterator().next();
-
- Element contentMessage = dom.createElement("message");
- Element contentPart = dom.createElement(bpelOperationOutputPart.getName());
-
- contentPart.appendChild(dom.importNode(invocationResult, true));
- contentMessage.appendChild(contentPart);
- dom.appendChild(contentMessage);
-
- if(__log.isDebugEnabled()) {
- __log.debug("Creating result message:");
- __log.debug(">>>" + DOMUtils.domToString(dom.getDocumentElement()));
- }
-
- QName id = partnerRoleMessageExchange.getOperation().getOutput().getMessage().getQName();
- Message response = partnerRoleMessageExchange.createMessage(id);
- response.setMessage(dom.getDocumentElement());
-
- return response;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEInitializationException.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEInitializationException.java
deleted file mode 100644
index 2fa91e4e86..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEInitializationException.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.bpel.ode;
-
-/**
- * Thrown when ODE failed to initialize one if its needed resources.
- *
- * @version $Rev$ $Date$
- */
-public class ODEInitializationException extends RuntimeException {
- private static final long serialVersionUID = -2869674556330744215L;
-
- public ODEInitializationException(Throwable cause) {
- super(cause);
- }
-
- public ODEInitializationException(String message) {
- super(message);
- }
-
- public ODEInitializationException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEMessageExchangeContext.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEMessageExchangeContext.java
deleted file mode 100644
index 1ec82390cf..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEMessageExchangeContext.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.implementation.bpel.ode;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.iapi.BpelEngineException;
-import org.apache.ode.bpel.iapi.ContextException;
-import org.apache.ode.bpel.iapi.MessageExchangeContext;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
-
-/**
- * Message Exchange Context information
- *
- * @version $Rev$ $Date$
- */
-public class ODEMessageExchangeContext implements MessageExchangeContext {
- private static final Log __log = LogFactory.getLog(ODEMessageExchangeContext.class);
-
- private EmbeddedODEServer _server;
-
- public ODEMessageExchangeContext(EmbeddedODEServer _server) {
- this._server = _server;
- }
-
- public void invokePartner(PartnerRoleMessageExchange partnerRoleMessageExchange) throws ContextException {
- if (__log.isDebugEnabled()) {
- __log.debug("Invoking a partner operation: " + partnerRoleMessageExchange.getOperationName());
- }
-
- ODEExternalService scaService = new ODEExternalService(_server);
- scaService.invoke(partnerRoleMessageExchange);
- }
-
- public void onAsyncReply(MyRoleMessageExchange myRoleMessageExchange) throws BpelEngineException {
- if (__log.isDebugEnabled()) {
- __log.debug("Processing an async reply from service " + myRoleMessageExchange.getServiceName());
- }
- }
- }
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEShutdownException.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEShutdownException.java
deleted file mode 100644
index a928379ba9..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEShutdownException.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.bpel.ode;
-
-/**
- * Thrown when ODE failed to shutdown.
- *
- * @version $Rev$ $Date$
- */
-public class ODEShutdownException extends RuntimeException {
- private static final long serialVersionUID = -2869674556330744215L;
-
- public ODEShutdownException(Throwable cause) {
- super(cause);
- }
-
- public ODEShutdownException(String message) {
- super(message);
- }
-
- public ODEShutdownException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyEPR.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyEPR.java
deleted file mode 100644
index 328403e626..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyEPR.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.bpel.ode;
-
-import javax.xml.namespace.QName;
-
-import org.apache.ode.bpel.iapi.Endpoint;
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.utils.DOMUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * This should hold something that makes sense for Tuscany so that the
- * process has an address that makes sense from the outside world perspective
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyEPR implements EndpointReference {
- private final QName prcessName;
- private final Endpoint endpoint;
- private final Document doc = DOMUtils.newDocument();
-
- public TuscanyEPR(QName processName, Endpoint endpoint) {
- this.prcessName = processName;
- this.endpoint = endpoint;
-
- Element serviceref = doc.createElementNS(EndpointReference.SERVICE_REF_QNAME.getNamespaceURI(),
- EndpointReference.SERVICE_REF_QNAME.getLocalPart());
- serviceref.setNodeValue(endpoint.serviceName + ":" + endpoint.portName);
- doc.appendChild(serviceref);
- }
-
- public Document toXML() {
- return doc;
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java
deleted file mode 100644
index 8f8f608217..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.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.implementation.bpel.ode;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import org.apache.ode.bpel.iapi.Endpoint;
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.bpel.iapi.PartnerRoleChannel;
-import org.apache.ode.utils.DOMUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Tuscany Partner Role Channel for ODE Integration
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyPRC implements PartnerRoleChannel {
- private final QName processName;
- private final QName pid;
- private final PortType portType;
- private final Endpoint endpoint;
-
- public TuscanyPRC(QName processName, QName pid, PortType portType, Endpoint endpoint){
- this.processName = processName;
- this.pid = pid;
- this.portType = portType;
- this.endpoint = endpoint;
- }
-
- public QName getProcessName() {
- return this.processName;
- }
-
- public void close() {
-
- }
-
- public EndpointReference getInitialEndpointReference() {
- final Document doc = DOMUtils.newDocument();
- Element serviceref = doc.createElementNS(EndpointReference.SERVICE_REF_QNAME.getNamespaceURI(),
- EndpointReference.SERVICE_REF_QNAME.getLocalPart());
- doc.appendChild(serviceref);
-
- return new EndpointReference() {
- public Document toXML() {
- return doc;
- }
- };
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyProcessConfImpl.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyProcessConfImpl.java
deleted file mode 100644
index 22a86a9e0f..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyProcessConfImpl.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.bpel.ode;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.compiler.BpelC;
-import org.apache.ode.bpel.evt.BpelEvent.TYPE;
-import org.apache.ode.bpel.iapi.Endpoint;
-import org.apache.ode.bpel.iapi.ProcessConf;
-import org.apache.ode.bpel.iapi.ProcessState;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * A Tuscany implementation of the ODE Process Conf
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyProcessConfImpl implements ProcessConf {
- private final Log __log = LogFactory.getLog(getClass());
-
- private BPELImplementation implementation;
- private Map<String, Endpoint> invokeEndpoints = null;
- private Map<String, Endpoint> provideEndpoints = null;
- private Map<QName, Node> properties = null;
- private ProcessState processState;
- private Date deployDate;
-
- private final String TUSCANY_NAMESPACE = "http://tuscany.apache.org";
-
- /**
- * Constructor for the ProcessConf implementation
- * @param theImplementation the BPEL implementation for which this is the ProcessConf
- */
- public TuscanyProcessConfImpl( BPELImplementation theImplementation ) {
- //System.out.println("New TuscanyProcessConfImpl...");
- this.implementation = theImplementation;
-
- processState = ProcessState.ACTIVE;
- deployDate = new Date();
-
- // Compile the process
- compile( getBPELFile() );
- } // end TuscanyProcessConfImpl constructor
-
- /**
- * Returns the URI for the directory containing the BPEL process
- */
- public URI getBaseURI() {
- //System.out.println("getBaseURI called");
- File theDir = getDirectory();
- return theDir.toURI();
- }
-
- /**
- * Returns a String containing the (local) name of the file containing the BPEL process
- */
- public String getBpelDocument() {
- //System.out.println("getBPELDocument called");
- try {
- File processFile = new File(URI.create(implementation.getProcessDefinition().getLocation()));
- return getRelativePath( getDirectory(), processFile);
- } catch (Exception e) {
- if(__log.isWarnEnabled()) {
- __log.warn("Unable to resolve relative path of BPEL process" + implementation.getProcessDefinition().getLocation(), e );
- }
- return null;
- } // end try
- } // end getBpelDocument
-
- /**
- * Returns an InputStream containing the Compiled BPEL Process (CBP)
- */
- public InputStream getCBPInputStream() {
- //System.out.println("getCBPInputStream called");
- // Find the CBP file - it has the same name as the BPEL process and lives in the same
- // directory as the process file
- String cbpFileName = null;
- try {
- String fileName = getRelativePath( getDirectory(), getBPELFile() );
- cbpFileName = fileName.substring(0, fileName.lastIndexOf(".")) + ".cbp";
- } catch (Exception e ) {
- // IOException trying to fetch the BPEL file name
- if(__log.isDebugEnabled()) {
- __log.debug("Unable to calculate the file name for BPEL process: " +
- implementation.getProcessDefinition().getName(), e);
- return null;
- } // end if
- } // end try
- File cbpFile = new File( getDirectory(), cbpFileName );
- if( cbpFile.exists() ) {
- // Create an InputStream from the cbp file...
- try {
- return new FileInputStream( cbpFile );
- } catch ( Exception e ) {
- if(__log.isDebugEnabled()) {
- __log.debug("Unable to open the cbp file for BPEL process: " +
- implementation.getProcessDefinition().getName(), e);
- }
- } // end try
- } else {
- // Cannot find the cbp file
- if(__log.isWarnEnabled()){
- __log.warn("Cannot find the cbp file for process: " +
- implementation.getProcessDefinition().getName());
- }
- } // end if
- // TODO - need better exception handling if we can't open the cbp file for any reason
- return null;
- } // end getCBPInputStream
-
- /**
- * Return the WSDL Definition for a given PortType
- * @param portTypeName - the QName of the PortType
- */
- public Definition getDefinitionForPortType( QName portTypeName ) {
- //System.out.println("getDefinitionForPortType called for portType: " + portTypeName );
- // Find the named PortType in the list of WSDL interfaces associated with this BPEL Process
- Collection<WSDLInterface> theInterfaces = implementation.getProcessDefinition().getInterfaces();
- for( WSDLInterface wsdlInterface : theInterfaces ) {
- if ( wsdlInterface.getPortType().getQName().equals( portTypeName ) ) {
- // Extract and return the Definition associated with the WSDLDefinition...
- return wsdlInterface.getWsdlDefinition().getDefinition();
- } // end if
- } // end for
- return null;
- } // end getDefinitionforPortType
-
- /**
- * Returns a WSDL Definition for a given Service QName
- *
- * 22/05/2008 - it is very unclear what this service QName is really meant to be.
- * From the handling of the deploy.xml file by the current ODE code, it seems that the key link
- * is from the Service QName to the PartnerLink name (done in the deploy.xml file).
- *
- * The curious part about this is that the QName for the service is ONLY defined in deploy.xml file
- * and does not appear to relate to anything else, except for the QName of the PartnerLink
- *
- * The PartnerLink name is the same as the name of the SCA service (or reference) which in turn points
- * at the PartnerLinkType which in turn points at an (WSDL) interface definition.
- */
- public Definition getDefinitionForService(QName serviceQName ) {
- //System.out.println("getDefinitionForService called for Service: " + serviceQName );
- if(__log.isDebugEnabled()){
- __log.debug("getDefinitionforService called for service: " + serviceQName );
- }
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * Returns the date of deployment of the process
- * - for SCA returns the date at which this object was created
- */
- public Date getDeployDate() {
- //System.out.println("getDeployDate called");
- return deployDate;
- }
-
- /**
- * Returns userid of deployer
- * - always "SCA Tuscany" for Tuscany...
- */
- public String getDeployer() {
- //System.out.println("getDeployer called");
- return "SCA Tuscany";
- } // end getDeployer
-
- /**
- * Returns a list of the files in the directory containing the BPEL Process
- */
- public List<File> getFiles() {
- //System.out.println("getFiles called");
- File theDir = getDirectory();
- List<File> theFiles = Arrays.asList( (File[]) theDir.listFiles() );
- // TODO recurse into subdirectories
- return theFiles;
- } // end getFiles
-
- /**
- * Returns a Map containing all the "invoke endpoints" - for which read "SCA references"
- * The map is keyed by partnerLink name and holds Endpoint objects
- *
- * TODO deal with service callbacks on bidirectional services
- */
- public Map<String, Endpoint> getInvokeEndpoints() {
- //System.out.println("getInvokeEndpoints called");
- if( invokeEndpoints == null ) {
- invokeEndpoints = new HashMap<String, Endpoint>();
- // Get a collection of the references
- List<Reference> theReferences = implementation.getReferences();
- // Create an endpoint for each reference, using the reference name as the "service"
- // name, combined with http://tuscany.apache.org to make a QName
- for( Reference reference : theReferences ) {
- invokeEndpoints.put( reference.getName(),
- new Endpoint( new QName( TUSCANY_NAMESPACE, reference.getName() ), "ReferencePort"));
- } // end for
- } // end if
- return invokeEndpoints;
- } // end getInvokeEndpoints
-
- /**
- * Returns the name of the directory containing the BPEL files
- */
- public String getPackage() {
- //System.out.println("getPackage called");
- File theDir = getDirectory();
- return theDir.getName();
- } // end getPackage
-
- /**
- * Return the BPEL Process ID - which is the Process QName appended "-versionnumber"
- */
- public QName getProcessId() {
- //System.out.println("getProcessId called");
- QName processType = getType();
- QName processID = new QName( processType.getNamespaceURI(),
- processType.getLocalPart() + "-" + getVersion() );
- return processID;
- } // end getProcessID
-
- /**
- * TODO - What are properties?
- */
- public Map<QName, Node> getProperties() {
- //System.out.println("getProperties called");
- if ( properties == null ) {
- properties = new HashMap<QName, Node>();
- } // end if
- return properties;
- } // end getProperties
-
- /**
- * Returns a Map containing all the "provide endpoints" - for which read "SCA services"
- * The map is keyed by partnerLink name and holds Endpoint objects
- *
- * TODO deal with reference callbacks on bidirectional references
- */
- public Map<String, Endpoint> getProvideEndpoints() {
- //System.out.println("getProvideEndpoints called");
- if( provideEndpoints == null ) {
- provideEndpoints = new HashMap<String, Endpoint>();
- // Get a collection of the references
- List<Service> theServices = implementation.getServices();
- // Create an endpoint for each reference, using the reference name as the "service"
- // name, combined with http://tuscany.apache.org to make a QName
- for( Service service : theServices ) {
- provideEndpoints.put( service.getName(),
- new Endpoint( new QName( TUSCANY_NAMESPACE, service.getName() ), "ServicePort"));
- } // end for
- } // end if
- return provideEndpoints;
- } // end getProvideEndpoints
-
- /**
- * Return the process state
- */
- public ProcessState getState() {
- //System.out.println("getState called");
- return processState;
- }
-
- /**
- * Returns the QName of the BPEL process
- */
- public QName getType() {
- //System.out.println("getType called");
- return implementation.getProcess();
- }
-
- /**
- * Gets the process Version number
- * - current code does not have versions for BPEL processes and always returns "1"
- */
- public long getVersion() {
- //System.out.println("getVersion called");
- return 1;
- }
-
- /**
- * Returns true if the supplied event type is enabled for any of the scopes in the provided
- * List. These events are "ODE Execution Events" and there is a definition of them on this
- * page: http://ode.apache.org/user-guide.html#UserGuide-ProcessDeployment
- *
- * For the present Tuscany does not support manipulating the event enablement and always
- * returns that the event is not enabled
- * @param scopeNames - list of BPEL process Scope names
- * @param type - the event type
- */
- public boolean isEventEnabled(List<String> scopeNames, TYPE type) {
- //System.out.println("isEventEnabled called with scopeNames: " +
- // scopeNames + " and type: " + type );
- return false;
- } // end isEventEnabled
-
- /**
- * Returns whether the process is persisted in the store
- *
- * Returns false for SCA configuration
- * - returning true causes problems in communicating with the BPEL process
- */
- public boolean isTransient() {
- //System.out.println("isTransient called");
- return false;
- } // end isTransient
-
- /**
- * Compiles a BPEL process file into a compiled form CBP file in the main directory
- * (ie same directory as the BPEL process file)
- * @param bpelFile - the BPEL process file
- */
- private void compile( File bpelFile ) {
- // Set up the compiler
- BpelC compiler = BpelC.newBpelCompiler();
- // Provide a null set of initial properties for now
- Map<QName, Node> processProps = new HashMap<QName, Node>();
- Map<String, Object> compileProps = new HashMap<String, Object>();
- compileProps.put( BpelC.PROCESS_CUSTOM_PROPERTIES, processProps );
- compiler.setCompileProperties( compileProps );
- compiler.setBaseDirectory( getDirectory() );
-
- // Run the compiler and generate the CBP file into the given directory
- try {
- compiler.compile( bpelFile );
- } catch (IOException e) {
- if(__log.isDebugEnabled()) {
- __log.debug("Compile error in " + bpelFile, e);
- }
- // TODO - need better exception handling here
- } // end try
- } // end compile
-
- /**
- * Gets the directory containing the BPEL process
- * @return
- */
- private File getDirectory() {
- File theDir = getBPELFile().getParentFile();
- return theDir;
- } // end getDirectory
-
- /**
- * Gets the File containing the BPEL process definition
- * @return - the File object containing the BPEL process
- */
- private File getBPELFile() {
- try {
- File theProcess = new File(URI.create(implementation.getProcessDefinition().getLocation()));
- return theProcess;
- } catch( Exception e ) {
- if(__log.isDebugEnabled()) {
- __log.debug("Exception converting BPEL file URL to an URI: " + e );
- }
- } // end try
- return null;
- } // end getBPELFile
-
- /**
- * Gets the relative path of a file against a directory in its hierarchy
- * @param base - the base directory
- * @param path - the file
- * @return
- * @throws IOException
- */
- private String getRelativePath(File base, File path) throws IOException {
- String basePath = base.getCanonicalPath();
- String filePath = path.getCanonicalPath();
- if (!filePath.startsWith(basePath)) {
- throw new IOException("Invalid relative path: base=" + base + " path=" + path);
- }
- String relative = filePath.substring(basePath.length());
- if (relative.startsWith(File.separator)) {
- relative = relative.substring(1);
- }
- return relative;
- } // end getRelativePath
-
- //-----------------------------------------------------------------------------
- // other public APIs which ProcessConfImpl displays which are not in ProcessConf interface
-
- public List<String> getMexInterceptors(QName processId) {
- System.out.println("getMexInterceptors for processID: " + processId );
- return null;
- }
-
- public void setTransient(boolean t) {
- System.out.println("setTransient called with boolean: " + t );
- }
-
- public List<Element> getExtensionElement(QName arg0) {
- return Collections.emptyList();
- }
- // end of other public APIs
- //-----------------------------------------------------------------------------
-
-} // end class TuscanyProcessConfImpl
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProvider.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProvider.java
deleted file mode 100644
index c644b6a965..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProvider.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.implementation.bpel.ode.provider;
-
-import java.io.File;
-import java.net.URI;
-
-import javax.transaction.TransactionManager;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.databinding.xml.DOMDataBinding;
-import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
-import org.apache.tuscany.sca.implementation.bpel.ode.EmbeddedODEServer;
-import org.apache.tuscany.sca.implementation.bpel.ode.ODEDeployment;
-import org.apache.tuscany.sca.implementation.bpel.ode.ODEInitializationException;
-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;
-
-/**
- * BPEL Implementation provider
- *
- * @version $Rev$ $Date$
- */
-public class BPELImplementationProvider implements ImplementationProvider {
- private final Log __log = LogFactory.getLog(getClass());
-
- private RuntimeComponent component;
- private BPELImplementation implementation;
-
- private EmbeddedODEServer odeServer;
- private TransactionManager txMgr;
-
- /**
- * Constructs a new BPEL Implementation.
- */
- public BPELImplementationProvider(RuntimeComponent component,
- BPELImplementation implementation,
- EmbeddedODEServer odeServer,
- TransactionManager txMgr) {
- this.component = component;
- this.implementation = implementation;
- this.odeServer = odeServer;
- this.txMgr = txMgr;
-
- // Configure the service and reference interfaces to use a DOM databinding
- // as it's what ODE expects
- for (Service service: implementation.getServices()) {
- service.getInterfaceContract().getInterface().resetDataBinding(DOMDataBinding.NAME);
- }
- for (Reference reference: implementation.getReferences()) {
- reference.getInterfaceContract().getInterface().resetDataBinding(DOMDataBinding.NAME);
- }
-
- }
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- BPELInvoker invoker = new BPELInvoker(component, service, operation, odeServer, txMgr);
- return invoker;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- if(__log.isInfoEnabled()) {
- __log.info("Starting " + component.getName());
- }
-
- try {
- if (!odeServer.isInitialized()) {
- // start ode server
- odeServer.init();
- }
-
- URI deployURI = URI.create(this.implementation.getProcessDefinition().getLocation());
-
- File deploymentDir = new File(deployURI).getParentFile();
-
- if(__log.isInfoEnabled()) {
- __log.info(">>> Deploying : " + deploymentDir.toString());
- }
-
- // deploy the process
- if (odeServer.isInitialized()) {
- try {
- //txMgr.begin();
- odeServer.registerTuscanyRuntimeComponent(implementation.getProcess(), component);
- // Replaced by Mike Edwards 23/05/2008
- //odeServer.deploy(new ODEDeployment(deploymentDir));
- odeServer.deploy(new ODEDeployment(deploymentDir), implementation );
- //txMgr.commit();
- } catch (Exception e) {
- e.printStackTrace();
- //txMgr.rollback();
- }
- }
-
- } catch (ODEInitializationException inite) {
- throw new RuntimeException("BPEL Component Type Implementation : Error initializing embedded ODE server " + inite.getMessage(), inite);
- } catch(Exception e) {
- throw new RuntimeException("BPEl Component Type Implementation initialization failure : " + e.getMessage(), e);
- }
- }
-
- public void stop() {
- if(__log.isInfoEnabled()) {
- __log.info("Stopping " + component.getName());
- }
-
- if (odeServer.isInitialized()) {
- // start ode server
- odeServer.stop();
- }
-
- txMgr = null;
-
- if(__log.isInfoEnabled()) {
- __log.info("Stopped !!!");
- }
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProviderFactory.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProviderFactory.java
deleted file mode 100644
index c5d6555a24..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELImplementationProviderFactory.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.implementation.bpel.ode.provider;
-
-import javax.transaction.TransactionManager;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
-import org.apache.tuscany.sca.implementation.bpel.ode.EmbeddedODEServer;
-import org.apache.tuscany.sca.implementation.bpel.ode.GeronimoTxFactory;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.osoa.sca.annotations.Destroy;
-
-/**
- * BPEL Implementation provider factory
- *
- * We use the provider factory to instantiate a ODE server that is going to be injected in all BPEL components
- *
- * @version $Rev$ $Date$
- */
-public class BPELImplementationProviderFactory implements ImplementationProviderFactory<BPELImplementation> {
-
- private EmbeddedODEServer odeServer;
- private TransactionManager txMgr;
-
- /**
- * Default constructor receiving an extension point
- * @param extensionPoints
- */
- public BPELImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- GeronimoTxFactory txFactory = new GeronimoTxFactory();
- txMgr = txFactory.getTransactionManager();
- this.odeServer = new EmbeddedODEServer(txMgr);
- }
-
- /**
- * Creates a new BPEL Implementation and inject the EmbeddedODEServer
- */
- public ImplementationProvider createImplementationProvider(RuntimeComponent component, BPELImplementation implementation) {
- return new BPELImplementationProvider(component, implementation, odeServer, txMgr);
- }
-
- public Class<BPELImplementation> getModelType() {
- return BPELImplementation.class;
- }
-
- @Destroy
- public void destroy() {
- txMgr = null;
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java b/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
deleted file mode 100644
index f301082d59..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.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.implementation.bpel.ode.provider;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.concurrent.Future;
-
-import javax.transaction.SystemException;
-import javax.transaction.TransactionManager;
-import javax.wsdl.Part;
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.iapi.MessageExchange.Status;
-import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.utils.GUID;
-import org.apache.tuscany.sca.implementation.bpel.ode.EmbeddedODEServer;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Implements a target invoker for BPEL component implementations.
- *
- * The target invoker is responsible for dispatching invocations to the particular
- * component implementation logic. In this example we are simply delegating the
- * CRUD operation invocations to the corresponding methods on our fake
- * resource manager.
- *
- * @version $Rev$ $Date$
- */
-public class BPELInvoker implements Invoker {
- protected final Log __log = LogFactory.getLog(getClass());
-
- private EmbeddedODEServer odeServer;
- private TransactionManager txMgr;
-
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private Operation operation;
- private QName bpelServiceName;
- private String bpelOperationName;
- private Part bpelOperationInputPart;
- private Part bpelOperationOutputPart;
-
- public BPELInvoker(RuntimeComponent component, RuntimeComponentService service, Operation operation, EmbeddedODEServer odeServer, TransactionManager txMgr) {
- this.component = component;
- this.service = service;
- this.operation = operation;
- this.bpelOperationName = operation.getName();
- this.odeServer = odeServer;
- this.txMgr = txMgr;
-
- initializeInvocation();
- }
-
-
- private void initializeInvocation() {
-
- if(true){
- __log.debug("Initializing BPELInvoker");
- }
- Interface interfaze = operation.getInterface();
- if(interfaze instanceof WSDLInterface){
- WSDLInterface wsdlInterface = null;
- wsdlInterface = (WSDLInterface) interfaze;
-
- // The following commented out code is bogus and is replaced by what follows - Mike Edwards
- // Service serviceDefinition = (Service) wsdlInterface.getWsdlDefinition().getDefinition().getAllServices().values().iterator().next();
- // bpelServiceName = serviceDefinition.getQName();
- //
- // Fetch the service name from the service object
- bpelServiceName = new QName( "http://tuscany.apache.org", service.getName() );
- //System.out.println("Actual service QName: " + bpelServiceName );
-
- bpelOperationInputPart = (Part) wsdlInterface.getPortType().getOperation(bpelOperationName,null,null).getInput().getMessage().getParts().values().iterator().next();
- bpelOperationOutputPart = (Part) wsdlInterface.getPortType().getOperation(bpelOperationName,null,null).getOutput().getMessage().getParts().values().iterator().next();
- }
- }
-
- public Message invoke(Message msg) {
- try {
- Object[] args = msg.getBody();
- Object resp = doTheWork(args);
- msg.setBody(resp);
- } catch (InvocationTargetException e) {
- msg.setFaultBody(e.getCause());
- }
- return msg;
- }
-
- public Object doTheWork(Object[] args) throws InvocationTargetException {
- Element response = null;
-
- if(! (operation.getInterface() instanceof WSDLInterface)) {
- throw new InvocationTargetException(null,"Unsupported service contract");
- }
-
- if(true) {
- System.out.println("Invoking bpel component : " + bpelServiceName + "#" + bpelOperationName);
- }
-
- org.apache.ode.bpel.iapi.MyRoleMessageExchange mex = null;
- Future onhold = null;
-
- //Process the BPEL process invocation
- try {
- txMgr.begin();
- mex = odeServer.getBpelServer().getEngine().createMessageExchange(new GUID().toString(),
- bpelServiceName,
- bpelOperationName);
-
- onhold = mex.invoke(createInvocationMessage(mex, args));
-
- txMgr.commit();
- } catch (Exception e) {
- try {
- txMgr.rollback();
- } catch (SystemException se) {
-
- }
- throw new InvocationTargetException(e, "Error invoking BPEL process : " + e.getMessage());
- }
-
-
- // Waiting until the reply is ready in case the engine needs to continue in a different thread
- if (onhold != null) {
- try {
- onhold.get();
- } catch (Exception e) {
- throw new InvocationTargetException(e,"Error invoking BPEL process : " + e.getMessage());
- }
- }
-
- //Process the BPEL invocation response
- try {
- txMgr.begin();
- // Reloading the mex in the current transaction, otherwise we can't
- // be sure we have the "freshest" one.
- mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());
-
- if(true) {
- Status status = mex.getStatus();
- Element invocationResponse = mex.getResponse().getMessage();
-
- System.out.println(">>>Invocation status:" + status.name());
- System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
- System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
- }
- //process the method invocation result
- response = processResponse(mex.getResponse().getMessage());
-
- txMgr.commit();
- // end of transaction two
- } catch (Exception e) {
- try {
- txMgr.rollback();
- } catch (SystemException se) {
-
- }
- throw new InvocationTargetException(e, "Error retrieving BPEL process invocation status : " + e.getMessage());
- }
-
-
- return response;
- }
-
- /**
- * Create BPEL Invocation message
- *
- * BPEL invocation message like :
- * <message>
- * <TestPart>
- * <hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">Hello</hello>
- * </TestPart>
- * </message>
- * @param args
- * @return
- */
- private org.apache.ode.bpel.iapi.Message createInvocationMessage(org.apache.ode.bpel.iapi.MyRoleMessageExchange mex, Object[] args) {
- Document dom = DOMUtils.newDocument();
-
- Element contentMessage = dom.createElement("message");
- Element contentPart = dom.createElement(bpelOperationInputPart.getName());
- Element payload = null;
-
- //TUSCANY-2321 - Properly handling Document or Element types
- if(args[0] instanceof Document) {
- payload = (Element) ((Document) args[0]).getFirstChild();
- } else {
- payload = (Element) args[0];
- }
-
- contentPart.appendChild(dom.importNode(payload, true));
- contentMessage.appendChild(contentPart);
- dom.appendChild(contentMessage);
-
- if(true) {
- System.out.println("Creating invocation message:");
- System.out.println(">> args.....: " + DOMUtils.domToString(payload));
- System.out.println(">> message..:" + DOMUtils.domToString(dom.getDocumentElement()));
- }
-
- org.apache.ode.bpel.iapi.Message request = mex.createMessage(new QName("", ""));
- request.setMessage(dom.getDocumentElement());
-
- return request;
- }
-
- /**
- * Process BPEL response
- *
- * <message>
- * <TestPart>
- * <hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">World</hello>
- * </TestPart>
- * </message>
- *
- * @param response
- * @return
- */
- private Element processResponse(Element response) {
- // return (Element) DOMUtils.findChildByName(response, new QName("",bpelOperationOutputPart.getName())).getFirstChild();
- return (Element) DOMUtils.findChildByName(response, new QName("",bpelOperationOutputPart.getName()));
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-android/modules/implementation-bpel-ode/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index 3bce8aa9ab..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/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.bpel.ode.provider.BPELImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.bpel.BPELImplementation
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/test/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServerTestCase.java b/branches/sca-android/modules/implementation-bpel-ode/src/test/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServerTestCase.java
deleted file mode 100644
index 360df0b2c5..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/test/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServerTestCase.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.bpel.ode;
-
-import java.io.File;
-import java.io.StringReader;
-import java.net.URL;
-import java.util.concurrent.Future;
-
-import javax.transaction.TransactionManager;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.iapi.MessageExchange.Status;
-import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.utils.GUID;
-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.apache.tuscany.sca.implementation.bpel.ode.EmbeddedODEServer;
-import org.apache.tuscany.sca.implementation.bpel.ode.GeronimoTxFactory;
-import org.apache.tuscany.sca.implementation.bpel.ode.ODEDeployment;
-import org.w3c.dom.Element;
-
-/**
- * Test to Deploy and Invoke a HelloWorld BPEL process using EmbeddedODEServer
- *
- * Major changes introduced to this testcase on 27/05/2008 associated with changes in the
- * implementation of EmbeddedODEServer which remove the need for the ODE deploy.xml file -
- * instead a Tuscany BPELImplementation object is passed to the EmbeddedODEServer and this is
- * introspected to get all the necessary information about the BPEL process
- *
- * @version $Rev$ $Date$
- */
-public class EmbeddedODEServerTestCase extends TestCase {
-
- private EmbeddedODEServer odeServer;
-
- private TransactionManager txMgr;
-
- @Override
- protected void setUp() throws Exception {
- // Set up the ODE BPEL server...
- GeronimoTxFactory txFactory = new GeronimoTxFactory();
- txMgr = txFactory.getTransactionManager();
-
- this.odeServer = new EmbeddedODEServer(txMgr);
- odeServer.init();
-
- } // end setUp
-
- @Override
- protected void tearDown() throws Exception {
- odeServer.stop();
- }
-
- public void testProcessInvocation() throws Exception {
- if (!odeServer.isInitialized()) {
- fail("Server did not start !");
- }
-// TODO - write effective testcase - made problematic by the need to supply a resolved
-// BPELImplementation
-/*
- URL deployURL = getClass().getClassLoader().getResource("helloworld/deploy.xml");
- File deploymentDir = new File(deployURL.toURI().getPath()).getParentFile();
- System.out.println("Deploying : " + deploymentDir.toString());
- System.out.println(deploymentDir);
-
- if (odeServer.isInitialized()) {
- try {
- txMgr.begin();
- odeServer.deploy(new ODEDeployment(deploymentDir), implementation);
- txMgr.commit();
- } catch (Exception e) {
- e.printStackTrace();
- txMgr.rollback();
- }
-
- // transaction one
- MyRoleMessageExchange mex = null;
- Future onhold = null;
- try {
- // invoke the process
- txMgr.begin();
- mex = odeServer.getBpelServer().getEngine().createMessageExchange(new GUID().toString(),
- new QName("http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl", "HelloService"), "hello");
-
- Message request = mex.createMessage(new QName("", ""));
- request.setMessage(DOMUtils.stringToDOM("<message><TestPart><hello xmlns=\"http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl\">Hello</hello></TestPart></message>"));
- onhold = mex.invoke(request);
- txMgr.commit();
- } catch (Exception e) {
- e.printStackTrace();
- txMgr.rollback();
- }
- // - end of transaction one
-
- // Waiting until the reply is ready in case the engine needs to continue in a different thread
- if (onhold != null)
- onhold.get();
-
- // transaction two
- try {
- txMgr.begin();
- // Reloading the mex in the current transaction, otherwise we can't be sure we have
- // the "freshest" one.
- mex = (MyRoleMessageExchange) odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());
-
- Status status = mex.getStatus();
- System.out.println("Status: " + status.name());
- Element response = mex.getResponse().getMessage();
- System.out.println("Response: " + DOMUtils.domToString(response));
- txMgr.commit();
- // end of transaction two
- } catch (Exception e) {
- e.printStackTrace();
- txMgr.rollback();
- } // end try
- } // end if
-*/
- } // end testProcessInvocation
-
-}
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/deploy.xml b/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/deploy.xml
deleted file mode 100644
index 571aa37d58..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/deploy.xml
+++ /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.
- -->
-<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- xmlns:wns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">
-
-
- <process name="tns:HelloWorld">
- <active>true</active>
- <provide partnerLink="helloPartnerLink">
- <service name="wns:HelloService" port="HelloPort"/>
- </provide>
- </process>
-</deploy>
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/greetings.wsdl b/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/greetings.wsdl
deleted file mode 100644
index bcd3ea6afa..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/greetings.wsdl
+++ /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.
--->
-<wsdl:definitions name="greetings"
- targetNamespace="http://greetings"
- xmlns:tns="http://greetings"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://greetings" xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="getGreetings">
- <complexType>
- <sequence>
- <element name="name" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="getGreetingsResponse">
- <complexType>
- <sequence>
- <element name="getGreetingsReturn" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
-
- </schema>
- </wsdl:types>
-
- <wsdl:message name="getGreetingsRequest">
- <wsdl:part element="tns:getGreetings" name="parameters"/>
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
- <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
- </wsdl:message>
-
- <wsdl:portType name="Greetings">
- <wsdl:operation name="getGreetings">
- <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
- <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
- </wsdl:operation>
- </wsdl:portType>
-
- <wsdl:binding name="GreetingsSoapBinding" type="tns:Greetings">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="getGreetings">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="getGreetingsRequest">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="getGreetingsResponse">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="GreetingsService">
- <wsdl:port name="GreetingsSoapPort" binding="tns:GreetingsSoapBinding">
- <wsdlsoap:address location="http://localhost:8085/GreetingsServiceComponent"/>
- </wsdl:port>
- </wsdl:service>
-
- <plnk:partnerLinkType name="GreetingsPartnerLinkType">
- <plnk:role name="Provider" portType="tns:Greetings"/>
- </plnk:partnerLinkType>
-</wsdl:definitions>
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/helloworld.bpel b/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/helloworld.bpel
deleted file mode 100644
index 8cf91adc2c..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/helloworld.bpel
+++ /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.
- -->
-<process name="HelloWorld"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:test="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
- expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
-
- <import location="helloworld.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"
- namespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"/>
-
- <partnerLinks>
- <partnerLink name="helloPartnerLink" partnerLinkType="test:HelloPartnerLinkType" myRole="me" />
- </partnerLinks>
-
- <variables>
- <variable name="helloMessage" messageType="test:HelloMessage"/>
- <variable name="tmpVar" type="xsd:string"/>
- </variables>
-
- <sequence>
- <receive
- name="start"
- partnerLink="helloPartnerLink"
- portType="test:HelloPortType"
- operation="hello"
- variable="helloMessage"
- createInstance="yes"/>
-
- <assign name="assign1">
- <copy>
- <from variable="helloMessage" part="TestPart"/>
- <to variable="tmpVar"/>
- </copy>
- <copy>
- <from>concat($tmpVar,' World')</from>
- <to variable="helloMessage" part="TestPart"/>
- </copy>
- </assign>
- <reply name="end"
- partnerLink="helloPartnerLink"
- portType="test:HelloPortType"
- operation="hello"
- variable="helloMessage"/>
- </sequence>
-</process>
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/helloworld.wsdl b/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/helloworld.wsdl
deleted file mode 100644
index 1d71727b2d..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/helloworld/helloworld.wsdl
+++ /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.
- -->
-
-<wsdl:definitions name="helloworld"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
-
- <wsdl:types>
- <schema elementFormDefault="qualified"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="hello">
- <complexType>
- <sequence>
- <element name="message" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- </schema>
- </wsdl:types>
-
- <wsdl:message name="HelloMessage">
- <wsdl:part element="tns:hello" name="TestPart"/>
- </wsdl:message>
-
- <wsdl:portType name="HelloPortType">
- <wsdl:operation name="hello">
- <wsdl:input message="tns:HelloMessage" name="TestIn"/>
- <wsdl:output message="tns:HelloMessage" name="TestOut"/>
- </wsdl:operation>
- </wsdl:portType>
-
-
- <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="hello">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="TestIn">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="TestOut">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloService">
- <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
- <soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
- </wsdl:port>
- </wsdl:service>
-
- <plnk:partnerLinkType name="HelloPartnerLinkType">
- <plnk:role name="me" portType="tns:HelloPortType"/>
- <plnk:role name="you" portType="tns:HelloPortType"/>
- </plnk:partnerLinkType>
-</wsdl:definitions> \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/log4j.properties b/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/log4j.properties
deleted file mode 100644
index 82b3c09723..0000000000
--- a/branches/sca-android/modules/implementation-bpel-ode/src/test/resources/log4j.properties
+++ /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.
-#
-
-# Set root logger level to WARN and its only appender to CONSOLE
-log4j.rootLogger=OFF, CONSOLE
-
-# log4j properties to work with commandline tools.
-log4j.category.org.mortbay=OFF
-log4j.category.org.hibernate.type=OFF
-log4j.category.org.objectweb=OFF
-log4j.category.org.apache.ode.axis2=OFF
-log4j.category.org.apache.ode.bpel.engine=OFF
-log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF
-log4j.category.org.apache.ode.bpel.epr=OFF
-log4j.category.org.apache.tuscany.sca.implementation.bpel=OFF
-log4j.category.org.apache.tuscany.sca.implementation.bpel.ode=OFF
-log4j.category.org.apache.tuscany.sca.implementation.bpel.ode.provider=OFF
-
-# Console appender
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=[%p] - %C{1}.%M(%L) | %m%n
diff --git a/branches/sca-android/modules/implementation-bpel/LICENSE b/branches/sca-android/modules/implementation-bpel/LICENSE
deleted file mode 100644
index baba9ca048..0000000000
--- a/branches/sca-android/modules/implementation-bpel/LICENSE
+++ /dev/null
@@ -1,251 +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 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.
-
-=================================================================================================================
diff --git a/branches/sca-android/modules/implementation-bpel/META-INF/README b/branches/sca-android/modules/implementation-bpel/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-bpel/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-bpel/NOTICE b/branches/sca-android/modules/implementation-bpel/NOTICE
deleted file mode 100644
index a2f696be26..0000000000
--- a/branches/sca-android/modules/implementation-bpel/NOTICE
+++ /dev/null
@@ -1,17 +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/).
-
-Unless otherwise indicated, all distribution made available by the Apache Software Foundation
-is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
-A copy of the AL is provided with this distribution as the LICENSE file present in the
-root directory, and is also available at http://www.apache.org/licenses/.
-
-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.
diff --git a/branches/sca-android/modules/implementation-bpel/pom.xml b/branches/sca-android/modules/implementation-bpel/pom.xml
deleted file mode 100644
index ac1e8af858..0000000000
--- a/branches/sca-android/modules/implementation-bpel/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-bpel</artifactId>
- <name>Apache Tuscany SCA BPEL Implementation Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</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.implementation.bpel</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.bpel*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELFactory.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELFactory.java
deleted file mode 100644
index 9f8f9c0e9a..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELFactory.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.bpel;
-
-/**
- * A factory for the BPEL implementation model.
- *
- * @version $Rev$ $Date$
- */
-public interface BPELFactory {
-
- /**
- * Creates a new BPEL implementation.
- *
- * @return
- */
- BPELImplementation createBPELImplementation();
-
- /**
- * Creates a new BPEL Process Definition
- *
- * @return
- */
- BPELProcessDefinition createBPELProcessDefinition();
-}
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementation.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementation.java
deleted file mode 100644
index d54add5391..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementation.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.implementation.bpel;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * The model representing the BPEL implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public interface BPELImplementation extends Implementation {
-
- /**
- * Get the BPEL process Name
- *
- * @return
- */
- QName getProcess();
-
- /**
- * Set the BPEL process Name
- *
- * @param processName process QName
- */
- void setProcess(QName processName);
-
- /**
- * Get the BPEL process definition
- *
- * @return
- */
- BPELProcessDefinition getProcessDefinition();
-
- /**
- * Set the BPEL process definition
- *
- * @param processDefinition
- */
- void setProcessDefinition(BPELProcessDefinition processDefinition);
-
- /**
- * Returns the componentType for this implementation.
- *
- * @return
- */
- public ComponentType getComponentType();
-
- /**
- * Sets the componentType for this implementation
- *
- * @param componentType the component type to set
- */
- public void setComponentType(ComponentType componentType);
-
- /**
- * Returns the model resolver that can be used to resolve WSDLs and XSDs
- * referenced by the BPEL process.
- *
- * @return
- */
- ModelResolver getModelResolver();
-
- /**
- * Sets the model resolver that can be used to resolve WSDLs and XSDs referenced
- * by the BPEL process.
- *
- * @param modelResolver
- */
- void setModelResolver(ModelResolver modelResolver);
-}
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELProcessDefinition.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELProcessDefinition.java
deleted file mode 100644
index a6518ed11b..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/BPELProcessDefinition.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.implementation.bpel;
-
-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.assembly.Base;
-import org.apache.tuscany.sca.implementation.bpel.xml.BPELImportElement;
-import org.apache.tuscany.sca.implementation.bpel.xml.BPELPartnerLinkElement;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-
-/**
- * The model representing a BPEL process definition.
- *
- * @version $Rev$ $Date$
- */
-public interface BPELProcessDefinition extends Base {
-
- /**
- * Get the BPEL process Name
- *
- * @return
- */
- QName getName();
-
- /**
- * Set the BPEL process Name
- *
- * @param processName process QName
- */
- void setName(QName name);
-
- /**
- * Get BPEL process URI
- *
- * @return URI for the process
- */
- String getURI();
-
- /**
- * Set the BPEL process URI
- *
- * @param uri for the process
- */
- void setURI(String uri);
-
- /**
- * Get the URL for the process location
- *
- * @return
- */
- String getLocation();
-
- /**
- * Set the URL for the process location
- *
- * @param url
- */
- void setLocation(String location);
-
- /**
- * Return the list of PartnerLinks for this process
- *
- * @return
- */
- List<BPELPartnerLinkElement> getPartnerLinks();
-
- /**
- * Return the list of imports for this process
- *
- * @return
- */
- List<BPELImportElement> getImports();
-
- /**
- * Return the collection of associated port types
- *
- * @return
- */
- public List<PortType> getPortTypes() ;
-
- /**
- * Return the collection of associated WSDL interfaces
- * @return
- */
- public List<WSDLInterface> getInterfaces() ;
-}
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELFactoryImpl.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELFactoryImpl.java
deleted file mode 100644
index ab53964fb3..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELFactoryImpl.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.bpel.impl;
-
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.implementation.bpel.BPELFactory;
-import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
-import org.apache.tuscany.sca.implementation.bpel.BPELProcessDefinition;
-
-/**
- * A factory for the BPEL implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class BPELFactoryImpl implements BPELFactory {
-
- public BPELFactoryImpl(ModelFactoryExtensionPoint modelFactories) {
- }
-
- public BPELImplementation createBPELImplementation() {
- return new BPELImplementationImpl();
- }
-
- public BPELProcessDefinition createBPELProcessDefinition() {
- return new BPELProcessDefinitionImpl();
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationImpl.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationImpl.java
deleted file mode 100644
index f1c943e49c..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationImpl.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.implementation.bpel.impl;
-
-import java.util.Collections;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
-import org.apache.tuscany.sca.implementation.bpel.BPELProcessDefinition;
-
-/**
- * The model representing a BPEL implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-class BPELImplementationImpl extends ImplementationImpl implements BPELImplementation {
-
- private QName processName;
- private BPELProcessDefinition processDefinition;
- private ComponentType componentType;
- private ModelResolver modelResolver;
-
- public QName getProcess() {
- return processName;
- }
-
- public void setProcess(QName processName) {
- this.processName = processName;
- }
-
- public BPELProcessDefinition getProcessDefinition() {
- return this.processDefinition;
- }
-
- public void setProcessDefinition(BPELProcessDefinition processDefinition) {
- this.processDefinition = processDefinition;
- }
-
- @Override
- public String getURI() {
- // The BPEL implementation does not have a URI
- return null;
- }
-
- @Override
- public void setURI(String uri) {
- // The BPEL implementation does not have a URI
- }
-
- @Override
- public ConstrainingType getConstrainingType() {
- // The BPEL implementation does not support constrainingTypes
- return null;
- }
-
- @Override
- public List<Property> getProperties() {
- // The BPEL implementation does not support properties
- return Collections.emptyList();
- }
-
- public ComponentType getComponentType() {
- return componentType;
- }
-
- public void setComponentType(ComponentType componentType) {
- this.componentType = componentType;
- }
-
- public ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
- @Override
- public List<Service> getServices() {
- return componentType.getServices();
- }
-
- @Override
- public List<Reference> getReferences() {
- return componentType.getReferences();
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(this.getProcess()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof BPELImplementation) {
- if (getProcess() != null) {
- return getProcess().equals(((BPELImplementation)obj).getProcess());
- } else {
- return ((BPELImplementation)obj).getProcess() == null;
- }
- } else {
- return false;
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELProcessDefinitionImpl.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELProcessDefinitionImpl.java
deleted file mode 100644
index 5ce4f91376..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELProcessDefinitionImpl.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.bpel.impl;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.implementation.bpel.BPELProcessDefinition;
-import org.apache.tuscany.sca.implementation.bpel.xml.BPELImportElement;
-import org.apache.tuscany.sca.implementation.bpel.xml.BPELPartnerLinkElement;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-
-/**
- * The BPEL process definition implementation.
- *
- * @version $Rev$ $Date$
- */
-class BPELProcessDefinitionImpl implements BPELProcessDefinition {
- private QName name;
- private String uri;
- private String location;
- private boolean unresolved;
- private List<BPELPartnerLinkElement> partnerLinks = new ArrayList<BPELPartnerLinkElement>();
- private List<BPELImportElement> imports = new ArrayList<BPELImportElement>();
- private List<PortType> thePortTypes = new ArrayList<PortType>();
- private List<WSDLInterface> theInterfaces = new ArrayList<WSDLInterface>();
-
- public QName getName() {
- return name;
- }
-
- public void setName(QName name) {
- this.name = name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean undefined) {
- this.unresolved = undefined;
- }
-
- public List<BPELPartnerLinkElement> getPartnerLinks() {
- return partnerLinks;
- }
-
- public List<BPELImportElement> getImports() {
- return imports;
- }
-
- public List<PortType> getPortTypes() {
- return thePortTypes;
- }
-
- public List<WSDLInterface> getInterfaces() {
- return theInterfaces;
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(getName()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof BPELProcessDefinition) {
- if (getName() != null) {
- return getName().equals(((BPELProcessDefinition)obj).getName());
- } else {
- return ((BPELProcessDefinition)obj).getName() == null;
- }
- } else {
- return false;
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentProcessor.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentProcessor.java
deleted file mode 100644
index cde6fc4fc5..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentProcessor.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.bpel.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.PortType;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.implementation.bpel.BPELFactory;
-import org.apache.tuscany.sca.implementation.bpel.BPELProcessDefinition;
-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.WSDLObject;
-import org.apache.tuscany.sca.interfacedef.wsdl.xml.BPELPartnerLinkTypeExt;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * BPEL document processor responsible for reading a BPEL file and producing necessary model info about it
- *
- * TODO: The namespaces for WS-BPEL include 2 versions - only the earlier BPEL 1.1 versions are
- * supported at present - the BPEL 2.0 namespaces also need support. This will require inspection
- * of both BPEL process files and of WSDL files for their BPEL namespaces
- * @version $Rev$ $Date$
- */
-public class BPELDocumentProcessor extends BaseStAXArtifactProcessor implements URLArtifactProcessor<BPELProcessDefinition> {
- public final static QName BPEL_PROCESS_DEFINITION = new QName("http://schemas.xmlsoap.org/ws/2004/03/business-process/", "process");
- public final static QName BPEL_EXECUTABLE_DEFINITION = new QName("http://docs.oasis-open.org/wsbpel/2.0/process/executable", "process");
- private static final String SCA_BPEL_NS = "http://docs.oasis-open.org/ns/opencsa/sca-bpel/200801";
- private static final String BPEL_NS = "http://schemas.xmlsoap.org/ws/2004/03/business-process/";
- private static final String BPEL_PLINK_NS = "http://schemas.xmlsoap.org/ws/2004/03/partner-link/";
- private static final String WSDL_NS = "http://schemas.xmlsoap.org/wsdl/";
- private static final QName PROCESS_ELEMENT = new QName(BPEL_NS, "process");
- private static final QName PARTNERLINK_ELEMENT = new QName(BPEL_NS, "partnerLink");
- private static final QName ONEVENT_ELEMENT = new QName(BPEL_NS, "onEvent");
- private static final QName RECEIVE_ELEMENT = new QName(BPEL_NS, "receive");
- private static final QName ONMESSAGE_ELEMENT = new QName(BPEL_NS, "onMessage");
- private static final QName INVOKE_ELEMENT = new QName(BPEL_NS, "invoke");
- private static final QName IMPORT_ELEMENT = new QName(BPEL_NS, "import");
- private static final String LINKTYPE_NAME = "partnerLinkType";
- private static final QName LINKTYPE_ELEMENT = new QName(BPEL_PLINK_NS, LINKTYPE_NAME);
- public final static String NAME_ELEMENT = "name";
-
- private final static XMLInputFactory inputFactory = XMLInputFactory.newInstance();
-
- private final BPELFactory factory;
- private WSDLFactory WSDLfactory;
- private Monitor monitor;
-
- public BPELDocumentProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.factory = modelFactories.getFactory(BPELFactory.class);
- this.WSDLfactory = modelFactories.getFactory(WSDLFactory.class);
- this.monitor = monitor;
- }
-
- public String getArtifactType() {
- return "*.bpel";
- }
-
- public Class<BPELProcessDefinition> getModelType() {
- return BPELProcessDefinition.class;
- }
-
- public BPELProcessDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
- BPELProcessDefinition processDefinition = null;
- try {
- // for now we are just using process name
- // and relying on componentType file for service definition
- // so it's OK to set resolved for now
- processDefinition = readProcessDefinition(artifactURL);
- processDefinition.setURI(artifactURI.toString());
- processDefinition.setUnresolved(false);
- } catch (Exception e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", artifactURL, ce);
- }
-
- return processDefinition;
- }
-
- public void resolve(BPELProcessDefinition model, ModelResolver resolver) throws ContributionResolveException {
- // FIXME - serious resolving needs to happen here
-
- // Step 1 is to resolve the WSDL files referenced from this BPEL process
- // - one complexity here is that the WSDL definitions hold BPEL extension elements for
- // the partnerLinkType declarations - and these must be used in later steps
- //
- // Step 2 is to take all the partnerLink definitions and establish the PortType being
- // used, by tracing through the related partnerLinkType declarations - the PortType is
- // effectively a definition of the interface used by the partnerLink.
- // - another consideration here is that each partnerLink can involve 2 interfaces, one
- // for the forward calls to the process, the other for calls from the process - depending
- // on whether the partnerLink is a reference or a service, one of these interfaces is a
- // callback interface.
-
- List<BPELImportElement> theImports = model.getImports();
- for (BPELImportElement theImport : theImports) {
-
- // Deal with WSDL imports
- if (theImport.getImportType().equals(WSDL_NS)) {
- String wsdlLocation = theImport.getLocation();
- String wsdlNamespace = theImport.getNamespace();
-
- // Resolve the WSDL definition
- WSDLDefinition proxy = WSDLfactory.createWSDLDefinition();
- proxy.setUnresolved(true);
- proxy.setNamespace(wsdlNamespace);
- if (wsdlLocation != null) {
- proxy.setLocation(URI.create(wsdlLocation));
- }
- WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, proxy);
- if (resolved != null && !resolved.isUnresolved()) {
- theImport.setWSDLDefinition(resolved);
- } else {
- error("CannotResolveWSDLReference", resolver, wsdlLocation, wsdlNamespace);
- return;
- } // end if
- } // end if
- } // end for
-
- // Fetch the sets of partner links, port types and interfaces
- List<BPELPartnerLinkTypeElement> thePLinkTypes = getPartnerLinkTypes( theImports );
- Collection<WSDLInterface> theInterfaces = (Collection<WSDLInterface>)new ArrayList<WSDLInterface>();
- Collection<PortType> thePortTypes = getAllPortTypes( theImports, theInterfaces, resolver );
-
- // Store the Port Types and the Interfaces for later calculation of the component type...
- model.getPortTypes().addAll(thePortTypes);
- model.getInterfaces().addAll(theInterfaces);
-
- // Now, for each partnerLink in the BPEL process, find the related partnerLinkType
- // element
- List<BPELPartnerLinkElement> thePartnerLinks = model.getPartnerLinks();
- for (BPELPartnerLinkElement thePartnerLink : thePartnerLinks) {
- QName partnerLinkType = thePartnerLink.getPartnerLinkType();
- BPELPartnerLinkTypeElement pLinkType = findPartnerLinkType(partnerLinkType, thePLinkTypes);
- if (pLinkType == null) {
- error("PartnerLinkNoMatchingType", thePartnerLink, thePartnerLink.getName());
- } else
- thePartnerLink.setPartnerLinkType(pLinkType);
- } // end for
-
- } // end resolve
-
- /**
- * Retrieve all the Partner Link types defined in the imported WSDL files
- *
- * @param theImports
- */
- private List<BPELPartnerLinkTypeElement> getPartnerLinkTypes( List<BPELImportElement> theImports) throws ContributionResolveException {
-
- List<BPELPartnerLinkTypeElement> thePLinks = new ArrayList<BPELPartnerLinkTypeElement>();
-
- // We must find the partner link type elements from amongst the imported
- // WSDLs
- for (BPELImportElement theImport : theImports) {
- if (theImport.getImportType().equals(WSDL_NS)) {
-
- // Find all the WSDL definitions matching the imported namespace
- List<Definition> wsdlDefinitions = new ArrayList<Definition>();
- WSDLDefinition theWSDL = theImport.getWSDLDefinition();
- wsdlDefinitions.add(theWSDL.getDefinition());
- for (WSDLDefinition importedWSDL: theWSDL.getImportedDefinitions()) {
- wsdlDefinitions.add(importedWSDL.getDefinition());
- }
-
- // The BPEL partnerLinkType elements are extension elements within
- // the WSDL definitions
- for (Definition wsdlDefinition: wsdlDefinitions) {
- for (ExtensibilityElement theElement : (List<ExtensibilityElement>)wsdlDefinition.getExtensibilityElements()) {
- QName elementType = theElement.getElementType();
- if (elementType.equals(LINKTYPE_ELEMENT)) {
- BPELPartnerLinkTypeExt pLinkExt = (BPELPartnerLinkTypeExt)theElement;
-
- // Fetch the name of the partnerLinkType
- String name = pLinkExt.getName();
- QName qName = new QName(wsdlDefinition.getTargetNamespace(), name);
- BPELPartnerLinkTypeElement pLinkElement = new BPELPartnerLinkTypeElement(qName);
-
- // The partnerLinkType must have one and may have 2 role
- // child elements
- int count = 0;
- for (int i = 0; i < 2; i++) {
- if (pLinkExt.getRoleName(i) == null)
- continue;
- PortType pType = wsdlDefinition.getPortType(pLinkExt.getRolePortType(i));
- if (count == 0) {
- pLinkElement.setRole1(pLinkExt.getRoleName(i), pLinkExt.getRolePortType(i), pType);
- count++;
- } else if (count == 1) {
- pLinkElement.setRole2(pLinkExt.getRoleName(i), pLinkExt.getRolePortType(i), pType);
- count++;
- } else {
- break;
- } // end if
- } // end for
-
- if (count == 0) {
- error("PartnerLinkTypeNoRoles", theElement, pLinkElement.getName());
- throw new ContributionResolveException("partnerLinkType " + pLinkElement.getName() + " has no Roles defined");
- } else
- thePLinks.add(pLinkElement);
- } // end if
-
- } // end for
- }
- }
- } // end for
- return thePLinks;
- } // end getPartnerLinkTypes
-
- /**
- * Returns all the portTypes referenced by the process.
- *
- * @param theImports
- * @param theInterfaces
- * @param resolver
- * @return
- * @throws ContributionResolveException
- */
- private Collection<PortType> getAllPortTypes(List<BPELImportElement> theImports,
- Collection<WSDLInterface> theInterfaces, ModelResolver resolver) throws ContributionResolveException {
-
- Collection<PortType> thePortTypes = (Collection<PortType>)new ArrayList<PortType>();
- for (BPELImportElement theImport : theImports) {
- if (theImport.getImportType().equals(WSDL_NS)) {
-
- // Find all the WSDL definitions matching the imported namespace
- List<Definition> wsdlDefinitions = new ArrayList<Definition>();
- WSDLDefinition theWSDL = theImport.getWSDLDefinition();
- wsdlDefinitions.add(theWSDL.getDefinition());
- for (WSDLDefinition importedWSDL: theWSDL.getImportedDefinitions()) {
- wsdlDefinitions.add(importedWSDL.getDefinition());
- }
- for (Definition wsdlDefinition: wsdlDefinitions) {
-
- Collection<PortType> portTypes = (Collection<PortType>)wsdlDefinition.getPortTypes().values();
- thePortTypes.addAll(portTypes);
-
- // Create WSDLInterface elements for each PortType found
- for (PortType portType : portTypes) {
- WSDLObject<PortType> wsdlPortType = theWSDL.getWSDLObject(PortType.class, portType.getQName());
- WSDLInterface wsdlInterface;
- if (wsdlPortType != null) {
- // Introspect the WSDL portType and add the resulting
- // WSDLInterface to the resolver
- try {
- theWSDL.setDefinition(wsdlPortType.getDefinition());
- wsdlInterface = WSDLfactory.createWSDLInterface(wsdlPortType.getElement(), theWSDL, resolver);
- wsdlInterface.setWsdlDefinition(theWSDL);
- } catch (InvalidInterfaceException e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", resolver, ce);
- throw ce;
- } // end try
- resolver.addModel(wsdlInterface);
- theInterfaces.add(wsdlInterface);
- } // end if
- } // end for
- }
- }
- } // end for
-
- return thePortTypes;
- } // end getAllPortTypes
-
- /**
- * Finds a partnerLinkType definition within the WSDLs imported by the BPEL
- * process.
- *
- * @param partnerLinkTypeName - the name of the partnerLinkType
- * @param theImports a list of the WSDL import declarations
- * @return a BPELPartnerLinkTypeElement for the partnerLinkType or null if it cannot be
- * found
- */
- private BPELPartnerLinkTypeElement findPartnerLinkType( QName partnerLinkTypeName,
- List<BPELPartnerLinkTypeElement> thePLinkTypes) {
- // We must find the partner link type element from amongst the imported WSDLs
- for ( BPELPartnerLinkTypeElement thePLinkType : thePLinkTypes ){
- if( thePLinkType.getName().equals(partnerLinkTypeName) ) return thePLinkType;
- } // end for
- return null;
- } // end findPartnerLinkType
-
-
- /**
- * Read a process definition.
- *
- * @param doc
- * @return
- * @throws Exception
- */
- private BPELProcessDefinition readProcessDefinition(URL doc) throws Exception {
- BPELProcessDefinition processDefinition = factory.createBPELProcessDefinition();
- processDefinition.setUnresolved(true);
- processDefinition.setLocation(doc.toString());
-
- InputStream is = doc.openStream();
- XMLStreamReader reader = null;
- try {
- reader = inputFactory.createXMLStreamReader(is);
-
- /*
- * The principle here is to look for partnerLink elements, which
- * form either services or references. A partnerLink can be EITHER -
- * the algorithm for deciding is: 1) Explicit marking with
- * sca:reference or sca:service attribute 2) "first use" of the
- * partnerLink by specific BPEL activity elements: <onEvent../>,
- * <receive../> or <pick../> elements imply a service <invoke../>
- * implies a reference
- */
-
- // TODO - need to handle <scope../> elements as kind of "nested" processes
- // - and scopes introduce the possibility of partnerLinks with the
- // same name at different levels of scope.... (yuk!!)
- boolean completed = false;
- while (!completed) {
- switch (reader.next()) {
- case START_ELEMENT:
- QName qname = reader.getName();
- if (BPEL_PROCESS_DEFINITION.equals(qname) || BPEL_EXECUTABLE_DEFINITION.equals(qname)) {
- QName processName = new QName(getString(reader, org.apache.tuscany.sca.assembly.xml.Constants.TARGET_NAMESPACE), getString(reader, NAME_ELEMENT));
- processDefinition.setName(processName);
- } else if (PARTNERLINK_ELEMENT.equals(qname)) {
- processDefinition.getPartnerLinks().add(processPartnerLinkElement(reader));
- } else if (ONEVENT_ELEMENT.equals(qname) || RECEIVE_ELEMENT.equals(qname) || ONMESSAGE_ELEMENT.equals(qname)) {
- processPartnerLinkAsService(reader.getAttributeValue(null, "partnerLink"), processDefinition.getPartnerLinks());
- } else if (INVOKE_ELEMENT.equals(qname)) {
- processPartnerLinkAsReference(reader.getAttributeValue(null, "partnerLink"), processDefinition.getPartnerLinks());
- } else if (IMPORT_ELEMENT.equals(qname)) {
- processDefinition.getImports().add(processImportElement(reader));
- } // end if
- break;
- case END_ELEMENT:
- if (PROCESS_ELEMENT.equals(reader.getName())) {
- completed = true;
- break;
- } // end if
- } // end switch
- } // end while
- } finally {
- if (reader != null)
- reader.close();
- is.close();
- } // end try
-
- return processDefinition;
- } // end readProcessDefinition
-
- /**
- * Processes a partnerLink element from the BPEL process and creates a
- * BPELPartnerLink object
- *
- * @param reader
- */
- private BPELPartnerLinkElement processPartnerLinkElement(XMLStreamReader reader) throws ContributionReadException {
- BPELPartnerLinkElement partnerLink = new BPELPartnerLinkElement(
- reader.getAttributeValue(null, "name"),
- getQNameValue(reader, reader.getAttributeValue(null, "partnerLinkType")),
- reader.getAttributeValue(null, "myRole"),
- reader.getAttributeValue(null, "partnerRole"));
-
- // See if there are any SCA extension attributes
- String scaService = reader.getAttributeValue(SCA_BPEL_NS, "service");
- String scaReference = reader.getAttributeValue(SCA_BPEL_NS, "reference");
- if ((scaService != null) && (scaReference != null)) {
- // It is incorrect to set both service & reference attributes
- error("PartnerLinkHasBothAttr", partnerLink, reader.getAttributeValue(null, "name"));
- throw new ContributionReadException("BPEL PartnerLink " + reader.getAttributeValue(null, "name") + " has both sca:reference and sca:service attributes set");
- }
-
- // Set the SCA type and the related name, if present
- if (scaService != null)
- partnerLink.setAsService(scaService);
- else if (scaReference != null)
- partnerLink.setAsReference(scaReference);
- return partnerLink;
-
- } // end processPartnerLinkElement
-
- /**
- * Processes an <import../> element from the BPEL process and creates a
- * BPELImportElement object
- *
- * @param reader
- */
- private BPELImportElement processImportElement(XMLStreamReader reader) {
- return (new BPELImportElement(reader.getAttributeValue(null, "location"),
- reader.getAttributeValue(null, "importType"),
- reader.getAttributeValue(null, "namespace")));
-
- } // end processImportElement
-
- /**
- * Mark a named partnerLink as a Service, unless it is already marked as a
- * Reference
- *
- * @param partnerLinkName
- * @param partnerLinks
- */
- private void processPartnerLinkAsService(String partnerLinkName, List<BPELPartnerLinkElement> partnerLinks) {
- BPELPartnerLinkElement partnerLink = findPartnerLinkByName(partnerLinks, partnerLinkName);
- if (partnerLink == null) {
- warning("ReferencePartnerLinkNotInList", partnerLinkName, partnerLinkName);
- } else {
- // Set the type of the partnerLink to "service" if not already
- // set...
- if (!partnerLink.isSCATyped())
- partnerLink.setAsService(partnerLinkName);
- } // endif
- } // end processPartnerLinkAsReference
-
- /**
- * Mark a named partnerLink as a Reference, unless it is already marked as a
- * Service
- *
- * @param partnerLinkName
- * @param partnerLinks
- */
- private void processPartnerLinkAsReference(String partnerLinkName, List<BPELPartnerLinkElement> partnerLinks) {
- BPELPartnerLinkElement partnerLink = findPartnerLinkByName(partnerLinks, partnerLinkName);
- if (partnerLink == null) {
- warning("ReferencePartnerLinkNotInList", partnerLinkName, partnerLinkName);
- } else {
- // Set the type of the partnerLink to "service" if not already
- // set...
- if (!partnerLink.isSCATyped())
- partnerLink.setAsReference(partnerLinkName);
- } // endif
- } // end processPartnerLinkAsReference
-
- /**
- * Finds a PartnerLink by name from a List of PartnerLinks returns null if
- * there is no partnerLink with a matching name - returns the PartnerLink
- * with a matching name
- *
- * @param partnerLinks
- * @param partnerLinkName
- */
- private BPELPartnerLinkElement findPartnerLinkByName(List<BPELPartnerLinkElement> partnerLinks, String partnerLinkName) {
- // Scan the list looking for a partner link with the supplied name
- Iterator<BPELPartnerLinkElement> it = partnerLinks.iterator();
- while (it.hasNext()) {
- BPELPartnerLinkElement thePartnerLink = it.next();
- if (thePartnerLink.getName().equals(partnerLinkName))
- return thePartnerLink;
- }
- return null;
- } // end method findPartnerLinkByName
-
- /**
- * Report a warning.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void warning(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "impl-bpel-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 = new ProblemImpl(this.getClass().getName(), "impl-bpel-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 = new ProblemImpl(this.getClass().getName(), "impl-bpel-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java
deleted file mode 100644
index ce1c22e641..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.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.implementation.bpel.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-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.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.databinding.xml.DOMDataBinding;
-import org.apache.tuscany.sca.implementation.bpel.BPELFactory;
-import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
-import org.apache.tuscany.sca.implementation.bpel.BPELProcessDefinition;
-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;
-
-/**
- * Implements a StAX artifact processor for BPEL implementations.
- *
- * The artifact processor is responsible for processing <implementation.bpel>
- * elements in SCA assembly XML composite files and populating the BPEL
- * implementation model, resolving its references to other artifacts in the SCA
- * contribution, and optionally write the model back to SCA assembly XML.
- *
- * @version $Rev$ $Date$
- */
-public class BPELImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<BPELImplementation> {
- private static final String PROCESS = "process";
- private static final String IMPLEMENTATION_BPEL = "implementation.bpel";
- private static final QName IMPLEMENTATION_BPEL_QNAME = new QName(Constants.SCA10_NS, IMPLEMENTATION_BPEL);
-
- private AssemblyFactory assemblyFactory;
- private BPELFactory bpelFactory;
- private WSDLFactory wsdlFactory;
- private Monitor monitor;
-
- public BPELImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
- this.bpelFactory = modelFactories.getFactory(BPELFactory.class);
- this.monitor = monitor;
- }
-
- public QName getArtifactType() {
- // Returns the QName of the XML element processed by this processor
- return IMPLEMENTATION_BPEL_QNAME;
- }
-
- public Class<BPELImplementation> getModelType() {
- // Returns the type of model processed by this processor
- return BPELImplementation.class;
- }
-
- public BPELImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- assert IMPLEMENTATION_BPEL_QNAME.equals(reader.getName());
-
- // Read an <implementation.bpel> element
- BPELImplementation implementation = null;
-
- // Read the process attribute.
- QName process = getAttributeValueNS(reader, PROCESS);
- if (process == null) {
- return implementation;
- }
-
- // Create and initialize the BPEL implementation model
- implementation = bpelFactory.createBPELImplementation();
- implementation.setProcess(process);
- implementation.setUnresolved(true);
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && IMPLEMENTATION_BPEL_QNAME.equals(reader.getName())) {
- break;
- }
- }
-
- return implementation;
- }
-
- public void resolve(BPELImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
-
- if( implementation != null && implementation.isUnresolved())
- {
- implementation.setModelResolver(resolver);
-
- BPELProcessDefinition processDefinition = resolveBPELProcessDefinition(implementation, resolver);
- if(processDefinition.isUnresolved()) {
- error("BPELProcessNotFound", implementation, processDefinition.getName());
- } else {
- implementation.setProcessDefinition(processDefinition);
-
- // Get the component type from the process definition
- generateComponentType( implementation );
-
- //resolve component type
- mergeComponentType(resolver, implementation);
-
- //set current implementation resolved
- implementation.setUnresolved(false);
- }
- }
-
- } // end resolve
-
- public void write( BPELImplementation bpelImplementation,
- XMLStreamWriter writer ) throws ContributionWriteException, XMLStreamException {
- //FIXME Deal with policy processing...
- // Write <implementation.bpel process="..."/>
- // policyProcessor.writePolicyPrefixes(bpelImplementation, writer);
- writer.writeStartElement(Constants.SCA10_NS, IMPLEMENTATION_BPEL);
- // policyProcessor.writePolicyAttributes(bpelImplementation, writer);
-
- if (bpelImplementation.getProcess() != null) {
- writer.writeAttribute(PROCESS, bpelImplementation.getProcess().toString() );
- }
-
- writer.writeEndElement();
-
- } // end write
-
- private BPELProcessDefinition resolveBPELProcessDefinition(BPELImplementation impl, ModelResolver resolver) throws ContributionResolveException {
- QName processName = impl.getProcess();
- BPELProcessDefinition processDefinition = this.bpelFactory.createBPELProcessDefinition();
- processDefinition.setName(processName);
- processDefinition.setUnresolved(true);
-
- return resolver.resolveModel(BPELProcessDefinition.class, processDefinition);
- } // end resolveBPELProcessDefinition
-
- /**
- * Calculates the component type of the supplied implementation and attaches it to the
- * implementation.
- *
- * @param impl
- * @throws ContributionResolveException
- */
- private void generateComponentType(BPELImplementation impl) throws ContributionResolveException {
-
- // Create a ComponentType and mark it unresolved
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setUnresolved(true);
- impl.setComponentType(componentType);
-
- // Each partner link in the process represents either a service or a
- // reference
- // - or both, in the sense of involving a callback
- BPELProcessDefinition theProcess = impl.getProcessDefinition();
- List<BPELPartnerLinkElement> partnerLinks = theProcess.getPartnerLinks();
-
- for (BPELPartnerLinkElement pLink : partnerLinks) {
-
- // check that the partner link has been designated as service or
- // reference in SCA terms
- if (pLink.isSCATyped()) {
- String scaName = pLink.getSCAName();
- if (pLink.querySCAType().equals("reference")) {
- componentType.getReferences().add(generateReference(scaName, pLink.getMyRolePortType(), pLink.getPartnerRolePortType(), theProcess.getInterfaces()));
- } else {
- componentType.getServices().add(generateService(scaName, pLink.getMyRolePortType(), pLink.getPartnerRolePortType(), theProcess.getInterfaces()));
- } // end if
- } // end if
- } // end for
-
- } // end getComponentType
-
- /**
- * Create an SCA reference for a partnerLink
- * @param name - name of the reference
- * @param myRolePT - partner link type of myRole
- * @param partnerRolePT - partner link type of partnerRole
- * @param theInterfaces - list of WSDL interfaces associated with the BPEL process
- * @return
- */
- private Reference generateReference( String name, PortType myRolePT,
- PortType partnerRolePT, Collection<WSDLInterface> theInterfaces) throws ContributionResolveException {
-
- Reference reference = assemblyFactory.createReference();
- WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
- reference.setInterfaceContract(interfaceContract);
-
- // Establish whether there is just a call interface or a call + callback
- // interface
- PortType callPT = null;
- PortType callbackPT = null;
- if (myRolePT != null) {
- callPT = myRolePT;
- // If the 2 port types are not the same one, there is a callback...
- if (partnerRolePT != null) {
- if (!myRolePT.getQName().equals(partnerRolePT.getQName())) {
- callbackPT = partnerRolePT;
- } // end if
- } // end if
- } else if (partnerRolePT != null) {
- callPT = partnerRolePT;
- } // end if
-
- // No interfaces mean an error
- if (callPT == null && callbackPT == null) {
- error("MyRolePartnerRoleNull", theInterfaces);
- } // end if
-
- // Set the name of the reference to the supplied name and the
- // multiplicity of the reference
- // to 1..1
- // TODO: support other multiplicities
- reference.setName(name);
- reference.setMultiplicity(Multiplicity.ONE_ONE);
-
- if (callPT != null) {
- // Set the call interface and, if present, the callback interface
- WSDLInterface callInterface = null;
- for (WSDLInterface anInterface : theInterfaces) {
- if (anInterface.getPortType().getQName().equals(callPT.getQName()))
- callInterface = anInterface;
- } // end for
- if (callInterface == null) {
- error("NoInterfaceForPortType", theInterfaces, callPT.getQName().toString());
- } else
- reference.getInterfaceContract().setInterface(callInterface);
- }
-
- // There is a callback if the partner role is not null and if the
- // partner role port type
- // is not the same as the port type for my role
- if (callbackPT != null) {
- WSDLInterface callbackInterface = null;
- for (WSDLInterface anInterface : theInterfaces) {
- if (anInterface.getPortType().getQName().equals(callbackPT.getQName()))
- callbackInterface = anInterface;
- } // end for
- if (callbackInterface == null) {
- error("NoInterfaceForPortType", theInterfaces, callbackPT.getQName().toString());
- } else
- reference.getInterfaceContract().setCallbackInterface(callbackInterface);
- } // end if
-
- return reference;
- } // end generateReference
-
- /**
- * Create an SCA service for a partnerLink
- * @param name - name of the reference
- * @param myRolePT - partner link type of myRole
- * @param partnerRolePT - partner link type of partnerRole
- * @param theInterfaces - list of WSDL interfaces associated with the BPEL process
- * @return
- */
- private Service generateService( String name, PortType myRolePT,
- PortType partnerRolePT, Collection<WSDLInterface> theInterfaces )
- throws ContributionResolveException {
- Service service = assemblyFactory.createService();
- WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
- service.setInterfaceContract(interfaceContract);
-
- // Set the name of the service to the supplied name
- service.setName(name);
-
- // Establish whether there is just a call interface or a call + callback
- // interface
- PortType callPT = null;
- PortType callbackPT = null;
- if (myRolePT != null) {
- callPT = myRolePT;
- // If the 2 port types are not the same one, there is a callback...
- if (partnerRolePT != null) {
- if (!myRolePT.getQName().equals(partnerRolePT.getQName())) {
- callbackPT = partnerRolePT;
- } // end if
- } // end if
- } else if (partnerRolePT != null) {
- callPT = partnerRolePT;
- } // end if
-
- // No interfaces mean an error
- if (callPT == null && callbackPT == null) {
- error("MyRolePartnerRoleNull", theInterfaces);
- } // end if
-
- if (callPT != null) {
- // Set the call interface and, if present, the callback interface
- WSDLInterface callInterface = null;
- for (WSDLInterface anInterface : theInterfaces) {
- if (anInterface.getPortType().getQName().equals(callPT.getQName()))
- callInterface = anInterface;
- } // end for
- if (callInterface == null) {
- error("NoInterfaceForPortType", theInterfaces, callPT.getQName().toString());
- } else
- service.getInterfaceContract().setInterface(callInterface);
- } // end if
-
- // There is a callback if the partner role is not null and if the
- // partner role port type
- // is not the same as the port type for my role
- if (callbackPT != null) {
- WSDLInterface callbackInterface = null;
- for (WSDLInterface anInterface : theInterfaces) {
- if (anInterface.getPortType().getQName().equals(callbackPT.getQName()))
- callbackInterface = anInterface;
- } // end for
- if (callbackInterface == null) {
- error("NoInterfaceForPortType", theInterfaces, callbackPT.getQName().toString());
- } else
- service.getInterfaceContract().setCallbackInterface(callbackInterface);
- } // end if
-
- return service;
- } // end generateService
-
- /**
- * Merge the componentType from introspection and from external file
- *
- * Note the setting of the DataBinding for both Services and References to DOM, since this is
- * the data format expected by the ODE BPEL implementation code.
- *
- * @param resolver
- * @param impl
- */
- private void mergeComponentType(ModelResolver resolver, BPELImplementation impl) {
-
- // Load the component type from a component type file, if any
- ComponentType componentType = getComponentType(resolver, impl);
- if (componentType != null && !componentType.isUnresolved()) {
-
- // References...
- Map<String, Reference> refMap = new HashMap<String, Reference>();
- for (Reference reference : componentType.getReferences()) {
- refMap.put(reference.getName(), reference);
- } // end for
-
- // For the present, overwrite anything arising from the component
- // type sidefile if
- // equivalent services are defined in the implementation.
- // TODO - a more careful merge must be done, using the
- // implementation introspection data
- // as the master but adding any additional and non-conflicting
- // information from the
- // sidefile
- for (Reference ref : impl.getReferences()) {
- refMap.put(ref.getName(), ref);
- } // end for
-
- impl.getReferences().clear();
- impl.getReferences().addAll(refMap.values());
-
- // Services.....
- Map<String, Service> serviceMap = new HashMap<String, Service>();
- for (Service service : componentType.getServices()) {
- serviceMap.put(service.getName(), service);
- } // end for
-
- // For the present, overwrite anything arising from the component
- // type sidefile if
- // equivalent services are defined in the implementation.
- // TODO - a more careful merge must be done, using the
- // implementation introspection data
- // as the master but adding any additional and non-conflicting
- // information from the
- // sidefile
- for (Service svc : impl.getServices()) {
- serviceMap.put(svc.getName(), svc);
- } // end for
-
- impl.getServices().clear();
- impl.getServices().addAll(serviceMap.values());
-
- // Properties
- Map<String, Property> propMap = new HashMap<String, Property>();
- for (Property property : componentType.getProperties()) {
- propMap.put(property.getName(), property);
- } // end for
-
- // A simple overwrite of any equivalent properties from the
- // component type sidefile
- for (Property prop : impl.getProperties()) {
- propMap.put(prop.getName(), prop);
- }
- }
- }
-
-
- /**
- * Find the componentType side file based on the BPEL implementation artifact
- * @param resolver
- * @param impl
- * @return
- */
- private ComponentType getComponentType(ModelResolver resolver, BPELImplementation impl) {
- String bpelProcessURI = impl.getProcessDefinition().getURI().toString();
-
- // Get the component type definition contained in the componentType file, if any
- String componentTypeURI = bpelProcessURI.replace(".bpel", ".componentType");
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setUnresolved(true);
- componentType.setURI(componentTypeURI);
- componentType = resolver.resolveModel(ComponentType.class, componentType);
- if (!componentType.isUnresolved()) {
- return componentType;
- }
- return null;
- } // end getComponentType
-
- /**
- * Returns a QName from its string representation in a named attribute of an XML element
- * supplied in an XMLStreamReader
- *
- * QName attributes of an XML element (such as BPEL process) is presented in one of
- * two alternative formats:
- * 1) In the form of a local name with a prefix, with the prefix referencing a namespace
- * URI declaration elsewhere in the composite (typically on the composite element)
- *
- * ie: nms:SomeName
- * xmlns:nms="http://example.com/somenamespace"
- *
- * 2) In the XML Namespaces recommendation format (see http://jclark.com/xml/xmlns.htm )
- * where the namespace URI and the local name are encoded into a single string, with the
- * namespace URI enclosed between a pair of braces {...}
- *
- * ie: {http://example.com/somenamespace}SomeName
- */
- private QName getAttributeValueNS(XMLStreamReader reader, String attribute) {
- String fullValue = reader.getAttributeValue(null, attribute);
- if (fullValue == null) {
- error("AttributeProcessMissing", reader);
- return null;
- }
-
- // Deal with the attribute in the XML Namespaces recommendation format
- // - trim off any leading/trailing spaces and check that the first
- // character is '{'
- if (fullValue.trim().charAt(0) == '{') {
- try {
- // Attempt conversion to a QName object
- QName theProcess = QName.valueOf(fullValue);
- return theProcess;
- } catch (IllegalArgumentException e) {
- // This exception happens if the attribute begins with '{' but
- // doesn't conform
- // to the XML Namespaces recommendation format
- error("AttributeWithoutNamespace", reader, attribute, fullValue);
- return null;
- }
- } // endif
-
- // Deal with the attribute in the local name + prefix format
- if (fullValue.indexOf(":") < 0) {
- error("AttributeWithoutPrefix", reader, attribute, fullValue);
- return null;
- }
- String prefix = fullValue.substring(0, fullValue.indexOf(":"));
- String name = fullValue.substring(fullValue.indexOf(":") + 1);
- String nsUri = reader.getNamespaceContext().getNamespaceURI(prefix);
- if (nsUri == null) {
- error("AttributeUnrecognizedNamespace", reader, attribute, fullValue);
- return null;
- }
- return new QName(nsUri, name, prefix);
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "impl-bpel-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImportElement.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImportElement.java
deleted file mode 100644
index bf0020323c..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImportElement.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.implementation.bpel.xml;
-
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-
-/**
- * Represents an <import.../> element in a BPEL process
- * - this has attributes:
- * location
- * importType
- * namespace
- *
- * @version $Rev$ $Date$
- */
-public class BPELImportElement {
-
- private String location;
- private String importType;
- private String namespace;
- private WSDLDefinition theWSDL = null;
-
- public BPELImportElement(String location, String importType, String namespace) {
- this.location = location;
- this.importType = importType;
- this.namespace = namespace;
- }
-
- public String getImportType() {
- return importType;
- }
-
- public String getLocation() {
- return location;
- }
-
- public String getNamespace() {
- return namespace;
- }
-
- public void setWSDLDefinition(WSDLDefinition theDefinition) {
- theWSDL = theDefinition;
- }
-
- public WSDLDefinition getWSDLDefinition() {
- return theWSDL;
- }
-
-} // end class BPELImportElement
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java
deleted file mode 100644
index b7f5d1d3f2..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.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.implementation.bpel.xml;
-
-import javax.xml.namespace.QName;
-
-import javax.wsdl.PortType;
-
-/**
- * Represents a <partnerLink.../> element in a BPEL process
- * - this has attributes:
- * name
- * partnerLinkType
- * myRole
- * partnerRole
- * - plus zero or more property elements as children
- *
- * The partnerlink may also be given an SCA Type - either of service or of reference - this must
- * generally be calculated and set on the partnerLink by inspecting the BPEL process
- *
- * @version $Rev$ $Date$
- */
-public class BPELPartnerLinkElement {
-
- private String REFERENCE_TYPE = "reference";
- private String SERVICE_TYPE = "service";
- private String name;
- private QName partnerLinkType;
- private BPELPartnerLinkTypeElement pLinkType = null;
- private String myRole;
- private String partnerRole;
- private String scaName; // Holds the SCA reference or service name
- private String scaType = null; // Holds the SCA type = null | service | reference
-
- public BPELPartnerLinkElement(String name,
- QName partnerLinkType,
- String myRole,
- String partnerRole ) {
- this.name = name;
- this.partnerLinkType = partnerLinkType;
- this.myRole = myRole;
- this.partnerRole = partnerRole;
-
- scaName = null;
- }
-
- public QName getPartnerLinkType() {
- return partnerLinkType;
- }
-
- public void setPartnerLinkType( BPELPartnerLinkTypeElement pLinkType ) {
- this.pLinkType = pLinkType;
- }
-
-
- public PortType getMyRolePortType() {
- return getRolePortType( myRole );
- }
-
- public PortType getPartnerRolePortType() {
- return getRolePortType( partnerRole );
- }
-
- private PortType getRolePortType( String theRole ) {
- if (theRole == null || theRole.length() == 0) {
- return null;
- } // end if
- if (theRole.equals(pLinkType.getRole1Name())) {
- return pLinkType.getRole1pType();
- } else if (theRole.equals(pLinkType.getRole2Name())) {
- return pLinkType.getRole2pType();
- } // end if
- return null;
- } // end getRolePortType
-
- public String getName() {
- return name;
- }
-
- public String getMyRole() {
- return myRole;
- }
-
- public String getPartnerRole() {
- return partnerRole;
- }
-
- public void setSCAName( String name ) {
- scaName = name;
- }
-
- public String getSCAName() {
- return scaName;
- }
-
- public boolean isSCATyped() {
- return ( !(scaType == null) );
- }
-
- public void setAsReference( String name ) {
- scaType = REFERENCE_TYPE;
- scaName = name;
- }
-
- public void setAsService( String name ) {
- scaType = SERVICE_TYPE;
- scaName = name;
- }
-
- public String querySCAType() {
- return scaType;
- }
-
-} // end class BPELPartnerLinkElement
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java b/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java
deleted file mode 100644
index fdaf98a97f..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.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.bpel.xml;
-
- import javax.xml.namespace.QName;
-
- import javax.wsdl.extensions.ExtensibilityElement;
- import javax.wsdl.PortType;
-
-/**
- * Represents a <partnerLinkType.../> element related to a BPEL process
- * - this has attributes:
- * name
- * Role1 name
- * Role1 portType
- * Role2 name
- * Role2 portType
- *
- * - in the XML the 2 roles are child elements of the partnerLinkType element, but there
- * seems little point in reflecting this back into this model - it is simpler to include
- * both roles within the representation of the partnerLinkType itself
- *
- * @version $Rev$ $Date$
- */
-public class BPELPartnerLinkTypeElement implements ExtensibilityElement {
-
- private QName name;
- private String Role1name = null;
- private QName Role1porttype = null;
- private PortType Role1pType = null;
- private String Role2name = null;
- private QName Role2porttype = null;
- private PortType Role2pType = null;
- private QName elementType = null;
- private Boolean required = false;
-
- public BPELPartnerLinkTypeElement(QName name) {
- this.name = name;
- }
-
- public QName getName() {
- return name;
- }
-
- public void setRole1(String name, QName portType, PortType pType) {
- Role1name = name;
- Role1porttype = portType;
- Role1pType = pType;
- }
-
- public void setRole2(String name, QName portType, PortType pType) {
- Role2name = name;
- Role2porttype = portType;
- Role2pType = pType;
- }
-
- public String getRole1Name() {
- return Role1name;
- }
-
- public String getRole2Name() {
- return Role2name;
- }
-
- public QName getRole1PortType() {
- return Role1porttype;
- }
-
- public QName getRole2PortType() {
- return Role2porttype;
- }
-
- public PortType getRole1pType() {
- return Role1pType;
- }
-
- public PortType getRole2pType() {
- return Role2pType;
- }
-
- public QName getElementType() {
- return elementType;
- }
-
- public Boolean getRequired() {
- return required;
- }
-
- public void setElementType(QName elementType) {
- this.elementType = elementType;
- }
-
- public void setRequired(java.lang.Boolean required) {
- this.required = required;
- }
-
-} // end BPELPartnerLinkType
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/implementation-bpel/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 03ef3e3a7f..0000000000
--- a/branches/sca-android/modules/implementation-bpel/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.bpel.xml.BPELImplementationProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#implementation.bpel,model=org.apache.tuscany.sca.implementation.bpel.BPELImplementation \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/branches/sca-android/modules/implementation-bpel/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
deleted file mode 100644
index f6fd442f56..0000000000
--- a/branches/sca-android/modules/implementation-bpel/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.implementation.bpel.xml.BPELDocumentProcessor;type=.bpel,model=org.apache.tuscany.sca.implementation.bpel.BPELProcessDefinition \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.bpel.BPELFactory b/branches/sca-android/modules/implementation-bpel/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.bpel.BPELFactory
deleted file mode 100644
index 4276e938f1..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.bpel.BPELFactory
+++ /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.bpel.impl.BPELFactoryImpl
diff --git a/branches/sca-android/modules/implementation-bpel/src/main/resources/impl-bpel-validation-messages.properties b/branches/sca-android/modules/implementation-bpel/src/main/resources/impl-bpel-validation-messages.properties
deleted file mode 100644
index b6d8bdc0f1..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/main/resources/impl-bpel-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.
-#
-#
-CannotResolveWSDLReference = BPELDocumentProcessor:resolve - unable to resolve WSDL referenced by BPEL import WSDL location: {0} WSDLNamespace: {1}
-ContributionReadException = ContributionReadException occured due to :
-PartnerLinkNoMatchingType = PartnerLink {0} has no matching partner link type
-PartnerLinkTypeNoRoles = PartnerLinkType {0} has no Roles defined
-ContributionResolveException = ContributionResolveException occured due to :
-PartnerLinkHasBothAttr = BPEL PartnerLink {0} has both sca:reference and sca:service attributes set
-ReferencePartnerLinkNotInList = BPEL TypeLoader - element references partnerLink {0} not in the list
-MyRolePartnerRoleNull = Error: myRole and partnerRole port types are both null
-NoInterfaceForPortType = Interface not found for port type {0}
-AttributeProcessMissing = Attribute 'process' is missing.
-AttributeWithoutNamespace = Attribute {0} with value {1} in your composite should be of the form {namespaceURI}localname
-AttributeWithoutPrefix = Attribute {0} with value {1} in your composite should be prefixed (process=\"prefix:name\").
-AttributeUnrecognizedNamespace = Attribute {0} with value {1} in your composite has un unrecognized namespace prefix.
-BPELProcessNotFound = Can't find BPEL Process : {0} \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELDocumentProcessorTestCase.java b/branches/sca-android/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELDocumentProcessorTestCase.java
deleted file mode 100644
index e355b7adf9..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELDocumentProcessorTestCase.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.bpel;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-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.core.DefaultExtensionPointRegistry;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BPELDocumentProcessorTestCase extends TestCase {
-
- protected static final String BPEL_PROCESS_FILE = "helloworld/helloworld.bpel";
-
- private URLArtifactProcessor<Object> documentProcessor;
-
- @Override
- protected void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
- }
-
- public void testLoadBPELProcessDefinition() throws Exception {
- URI processURI = getClass().getClassLoader().getResource(BPEL_PROCESS_FILE).toURI();
- URL processLocation = getClass().getClassLoader().getResource(BPEL_PROCESS_FILE);
- BPELProcessDefinition bpelProcessDefinition = (BPELProcessDefinition)documentProcessor.read(null, processURI, processLocation);
-
- assertNotNull(bpelProcessDefinition);
- assertEquals(new QName("http://tuscany.apache.org/implementation/bpel/example/helloworld", "HelloWorld"), bpelProcessDefinition.getName());
- assertEquals(processLocation.toString(), bpelProcessDefinition.getLocation());
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementationProcessorTestCase.java b/branches/sca-android/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementationProcessorTestCase.java
deleted file mode 100644
index 9dd5306de1..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementationProcessorTestCase.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.bpel;
-
-import java.io.StringReader;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-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.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.impl.DefaultMonitorFactoryImpl;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BPELImplementationProcessorTestCase extends TestCase {
-
- protected static final QName IMPLEMENTATION_BPEL = new QName(Constants.SCA10_NS, "implementation.bpel");
-
- private static final String COMPOSITE =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:hns=\"http://tuscany.apache.org/implementation/bpel/example/helloworld\" targetNamespace=\"http://bpel\" name=\"bpel\">"
- + " <component name=\"BPELHelloWorldComponent\">"
- + " <implementation.bpel process=\"hns:HelloWorld\" />"
- + " </component>"
- + "</composite>";
-
- private static final String COMPOSITE_INVALID =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:hns=\"http://tuscany.apache.org/implementation/bpel/example/helloworld\" targetNamespace=\"http://bpel\" name=\"bpel\">"
- + " <component name=\"BPELHelloWorldComponent\">"
- + " <implementation.bpel/>"
- + " </component>"
- + "</composite>";
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private Monitor monitor;
-
- @Override
- protected void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();
- if (monitorFactory != null) {
- monitor = monitorFactory.createMonitor();
- utilities.addUtility(monitorFactory);
- }
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
- }
-
- /**
- * Test parsing valid composite definition. Valid composite populated with correct values expected.
- * @throws Exception
- */
- public void testLoadValidComposite() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE));
-
- Composite composite = (Composite)staxProcessor.read(reader);
- BPELImplementation implementation = (BPELImplementation)composite.getComponents().get(0).getImplementation();
-
- assertNotNull(implementation);
- assertEquals(new QName("http://tuscany.apache.org/implementation/bpel/example/helloworld", "HelloWorld"), implementation.getProcess());
- }
-
- /**
- * Test parsing invalid composite definition. Exception should be thrown
- * @throws Exception
- */
- public void testLoadInvalidComposite() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE_INVALID));
- staxProcessor.read(reader);
- Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
- assertNotNull(problem);
- assertEquals("AttributeProcessMissing", problem.getMessageId());
- }
-}
diff --git a/branches/sca-android/modules/implementation-bpel/src/test/resources/helloworld/helloworld.bpel b/branches/sca-android/modules/implementation-bpel/src/test/resources/helloworld/helloworld.bpel
deleted file mode 100644
index 8cf91adc2c..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/test/resources/helloworld/helloworld.bpel
+++ /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.
- -->
-<process name="HelloWorld"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:test="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
- expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
-
- <import location="helloworld.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"
- namespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"/>
-
- <partnerLinks>
- <partnerLink name="helloPartnerLink" partnerLinkType="test:HelloPartnerLinkType" myRole="me" />
- </partnerLinks>
-
- <variables>
- <variable name="helloMessage" messageType="test:HelloMessage"/>
- <variable name="tmpVar" type="xsd:string"/>
- </variables>
-
- <sequence>
- <receive
- name="start"
- partnerLink="helloPartnerLink"
- portType="test:HelloPortType"
- operation="hello"
- variable="helloMessage"
- createInstance="yes"/>
-
- <assign name="assign1">
- <copy>
- <from variable="helloMessage" part="TestPart"/>
- <to variable="tmpVar"/>
- </copy>
- <copy>
- <from>concat($tmpVar,' World')</from>
- <to variable="helloMessage" part="TestPart"/>
- </copy>
- </assign>
- <reply name="end"
- partnerLink="helloPartnerLink"
- portType="test:HelloPortType"
- operation="hello"
- variable="helloMessage"/>
- </sequence>
-</process>
diff --git a/branches/sca-android/modules/implementation-bpel/src/test/resources/helloworld/helloworld.wsdl b/branches/sca-android/modules/implementation-bpel/src/test/resources/helloworld/helloworld.wsdl
deleted file mode 100644
index 1d71727b2d..0000000000
--- a/branches/sca-android/modules/implementation-bpel/src/test/resources/helloworld/helloworld.wsdl
+++ /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.
- -->
-
-<wsdl:definitions name="helloworld"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
-
- <wsdl:types>
- <schema elementFormDefault="qualified"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="hello">
- <complexType>
- <sequence>
- <element name="message" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- </schema>
- </wsdl:types>
-
- <wsdl:message name="HelloMessage">
- <wsdl:part element="tns:hello" name="TestPart"/>
- </wsdl:message>
-
- <wsdl:portType name="HelloPortType">
- <wsdl:operation name="hello">
- <wsdl:input message="tns:HelloMessage" name="TestIn"/>
- <wsdl:output message="tns:HelloMessage" name="TestOut"/>
- </wsdl:operation>
- </wsdl:portType>
-
-
- <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="hello">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="TestIn">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="TestOut">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloService">
- <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
- <soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
- </wsdl:port>
- </wsdl:service>
-
- <plnk:partnerLinkType name="HelloPartnerLinkType">
- <plnk:role name="me" portType="tns:HelloPortType"/>
- <plnk:role name="you" portType="tns:HelloPortType"/>
- </plnk:partnerLinkType>
-</wsdl:definitions> \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-das/LICENSE b/branches/sca-android/modules/implementation-das/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/implementation-das/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/implementation-das/META-INF/README b/branches/sca-android/modules/implementation-das/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-das/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-das/NOTICE b/branches/sca-android/modules/implementation-das/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/implementation-das/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/branches/sca-android/modules/implementation-das/README b/branches/sca-android/modules/implementation-das/README
deleted file mode 100644
index 763daafe46..0000000000
--- a/branches/sca-android/modules/implementation-das/README
+++ /dev/null
@@ -1,78 +0,0 @@
-Implementation CRUD Sample
-==========================
-This sample demonstrates how new implementation types are constructed for
-Apache Tuscany SCA.
-
-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 want to try out the crud implementation type that this sample provides
-please see the implementation-crud-client sample that provides the necessary
-client code to bring up an application that uses this implementation-crud
-
-Sample Overview
----------------
-This sample contains a CRUD implementation type as an example of how to create
-new implementation types. Components using this implementation type always
-expose the same Create, Retrieve, Update and Delete interface. This sample
-uses a singleton ResourceManager to perform the CRUD operations but of course
-a real component would provide a real implementation.
-
-implementation-crud/
- src/
- main/
- java/
- crud/ - implementation model interfaces
- crud.backend/ - fake component implementation
- crud.impl/ - implementations of the model interfaces
- crud.module/ - gets the implementation-crud module registered
- with the SCA runtime
- crud.provider/ - runtime implementation
- resources/
- crud.composite - the SCA assembly used during unit testing
-
- build.xml - the Ant build file
- pom.xml - the Maven build file
-
-Building The Sample Extension Using Ant
------------------------------------------
-With the binary distribution the sample extension can be built using Ant as
-follows
-
-cd implementation-crud
-ant compile
-
-See the sample implementation-crud-client to run a sample that uses this
-binding.
-
-Building The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built
-using Maven as follows.
-
-cd implementation-crud
-mvn
-
-Maven will also test that the sample extension built properly. You should see
-the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running crud.CRUDTestCase
-Starting CRUDServiceComponent
-create(ABC) in tmp
-retrieve(0)
-update(0)
-retrieve(0)
-delete(0)
-retrieve(0)
-Stopping CRUDServiceComponent
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.212 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
diff --git a/branches/sca-android/modules/implementation-das/build.xml b/branches/sca-android/modules/implementation-das/build.xml
deleted file mode 100644
index ab0d93beb0..0000000000
--- a/branches/sca-android/modules/implementation-das/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="implementation-crud" default="compile">
- <property name="test.jar" value="sample-implementation-crud.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>
- <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${test.jar}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${test.class}" />
- </manifest>
- </jar>
- </target>
-
- <target name="clean">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-</project>
diff --git a/branches/sca-android/modules/implementation-das/company.sql b/branches/sca-android/modules/implementation-das/company.sql
deleted file mode 100644
index 4911f9e62f..0000000000
--- a/branches/sca-android/modules/implementation-das/company.sql
+++ /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.
---
-
-DROP TABLE COMPANY;
-
-CREATE TABLE COMPANY (
- ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY,
- NAME VARCHAR(30));
-
-INSERT INTO COMPANY (NAME) VALUES('ACME Publishing');
-INSERT INTO COMPANY (NAME) VALUES('Do-rite plumbing');
-INSERT INTO COMPANY (NAME) VALUES('MegaCorp'); \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-das/pom.xml b/branches/sca-android/modules/implementation-das/pom.xml
deleted file mode 100644
index b9e42fb6a9..0000000000
--- a/branches/sca-android/modules/implementation-das/pom.xml
+++ /dev/null
@@ -1,187 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-das</artifactId>
- <name>Apache Tuscany SCA DAS Implementation Extension</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.das</groupId>
- <artifactId>tuscany-das-rdb</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-engine-helper</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.3.1.4</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>sql-maven-plugin</artifactId>
- <!-- 1.1 due to MOJO-619 -->
- <version>1.1-SNAPSHOT</version>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.3.1.4</version>
- </dependency>
- </dependencies>
-
- <executions>
- <execution>
- <id>create-db</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:${pom.basedir}/target/test-classes/company;create=true</url>
- <autocommit>true</autocommit>
- <onError>continue</onError>
- <onConnectionError>skip</onConnectionError>
- <delimiter>;</delimiter>
- <srcFiles>
- <srcFile>${pom.basedir}/company.sql</srcFile>
- </srcFiles>
- </configuration>
- </execution>
-
- <!-- Shutdown DB in order to be able to run unit tests -->
- <execution>
- <id>shutdown-database-sothat-test-can-run</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:${pom.basedir}/target/test-classes/company;shutdown=true</url>
- <skipOnConnectionError>true</skipOnConnectionError>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <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.implementation.das</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.das*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
-
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java b/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java
deleted file mode 100644
index b0b4b132e6..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.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.das;
-
-/**
- * Generic constants used in this implementation
- *
- * @version $Rev$ $Date$
- */
-public interface Constants {
- /**
- * Identify Relation Database data store
- */
- String DATA_ACCESS_TYPE_RDB = "rdb";
-
-}
diff --git a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java b/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java
deleted file mode 100644
index 1fc46ea710..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.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.das;
-
-import commonj.sdo.DataObject;
-
-
-/**
- * The service interface of a DAS service provided by DAS components.
- *
- * @version $Rev$ $Date$
- */
-public interface DAS {
-
- /**
- * Execute a DAS Command specified on the DAS config file.
- * @param commandName The name of the command
- * @return
- */
- DataObject executeCommand(String commandName);
-
- /**Execute a DAS Command specified on the DAS config file,
- * and narrow the results based on the provided XPath
- *
- * @param commandName The name of the command
- * @param xPath The xPath filter
- * @return
- */
- DataObject executeCommand(String commandName, String xPath);
-
-
-
-}
diff --git a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java b/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java
deleted file mode 100644
index 0e0c689b41..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.das;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-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;
-
-
-/**
- * The model representing a sample DAS implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public class DASImplementation implements Implementation {
-
- private String dasConfig;
- private String dataAccessType;
-
- private ConnectionInfo connectionInfo;
-
- private boolean unresolved;
- private List<Service> services = new ArrayList<Service>();
-
- /**
- * Constructs a new DAS implementation.
- */
- public DASImplementation(AssemblyFactory assemblyFactory,
- JavaInterfaceFactory javaFactory) {
-
- // DAS implementation always provide a single service exposing
- // the DAS interface, and have no references and properties
- Service dasService = null;
- dasService = assemblyFactory.createService();
- dasService.setName("DAS");
- JavaInterface javaInterface;
- try {
- javaInterface = javaFactory.createJavaInterface(DAS.class);
- } catch (InvalidInterfaceException e) {
- throw new IllegalArgumentException(e);
- }
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- interfaceContract.setInterface(javaInterface);
- dasService.setInterfaceContract(interfaceContract);
-
- services.add(dasService);
- }
-
- /* DAS Model Information */
-
- public String getConfig() {
- return this.dasConfig;
- }
-
- public void setConfig(String config) {
- this.dasConfig = config;
- }
-
- public String getDataAccessType() {
- return this.dataAccessType;
- }
-
- public void setDataAccessType (String dataAccessType) {
- this.dataAccessType = dataAccessType;
- }
-
- public ConnectionInfo getConnectionInfo() {
- return this.connectionInfo;
- }
-
- public void setConnectionInfo(ConnectionInfo connectionInfo) {
- this.connectionInfo = connectionInfo;
- }
-
- /* SCA Model Information */
-
- public ConstrainingType getConstrainingType() {
- // DAS implementation does not support constrainingTypes
- return null;
- }
-
- public List<Property> getProperties() {
- // DAS implementation does not support properties
- return Collections.emptyList();
- }
-
- public List<Reference> getReferences() {
- // DAS implementation does not support references
- return Collections.emptyList();
- }
-
- public List<Service> getServices() {
- return services;
- }
-
- public String getURI() {
- // DAS implementation does not have a URI
- return null;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- // DAS implementation does not support constrainingTypes
- }
-
- public void setURI(String uri) {
- // DAS implementation does not have a URI
-
- }
-
- public void setUnresolved(boolean undefined) {
- this.unresolved = undefined;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java b/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java
deleted file mode 100644
index 93d22d2d5a..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.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.das;
-
-/**
- * A factory for the sample DAS implementation model.
- *
- * @version $Rev$ $Date$
- */
-public interface DASImplementationFactory {
-
- /**
- * Creates a new CRUD implementation.
- *
- * @return
- */
- DASImplementation createDASImplementation();
-
-}
diff --git a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.java b/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.java
deleted file mode 100644
index 0e90c90082..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.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.implementation.das;
-
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.data.engine.ConnectionInfoArtifactProcessor;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-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;
-
-
-/**
- * Implements a StAX artifact processor for DAS implementations.
- *
- * The artifact processor is responsible for processing <implementation.das>
- * elements in SCA assembly XML composite files and populating the DAS
- * implementation model, resolving its references to other artifacts in the SCA
- * contribution, and optionally write the model back to SCA assembly XML.
- *
- * @version $Rev$ $Date$
- */
-public class DASImplementationProcessor implements StAXArtifactProcessor<DASImplementation> {
- private static final QName IMPLEMENTATION_DAS = new QName(Constants.SCA10_TUSCANY_NS, "implementation.das");
-
- private DASImplementationFactory dasFactory;
-
- private final AssemblyFactory assemblyFactory;
- private final JavaInterfaceFactory javaFactory;
- private Monitor monitor;
- private StAXArtifactProcessor<ConnectionInfo> connectionInfoProcessor;
-
- public DASImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- this.monitor = monitor;
- this.dasFactory = new DefaultDASImplementationFactory(assemblyFactory, javaFactory);
- this.connectionInfoProcessor = new ConnectionInfoArtifactProcessor(modelFactories, this.monitor);
- }
-
- public QName getArtifactType() {
- // Returns the QName of the XML element processed by this processor
- return IMPLEMENTATION_DAS;
- }
-
- public Class<DASImplementation> getModelType() {
- // Returns the type of model processed by this processor
- return DASImplementation.class;
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "impl-das-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /*
- * <component name="CompanyDataComponent">
- * <implementation.das config="/CompanyConfig.xml" dataAccessType="rdb">
- * <connectionInfo>
- * <connectionProperties
- * driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- * databaseURL="jdbc:derby:target/test-classes/dastest; create = true"
- * loginTimeout="600000"/>
- * </connectionInfo>
- * </implementation.data>
- * </component>
- */
- public DASImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- assert IMPLEMENTATION_DAS.equals(reader.getName());
-
- // Read an <implementation.das> element
-
- // Create an initialize the DAS implementation model
- DASImplementation implementation = null;
-
- // Read the das config file attribute.
- // This is das configuration side file to use
- String config = reader.getAttributeValue(null, "config");
-
- // Read the data access type attribute
- // This is the type of data store in use (e.g RDB, XML, etc)
- String dataAccessType = reader.getAttributeValue(null, "dataAccessType");
-
- // Both config and dataAccessType are required attributes, hence validating.
- if (config == null || dataAccessType == null) {
- if (config == null)
- error("ConfigAttributeMissing", reader);
- if (dataAccessType == null)
- error("DataAccessTypeAttributeMissing", reader);
- return implementation;
- }
-
- // Create an initialize the DAS implementation model
- implementation = dasFactory.createDASImplementation();
- implementation.setConfig(config);
- implementation.setDataAccessType(dataAccessType);
- implementation.setUnresolved(true);
-
- while (true) {
- int event = reader.next();
- switch (event) {
-
- case START_ELEMENT:
- if (ConnectionInfoArtifactProcessor.CONNECTION_INFO.equals(reader.getName())) {
-
- // Read connection info
- ConnectionInfo connectionInfo = (ConnectionInfo) connectionInfoProcessor.read(reader);
- implementation.setConnectionInfo(connectionInfo);
- }
- break;
- case XMLStreamConstants.END_ELEMENT:
- if (IMPLEMENTATION_DAS.equals(reader.getName())) {
- return implementation;
- }
- break;
- }
- }
- }
-
- public void resolve(DASImplementation impl, ModelResolver resolver) throws ContributionResolveException {
- if( impl != null && impl.isUnresolved()) {
- //resolve component type
- mergeComponentType(resolver, impl);
-
- //set current implementation resolved
- impl.setUnresolved(false);
- }
- }
-
- public void write(DASImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- writer.writeStartElement(IMPLEMENTATION_DAS.getNamespaceURI(), IMPLEMENTATION_DAS.getLocalPart());
-
- if (implementation.getConfig() != null) {
- writer.writeAttribute("config", implementation.getConfig());
- }
- if (implementation.getDataAccessType() != null) {
- writer.writeAttribute("dataAccessType", implementation.getDataAccessType());
- }
-
- if (implementation.getConnectionInfo() != null) {
- connectionInfoProcessor.write(implementation.getConnectionInfo(), writer);
- }
-
- writer.writeEndElement();
- }
-
- /**
- * Merge the componentType from introspection and external file
- * @param resolver
- * @param impl
- */
- private void mergeComponentType(ModelResolver resolver, DASImplementation 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()) {
- if(svc != null) {
- 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);
- }
- }
- }
-
- private String getFileName(String filePath) {
- int pos = filePath.lastIndexOf(".");
-
- return filePath.substring(0, pos);
-
- }
-
- private ComponentType getComponentType(ModelResolver resolver, DASImplementation impl) {
- String dasConfig = this.getFileName(impl.getConfig());
- String componentTypeURI = dasConfig.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;
- }
-}
diff --git a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java b/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java
deleted file mode 100644
index 2e18541b3b..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.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.das;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-
-
-/**
- * A default factory for the DAS implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultDASImplementationFactory implements DASImplementationFactory {
-
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
-
- public DefaultDASImplementationFactory(AssemblyFactory assemblyFactory,
- JavaInterfaceFactory javaFactory) {
- this.assemblyFactory = assemblyFactory;
- this.javaFactory = javaFactory;
- }
-
- public DASImplementation createDASImplementation() {
- return new DASImplementation(assemblyFactory, javaFactory);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/annotations/Command.java b/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/annotations/Command.java
deleted file mode 100644
index c8c3fd75e6..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/annotations/Command.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.das.annotations;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public @interface Command {
- enum TYPE {SELECT, INSERT, DELETE, UPDATE}
-
- /**
- * Defines an Ad hoc command query
- * @return
- */
- String query() default "";
-
- TYPE type() default TYPE.SELECT;
-}
diff --git a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java b/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java
deleted file mode 100644
index 40f414b7ef..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.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.das.provider;
-
-import org.apache.tuscany.das.rdb.DAS;
-import org.apache.tuscany.sca.data.engine.DataAccessEngine;
-import org.apache.tuscany.sca.data.engine.DataAccessEngineManager;
-import org.apache.tuscany.sca.implementation.das.DASImplementation;
-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;
-
-/**
- * DAS Implementation provider
- *
- * @version $Rev$ $Date$
- */
-public class DASImplementationProvider implements ImplementationProvider {
-
- private RuntimeComponent component;
- private DASImplementation implementation;
- private final DataAccessEngineManager dataAccessEngineManager;
-
- /**
- * Constructs a new DAS implementation.
- */
- public DASImplementationProvider(RuntimeComponent component, DASImplementation implementation) {
- this.component = component;
- this.implementation = implementation;
- this.dataAccessEngineManager = new DataAccessEngineManager();
- }
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- DAS das = null;
- try {
- das = dataAccessEngineManager.getDAS(implementation.getConfig(), implementation.getConnectionInfo());
- } catch(Exception e) {
- e.printStackTrace();
- //what now ?
- }
- DASInvoker invoker = new DASInvoker(operation, new DataAccessEngine(das) );
- return invoker;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- System.out.println("Starting " + component.getName());
- }
-
- public void stop() {
- System.out.println("Stopping " + component.getName());
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java b/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java
deleted file mode 100644
index 3ce182347c..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.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.das.provider;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.das.DASImplementation;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * Factory for DAS Implementation Provider
- *
- * @version $Rev$ $Date$
- */
-public class DASImplementationProviderFactory implements ImplementationProviderFactory<DASImplementation> {
-
- /**
- * Constructs a new DAS implementation.
- */
- public DASImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component, DASImplementation implementation) {
- return new DASImplementationProvider(component, implementation);
- }
-
- public Class<DASImplementation> getModelType() {
- return DASImplementation.class;
- }
-}
diff --git a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java b/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java
deleted file mode 100644
index 4cd227717c..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.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.implementation.das.provider;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.apache.tuscany.sca.data.engine.DataAccessEngine;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-
-/**
- * Implements a target invoker for DAS component implementations.
- *
- * The target invoker is responsible for dispatching invocations to the particular
- * component implementation logic. The current component implementation will
- * dispatch calls to the DAS APIs to retrieve the requested data from the back-end store
- *
- * @version $Rev$ $Date$
- */
-public class DASInvoker implements Invoker {
- private final Operation operation;
- private final DataAccessEngine dataAccessEngine;
-
- public DASInvoker(Operation operation, DataAccessEngine dataAccessEngine) {
- this.operation = operation;
- this.dataAccessEngine = dataAccessEngine;
- }
-
- public Message invoke(Message msg) {
- try {
- Object[] args = msg.getBody();
- Object resp = doTheWork(args);
- msg.setBody(resp);
- } catch (InvocationTargetException e) {
- msg.setFaultBody(e.getCause());
- }
- return msg;
- }
-
- public Object doTheWork(Object[] args) throws InvocationTargetException {
- //check annotation
-// try {
-// Method methodDeclaration = this.getClass().getMethod(operation.getName(), null);
-// methodDeclaration.getAnnotation(org.apache.tuscany.sca.implementation.das.annotations.Command.class);
-// } catch (Exception e) {
-// //ignore
-// }
-
- //check if static way
- if (operation.getName().equals("executeCommand")) {
- String commandName, xPath;
-
- //simple execute command by name
- if( args.length == 1){
- commandName = (String) args[0];
- return this.dataAccessEngine.executeCommand(commandName);
- } else {
- commandName = (String) args[0];
- xPath = (String) args[1];
-
- return this.dataAccessEngine.executeCommand(commandName, xPath);
- }
- } else { // dynamic mapping to command
-
- return this.dataAccessEngine.executeCommand(operation.getName());
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 417195c684..0000000000
--- a/branches/sca-android/modules/implementation-das/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.das.DASImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.das,model=org.apache.tuscany.sca.implementation.das.DASImplementation
diff --git a/branches/sca-android/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-android/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index 290f05d03e..0000000000
--- a/branches/sca-android/modules/implementation-das/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.das.provider.DASImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.das.DASImplementation
diff --git a/branches/sca-android/modules/implementation-das/src/main/resources/impl-das-validation-messages.properties b/branches/sca-android/modules/implementation-das/src/main/resources/impl-das-validation-messages.properties
deleted file mode 100644
index a002d3cef0..0000000000
--- a/branches/sca-android/modules/implementation-das/src/main/resources/impl-das-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.
-#
-#
-ConfigAttributeMissing = Attribute 'config' is missing.
-DataAccessTypeAttributeMissing = Attribute 'dataAccessType' is missing.
-
diff --git a/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.java b/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.java
deleted file mode 100644
index 8659280891..0000000000
--- a/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.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.implementation.das;
-
-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 junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-import org.apache.tuscany.sca.data.engine.config.ConnectionProperties;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorFactoryImpl;
-import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DASImplementationProcessorTestCase extends TestCase {
-
- protected static final QName IMPLEMENTATION_DAS = new QName(Constants.SCA10_TUSCANY_NS, "implementation.das");
-
- private static final String COMPOSITE_USING_DATASOURCE =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">"
- + " <component name=\"DasComponent\">"
- + " <tuscany:implementation.das config=\"config.xml\" dataAccessType=\"rdb\">"
- + " <tuscany:connectionInfo datasource=\"dataSource\"/>"
- + " </tuscany:implementation.das>"
- + "</component>";
-
- private static final String COMPOSITE_USING_CONNECTION_PROPERTIES =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">"
- + " <component name=\"DasComponent\">"
- + " <tuscany:implementation.das config=\"config.xml\" dataAccessType=\"rdb\">"
- + " <tuscany:connectionInfo>"
- + " <tuscany:connectionProperties"
- + " driverClass=\"driverClass\""
- + " databaseURL=\"databaseURL\""
- + " loginTimeout=\"1\"/>"
- + " </tuscany:connectionInfo>"
- + " </tuscany:implementation.das>"
- + "</component>";
-
- private static final String INVALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">"
- + " <component name=\"DasComponent\">"
- + " <tuscany:implementation.das>"
- + " <tuscany:connectionInfo datasource=\"dataSource\"/>"
- + " </tuscany:implementation.das>"
- + "</component>";
-
- private XMLInputFactory xmlFactory;
- private ModelFactoryExtensionPoint modelFactories;
- private Monitor monitor;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- xmlFactory = XMLInputFactory.newInstance();
- // Create a monitor
- MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();
- if (monitorFactory != null)
- this.monitor = monitorFactory.createMonitor();
- modelFactories = new DefaultModelFactoryExtensionPoint();
- AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
- modelFactories.addFactory(assemblyFactory);
- JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
- modelFactories.addFactory(javaFactory);
- }
-
- public void testLoadCompositeUsingDatasource() throws Exception {
- XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_DATASOURCE));
-
- DASImplementationProcessor dataProcessor = new DASImplementationProcessor(modelFactories, monitor);
-
- while(true) {
- int event = reader.next();
- if(event == XMLStreamConstants.START_ELEMENT && IMPLEMENTATION_DAS.equals(reader.getName())) {
- break;
- }
- }
-
- DASImplementation implementation = dataProcessor.read(reader);
-
- assertNotNull(implementation);
- assertEquals("config.xml", implementation.getConfig());
- assertEquals("rdb", implementation.getDataAccessType());
-
- ConnectionInfo connInfo = implementation.getConnectionInfo();
- assertNotNull(connInfo);
- assertEquals("dataSource", connInfo.getDataSource());
-
- ConnectionProperties connProperties = connInfo.getConnectionProperties();
- assertNull(connProperties);
- }
-
- public void testLoadCompositeUsingConnectionProperties() throws Exception {
- XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_CONNECTION_PROPERTIES));
-
- DASImplementationProcessor dataProcessor = new DASImplementationProcessor(modelFactories, monitor);
-
- while(true) {
- int event = reader.next();
- if(event == XMLStreamConstants.START_ELEMENT && IMPLEMENTATION_DAS.equals(reader.getName())) {
- break;
- }
- }
-
- DASImplementation implementation = dataProcessor.read(reader);
-
- assertNotNull(implementation);
- assertEquals("config.xml", implementation.getConfig());
- assertEquals("rdb", implementation.getDataAccessType());
-
- ConnectionInfo connInfo = implementation.getConnectionInfo();
- assertNotNull(connInfo);
- assertNull("dataSource", connInfo.getDataSource());
-
- ConnectionProperties connProperties = connInfo.getConnectionProperties();
- assertNotNull(connProperties);
- assertEquals("driverClass",connProperties.getDriverClass());
- assertEquals("databaseURL",connProperties.getDatabaseURL());
- assertEquals(1,connProperties.getLoginTimeout().intValue());
- }
-
- /**
- * Test loading an INVALID implementation.das element from a contribution metadata stream
- */
- public void testLoadInvalid() throws Exception {
- XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(INVALID_XML));
-
- DASImplementationProcessor dataProcessor = new DASImplementationProcessor(modelFactories, monitor);
-
- while(true) {
- int event = reader.next();
- if(event == XMLStreamConstants.START_ELEMENT && IMPLEMENTATION_DAS.equals(reader.getName())) {
- break;
- }
- }
-
- dataProcessor.read(reader);
- Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
- assertNotNull(problem);
- assertEquals("DataAccessTypeAttributeMissing", problem.getMessageId());
- }
-}
diff --git a/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java b/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java
deleted file mode 100644
index 7d8b4181c1..0000000000
--- a/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.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.das;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import commonj.sdo.DataObject;
-
-/**
- * Tests the DAS service
- *
- * @version $Rev$ $Date$
- */
-public class DASTestCase extends TestCase {
-
- private SCADomain scaDomain;
- private DAS dasService;
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("das.composite");
- dasService = scaDomain.getService(DAS.class, "DASServiceComponent/DAS");
-
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
-
- public void testExecuteCommand() throws Exception {
- String commandName = "all companies";
-
- DataObject resultRoot= dasService.executeCommand(commandName);
- assertNotNull(resultRoot);
- assertEquals(3, resultRoot.getList("COMPANY").size());
- }
-
- public void testExecuteCommandWithFilter() throws Exception {
- String commandName = "all companies";
-
- DataObject resultRoot= dasService.executeCommand(commandName, "COMPANY[1]");
- assertNotNull(resultRoot);
- }
-
-
-}
diff --git a/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java b/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java
deleted file mode 100644
index 63d0c92683..0000000000
--- a/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.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.das.company;
-
-import org.apache.tuscany.sca.implementation.das.annotations.Command;
-
-import commonj.sdo.DataObject;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public interface CompanyService {
- @Command(query="select * from COMPANY")
- DataObject getCompanies();
-}
diff --git a/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java b/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java
deleted file mode 100644
index 565a930ebe..0000000000
--- a/branches/sca-android/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.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.das.company;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import commonj.sdo.DataObject;
-
-/**
- * Tests the DAS service
- *
- * @version $Rev$ $Date$
- */
-public class CompanyServiceTestCase extends TestCase {
-
- private SCADomain scaDomain;
- private CompanyService dasCompanyService;
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("company.composite");
- dasCompanyService = scaDomain.getService(CompanyService.class, "CompanyServiceComponent/CompanyService");
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- public void testGetCompanies() throws Exception {
- DataObject root = dasCompanyService.getCompanies();
- assertNotNull(root);
- String nome = root.getString("COMPANY[1]/NAME");
- assertEquals("ACME Publishing", root.getString("COMPANY[1]/NAME"));
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-das/src/test/resources/company.componentType b/branches/sca-android/modules/implementation-das/src/test/resources/company.componentType
deleted file mode 100644
index 5017cfcffd..0000000000
--- a/branches/sca-android/modules/implementation-das/src/test/resources/company.componentType
+++ /dev/null
@@ -1,29 +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/2006/01/wsdl-instance"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <service name="CompanyService">
- <interface.java interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/>
- </service>
-
-</componentType> \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-das/src/test/resources/company.composite b/branches/sca-android/modules/implementation-das/src/test/resources/company.composite
deleted file mode 100644
index ee6104360e..0000000000
--- a/branches/sca-android/modules/implementation-das/src/test/resources/company.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"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://sample/das"
- name="das">
-
- <component name="CompanyServiceComponent">
- <tuscany:implementation.das config="company.xml" dataAccessType="rdb">
- <tuscany:connectionInfo>
- <tuscany:connectionProperties
- driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- databaseURL="jdbc:derby:target/test-classes/company; create = true"
- loginTimeout="600000"/>
- </tuscany:connectionInfo>
- </tuscany:implementation.das>
- </component>
-</composite>
diff --git a/branches/sca-android/modules/implementation-das/src/test/resources/company.xml b/branches/sca-android/modules/implementation-das/src/test/resources/company.xml
deleted file mode 100644
index 350c8b99ce..0000000000
--- a/branches/sca-android/modules/implementation-das/src/test/resources/company.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.
- -->
-<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">
-
- <Command name="getCompanies" SQL="select * from COMPANY" kind="Select"/>
-
- <Command name="all companies" SQL="select * from COMPANY" kind="Select"/>
-
- <Command name="all companies and departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID" kind="Select"/>
-
- <Command name="all departments for company" SQL="select * from COMPANY inner join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
-
- <Command name="company by id with departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
-
- <Table tableName="COMPANY">
- <Column columnName="ID" primaryKey="true" generated="true"/>
- </Table>
-
- <Table tableName="DEPARTMENT">
- <Column columnName="ID" primaryKey="true" generated="true"/>
- </Table>
-
- <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true">
- <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/>
- </Relationship>
-
-
-</Config>
diff --git a/branches/sca-android/modules/implementation-das/src/test/resources/das.composite b/branches/sca-android/modules/implementation-das/src/test/resources/das.composite
deleted file mode 100644
index e54f4390ac..0000000000
--- a/branches/sca-android/modules/implementation-das/src/test/resources/das.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"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://sample/das"
- name="das">
-
- <component name="DASServiceComponent">
- <tuscany:implementation.das config="company.xml" dataAccessType="rdb">
- <tuscany:connectionInfo>
- <tuscany:connectionProperties
- driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- databaseURL="jdbc:derby:target/test-classes/company; create = true"
- loginTimeout="600000"/>
- </tuscany:connectionInfo>
- </tuscany:implementation.das>
- </component>
-</composite>
diff --git a/branches/sca-android/modules/implementation-data-api/META-INF/README b/branches/sca-android/modules/implementation-data-api/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-data-api/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-data-xml/LICENSE b/branches/sca-android/modules/implementation-data-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/implementation-data-xml/META-INF/README b/branches/sca-android/modules/implementation-data-xml/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-data-xml/NOTICE b/branches/sca-android/modules/implementation-data-xml/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/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/branches/sca-android/modules/implementation-data-xml/README b/branches/sca-android/modules/implementation-data-xml/README
deleted file mode 100644
index 763daafe46..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/README
+++ /dev/null
@@ -1,78 +0,0 @@
-Implementation CRUD Sample
-==========================
-This sample demonstrates how new implementation types are constructed for
-Apache Tuscany SCA.
-
-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 want to try out the crud implementation type that this sample provides
-please see the implementation-crud-client sample that provides the necessary
-client code to bring up an application that uses this implementation-crud
-
-Sample Overview
----------------
-This sample contains a CRUD implementation type as an example of how to create
-new implementation types. Components using this implementation type always
-expose the same Create, Retrieve, Update and Delete interface. This sample
-uses a singleton ResourceManager to perform the CRUD operations but of course
-a real component would provide a real implementation.
-
-implementation-crud/
- src/
- main/
- java/
- crud/ - implementation model interfaces
- crud.backend/ - fake component implementation
- crud.impl/ - implementations of the model interfaces
- crud.module/ - gets the implementation-crud module registered
- with the SCA runtime
- crud.provider/ - runtime implementation
- resources/
- crud.composite - the SCA assembly used during unit testing
-
- build.xml - the Ant build file
- pom.xml - the Maven build file
-
-Building The Sample Extension Using Ant
------------------------------------------
-With the binary distribution the sample extension can be built using Ant as
-follows
-
-cd implementation-crud
-ant compile
-
-See the sample implementation-crud-client to run a sample that uses this
-binding.
-
-Building The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built
-using Maven as follows.
-
-cd implementation-crud
-mvn
-
-Maven will also test that the sample extension built properly. You should see
-the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running crud.CRUDTestCase
-Starting CRUDServiceComponent
-create(ABC) in tmp
-retrieve(0)
-update(0)
-retrieve(0)
-delete(0)
-retrieve(0)
-Stopping CRUDServiceComponent
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.212 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
diff --git a/branches/sca-android/modules/implementation-data-xml/build.xml b/branches/sca-android/modules/implementation-data-xml/build.xml
deleted file mode 100644
index ab0d93beb0..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/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="implementation-crud" default="compile">
- <property name="test.jar" value="sample-implementation-crud.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>
- <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${test.jar}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${test.class}" />
- </manifest>
- </jar>
- </target>
-
- <target name="clean">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-</project>
diff --git a/branches/sca-android/modules/implementation-data-xml/company.sql b/branches/sca-android/modules/implementation-data-xml/company.sql
deleted file mode 100644
index 4911f9e62f..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/company.sql
+++ /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.
---
-
-DROP TABLE COMPANY;
-
-CREATE TABLE COMPANY (
- ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY,
- NAME VARCHAR(30));
-
-INSERT INTO COMPANY (NAME) VALUES('ACME Publishing');
-INSERT INTO COMPANY (NAME) VALUES('Do-rite plumbing');
-INSERT INTO COMPANY (NAME) VALUES('MegaCorp'); \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-data-xml/pom.xml b/branches/sca-android/modules/implementation-data-xml/pom.xml
deleted file mode 100644
index 29b53a6d86..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/pom.xml
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-data-xml</artifactId>
- <name>Apache Tuscany SCA Data Implementation Extension</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.das</groupId>
- <artifactId>tuscany-das-rdb</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-engine-helper</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-atom-abdera</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.3.1.4</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>sql-maven-plugin</artifactId>
- <!-- 1.1 due to MOJO-619 -->
- <version>1.1-SNAPSHOT</version>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.1.2.1</version>
- </dependency>
- </dependencies>
-
- <executions>
- <execution>
- <id>create-db</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:${pom.basedir}/target/test-classes/company;create=true</url>
- <autocommit>true</autocommit>
- <onError>continue</onError>
- <onConnectionError>skip</onConnectionError>
- <delimiter>;</delimiter>
- <srcFiles>
- <srcFile>${pom.basedir}/company.sql</srcFile>
- </srcFiles>
- </configuration>
- </execution>
-
- <!-- Shutdown DB in order to be able to run unit tests -->
- <execution>
- <id>shutdown-database-sothat-test-can-run</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:${pom.basedir}/target/test-classes/company;shutdown=true</url>
- <skipOnConnectionError>true</skipOnConnectionError>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <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.implementation.data.xml</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.data*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATA.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATA.java
deleted file mode 100644
index 3ce96e58da..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATA.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.data;
-
-import javax.xml.stream.XMLStreamReader;
-
-/**
- * The service interface of a DAS service provided by DAS components.
- *
- * @version $Rev$ $Date$
- */
-public interface DATA {
-
- /**
- * Retrieve the Database table contents If a id is given, the results will
- * be filtered to a matching row
- *
- * @param id The PK that identifies the row on the table
- * @return The row content in XML format
- */
- XMLStreamReader get(String id);
-
- /**
- * Insert new content in the Database
- *
- * @param insertStream The insertion in XML format
- * @return The number of rows affected
- */
- int insert(XMLStreamReader insertStream);
-
- /**
- * Update the Database table contents
- *
- * @param updateStream The updates in XML format
- * @return The number of rows affected
- */
- int update(XMLStreamReader updateStream);
-
- /**
- * Delete the Database table contents If a id is given, only a specific row
- * will be deleted
- *
- * @param id The PK that identifies the row on the table
- * @return The number of rows affected
- */
- int delete(String id);
-
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATACollection.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATACollection.java
deleted file mode 100644
index 1dc5673fe5..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATACollection.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.implementation.data;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.data.collection.Collection;
-
-public interface DATACollection extends Collection<String, XMLStreamReader> {
-
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementation.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementation.java
deleted file mode 100644
index a50ad89b64..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementation.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.implementation.data;
-
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-import org.apache.tuscany.sca.implementation.data.jdbc.JDBCHelper;
-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;
-
-
-/**
- * The model representing a sample DATA implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public class DATAImplementation implements Implementation {
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
-
- private ConnectionInfo connectionInfo;
- private List<Service> services = new ArrayList<Service>();
-
- /**
- * Constructs a new DAS implementation.
- */
- public DATAImplementation(AssemblyFactory assemblyFactory,
- JavaInterfaceFactory javaFactory) {
-
- // DATA implementation provides one service per database table
- // exposing the DATA interface, and have no references and properties
- this.assemblyFactory = assemblyFactory;
- this.javaFactory = javaFactory;
- }
-
- private void introspectServices( AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory) {
- Connection connection = null;
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- DatabaseMetaData databaseMetaData = connection.getMetaData();
- ResultSet tables = databaseMetaData.getTables(null, null, "%", null);
- while(tables.next()) {
- //create the SCA service for the table
- Service dataService = assemblyFactory.createService();
- Service dataCollectionService = assemblyFactory.createService();
-
- dataService.setName(tables.getString(3)+"_DATA");
- dataCollectionService.setName(tables.getString(3));
-
- JavaInterface dataInterface;
- JavaInterface dataCollectionInterface;
-
- try {
- dataInterface = javaFactory.createJavaInterface(DATA.class);
- dataCollectionInterface = javaFactory.createJavaInterface(DATACollection.class);
- } catch (InvalidInterfaceException e) {
- throw new IllegalArgumentException(e);
- }
- JavaInterfaceContract dataInterfaceContract = javaFactory.createJavaInterfaceContract();
- JavaInterfaceContract dataCollectionInterfaceContract = javaFactory.createJavaInterfaceContract();
-
- dataInterfaceContract.setInterface(dataInterface);
- dataCollectionInterfaceContract.setInterface(dataCollectionInterface);
-
- dataService.setInterfaceContract(dataInterfaceContract);
- dataCollectionService.setInterfaceContract(dataCollectionInterfaceContract);
-
- services.add(dataService);
- services.add(dataCollectionService);
-
- }
- } catch(SQLException e) {
-
- } finally {
- JDBCHelper.cleanupResources(connection, null, null);
- }
- }
-
- public ConnectionInfo getConnectionInfo() {
- return this.connectionInfo;
- }
-
- public void setConnectionInfo(ConnectionInfo connectionInfo) {
- this.connectionInfo = connectionInfo;
- }
-
- public ConstrainingType getConstrainingType() {
- // The sample DATA implementation does not support constrainingTypes
- return null;
- }
-
- public List<Property> getProperties() {
- // The sample DATA implementation does not support properties
- return Collections.emptyList();
- }
-
- public List<Service> getServices() {
- if(services == null || services.size() == 0) {
- introspectServices(assemblyFactory, javaFactory);
- }
- return services;
- }
-
- public List<Reference> getReferences() {
- // The sample DATA implementation does not support references
- return Collections.emptyList();
- }
-
- public String getURI() {
- // The sample DATA implementation does not have a URI
- return null;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- // The sample DATA implementation does not support constrainingTypes
- }
-
- public void setURI(String uri) {
- // The sample DATA implementation does not have a URI
- }
-
- public boolean isUnresolved() {
- // The sample DATA implementation is always resolved
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- // The sample DATA implementation is always resolved
- }
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationFactory.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationFactory.java
deleted file mode 100644
index d4cf816dbf..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationFactory.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.data;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-
-/**
- * A default factory for the DATA implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class DATAImplementationFactory {
-
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
-
- public DATAImplementationFactory(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory) {
- this.assemblyFactory = assemblyFactory;
- this.javaFactory = javaFactory;
- }
-
- public DATAImplementation createDASImplementation() {
- return new DATAImplementation(assemblyFactory, javaFactory);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.java
deleted file mode 100644
index 16c5a370ec..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.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.implementation.data;
-
-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.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.data.engine.ConnectionInfoArtifactProcessor;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-
-/**
- * Implements a StAX artifact processor for DATA implementations.
- *
- * The artifact processor is responsible for processing <implementation.data>
- * elements in SCA assembly XML composite files and populating the DATA
- * implementation model, resolving its references to other artifacts in the SCA
- * contribution, and optionally write the model back to SCA assembly XML.
- *
- * @version $Rev$ $Date$
- */
-public class DATAImplementationProcessor implements StAXArtifactProcessor<DATAImplementation> {
- protected static final QName IMPLEMENTATION_DATA_XML = new QName(Constants.SCA10_TUSCANY_NS, "implementation.data.xml");
-
- private DATAImplementationFactory dataFactory;
- private Monitor monitor;
- private StAXArtifactProcessor<ConnectionInfo> connectionInfoProcessor;
-
- public DATAImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- this.monitor = monitor;
- this.dataFactory = new DATAImplementationFactory(assemblyFactory, javaFactory);
- this.connectionInfoProcessor = new ConnectionInfoArtifactProcessor(modelFactories, this.monitor);
- }
-
- public QName getArtifactType() {
- // Returns the qname of the XML element processed by this processor
- return IMPLEMENTATION_DATA_XML;
- }
-
- public Class<DATAImplementation> getModelType() {
- // Returns the type of model processed by this processor
- return DATAImplementation.class;
- }
-
- /*
- * <component name="CompanyDataComponent">
- * <implementation.data.xml>
- * <connectionInfo>
- * <connectionProperties
- * driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- * databaseURL="jdbc:derby:target/test-classes/dastest; create = true"
- * loginTimeout="600000"/>
- * </connectionInfo>
- * </implementation.data>
- * </component>
- */
- public DATAImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- assert IMPLEMENTATION_DATA_XML.equals(reader.getName());
-
- // Read an <implementation.data.xml> element
-
- // Create an initialize the DAS implementation model
- DATAImplementation implementation = dataFactory.createDASImplementation();
-
- while (true) {
- int event = reader.next();
- switch (event) {
-
- case START_ELEMENT:
- if (ConnectionInfoArtifactProcessor.CONNECTION_INFO.equals(reader.getName())) {
-
- // Read connection info
- ConnectionInfo connectionInfo = (ConnectionInfo) connectionInfoProcessor.read(reader);
- implementation.setConnectionInfo(connectionInfo);
- }
- break;
- case XMLStreamConstants.END_ELEMENT:
- if (IMPLEMENTATION_DATA_XML.equals(reader.getName())) {
- return implementation;
- }
- break;
- }
- }
-
- }
-
- public void resolve(DATAImplementation impl, ModelResolver resolver) throws ContributionResolveException {
- }
-
- public void write(DATAImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- writer.writeStartElement(IMPLEMENTATION_DATA_XML.getNamespaceURI(), IMPLEMENTATION_DATA_XML.getLocalPart());
-
- if (implementation.getConnectionInfo() != null) {
- connectionInfoProcessor.write(implementation.getConnectionInfo(), writer);
- }
-
- writer.writeEndElement();
- }
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCHelper.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCHelper.java
deleted file mode 100644
index 265f250717..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCHelper.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.implementation.data.jdbc;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-
-import org.apache.tuscany.das.rdb.exception.DataSourceInitializationException;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-
-/**
- * JDBC Helper
- * - JDBC Connection utility methods
- * - JDBC Resource cleanup methods
- *
- * @version $Rev$ $Date$
- */
-public class JDBCHelper {
-
- /**
- * protected constructor
- */
- protected JDBCHelper() {
-
- }
-
- /**
- *
- * @param connectionInfo
- * @return
- */
- public static Connection getConnection(ConnectionInfo connectionInfo) {
- if (connectionInfo.getDataSource() == null && connectionInfo.getConnectionProperties() == null) {
- throw new IllegalArgumentException("Not enough information to create Database Connection.");
- }
-
- if(connectionInfo.getDataSource() != null && connectionInfo.getConnectionProperties() != null) {
- throw new IllegalArgumentException("Use either dataSource or ConnectionProperties. Can't use both !");
- }
-
- if(connectionInfo.getDataSource() != null) {
- return getDataSourceConnection(connectionInfo);
- } else {
- return getDriverManagerConnection(connectionInfo);
- }
- }
-
- /**
- * Initializes a DB connection on a managed environment (e.g inside Tomcat)
- *
- * @param connectionInfo
- * @return
- */
- private static Connection getDataSourceConnection(ConnectionInfo connectionInfo) {
- Connection connection = null;
-
- InitialContext ctx;
- try {
- ctx = new InitialContext();
- } catch (NamingException e) {
- throw new RuntimeException(e);
- }
- try {
- DataSource ds = (DataSource) ctx.lookup(connectionInfo.getDataSource());
- try {
- connection = ds.getConnection();
- if (connection == null) {
- throw new RuntimeException("Could not obtain a Connection from DataSource");
- }
- connection.setAutoCommit(false);
- } catch (SQLException e) {
- throw new RuntimeException(e);
- }
- } catch (NamingException e) {
- throw new RuntimeException(e);
- }
-
- return connection;
- }
-
- /**
- * Initialize a DB connection on a J2SE environment
- * For more info, see http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/drivermanager.html
- *
- * @param connectionInfo
- * @return
- */
- private static Connection getDriverManagerConnection(ConnectionInfo connectionInfo) {
- Connection connection = null;
-
- if (connectionInfo.getConnectionProperties() == null) {
- throw new RuntimeException("No existing context and no connection properties");
- }
-
- if (connectionInfo.getConnectionProperties().getDriverClass() == null) {
- throw new RuntimeException("No jdbc driver class specified!");
- }
-
- try {
- Properties p = System.getProperties();
- p.put("derby.system.home", "target");
-
- //initialize driver and register it with DriverManager
- Class.forName(connectionInfo.getConnectionProperties().getDriverClass());
-
- //prepare to initialize connection
- String databaseUrl = connectionInfo.getConnectionProperties().getDatabaseURL();
- String userName = connectionInfo.getConnectionProperties().getUsername();
- String userPassword = connectionInfo.getConnectionProperties().getPassword();
- int loginTimeout = connectionInfo.getConnectionProperties().getLoginTimeout();
-
- DriverManager.setLoginTimeout(loginTimeout);
- if( (userName == null || userName.length() ==0) && (userPassword == null || userPassword.length()==0) ){
- //no username or password supplied
- connection = DriverManager.getConnection(databaseUrl);
- }else{
- connection = DriverManager.getConnection(databaseUrl, userName, userPassword);
- }
-
- if(connection == null){
- throw new DataSourceInitializationException("Error initializing connection : null");
- }
-
- //FIXME we should make this flexible, we can't autocommit when participating in transactions
- connection.setAutoCommit(true);
-
- }catch(ClassNotFoundException cnf){
- throw new DataSourceInitializationException("JDBC Driver '" + connectionInfo.getConnectionProperties().getDriverClass() + "' not found", cnf);
- }catch(SQLException sqle){
- throw new DataSourceInitializationException(sqle.getMessage(), sqle);
- }
-
- return connection;
- }
-
- /**
- * Cleanup and close all JDBC resources in the proper order and ignoring erros
- * @param connection The connection to be closed
- * @param queryStatement The statement to be closed
- * @param resultSet The ResultSet to be closed
- */
- public static void cleanupResources(Connection connection, PreparedStatement queryStatement, ResultSet resultSet) {
- cleanupResultSet(resultSet);
- cleanupPreparedStatement(queryStatement);
- cleanupConnection(connection);
- }
-
- /**
- * Proper cleanup the ResultSet
- * @param resultSet
- */
- private static void cleanupResultSet(ResultSet resultSet) {
- if (resultSet != null) {
- try {
- resultSet.close();
- } catch (SQLException e) {
- // We should log the error. Since we're trying to close, we don't re-throw.
- }
- }
- }
-
- /**
- * Proper cleanup the prepared statement
- * @param queryStatement
- */
- private static void cleanupPreparedStatement(PreparedStatement queryStatement) {
- if (queryStatement != null) {
- try {
- queryStatement.close();
- } catch (SQLException e) {
- // We should log the error. Since we're trying to close, we don't re-throw.
- }
- }
- }
-
- /**
- * proper cleanup the connection
- * @param connection
- */
- private static void cleanupConnection(Connection connection) {
- if (connection != null) {
- try {
- connection.close();
- } catch (SQLException e) {
- // We should log the error. Since we're trying to close, we don't re-throw.
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCResultSetStreamReader.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCResultSetStreamReader.java
deleted file mode 100644
index 316330243b..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCResultSetStreamReader.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.implementation.data.jdbc;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.tuscany.sca.databinding.xml.XmlTreeStreamReaderImpl;
-
-/**
- * JDBCResultSetStreamReader perform streaming of database tables as XML
- *
- * @version $Rev$ $Date$
- */
-public class JDBCResultSetStreamReader extends XmlTreeStreamReaderImpl {
- private ResultSet resultSet;
-
- /**
- * @param root
- */
- public JDBCResultSetStreamReader(ResultSet resultSet) {
- super(new ResultSetXmlNodeImpl(resultSet));
- this.resultSet = resultSet;
- }
-
- @Override
- public void close() throws XMLStreamException {
- try {
- resultSet.close();
- } catch (SQLException e) {
- }
- }
-}
-
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/ResultSetXmlNodeImpl.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/ResultSetXmlNodeImpl.java
deleted file mode 100644
index 576fe5605d..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/ResultSetXmlNodeImpl.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.implementation.data.jdbc;
-
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.xml.SimpleXmlNodeImpl;
-import org.apache.tuscany.sca.databinding.xml.XmlNode;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ResultSetXmlNodeImpl implements XmlNode {
- private static final String NS = "";
- private static final QName RESULT_SET = new QName(NS, "resultSet");
- private static final QName RECORD = new QName(NS, "record");
- private static final QName COLUMN = new QName(NS, "column");
- private static final QName NAME = new QName(NS, "name");
-
- private ResultSet resultSet;
- private String[] columnNames;
-
- /**
- * @param resultSet
- */
- public ResultSetXmlNodeImpl(ResultSet resultSet) {
- super();
- this.resultSet = resultSet;
- try {
- ResultSetMetaData metaData = resultSet.getMetaData();
- columnNames = new String[metaData.getColumnCount()];
- for (int i = 0; i < columnNames.length; i++) {
- columnNames[i] = metaData.getColumnName(i + 1);
- }
- } catch (SQLException e) {
- throw new IllegalStateException(e);
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#attributes()
- */
- public List<XmlNode> attributes() {
- return Collections.emptyList();
- }
-
- public Type getType() {
- return Type.ELEMENT;
- }
-
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#children()
- */
- public Iterator<XmlNode> children() {
- return new ResultSetIteraror();
- }
-
- private class ResultSetIteraror implements Iterator<XmlNode> {
- private Boolean hasNext;
-
- public ResultSetIteraror() {
- }
-
- public boolean hasNext() {
- try {
- if (hasNext == null) {
- hasNext = resultSet.next();
- }
- return hasNext;
- } catch (SQLException e) {
- throw new IllegalStateException(e);
- }
- }
-
- public XmlNode next() {
- hasNext();
- hasNext = null;
- return new RecordXmlNodeImpl();
- }
-
- public void remove() {
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#getName()
- */
- public QName getName() {
- return RESULT_SET;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#getValue()
- */
- public String getValue() {
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#namespaces()
- */
- public Map<String, String> namespaces() {
- return Collections.emptyMap();
- }
-
- private class RecordXmlNodeImpl extends XmlNodeImpl {
- int index = 0;
-
- @Override
- public Iterator<XmlNode> children() {
- return new Iterator<XmlNode>() {
-
- public boolean hasNext() {
- return index < columnNames.length;
- }
-
- public XmlNode next() {
- return new ColumnXmlNodeImpl(index++);
- }
-
- public void remove() {
- }
-
- };
- }
-
- @Override
- public QName getName() {
- return RECORD;
- }
-
- }
-
- private class ColumnXmlNodeImpl extends XmlNodeImpl {
- private int index;
-
- /**
- * @param index
- */
- public ColumnXmlNodeImpl(int index) {
- super();
- this.index = index;
- }
-
- @Override
- public List<XmlNode> attributes() {
- XmlNode attr = new SimpleXmlNodeImpl(NAME, columnNames[index], XmlNode.Type.ATTRIBUTE);
- return Arrays.asList(attr);
- }
-
- @Override
- public Iterator<XmlNode> children() {
- XmlNode[] nodes = {new ValueXmlNodeImpl(index)};
- return Arrays.asList(nodes).iterator();
- }
-
- @Override
- public QName getName() {
- return COLUMN;
- }
-
- }
-
- private class ValueXmlNodeImpl extends XmlNodeImpl {
- private int index;
-
- /**
- * @param index
- */
- public ValueXmlNodeImpl(int index) {
- super();
- this.index = index;
- }
-
- @Override
- public String getValue() {
- try {
- return String.valueOf(resultSet.getObject(index + 1));
- } catch (SQLException e) {
- throw new IllegalStateException(e);
- }
- }
-
- @Override
- public Type getType() {
- return Type.CHARACTERS;
- }
-
- }
-
- private static abstract class XmlNodeImpl implements XmlNode {
-
- public List<XmlNode> attributes() {
- return Collections.emptyList();
- }
-
- public Iterator<XmlNode> children() {
- return null;
- }
-
- public QName getName() {
- return null;
- }
-
- public String getValue() {
- return null;
- }
-
- public boolean isLeaf() {
- return false;
- }
-
- public Map<String, String> namespaces() {
- return Collections.emptyMap();
- }
-
- public Type getType() {
- return Type.ELEMENT;
- }
-
- }
-
-
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProvider.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProvider.java
deleted file mode 100644
index bbd963922c..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProvider.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.implementation.data.provider;
-
-import org.apache.tuscany.sca.implementation.data.DATAImplementation;
-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;
-
-/**
- * DATA Implementation provider
- *
- * @version $Rev$ $Date$
- */
-public class DATAImplementationProvider implements ImplementationProvider {
- //private RuntimeComponent component;
- private DATAImplementation implementation;
-
- /**
- * Constructs a new DATA implementation.
- */
- public DATAImplementationProvider(RuntimeComponent component, DATAImplementation implementation) {
- //this.component = component;
- this.implementation = implementation;
- }
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- String operationName = operation.getName();
- String tableName = service.getName();
-
- String interfaceFullName = operation.getInterface().toString();
- int index = interfaceFullName.lastIndexOf(".") + 1;
- String interfaceName = interfaceFullName.substring(index, interfaceFullName.length());
-
- if (interfaceName.equals("DATACollection")) {
-
- if (operationName.equals("getAll")) {
- return new DATAInvoker.GetAllInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("query")) {
- return new DATAInvoker.QueryInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("post")) {
- return new DATAInvoker.PostInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("get")) {
- return new DATAInvoker.GetInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("put")) {
- return new DATAInvoker.PutInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("delete")) {
- return new DATAInvoker.DeleteInvoker(operation, implementation.getConnectionInfo(), tableName);
- }
-
- } else if (interfaceName.equals("DATA")) {
-
- tableName = tableName.split("_")[0];
-
- if (operationName.equals("get")) {
- return new DATAInvoker.GetDATAInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("insert")) {
- return new DATAInvoker.InsertDATAInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("update")) {
- return new DATAInvoker.UpdateDATAInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("delete")) {
- return new DATAInvoker.DeleteDATAInvoker(operation, implementation.getConnectionInfo(), tableName);
- }
- }
-
- return new DATAInvoker(operation, implementation.getConnectionInfo(), tableName);
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- // System.out.println("Starting " + component.getName());
- }
-
- public void stop() {
- // System.out.println("Stopping " + component.getName());
- }
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProviderFactory.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProviderFactory.java
deleted file mode 100644
index e1af9ecd92..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProviderFactory.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.data.provider;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.data.DATAImplementation;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * Factory for DATA Implementation Provider
- *
- * @version $Rev$ $Date$
- */
-public class DATAImplementationProviderFactory implements ImplementationProviderFactory<DATAImplementation> {
-
- /**
- * Constructs a new DATA implementation.
- */
- public DATAImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component, DATAImplementation implementation) {
- return new DATAImplementationProvider(component, implementation);
- }
-
- public Class<DATAImplementation> getModelType() {
- return DATAImplementation.class;
- }
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAInvoker.java b/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAInvoker.java
deleted file mode 100644
index e74bf4d134..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAInvoker.java
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.data.provider;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-import org.apache.tuscany.sca.implementation.data.jdbc.JDBCHelper;
-import org.apache.tuscany.sca.implementation.data.jdbc.JDBCResultSetStreamReader;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * Implements a target invoker for DAS component implementations.
- *
- * The target invoker is responsible for dispatching invocations to the particular
- * component implementation logic. The current component implementation will
- * dispatch calls to the DAS APIs to retrieve the requested data from the back-end store
- *
- * @version $Rev$ $Date$
- */
-public class DATAInvoker implements Invoker {
-
- protected final Operation operation;
- protected final ConnectionInfo connectionInfo;
- protected final String table;
-
- public DATAInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- this.operation = operation;
- this.connectionInfo = connectionInfo;
- this.table = table;
- }
-
- public Message invoke(Message msg) {
- // Shouldn't get here, as the only supported operations
- // are the ones defined DATA interface and implemented
- // by specific invoker subclasses
-
- throw new UnsupportedOperationException(operation.getName());
- }
-
- /****************************************************************
- *
- * Internal invoker implementations for each supported operation
- *
- *****************************************************************/
- /**
- * GetAll operation invoker
- */
- public static class GetAllInvoker extends DATAInvoker {
-
- public GetAllInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
- return msg;
- }
- }
-
- /**
- * Query operation invoker
- */
- public static class QueryInvoker extends DATAInvoker {
-
- public QueryInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
- return msg;
- }
- }
-
- /**
- * Post operation invoker
- */
- public static class PostInvoker extends DATAInvoker {
-
- public PostInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- StringBuilder sqlInsert = new StringBuilder();
- XMLStreamReader insertStream = (XMLStreamReader) ((Object[]) msg.getBody())[1];
-
- if (insertStream == null) {
- throw new IllegalArgumentException("The XMLStreamReader \"insertStream\" must not be null");
- }
-
-
- Connection connection = null;
- PreparedStatement inStmt = null;
-
- List<String> colNames = new ArrayList<String>();
- List<String> values = new ArrayList<String>();
-
- int result = 0;
- try {
-
- connection = JDBCHelper.getConnection(connectionInfo);
-
- while (insertStream.hasNext()) {
-
- insertStream.next();
- if (insertStream.isStartElement()) {
- if (insertStream.getLocalName().equals("record")) {
- sqlInsert.append("INSERT INTO " + this.table + " (");
- } else if (insertStream.getLocalName().equals("column")) {
- colNames.add(insertStream.getAttributeValue(0));
- insertStream.next();
- if (insertStream.isCharacters()) {
- values.add(insertStream.getText());
- }
- }
- } else if (insertStream.isEndElement() && insertStream.getLocalName().equals("record")) {
- for (String c : colNames) {
- sqlInsert.append(" " + c + ",");
- }
-
- sqlInsert.deleteCharAt(sqlInsert.length() - 1);
- sqlInsert.append(" ) VALUES (");
-
- for (String v : values) {
- sqlInsert.append(" '" + v + "',");
- }
-
- sqlInsert.deleteCharAt(sqlInsert.length() - 1);
- sqlInsert.append(" )");
-
- inStmt = connection.prepareStatement(sqlInsert.toString());
-
- result += inStmt.executeUpdate();
-
- // Clean up resources
- inStmt.close();
- sqlInsert.delete(0, sqlInsert.length());
- values.clear();
- colNames.clear();
- }
- }
- } catch (XMLStreamException e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } catch (SQLException sqle) {
- sqle.printStackTrace();
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, inStmt, null);
- }
-
- msg.setBody(Integer.toString(result));
- return msg;
- }
- }
-
- /**
- * Get operation invoker
- */
- public static class GetInvoker extends DATAInvoker {
-
- public GetInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- // Get an entry
- String sqlQuery = null;
- String id = (String) ((Object[]) msg.getBody())[0];
-
- if (id == null) {
- sqlQuery = "SELECT * FROM " + this.table;
- } else {
- sqlQuery = "SELECT * FROM " + this.table + " WHERE ID = " + id;
- }
-
- Connection connection = null;
- PreparedStatement queryStatement = null;
- ResultSet resultSet = null;
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- queryStatement = connection.prepareStatement(sqlQuery);
- resultSet = queryStatement.executeQuery();
-
-
- } catch (SQLException sqle) {
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- JDBCHelper.cleanupResources(connection, queryStatement, resultSet);
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- JDBCHelper.cleanupResources(connection, queryStatement, resultSet);
- } finally {
- //default we leave the connection open to pass to the JDBCStreamReader
- }
-
- msg.setBody(new JDBCResultSetStreamReader(resultSet));
- return msg;
- }
- }
-
- /**
- * Put operation invoker
- */
- public static class PutInvoker extends DATAInvoker {
-
- public PutInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- XMLStreamReader updateStream = (XMLStreamReader) ((Object[]) msg.getBody())[1];
-
- if (updateStream == null) {
- throw new IllegalArgumentException("The XMLStreamReader \"updateStream\" must not be null");
- }
-
- Connection connection = null;
- PreparedStatement upStmt = null;
-
- String id = null;
- String columnName = null;
- String newValue = null;
- int result = 0;
-
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- while (updateStream.hasNext()) {
- updateStream.next();
-
- if (updateStream.isStartElement() && updateStream.getLocalName().equals("column")) {
- columnName = updateStream.getAttributeValue(0);
- updateStream.next();
- if (updateStream.isCharacters()) {
- if (columnName.equals("ID")) {
- id = updateStream.getText();
- } else {
- newValue = updateStream.getText();
-
- upStmt = connection.prepareStatement("UPDATE " + this.table + " SET " + columnName + " = '" + newValue + "' WHERE ID = " + id);
-
- result += upStmt.executeUpdate();
- upStmt.close();
- }
- }
- }
- }
- } catch (XMLStreamException e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } catch (SQLException sqle) {
- sqle.printStackTrace();
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, upStmt, null);
- }
-
- msg.setBody(result);
- return msg;
- }
- }
-
- /**
- * Delete operation invoker
- */
- public static class DeleteInvoker extends DATAInvoker {
-
- public DeleteInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- // Get an entry
- String sqlDelete = null;
- String id = (String) ((Object[]) msg.getBody())[0];
-
- if (id == null) {
- sqlDelete = "DELETE FROM " + this.table;
- } else {
- sqlDelete = "DELETE FROM " + this.table + " WHERE ID = " + id;
- }
-
- Connection connection = null;
- PreparedStatement deleteStatement = null;
- int result = -1;
-
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- deleteStatement = connection.prepareStatement(sqlDelete);
- result = deleteStatement.executeUpdate();
-
- } catch (SQLException sqle) {
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, deleteStatement, null);
- }
-
- msg.setBody(result);
- return msg;
- }
- }
- /**
- * Get operation invoker
- *
- * @version $Rev$ $Date$
- */
- public static class GetDATAInvoker extends DATAInvoker {
-
- public GetDATAInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- // Get an entry
- String sqlQuery = null;
- String id = (String) ((Object[]) msg.getBody())[0];
-
- if (id == null) {
- sqlQuery = "SELECT * FROM " + this.table;
- } else {
- sqlQuery = "SELECT * FROM " + this.table + " WHERE ID = " + id;
- }
-
- Connection connection = null;
- PreparedStatement queryStatement = null;
- ResultSet resultSet = null;
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- queryStatement = connection.prepareStatement(sqlQuery);
- resultSet = queryStatement.executeQuery();
-
-
- } catch (SQLException sqle) {
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- JDBCHelper.cleanupResources(connection, queryStatement, resultSet);
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- JDBCHelper.cleanupResources(connection, queryStatement, resultSet);
- } finally {
- //default we leave the connection open to pass to the JDBCStreamReader
- }
-
- msg.setBody(new JDBCResultSetStreamReader(resultSet));
- return msg;
- }
- }
-
- /**
- * Insert operation invoker
- */
- public static class InsertDATAInvoker extends DATAInvoker {
-
- public InsertDATAInvoker(Operation operation,
- ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) throws IllegalArgumentException {
- StringBuilder sqlInsert = new StringBuilder();
- XMLStreamReader insertStream = (XMLStreamReader) ((Object[]) msg.getBody())[0];
-
- if (insertStream == null) {
- throw new IllegalArgumentException("The XMLStreamReader \"insertStream\" must not be null");
- }
-
-
- Connection connection = null;
- PreparedStatement inStmt = null;
-
- List<String> colNames = new ArrayList<String>();
- List<String> values = new ArrayList<String>();
-
- int result = 0;
- try {
-
- connection = JDBCHelper.getConnection(connectionInfo);
-
- while (insertStream.hasNext()) {
-
- insertStream.next();
- if (insertStream.isStartElement()) {
- if (insertStream.getLocalName().equals("record")) {
- sqlInsert.append("INSERT INTO " + this.table + " (");
- } else if (insertStream.getLocalName().equals("column")) {
- colNames.add(insertStream.getAttributeValue(0));
- insertStream.next();
- if (insertStream.isCharacters()) {
- values.add(insertStream.getText());
- }
- }
- } else if (insertStream.isEndElement() && insertStream.getLocalName().equals("record")) {
- for (String c : colNames) {
- sqlInsert.append(" " + c + ",");
- }
-
- sqlInsert.deleteCharAt(sqlInsert.length() - 1);
- sqlInsert.append(" ) VALUES (");
-
- for (String v : values) {
- sqlInsert.append(" '" + v + "',");
- }
-
- sqlInsert.deleteCharAt(sqlInsert.length() - 1);
- sqlInsert.append(" )");
-
- inStmt = connection.prepareStatement(sqlInsert.toString());
- result += inStmt.executeUpdate();
-
- // Clean up resources
- inStmt.close();
- sqlInsert.delete(0, sqlInsert.length());
- values.clear();
- colNames.clear();
- }
- }
- } catch (XMLStreamException e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } catch (SQLException sqle) {
- sqle.printStackTrace();
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, inStmt, null);
- }
-
- msg.setBody(result);
- return msg;
- }
- }
-
- /**
- * Update operation invoker
- */
- public static class UpdateDATAInvoker extends DATAInvoker {
-
- public UpdateDATAInvoker(Operation operation,
- ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) throws IllegalArgumentException {
-
- XMLStreamReader updateStream = (XMLStreamReader) ((Object[]) msg.getBody())[0];
-
- if (updateStream == null) {
- throw new IllegalArgumentException("The XMLStreamReader \"updateStream\" must not be null");
- }
-
- Connection connection = null;
- PreparedStatement upStmt = null;
-
- String id = null;
- String columnName = null;
- String newValue = null;
- int result = 0;
-
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- while (updateStream.hasNext()) {
- updateStream.next();
-
- if (updateStream.isStartElement() && updateStream.getLocalName().equals("column")) {
- columnName = updateStream.getAttributeValue(0);
- updateStream.next();
- if (updateStream.isCharacters()) {
- if (columnName.equals("ID")) {
- id = updateStream.getText();
- } else {
- newValue = updateStream.getText();
-
- upStmt = connection.prepareStatement("UPDATE " + this.table + " SET " + columnName + " = '" + newValue + "' WHERE ID = " + id);
-
- result += upStmt.executeUpdate();
- upStmt.close();
- }
- }
- }
- }
- } catch (XMLStreamException e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } catch (SQLException sqle) {
- sqle.printStackTrace();
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, upStmt, null);
- }
-
- msg.setBody(result);
- return msg;
- }
- }
-
- /**
- * Delete operation invoker
- */
- public static class DeleteDATAInvoker extends DATAInvoker {
-
- public DeleteDATAInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- // Get an entry
- String sqlDelete = null;
- String id = (String) ((Object[]) msg.getBody())[0];
-
- if (id == null) {
- sqlDelete = "DELETE FROM " + this.table;
- } else {
- sqlDelete = "DELETE FROM " + this.table + " WHERE ID = " + id;
- }
-
- Connection connection = null;
- PreparedStatement deleteStatement = null;
- int result = -1;
-
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- deleteStatement = connection.prepareStatement(sqlDelete);
- result = deleteStatement.executeUpdate();
-
- } catch (SQLException sqle) {
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, deleteStatement, null);
- }
-
- msg.setBody(result);
- return msg;
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 5cd3334e3f..0000000000
--- a/branches/sca-android/modules/implementation-data-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.data.DATAImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.data.xml,model=org.apache.tuscany.sca.implementation.data.DATAImplementation
diff --git a/branches/sca-android/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-android/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index e20f1a6379..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/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.data.provider.DATAImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.data.DATAImplementation
diff --git a/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATACollectionTestCaseFIXME.java b/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATACollectionTestCaseFIXME.java
deleted file mode 100644
index 458025dd66..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATACollectionTestCaseFIXME.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.implementation.data;
-
-import java.io.FileInputStream;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-import junit.framework.TestCase;
-import org.apache.tuscany.sca.databinding.xml.XMLStreamReader2String;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.apache.tuscany.sca.implementation.data.DATACollection;
-
-public class DATACollectionTestCaseFIXME extends TestCase {
-
- private SCADomain scaDomain;
- private DATACollection dataService;
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("data.composite");
- dataService = scaDomain.getService(DATACollection.class, "DataComponent/COMPANY");
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- public void testInsert() throws Exception {
- System.out.println(">testInsert");
-
- //Read and process the XML file
- FileInputStream fileInputStream = new FileInputStream("src/test/resources/insert.xml");
- XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(fileInputStream);
-
- String result = dataService.post(null, reader);
- assertEquals(result, "2");
-
- System.out.println("Number of rows inserted: " + result);
-
- reader.close();
- }
-
- public void testGet() throws Exception {
-
- System.out.println(">testGet");
-
- XMLStreamReader reader = dataService.get(null);
- assertNotNull(reader);
- String xml = new XMLStreamReader2String().transform(reader, null);
- System.out.println(xml);
- reader.close();
- }
-
- public void testUpdate() throws Exception {
-
- System.out.println(">testUpdate");
-
- //Read and process the XML file
- FileInputStream fileInputStream = new FileInputStream("src/test/resources/update.xml");
- XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(fileInputStream);
-
- dataService.put(null,reader);
-
- reader.close();
- }
-
- public void testGetByID() throws Exception {
- System.out.println(">testGetByID");
-
- Integer companyID = new Integer(4);
-
- XMLStreamReader reader = dataService.get(companyID.toString());
- assertNotNull(reader);
- String xml = new XMLStreamReader2String().transform(reader, null);
- System.out.println(xml);
- reader.close();
- }
-
- public void testDeleteByID() throws Exception {
- System.out.println(">testDeleteByID");
-
- Integer companyID = new Integer(4);
- dataService.delete(companyID.toString());
- }
-
- public void testDelete() throws Exception {
- System.out.println(">testDelete");
-
- dataService.delete(null);
-
- System.out.println("recreating database...");
- //Helper.createDB();
- System.out.println("done!");
- }
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.java b/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.java
deleted file mode 100644
index dcf87d8c68..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.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.data;
-
-import java.io.StringReader;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.UtilityExtensionPoint;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-import org.apache.tuscany.sca.data.engine.config.ConnectionProperties;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-
-/**
- * @version $Rev: 538445 $ $Date: 2007-05-15 23:20:37 -0700 (Tue, 15 May 2007) $
- */
-public class DATAImplementationProcessorTestCase extends TestCase {
-
- protected static final QName IMPLEMENTATION_DATA = new QName(Constants.SCA10_TUSCANY_NS, "implementation.data.xml");
-
- private static final String COMPOSITE_USING_DATASOURCE =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">"
- + " <component name=\"DataComponent\">"
- + " <tuscany:implementation.data.xml>"
- + " <tuscany:connectionInfo datasource=\"dataSource\"/>"
- + " </tuscany:implementation.data.xml>"
- + " </component>"
- + "</composite>";
-
- private static final String COMPOSITE_USING_CONNECTION_PROPERTIES =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">"
- + " <component name=\"DataComponent\">"
- + " <tuscany:implementation.data.xml>"
- + " <tuscany:connectionInfo>"
- + " <tuscany:connectionProperties"
- + " driverClass=\"driverClass\""
- + " databaseURL=\"databaseURL\""
- + " loginTimeout=\"1\"/>"
- + " </tuscany:connectionInfo>"
- + " </tuscany:implementation.data.xml>"
- + " </component>"
- + "</composite>";
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private CompositeBuilder compositeBuilder;
-
- @Override
- protected void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
- IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, mapper, null);
- }
-
- public void testLoadCompositeUsingDatasource() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_DATASOURCE));
-
- Composite composite = (Composite)staxProcessor.read(reader);
- DATAImplementation implementation = (DATAImplementation)composite.getComponents().get(0).getImplementation();
- assertNotNull(implementation);
-
- ConnectionInfo connInfo = implementation.getConnectionInfo();
- assertNotNull(connInfo);
- assertEquals("dataSource", connInfo.getDataSource());
-
- ConnectionProperties connProperties = connInfo.getConnectionProperties();
- assertNull(connProperties);
- }
-
- public void testLoadCompositeUsingConnectionProperties() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_CONNECTION_PROPERTIES));
-
- Composite composite = (Composite)staxProcessor.read(reader);
- DATAImplementation implementation = (DATAImplementation)composite.getComponents().get(0).getImplementation();
- assertNotNull(implementation);
-
- ConnectionInfo connInfo = implementation.getConnectionInfo();
- assertNotNull(connInfo);
- assertNull("dataSource", connInfo.getDataSource());
-
- ConnectionProperties connProperties = connInfo.getConnectionProperties();
- assertNotNull(connProperties);
- assertEquals("driverClass",connProperties.getDriverClass());
- assertEquals("databaseURL",connProperties.getDatabaseURL());
- assertEquals(1,connProperties.getLoginTimeout().intValue());
- }
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATATestCase.java b/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATATestCase.java
deleted file mode 100644
index 4010cb63d3..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATATestCase.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.data;
-
-import java.io.FileInputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.xml.XMLStreamReader2String;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.apache.tuscany.sca.implementation.data.DATA;
-
-/**
- * Tests the DAS service
- *
- * @version $Rev$ $Date$
- */
-public class DATATestCase extends TestCase {
- private SCADomain scaDomain;
- private DATA dataService;
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("data.composite");
- dataService = scaDomain.getService(DATA.class, "DataComponent/COMPANY_DATA");
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- public void testInsert() throws Exception {
- System.out.println(">testInsert");
-
- //Read and process the XML file
- FileInputStream fileInputStream = new FileInputStream("src/test/resources/insert.xml");
- XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(fileInputStream);
-
- int result = dataService.insert(reader);
- assertEquals(result,2);
-
- System.out.println("Number of rows inserted: "+result);
-
- reader.close();
- }
-
- public void testGet() throws Exception {
-
- System.out.println(">testGet");
-
- XMLStreamReader reader = dataService.get(null);
- assertNotNull(reader);
- String xml = new XMLStreamReader2String().transform(reader, null);
- System.out.println(xml);
- reader.close();
- }
-
- public void testUpdate() throws Exception {
-
- System.out.println(">testUpdate");
-
- //Read and process the XML file
- FileInputStream fileInputStream = new FileInputStream("src/test/resources/update.xml");
- XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(fileInputStream);
-
- int result = dataService.update(reader);
- assertEquals(result,1);
- System.out.println("Number of rows affected: "+result);
-
- reader.close();
- }
-
- public void testGetByID() throws Exception {
- System.out.println(">testGetByID");
-
- Integer companyID = new Integer(4);
-
- XMLStreamReader reader = dataService.get(companyID.toString());
- assertNotNull(reader);
- String xml = new XMLStreamReader2String().transform(reader, null);
- System.out.println(xml);
- reader.close();
- }
-
- public void testDeleteByID() throws Exception {
- System.out.println(">testDeleteByID");
-
- Integer companyID = new Integer(4);
- int result = dataService.delete(companyID.toString());
- assertEquals(result,1);
- System.out.println("Number of rows deleted: "+result);
- }
-
- public void testDelete() throws Exception {
- System.out.println(">testDelete");
-
- int result = dataService.delete(null);
- assertEquals(result,4);
- System.out.println("Number of rows deleted: "+result);
-
- System.out.println("recreating database...");
- //Helper.createDB();
- System.out.println("done!");
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeed.java b/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeed.java
deleted file mode 100644
index 7f0707c0bc..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeed.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.data.companyFeed;
-
-import org.apache.tuscany.sca.data.collection.Collection;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.apache.tuscany.sca.implementation.data.DATA;
-import org.osoa.sca.annotations.Reference;
-
-import commonj.sdo.DataObject;
-
-public class CompanyFeed implements Collection<String, DataObject> {
-
- @Reference
- protected DATA dataService;
-
- public Entry<String, DataObject>[] getAll() {
- return null;
- }
-
- public DataObject get(String id) throws NotFoundException{
-
- DataObject data = null;//dataService.get(id);
- if(data == null) {
- throw new NotFoundException();
- } else {
- return data;
- }
- }
-
- public void delete(String id) throws NotFoundException {
- }
-
- public String post(String key, DataObject item) {
- return null;
- }
-
- public void put(String key, DataObject item) throws NotFoundException {
- }
-
- public Entry<String, DataObject>[] query(String queryString) {
- return null;
- }
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeedTestCaseFIXME.java b/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeedTestCaseFIXME.java
deleted file mode 100644
index b72ff89e3b..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeedTestCaseFIXME.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.data.companyFeed;
-
-import java.io.IOException;
-import java.net.Socket;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * @version $Rev: 543175 $ $Date: 2007-05-31 09:09:12 -0700 (Thu, 31 May 2007) $
- */
-public class CompanyFeedTestCaseFIXME extends TestCase {
- private SCADomain scaDomain;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- scaDomain = SCADomain.newInstance("data-feed.composite");
- //System.in.read();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- scaDomain.close();
- }
-
- public void testPing() throws IOException {
- new Socket("127.0.0.1", 8085);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-data-xml/src/test/resources/data-feed.composite b/branches/sca-android/modules/implementation-data-xml/src/test/resources/data-feed.composite
deleted file mode 100644
index 40c755b134..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/test/resources/data-feed.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://data"
- name="data-feed">
-
-
- <service name="CompanyFeed" promote="CompanyFeedComponent">
- <tuscany:binding.atom uri="http://localhost:8085/comnpanyfeed/*"/>
- </service>
-
- <component name="CompanyFeedComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.data.companyFeed.CompanyFeed"/>
- <reference name="dataService" target="CompanyDataComponent"/>
- </component>
-
- <!-- service name="CompanyDataServiceComponent" promote="CompanyDataComponent">
- <binding.atom uri="http://localhost:8085/comnpanyfeed/"/>
- </service -->
-
- <component name="CompanyDataComponent">
- <tuscany:implementation.data.xml table="company">
- <tuscany:connectionInfo>
- <tuscany:connectionProperties
- driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- databaseURL="jdbc:derby:target/test-classes/company; create = true"
- loginTimeout="600000"/>
- </tuscany:connectionInfo>
- </tuscany:implementation.data.xml>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-data-xml/src/test/resources/data.composite b/branches/sca-android/modules/implementation-data-xml/src/test/resources/data.composite
deleted file mode 100644
index f30b15e34c..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/test/resources/data.composite
+++ /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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://data"
- name="data">
-
- <component name="DataComponent">
- <tuscany:implementation.data.xml>
- <tuscany:connectionInfo>
- <tuscany:connectionProperties
- driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- databaseURL="jdbc:derby:target/test-classes/company; create = true"
- loginTimeout="600000"/>
- </tuscany:connectionInfo>
- </tuscany:implementation.data.xml>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-data-xml/src/test/resources/insert.xml b/branches/sca-android/modules/implementation-data-xml/src/test/resources/insert.xml
deleted file mode 100644
index c0a5ada4bf..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/test/resources/insert.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resultSet>
- <record>
- <column name="NAME">New Coorporation I</column>
- </record>
- <record>
- <column name="NAME">New Coorporation II</column>
- </record>
-</resultSet>
diff --git a/branches/sca-android/modules/implementation-data-xml/src/test/resources/update.xml b/branches/sca-android/modules/implementation-data-xml/src/test/resources/update.xml
deleted file mode 100644
index c6cef75274..0000000000
--- a/branches/sca-android/modules/implementation-data-xml/src/test/resources/update.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<result_set>
- <record>
- <column name="ID">4</column>
- <column name="NAME">Update Coorporation</column>
- </record>
-</result_set>
diff --git a/branches/sca-android/modules/implementation-ejb/LICENSE b/branches/sca-android/modules/implementation-ejb/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/implementation-ejb/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/implementation-ejb/META-INF/README b/branches/sca-android/modules/implementation-ejb/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-ejb/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-ejb/NOTICE b/branches/sca-android/modules/implementation-ejb/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/implementation-ejb/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/branches/sca-android/modules/implementation-ejb/pom.xml b/branches/sca-android/modules/implementation-ejb/pom.xml
deleted file mode 100644
index ef77f2df2b..0000000000
--- a/branches/sca-android/modules/implementation-ejb/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-ejb</artifactId>
- <name>Apache Tuscany SCA EJB Session Bean Implementation Model</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.implementation.ejb</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.ejb*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/EJBImplementation.java b/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/EJBImplementation.java
deleted file mode 100644
index 0d3b05f0c9..0000000000
--- a/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/EJBImplementation.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.ejb;
-
-import org.apache.tuscany.sca.assembly.Implementation;
-
-
-
-/**
- * The model representing an EJB implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public interface EJBImplementation extends Implementation {
-
- /**
- * Returns the EJB link URI.
- * @return the EJB link URI
- */
- String getEJBLink();
-
- /**
- * Sets the EJB link URI.
- * @param ejbLink the EJB link URI
- */
- void setEJBLink(String ejbLink);
-
-}
diff --git a/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/EJBImplementationFactory.java b/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/EJBImplementationFactory.java
deleted file mode 100644
index bf9e13069b..0000000000
--- a/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/EJBImplementationFactory.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.ejb;
-
-
-/**
- * Factory for the EJB implementation model.
- *
- * @version $Rev$ $Date$
- */
-public interface EJBImplementationFactory {
-
- /**
- * Creates a new EJB implementation.
- * @return a new EJB implementation
- */
- EJBImplementation createEJBImplementation();
-
-}
diff --git a/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationFactoryImpl.java b/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationFactoryImpl.java
deleted file mode 100644
index 050d0cf17a..0000000000
--- a/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationFactoryImpl.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.ejb.impl;
-
-import org.apache.tuscany.sca.implementation.ejb.EJBImplementation;
-import org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory;
-
-/**
- * Factory for the EJB implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class EJBImplementationFactoryImpl implements EJBImplementationFactory {
-
- public EJBImplementationFactoryImpl() {
- }
-
- public EJBImplementation createEJBImplementation() {
- return new EJBImplementationImpl();
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java b/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java
deleted file mode 100644
index bf2e6354d5..0000000000
--- a/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.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.implementation.ejb.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.implementation.ejb.EJBImplementation;
-
-
-/**
- * The model representing an EJB implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-class EJBImplementationImpl implements EJBImplementation {
-
- private List<Property> properties = new ArrayList<Property>();
- private List<Service> services = new ArrayList<Service>();
- private List<Reference> references = new ArrayList<Reference>();
- private String ejbLink;
- private String uri;
- private boolean unresolved;
-
- /**
- * Constructs a new EJB implementation.
- */
- EJBImplementationImpl() {
- }
-
- public ConstrainingType getConstrainingType() {
- // The EJB implementation does not support constrainingTypes
- return null;
- }
-
- public List<Property> getProperties() {
- return properties;
- }
-
- public List<Service> getServices() {
- return services;
- }
-
- public List<Reference> getReferences() {
- return references;
- }
-
- public String getEJBLink() {
- return ejbLink;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- // The EJB implementation does not support constrainingTypes
- }
-
- public void setEJBLink(String ejbLink) {
- this.ejbLink = ejbLink;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-}
diff --git a/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java b/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
deleted file mode 100644
index b3e5e3394c..0000000000
--- a/branches/sca-android/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.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.ejb.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.implementation.ejb.EJBImplementation;
-import org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-
-/**
- * Implements a StAX artifact processor for EJB implementations.
- *
- * @version $Rev$ $Date$
- */
-public class EJBImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<EJBImplementation> {
- private static final QName IMPLEMENTATION_EJB = new QName(Constants.SCA10_NS, "implementation.ejb");
-
- private AssemblyFactory assemblyFactory;
- private EJBImplementationFactory implementationFactory;
- private Monitor monitor;
-
- public EJBImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.implementationFactory = modelFactories.getFactory(EJBImplementationFactory.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 = new ProblemImpl(this.getClass().getName(), "impl-ejb-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- // Returns the QName of the XML element processed by this processor
- return IMPLEMENTATION_EJB;
- }
-
- public Class<EJBImplementation> getModelType() {
- // Returns the type of model processed by this processor
- return EJBImplementation.class;
- }
-
- public EJBImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Read an <implementation.ejb> element
- EJBImplementation implementation = implementationFactory.createEJBImplementation();
- implementation.setUnresolved(true);
-
- // Read the ejb-link attribute
- String ejbLink = getString(reader, "ejb-link");
- if (ejbLink != null) {
- implementation.setEJBLink(ejbLink);
-
- // Set the URI of the component type
- //implementation.setURI(ejbLink.replace('#', '/'));
- int hashPosition = ejbLink.indexOf('#');
- if (hashPosition >= 0) {
- implementation.setURI(ejbLink.substring(hashPosition + 1));
- } else {
- implementation.setURI(ejbLink);
- }
- } else {
- error("EJBLinkAttributeMissing", reader);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && IMPLEMENTATION_EJB.equals(reader.getName())) {
- break;
- }
- }
-
- return implementation;
- }
-
- public void resolve(EJBImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve the component type
- String uri = implementation.getURI();
- if (uri != null) {
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setURI(uri + ".componentType");
- componentType = resolver.resolveModel(ComponentType.class, componentType);
- if (!componentType.isUnresolved()) {
-
- // Initialize the implementation's services, references and properties
- implementation.getServices().addAll(componentType.getServices());
- implementation.getReferences().addAll(componentType.getReferences());
- implementation.getProperties().addAll(componentType.getProperties());
- }
- }
- implementation.setUnresolved(false);
- }
-
- public void write(EJBImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <implementation.ejb>
- writeStart(writer, IMPLEMENTATION_EJB.getNamespaceURI(), IMPLEMENTATION_EJB.getLocalPart(),
- new XAttr("ejb-link", implementation.getEJBLink()));
-
- writeEnd(writer);
- }
-}
diff --git a/branches/sca-android/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index ae6db609a2..0000000000
--- a/branches/sca-android/modules/implementation-ejb/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.ejb.xml.EJBImplementationProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#implementation.ejb,model=org.apache.tuscany.sca.implementation.ejb.EJBImplementation,factory=org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory
diff --git a/branches/sca-android/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory b/branches/sca-android/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory
deleted file mode 100644
index fb828707a6..0000000000
--- a/branches/sca-android/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory
+++ /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.ejb.impl.EJBImplementationFactoryImpl
diff --git a/branches/sca-android/modules/implementation-ejb/src/main/resources/impl-ejb-validation-messages.properties b/branches/sca-android/modules/implementation-ejb/src/main/resources/impl-ejb-validation-messages.properties
deleted file mode 100644
index 4eaf2b9007..0000000000
--- a/branches/sca-android/modules/implementation-ejb/src/main/resources/impl-ejb-validation-messages.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.
-#
-#
-EJBLinkAttributeMissing = Reading implementation.ejb - ejb-link attribute missing \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java b/branches/sca-android/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java
deleted file mode 100644
index b692ab3f5a..0000000000
--- a/branches/sca-android/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.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.ejb.xml;
-
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-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.impl.CompositeBuilderImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.UtilityExtensionPoint;
-import org.apache.tuscany.sca.implementation.ejb.EJBImplementation;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-
-/**
- * Test reading Node implementations.
- *
- * @version $Rev$ $Date$
- */
-public class ReadTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private CompositeBuilder compositeBuilder;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
- IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, mapper, null);
- }
-
- public void testReadComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestEJB.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite) staxProcessor.read(reader);
- assertNotNull(composite);
-
- compositeBuilder.build(composite);
-
- assertTrue(((EJBImplementation) composite.getComponents().get(0).getImplementation()).getEJBLink().equals("module.jar#TestEJB"));
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java b/branches/sca-android/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java
deleted file mode 100644
index 8ba43dd635..0000000000
--- a/branches/sca-android/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/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.ejb.xml;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-
-/**
- * Test reading/write WSDL interfaces.
- *
- * @version $Rev$ $Date$
- */
-public class WriteTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- }
-
- public void testReadWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestEJB.composite");
- Composite composite = (Composite) staxProcessor.read(inputFactory.createXMLStreamReader(is));
- assertNotNull(composite);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
-
- assertTrue(bos.toString().contains("module.jar#TestEJB"));
-
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-ejb/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.composite b/branches/sca-android/modules/implementation-ejb/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.composite
deleted file mode 100644
index 0c1368c4dd..0000000000
--- a/branches/sca-android/modules/implementation-ejb/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.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"
- targetNamespace="http://sample/ejb"
- xmlns:sc="http://sample/composite"
- name="TestEJB">
-
- <component name="TestEJB">
- <implementation.ejb ejb-link="module.jar#TestEJB"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-osgi/LICENSE b/branches/sca-android/modules/implementation-osgi/LICENSE
deleted file mode 100644
index 6b0b1270ff..0000000000
--- a/branches/sca-android/modules/implementation-osgi/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
diff --git a/branches/sca-android/modules/implementation-osgi/META-INF/README b/branches/sca-android/modules/implementation-osgi/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-osgi/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-osgi/NOTICE b/branches/sca-android/modules/implementation-osgi/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/implementation-osgi/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/branches/sca-android/modules/implementation-osgi/pom.xml b/branches/sca-android/modules/implementation-osgi/pom.xml
deleted file mode 100644
index 55e61fda93..0000000000
--- a/branches/sca-android/modules/implementation-osgi/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-osgi</artifactId>
- <name>Apache Tuscany SCA OSGi Implementation Extension</name>
-
- <packaging>jar</packaging>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.main</artifactId>
- <version>1.0.4</version>
- </dependency>
-
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-osgi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-osgi-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>1.4-SNAPSHOT</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.implementation.osgi</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.osgi*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/OSGiImplementation.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/OSGiImplementation.java
deleted file mode 100644
index 7bcb0a1da5..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/OSGiImplementation.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.osgi;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.Extensible;
-import org.apache.tuscany.sca.assembly.Implementation;
-
-/**
- *
- * The model representing an OSGi implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public interface OSGiImplementation extends Implementation, Extensible {
-
- String getBundleSymbolicName();
-
- String getBundleVersion();
-
- String[] getImports();
-
- List<ComponentProperty> getReferenceProperties(String referenceName);
-
- List<ComponentProperty> getServiceProperties(String serviceName);
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiAnnotations.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiAnnotations.java
deleted file mode 100644
index 33c790585c..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiAnnotations.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.implementation.osgi.context;
-
-
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Hashtable;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.context.RequestContextFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.scope.Scope;
-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.impl.JavaScopeImpl;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.AllowsPassByReferenceProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.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.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.ServiceProcessor;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.osgi.framework.Bundle;
-
-
-/**
- * OSGi annotation processing
- * OSGi bundles are not introspected by OSGiImplementation when a component is created.
- * Instead if the list of implementation classes is specified in <implementation.osgi/>,
- * the classes are introspected when the bundle is resolved. The classes are loaded using
- * the bundle ClassLoader, and hence the delay in annotation processing is inevitable.
- * There is one other difference compared to implementation.java. While instances (and
- * the instance class) are associated with a component in Java, all Java annotations from
- * the component implementation class apply to all the component instances. In OSGi,
- * instances are associated with services, and a bundle can register multiple services.
- * Hence annotations from classes need to be stored separately so that the right ones
- * can be associated with the service instance.
- *
- * @version $Rev$ $Date$
- */
-public class OSGiAnnotations {
-
- private Scope scope = Scope.COMPOSITE;
- private boolean isEagerInit;
-
- private String[] classList;
-
- private Bundle[] bundles;
-
- private RuntimeComponent runtimeComponent;
- private JavaPropertyValueObjectFactory propertyValueFactory;
- private ProxyFactory proxyFactory;
-
- private JavaImplementationFactory javaImplementationFactory;
- private JavaInterfaceFactory javaInterfaceFactory;
- private PolicyFactory policyFactory;
- private RequestContextFactory requestContextFactory;
-
- private Hashtable<Class<?>, JavaImplementation> javaAnnotationInfo =
- new Hashtable<Class<?>, JavaImplementation>();
- private Hashtable<JavaImplementation, OSGiPropertyInjector> propertyInjectors =
- new Hashtable<JavaImplementation, OSGiPropertyInjector>();
-
- private long maxAge = -1;
- private long maxIdleTime = -1;
-
- private boolean annotationsProcessed;
-
-
-
- public OSGiAnnotations(ModelFactoryExtensionPoint modelFactories,
- String[] classList,
- RuntimeComponent runtimeComponent,
- JavaPropertyValueObjectFactory propertyValueFactory,
- ProxyFactory proxyFactory,
- RequestContextFactory requestContextFactory,
- Bundle mainBundle,
- ArrayList<Bundle> dependentBundles) {
-
-
- this.classList = classList;
- this.runtimeComponent = runtimeComponent;
- this.propertyValueFactory = propertyValueFactory;
- this.proxyFactory = proxyFactory;
-
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.javaInterfaceFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- this.javaImplementationFactory = createJavaImplementationFactory(assemblyFactory);
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
-
- bundles = new Bundle[dependentBundles.size() + 1];
- bundles[0] = mainBundle;
- for (int i = 0; i < dependentBundles.size(); i++)
- bundles[i + 1] = dependentBundles.get(i);
-
- }
-
-
- public void processAnnotations() throws IntrospectionException {
-
- if (annotationsProcessed)
- return;
- annotationsProcessed = true;
- for (String className : classList) {
- for (Bundle bundle : bundles) {
- try {
- Class<?> clazz = bundle.loadClass(className);
-
- processAnnotations(clazz);
-
- break;
-
- } catch (ClassNotFoundException e) {
- }
- }
- }
- }
-
-
- public void injectProperties(Object instance) {
- JavaImplementation javaImpl = getAnnotationInfo(instance);
- if (javaImpl != null) {
- OSGiPropertyInjector injector = propertyInjectors.get(javaImpl);
- if (injector != null)
- injector.injectProperties(instance);
- }
- }
-
-
- public Scope getScope() {
- return scope;
- }
-
-
-
- public boolean isAllowsPassByReference(Object instance, Method method) {
-
- JavaImplementation javaImpl = getAnnotationInfo(instance);
- if (javaImpl == null) {
- return false;
- }
- if (javaImpl.isAllowsPassByReference()) {
- return true;
- }
- return javaImpl.isAllowsPassByReference(method);
- }
-
-
- public boolean isEagerInit() {
- return isEagerInit;
- }
-
- public long getMaxAge() {
- return maxAge;
- }
-
- public long getMaxIdleTime() {
- return maxIdleTime;
- }
-
- public Method getInitMethod(Object instance) {
- JavaImplementation javaImpl = getAnnotationInfo(instance);
- return javaImpl == null? null : javaImpl.getInitMethod();
- }
-
-
- public Method getDestroyMethod(Object instance) {
- JavaImplementation javaImpl = getAnnotationInfo(instance);
- return javaImpl == null? null : javaImpl.getDestroyMethod();
- }
-
-
- /*
- * Get the annotation corresponding to an instance
- *
- */
- private JavaImplementation getAnnotationInfo(final Object instance) {
-
- // The simplest case where the implementation class was listed under the
- // classes attribute of <implementation.osgi/>, or this is the second call
- // to this method for the implementation class.
- // Allow privileged access to get classloader. Requires getClassLoader in security policy.
- JavaImplementation javaImpl = AccessController.doPrivileged(new PrivilegedAction<JavaImplementation>() {
- public JavaImplementation run() {
- return javaAnnotationInfo.get(instance.getClass());
- }
- });
- if (javaImpl != null)
- return javaImpl;
-
- // Process annotations from the instance class.
- try {
- return processAnnotations(instance.getClass());
- } catch (IntrospectionException e) {
- // e.printStackTrace();
- }
-
- return null;
- }
-
-
- private JavaImplementation processAnnotations(Class<?> clazz)
- throws IntrospectionException {
-
- JavaImplementation javaImpl = javaImplementationFactory.createJavaImplementation(clazz);
-
- javaAnnotationInfo.put(clazz, javaImpl);
-
- OSGiPropertyInjector propertyInjector = new OSGiPropertyInjector(
- javaImpl, runtimeComponent, propertyValueFactory, proxyFactory, requestContextFactory);
-
- propertyInjectors.put(javaImpl, propertyInjector);
-
- if (javaImpl.isEagerInit())
- isEagerInit = true;
- if (javaImpl.getMaxAge() != -1)
- maxAge = javaImpl.getMaxAge();
- if (javaImpl.getMaxIdleTime() != -1)
- maxIdleTime = javaImpl.getMaxIdleTime();
- if (javaImpl.getJavaScope() != JavaScopeImpl.COMPOSITE)
- scope = new Scope(javaImpl.getJavaScope().getScope());
-
- return javaImpl;
- }
-
-
-
-
- private JavaImplementationFactory createJavaImplementationFactory(AssemblyFactory assemblyFactory) {
- JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- // Create the list of class visitors
- BaseJavaClassVisitor[] extensions =
- new BaseJavaClassVisitor[] {
- new ConstructorProcessor(assemblyFactory),
- new AllowsPassByReferenceProcessor(assemblyFactory),
- new ComponentNameProcessor(assemblyFactory),
- new ContextProcessor(assemblyFactory),
- new ConversationProcessor(assemblyFactory),
- new DestroyProcessor(assemblyFactory),
- new EagerInitProcessor(assemblyFactory),
- new InitProcessor(assemblyFactory),
- new PropertyProcessor(assemblyFactory),
- new ReferenceProcessor(assemblyFactory, javaInterfaceFactory),
- new ResourceProcessor(assemblyFactory),
- new OSGiScopeProcessor(assemblyFactory),
- new ServiceProcessor(assemblyFactory, javaInterfaceFactory),
- new HeuristicPojoProcessor(assemblyFactory, javaInterfaceFactory),
- new PolicyProcessor(assemblyFactory, policyFactory)};
- for (JavaClassVisitor extension : extensions) {
- javaImplementationFactory.addClassVisitor(extension);
- }
-
- return javaImplementationFactory;
- }
-
- private class OSGiScopeProcessor extends BaseJavaClassVisitor {
-
- public OSGiScopeProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public <T> void visitClass(Class<T> clazz,
- JavaImplementation type)
- throws IntrospectionException {
- org.osoa.sca.annotations.Scope annotation = clazz.getAnnotation(org.osoa.sca.annotations.Scope.class);
- if (annotation == null) {
- type.setJavaScope(JavaScopeImpl.COMPOSITE);
- 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/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiPropertyInjector.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiPropertyInjector.java
deleted file mode 100644
index 0264f0b102..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiPropertyInjector.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.implementation.osgi.context;
-
-
-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.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.context.RequestContextFactory;
-import org.apache.tuscany.sca.core.context.RequestContextImpl;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl;
-import org.apache.tuscany.sca.implementation.java.injection.ArrayMultiplicityObjectFactory;
-import org.apache.tuscany.sca.implementation.java.injection.ConversationIDObjectFactory;
-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.JavaPropertyValueObjectFactory;
-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.injection.ResourceObjectFactory;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.JavaIntrospectionHelper;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.osoa.sca.ComponentContext;
-import org.osoa.sca.RequestContext;
-import org.osoa.sca.annotations.ConversationID;
-
-
-/**
- * OSGi property injection support
- *
- * @version $Rev$ $Date$
- */
-public class OSGiPropertyInjector {
-
-
- private ArrayList<JavaElementImpl> injectionSites = new ArrayList<JavaElementImpl>();
- private Hashtable<JavaElementImpl, ObjectFactory> factories =
- new Hashtable<JavaElementImpl, ObjectFactory>();
-
- private Injector[] injectors;
-
- public OSGiPropertyInjector(
- JavaImplementation javaImpl,
- RuntimeComponent component,
- JavaPropertyValueObjectFactory propertyValueFactory,
- ProxyFactory proxyFactory,
- RequestContextFactory requestContextFactory) throws IntrospectionException {
-
- createInjectionSites(javaImpl, component, propertyValueFactory, proxyFactory, requestContextFactory);
-
- injectors = createInjectors();
-
- }
-
-
- @SuppressWarnings("unchecked")
- public void injectProperties(Object instance) {
-
- for (Injector injector : injectors) {
- injector.inject(instance);
- }
-
- }
-
-
- @SuppressWarnings("unchecked")
- private void createInjectionSites(
- JavaImplementation javaImpl,
- RuntimeComponent component,
- JavaPropertyValueObjectFactory propertyValueFactory,
- ProxyFactory proxyFactory,
- RequestContextFactory requestContextFactory)
- {
-
- List<ComponentProperty> componentProperties = component.getProperties();
- Map<String, JavaElementImpl> propertyMembers = javaImpl.getPropertyMembers();
-
- for (ComponentProperty prop : componentProperties) {
- JavaElementImpl element = propertyMembers.get(prop.getName());
-
- if (element != null && !(element.getAnchor() instanceof Constructor) && prop.getValue() != null) {
- Class propertyJavaType = JavaIntrospectionHelper.getBaseType(element.getType(), element.getGenericType());
- ObjectFactory objFactory = propertyValueFactory.createValueFactory(prop, prop.getValue(), propertyJavaType);
-
- factories.put(element, objFactory);
- injectionSites.add(element);
- }
- }
-
- for (Member member : javaImpl.getConversationIDMembers()) {
- ObjectFactory<String> factory = new ConversationIDObjectFactory();
- if (member instanceof Field) {
- JavaElementImpl element = new JavaElementImpl((Field) member);
- element.setClassifer(ConversationID.class);
- injectionSites.add(element);
- factories.put(element, factory);
- } else if (member instanceof Method) {
- JavaElementImpl element = new JavaElementImpl((Method) member, 0);
- element.setName(JavaIntrospectionHelper.toPropertyName(member.getName()));
- element.setClassifer(ConversationID.class);
- injectionSites.add(element);
- factories.put(element, factory);
- } else {
- throw new InvalidAccessorException(
- "Member must be a field or method: " + member.getName());
- }
-
- }
-
- if (!javaImpl.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 : javaImpl.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()) {
- ObjectFactory<?> factory = new CallbackWireObjectFactory(element.getType(), proxyFactory, wires);
- if (!(element.getAnchor() instanceof Constructor)) {
- injectionSites.add(element);
- }
- factories.put(element, factory);
- }
- }
- }
-
- for (JavaResourceImpl resource : javaImpl.getResources().values()) {
-
- ObjectFactory<?> objectFactory;
- Class<?> type = resource.getElement().getType();
- if (ComponentContext.class.equals(type)) {
- objectFactory = new ComponentContextFactory(component);
-
- } else if (RequestContext.class.equals(type)) {
- objectFactory = new RequestContextObjectFactory(requestContextFactory, proxyFactory);
-
- } else {
- boolean optional = resource.isOptional();
- String mappedName = resource.getMappedName();
- objectFactory = new ResourceObjectFactory(type, mappedName, optional, null);
- }
- factories.put(resource.getElement(), objectFactory);
- if (!(resource.getElement().getAnchor() instanceof Constructor)) {
- injectionSites.add(resource.getElement());
- }
- }
-
-
- }
-
-
- @SuppressWarnings("unchecked")
- private Injector[] createInjectors() {
-
- Injector[] injectors = (Injector[])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((Field)member, factory);
- } else if (element.getElementType() == ElementType.PARAMETER && member instanceof Method) {
- injectors[i++] = new MethodInjector((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;
- }
-
- @SuppressWarnings("unchecked")
- protected Injector 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(field, new ArrayMultiplicityObjectFactory(interfaceType, factories));
- } else {
- return new FieldInjector(field, new ListMultiplicityObjectFactory(factories));
- }
- } else if (element.getAnchor() instanceof Method) {
- Method method = (Method)element.getAnchor();
- if (method.getParameterTypes()[0].isArray()) {
- return new MethodInjector(method, new ArrayMultiplicityObjectFactory(interfaceType, factories));
- } else {
- return new MethodInjector(method, new ListMultiplicityObjectFactory(factories));
- }
- } else {
- throw new InvalidAccessorException("Member must be a field or method: " + element.getName());
- }
- }
-
- private static class ComponentContextFactory implements ObjectFactory {
-
- RuntimeComponent component;
-
- private ComponentContextFactory(RuntimeComponent component) {
- this.component = component;
- }
-
- public Object getInstance() throws ObjectCreationException {
- return component.getComponentContext();
- }
-
- }
-
-
- private static class RequestContextObjectFactory implements ObjectFactory {
-
- private RequestContextFactory factory;
- private ProxyFactory proxyFactory;
-
- public RequestContextObjectFactory(RequestContextFactory factory) {
- this(factory, null);
- }
-
- public RequestContextObjectFactory(RequestContextFactory factory, ProxyFactory proxyFactory) {
- this.factory = factory;
- this.proxyFactory = proxyFactory;
- }
-
- public RequestContext getInstance() throws ObjectCreationException {
- if (factory != null) {
- return factory.createRequestContext();
- } else {
- return new RequestContextImpl(proxyFactory);
- }
- }
-
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiPropertyValueObjectFactory.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiPropertyValueObjectFactory.java
deleted file mode 100644
index 38befa611b..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/context/OSGiPropertyValueObjectFactory.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.osgi.context;
-
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-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.Mediator;
-import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-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.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;
-
-/**
- *
- * Process properties and create property values.
- *
- * This code has been copied from the Java implementation to avoid dependencies on the Java implementation.
- *
- * @version $Rev$ $Date$
- */
-public class OSGiPropertyValueObjectFactory {
- protected SimpleTypeMapper simpleTypeMapper = new SimpleTypeMapperImpl();
- boolean isSimpleType;
-
-
- public OSGiPropertyValueObjectFactory() {
- }
-
- public OSGiPropertyValueObjectFactory(Mediator mediator) {
- }
-
- public ObjectFactory createValueFactory(Property property, Object propertyValue) {
-
- Class javaType = SimpleTypeMapperImpl.getJavaType(property.getXSDType());
- 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 {
- Object value = getComplexPropertyValues(doc).get(0);
- return new ObjectFactoryImpl(property,
- value,
- isSimpleType,
- javaType);
- }
-
- }
- }
-
- private 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() == Node.TEXT_NODE) {
- return true;
- }
- }
- }
- return false;
- }
-
- private 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;
- }
-
- private List<Node> getComplexPropertyValues(Document document) {
- Element rootElement = document.getDocumentElement();
- List<Node> propValues = new ArrayList<Node>();
- for (int count = 0 ; count < rootElement.getChildNodes().getLength() ; ++count) {
- if (rootElement.getChildNodes().item(count).getNodeType() == Node.ELEMENT_NODE) {
- propValues.add(rootElement.getChildNodes().item(count));
- }
- }
- return propValues;
- }
-
- public 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);
- }
- }
- }
-
- public class ObjectFactoryImpl extends ObjectFactoryImplBase {
- public ObjectFactoryImpl(Property property, Object propertyValue, boolean isSimpleType, Class javaType) {
- super(property, propertyValue, isSimpleType, javaType);
- }
-
- @SuppressWarnings("unchecked")
- public Object getInstance() throws ObjectCreationException {
- if (isSimpleType) {
- return simpleTypeMapper.toJavaObject(property.getXSDType(), (String)propertyValue, null);
- } else {
- return null;
- }
- }
- }
-
- public 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) {
- values.add(simpleTypeMapper.toJavaObject(property.getXSDType(), aValue, null));
- }
- return values;
- } else {
- List instances = new ArrayList();
- for (Node aValue : (List<Node>)propertyValue) {
- instances.add(aValue);
- }
- return instances;
- }
- }
- }
-}
-
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationImpl.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationImpl.java
deleted file mode 100644
index fe3efd22cd..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationImpl.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.implementation.osgi.impl;
-
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.implementation.osgi.OSGiImplementation;
-
-
-/**
- * OSGi implementation
- * All attributes from <implementation.osgi> have getters in this class
- * This class implements OSGiImplementationInterface which is associated with OSGiImplementationProvider.
- *
- * @version $Rev$ $Date$
- */
-public class OSGiImplementationImpl extends ImplementationImpl implements OSGiImplementation {
-
- private String bundleSymbolicName;
- private String bundleVersion;
-
- private String[] imports;
- private Hashtable<String, List<ComponentProperty>> referenceProperties;
- private Hashtable<String, List<ComponentProperty>> serviceProperties;
-
- private Hashtable<String, List<ComponentProperty>> referenceCallbackProperties;
- private Hashtable<String, List<ComponentProperty>> serviceCallbackProperties;
-
- private String[] classList;
-
- private ModelFactoryExtensionPoint modelFactories;
-
- private Object osgiBundle;
-
- public OSGiImplementationImpl(
- ModelFactoryExtensionPoint modelFactories,
- String bundleSymbolicName,
- String bundleVersion,
- String[] imports,
- String[] classList,
- Hashtable<String, List<ComponentProperty>> refProperties,
- Hashtable<String, List<ComponentProperty>> serviceProperties) {
-
- super();
- this.bundleSymbolicName = bundleSymbolicName;
- this.bundleVersion = bundleVersion;
- this.imports = imports;
- this.referenceProperties = refProperties;
- this.serviceProperties = serviceProperties;
- this.classList = classList;
- this.modelFactories = modelFactories;
- }
-
- public void setCallbackProperties(Hashtable<String, List<ComponentProperty>> refCallbackProperties,
- Hashtable<String, List<ComponentProperty>> serviceCallbackProperties) {
-
- this.referenceCallbackProperties = refCallbackProperties;
- this.serviceCallbackProperties = serviceCallbackProperties;
-
- }
-
-
- public String getBundleSymbolicName() {
- return bundleSymbolicName;
- }
-
- public String getBundleVersion() {
- return bundleVersion;
- }
-
- public String[] getImports() {
- return imports;
- }
-
- public String[] getClassList() {
- return classList;
- }
-
- public ModelFactoryExtensionPoint getModelFactories() {
- return modelFactories;
- }
-
- public List<ComponentProperty> getReferenceProperties(String referenceName) {
- return referenceProperties.get(referenceName);
- }
-
- public List<ComponentProperty> getServiceProperties(String serviceName) {
- return serviceProperties.get(serviceName);
- }
-
- public List<ComponentProperty> getReferenceCallbackProperties(String referenceName) {
- return referenceCallbackProperties.get(referenceName);
- }
-
- public List<ComponentProperty> getServiceCallbackProperties(String serviceName) {
- return serviceCallbackProperties.get(serviceName);
- }
-
- /**
- * Since OSGi implementation annotations may not be processed until much later, leave it to
- * the OSGi invoker to decide whether pass-by-reference is allowed.
- * @return
- */
- public boolean isAllowsPassByReference() {
- return true;
- }
-
- public Object getOSGiBundle() {
- return osgiBundle;
- }
-
- public void setOSGiBundle(Object osgiBundle) {
- this.osgiBundle = osgiBundle;
- }
-
- private boolean areEqual(Object obj1, Object obj2) {
- if (obj1 == obj2)
- return true;
- if (obj1 == null || obj2 == null)
- return false;
- return obj1.equals(obj2);
- }
-
- @Override
- public boolean equals(Object obj) {
-
- if (!(obj instanceof OSGiImplementationImpl))
- return super.equals(obj);
- OSGiImplementationImpl impl = (OSGiImplementationImpl)obj;
- if (!areEqual(bundleSymbolicName, impl.bundleSymbolicName))
- return false;
- if (!areEqual(bundleVersion, impl.bundleVersion))
- return false;
- if (!areEqual(serviceProperties, impl.serviceProperties))
- return false;
- if (!areEqual(serviceCallbackProperties, impl.serviceCallbackProperties))
- return false;
- if (!areEqual(referenceProperties, impl.referenceProperties))
- return false;
- if (!areEqual(referenceCallbackProperties, impl.referenceCallbackProperties))
- return false;
- return super.equals(obj);
- }
-
-
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java
deleted file mode 100644
index 5664c77618..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java
+++ /dev/null
@@ -1,1254 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.osgi.runtime;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-
-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.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.context.RequestContextFactory;
-import org.apache.tuscany.sca.core.context.InstanceWrapper;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.core.invocation.JDKProxyFactory;
-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.ScopedImplementationProvider;
-import org.apache.tuscany.sca.core.scope.ScopedRuntimeComponent;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.osgi.OSGiImplementation;
-import org.apache.tuscany.sca.implementation.osgi.context.OSGiAnnotations;
-import org.apache.tuscany.sca.implementation.osgi.impl.OSGiImplementationImpl;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
-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.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.BundleListener;
-import org.osgi.framework.Constants;
-import org.osgi.framework.FrameworkEvent;
-import org.osgi.framework.FrameworkListener;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.service.packageadmin.ExportedPackage;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-/**
- * The runtime instantiation of OSGi component implementations
- *
- * @version $Rev$ $Date$
- */
-public class OSGiImplementationProvider implements ScopedImplementationProvider,
- FrameworkListener,
- BundleListener {
-
- private static final String COMPONENT_SERVICE_NAME = "component.service.name";
-
- // Maximum milliseconds to wait for a method to complete
- private static final long METHOD_TIMEOUT_MILLIS = 60000;
- // Maximum milliseconds to wait for services to be registered into OSGi service registry
- private static final long SERVICE_TIMEOUT_MILLIS = 300000;
-
- private OSGiImplementationImpl implementation;
- private OSGiAnnotations osgiAnnotations;
- private BundleContext bundleContext;
-
- private Hashtable<RuntimeWire, Reference> referenceWires = new Hashtable<RuntimeWire,Reference>();
- private Hashtable<RuntimeWire, ComponentReference> componentReferenceWires
- = new Hashtable<RuntimeWire,ComponentReference>();
- private HashSet<RuntimeWire> resolvedWires = new HashSet<RuntimeWire>();
- private boolean wiresResolved;
-
- private AtomicInteger startBundleEntryCount = new AtomicInteger();
- private AtomicInteger processAnnotationsEntryCount = new AtomicInteger();
-
- private JavaPropertyValueObjectFactory propertyValueFactory;
-
-
- private Hashtable<String, Object> componentProperties = new Hashtable<String, Object>();
- private RuntimeComponent runtimeComponent;
-
- private Bundle osgiBundle;
- private ArrayList<Bundle> dependentBundles = new ArrayList<Bundle>();
- private OSGiServiceListener osgiServiceListener;
- private PackageAdmin packageAdmin;
-
- private OSGiRuntime osgiRuntime;
-
- private ScopeRegistry scopeRegistry;
- private DataBindingExtensionPoint dataBindingRegistry;
-
- private boolean packagesRefreshed;
-
- private MessageFactory messageFactory;
- private InterfaceContractMapper mapper;
-
-
- public OSGiImplementationProvider(RuntimeComponent definition,
- OSGiImplementation impl,
- DataBindingExtensionPoint dataBindingRegistry,
- JavaPropertyValueObjectFactory propertyValueFactory,
- ProxyFactory proxyFactory,
- ScopeRegistry scopeRegistry,
- RequestContextFactory requestContextFactory,
- MessageFactory messageFactory,
- InterfaceContractMapper mapper) throws BundleException {
-
-
- this.implementation = (OSGiImplementationImpl)impl;
- this.runtimeComponent = definition;
- this.dataBindingRegistry = dataBindingRegistry;
- this.propertyValueFactory = propertyValueFactory;
- this.scopeRegistry = scopeRegistry;
- this.messageFactory = messageFactory;
- this.mapper = mapper;
-
- bundleContext = getBundleContext();
- osgiBundle = (Bundle)implementation.getOSGiBundle();
- bundleContext.addBundleListener(this);
- osgiServiceListener = new OSGiServiceListener(osgiBundle);
- bundleContext.addServiceListener(osgiServiceListener);
-
- // Install and start all dependent bundles
- String[] imports = implementation.getImports();
- for (int i = 0; i < imports.length; i++) {
- String location = imports[i].trim();
- if (location.length() > 0) {
- Bundle bundle = bundleContext.installBundle(location);
- dependentBundles.add(bundle);
- }
- }
-
-
- this.osgiAnnotations = new OSGiAnnotations(
- implementation.getModelFactories(),
- implementation.getClassList(),
- runtimeComponent,
- propertyValueFactory,
- proxyFactory,
- requestContextFactory,
- osgiBundle,
- dependentBundles);
-
-
- // PackageAdmin is used to resolve bundles
- org.osgi.framework.ServiceReference packageAdminReference =
- bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin");
- if (packageAdminReference != null) {
- packageAdmin = (PackageAdmin) bundleContext.getService(packageAdminReference);
- bundleContext.addFrameworkListener(this);
- }
-
-
- }
-
- protected RuntimeComponent getRuntimeComponent() {
- return runtimeComponent;
- }
-
- protected OSGiImplementationImpl getImplementation() {
- return implementation;
- }
-
- // Create a property table from the list of properties
- // The source properties are properties read from <property/> elements
- // Create property values in the table of the appropriate class based
- // on the property type specified.
- private void processProperties(List<?> props, Hashtable<String, Object> propsTable) {
-
- if (props != null) {
- for (Object p : props) {
-
- Property prop = (Property)p;
- Class javaType = SimpleTypeMapperImpl.getJavaType(prop.getXSDType());
- ObjectFactory<?> objFactory = propertyValueFactory.createValueFactory(prop, prop.getValue(), javaType);
- Object value = objFactory.getInstance();
-
- propsTable.put(prop.getName(), value);
- }
- }
- }
-
-
- private BundleContext getBundleContext() throws BundleException {
-
- try {
- if (bundleContext == null) {
- osgiRuntime = OSGiRuntime.getRuntime();
- bundleContext = osgiRuntime .getBundleContext();
- }
- } catch (BundleException e) {
- throw e;
- } catch (Exception e) {
- throw new BundleException("Could not start OSGi runtime", e);
- }
-
-
- return bundleContext;
- }
-
-
- private String getOSGiFilter(Hashtable<String, Object> props) {
-
- String filter = "";
-
- if (props != null && props.size() > 0) {
- int propCount = 0;
- for (String propName : props.keySet()) {
- if (propName.equals("service.pid"))
- continue;
- filter = filter + "(" + propName + "=" + props.get(propName) + ")";
- propCount++;
- }
-
- if (propCount > 1) filter = "(&" + filter + ")";
- }
- else
- filter = null;
- return filter;
- }
-
- /*
- * Return a matching service registered by the specified bundle.
- * If <implementation.osgi /> has the attribute filter defined, return a service
- * reference that matches the filter. Otherwise, return a service which has a component
- * name equal to this component's name. If not found, return a service which no
- * component name set.
- *
- * Even though services registered by this bundle can be filtered using the
- * service listener, we use this method to filter all service references so that
- * the service matching functionality of OSGi can be directly used.
- */
- private org.osgi.framework.ServiceReference getOSGiServiceReference(
- String scaServiceName,
- String osgiServiceName, String filter)
- throws InvalidSyntaxException {
-
- String compServiceName = runtimeComponent.getName() + "/" + scaServiceName;
- if (filter != null && filter.length() > 0) {
- org.osgi.framework.ServiceReference[] references =
- bundleContext.getServiceReferences(osgiServiceName, filter);
-
-
- org.osgi.framework.ServiceReference reference = null;
- if (references != null) {
- for (org.osgi.framework.ServiceReference ref : references) {
- if (ref.getBundle() != osgiBundle)
- continue;
- Object compName = ref.getProperty(COMPONENT_SERVICE_NAME);
- if (compName == null && reference == null)
- reference = ref;
- if (scaServiceName == null || compServiceName.equals(compName)) {
- reference = ref;
- break;
- }
- }
- }
-
- return reference;
-
- }
-
- filter = scaServiceName == null? null :
- "(" + COMPONENT_SERVICE_NAME + "="+ compServiceName + ")";
-
- org.osgi.framework.ServiceReference[] references =
- bundleContext.getServiceReferences(osgiServiceName, filter);
-
- if (references != null) {
- for (org.osgi.framework.ServiceReference ref : references) {
- if (ref.getBundle() == osgiBundle) {
- return ref;
- }
- }
- }
-
- references = bundleContext.getServiceReferences(osgiServiceName, null);
-
- org.osgi.framework.ServiceReference reference = null;
-
- if (references != null) {
- for (org.osgi.framework.ServiceReference ref : references) {
-
- if (ref.getBundle() != osgiBundle)
- continue;
- Object compName = ref.getProperty(COMPONENT_SERVICE_NAME);
- if (compName == null && reference == null)
- reference = ref;
- if (compServiceName.equals(compName)) {
- reference = ref;
- break;
- }
- }
- }
-
- return reference;
- }
-
- /**
- * This method is used to avoid full synchronization of methods which should
- * be executed only once.
- *
- * entryCount=0: The count is incremented, and this thread executes the method. Returns true.
- *
- * entryCount=1: Another thread is already executing this method.
- * Wait for the thread to complete if doWait is true. Returns false.
- *
- * entryCount=2: The method has already been executed. Returns false.
- *
- * @param doWait If true, and another method is executing this method
- * wait for method execution to complete
- * @param entryCount Atomic integer used to ensure that the method is
- * executed only once
- * @return true if this thread has exclusive access to execute this method
- */
- private boolean enterMethod(boolean doWait, AtomicInteger entryCount) {
-
- if (entryCount.compareAndSet(0, 1)) {
- return true;
- }
- else {
- if (doWait) {
- synchronized (entryCount) {
- if (entryCount.get() != 2) {
- try {
- entryCount.wait(METHOD_TIMEOUT_MILLIS);
- } catch (InterruptedException e) {
- }
- }
- }
- }
- return false;
- }
- }
-
- /**
- * Called on method exit of methods which were entered after
- * enterMethod returned true. Increments entryCount, and wakes
- * up threads waiting for the method to complete.
- *
- * @param entryCount Atomic integer used for synchronization
- */
- private void exitMethod(AtomicInteger entryCount) {
- entryCount.compareAndSet(1, 2);
- synchronized (entryCount) {
- entryCount.notifyAll();
- }
- }
-
- protected Bundle startBundle(boolean doWait) throws ObjectCreationException {
-
- try {
-
- if (enterMethod(doWait, startBundleEntryCount)) {
-
- configurePropertiesUsingConfigAdmin();
-
- resolveBundle();
-
- processAnnotations(true);
-
-
- for (Bundle bundle : dependentBundles) {
- try {
- if (bundle.getState() != Bundle.ACTIVE && bundle.getState() != Bundle.STARTING) {
- bundle.start();
- }
- } catch (BundleException e) {
- if (bundle.getHeaders().get("Fragment-Host") == null)
- throw e;
- }
- }
-
- }
-
- if (osgiBundle.getState() != Bundle.ACTIVE && osgiBundle.getState() != Bundle.STARTING) {
-
-
- int retry = 0;
-
- while (retry++ < 10) {
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws BundleException {
- osgiBundle.start();
- return null;
- }
- });
- break;
- // } catch ( BundleException e) {
- } catch ( PrivilegedActionException e) {
- // It is possible that the thread "Refresh Packages" is in the process of
- // changing the state of this bundle.
- Thread.yield();
-
- if (retry == 10)
- throw e;
- }
- }
- }
-
- } catch (Exception e) {
- throw new ObjectCreationException(e);
- } finally {
- exitMethod(startBundleEntryCount);
- }
- return osgiBundle;
- }
-
-
- // This method is called by OSGiInstanceWrapper.getInstance to obtain the OSGi service reference
- // corresponding to the specified service. The properties used to filter the service should
- // be chosen based on whether this is a normal service or a callback.
- protected org.osgi.framework.ServiceReference getOSGiServiceReference(ComponentService service)
- throws ObjectCreationException {
-
- Hashtable<String, Object> props = new Hashtable<String, Object>();
- if (!service.isCallback())
- processProperties(implementation.getServiceProperties(service.getName()), props);
- else
- processProperties(implementation.getServiceCallbackProperties(service.getName()), props);
-
- String filter = getOSGiFilter(props);
- Interface serviceInterface = service.getInterfaceContract().getInterface();
- String scaServiceName = service.getName();
-
- return getOSGiServiceReference(serviceInterface, filter, scaServiceName);
-
- }
-
- protected org.osgi.framework.ServiceReference getOSGiServiceReference(
- EndpointReference from, Interface callbackInterface)
- throws ObjectCreationException {
-
- RuntimeWire refWire = null;
- String filter = null;
- for (RuntimeWire wire : referenceWires.keySet()) {
- if (wire.getSource() == from) {
- refWire = wire;
- break;
- }
- }
- if (refWire != null) {
- Hashtable<String, Object> props = new Hashtable<String, Object>();
- ComponentReference scaRef = componentReferenceWires.get(refWire);
- processProperties(implementation.getReferenceCallbackProperties(scaRef.getName()), props);
- filter = getOSGiFilter(props);
- }
-
- return getOSGiServiceReference(callbackInterface, filter, null);
- }
-
- private org.osgi.framework.ServiceReference getOSGiServiceReference(Interface serviceInterface,
- String filter, String scaServiceName)
- throws ObjectCreationException {
-
- try {
-
- String serviceInterfaceName = null;
-
- org.osgi.framework.ServiceReference osgiServiceReference = null;
-
- if (serviceInterface instanceof JavaInterface) {
- serviceInterfaceName = ((JavaInterface)serviceInterface).getJavaClass().getName();
-
- if ((osgiServiceReference = getOSGiServiceReference(
- scaServiceName,
- serviceInterfaceName, filter)) == null) {
-
- // The service listener for our bundle will notify us when the service is registered.
- synchronized (implementation) {
-
- // When declarative services are used, the component is started asynchronously
- // So this thread has to wait for the service to be registered by the component
- // activate method
- // For regular bundle activators, bundle.start activates the bundle synchronously
- // and hence the service would probably have been started by the bundle activator
- long startTime = System.currentTimeMillis();
- while ((osgiServiceReference = getOSGiServiceReference(
- scaServiceName,
- serviceInterfaceName, filter)) == null) {
-
- // Wait for the bundle to register the service
- implementation.wait(100);
- if (System.currentTimeMillis() - startTime > SERVICE_TIMEOUT_MILLIS)
- break;
- }
- }
-
- }
- }
-
- return osgiServiceReference;
-
- } catch (Exception e) {
- throw new ObjectCreationException(e);
- }
- }
-
-
- // Felix does not support bundle fragments. This is a temporary workaround.
- protected Bundle installDummyBundleWithoutFragments(Class<?> interfaceClass)
- throws Exception {
-
- ByteArrayOutputStream out = new ByteArrayOutputStream();
-
- String EOL = System.getProperty("line.separator");
-
- String interfaceName = interfaceClass.getName();
- String packageName = getPackageName(interfaceClass);
- String bundleName = "dummy.sca." + packageName;
-
- String manifestStr = "Manifest-Version: 1.0" + EOL
- + "Bundle-ManifestVersion: 2" + EOL + "Bundle-Name: "
- + bundleName + EOL + "Bundle-SymbolicName: " + bundleName + EOL
- + "Bundle-Version: " + "1.0.0" + EOL
- + "Bundle-Localization: plugin" + EOL;
-
- ArrayList<String> dummyClasses = new ArrayList<String>();
-
- StringBuilder manifestBuf = new StringBuilder();
- manifestBuf.append(manifestStr);
- manifestBuf.append("Export-Package: " + packageName + EOL);
- String exportedInterfaces = interfaceName;
- Bundle existingBundle = getDummyHostBundle(packageName);
- String existingClasses;
- dummyClasses.add(interfaceClass.getName());
- for (Class<?> clazz : interfaceClass.getClasses()) {
- dummyClasses.add(clazz.getName());
- }
- if (existingBundle != null &&
- (existingClasses = (String)existingBundle.getHeaders().get("SCA-Dummy-Classes")) != null) {
- exportedInterfaces = exportedInterfaces + " " + existingClasses;
-
- StringTokenizer tokenizer = new StringTokenizer(existingClasses);
- while (tokenizer.hasMoreTokens()) {
- String className = tokenizer.nextToken();
- if (!dummyClasses.contains(className))
- dummyClasses.add(className);
- }
- }
-
- manifestBuf.append("SCA-Dummy-Classes: " + exportedInterfaces + EOL);
-
- ByteArrayInputStream manifestStream = new ByteArrayInputStream(
- manifestBuf.toString().getBytes());
- Manifest manifest = new Manifest();
- manifest.read(manifestStream);
-
- JarOutputStream jarOut = new JarOutputStream(out, manifest);
-
- for (int i = 0; i < dummyClasses.size(); i++) {
-
- String className = dummyClasses.get(i);
-
- Class clazz = interfaceClass.getClassLoader().loadClass(className);
- className = clazz.getName().replaceAll("\\.", "/") + ".class";
- ZipEntry ze = new ZipEntry(className);
- jarOut.putNextEntry(ze);
- InputStream stream = clazz.getResourceAsStream(clazz.getSimpleName() + ".class");
-
- byte[] bytes = new byte[stream.available()];
- stream.read(bytes);
- jarOut.write(bytes);
- stream.close();
- }
-
-
- jarOut.close();
- out.close();
-
- if (existingBundle != null) {
- existingBundle.stop();
- existingBundle.uninstall();
- }
-
- ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
-
- Bundle bundle = bundleContext.installBundle("file://" + bundleName
- + ".jar", in);
-
- bundle.start();
-
- if (existingBundle != null && packageAdmin != null) {
- refreshPackages();
-
- }
-
- return bundle;
-
- }
-
- private Bundle getDummyHostBundle(String packageName) {
-
- if (packageAdmin == null)
- return null;
-
- ExportedPackage exp = packageAdmin.getExportedPackage(packageName);
- if (exp == null)
- return null;
- else
- return exp.getExportingBundle();
- }
-
- private static String getPackageName(Class<?> cls) {
- String name = cls.getName();
- int index = name.lastIndexOf('.');
- return index == -1 ? "" : name.substring(0, index);
- }
-
- private Bundle installDummyBundle(Class<?> interfaceClass)
- throws Exception {
-
-
- if (!osgiRuntime.supportsBundleFragments()) {
- return installDummyBundleWithoutFragments(interfaceClass);
- }
-
- ByteArrayOutputStream out = new ByteArrayOutputStream();
-
- String EOL = System.getProperty("line.separator");
- ArrayList<Class<?>> dummyClasses = new ArrayList<Class<?>>();
-
- String interfaceName = interfaceClass.getName();
- String packageName = getPackageName(interfaceClass);
- String bundleName = "dummy.sca." + interfaceName;
-
-
- String manifestStr = "Manifest-Version: 1.0" + EOL +
- "Bundle-ManifestVersion: 2" + EOL +
- "Bundle-Name: " + bundleName + EOL +
- "Bundle-SymbolicName: " + bundleName + EOL +
- "Bundle-Version: " + "1.0.0" + EOL +
- "Bundle-Localization: plugin" + EOL;
-
-
- StringBuilder manifestBuf = new StringBuilder();
- manifestBuf.append(manifestStr);
- manifestBuf.append("Export-Package: " + packageName + EOL);
- Bundle dummyHost = getDummyHostBundle(packageName);
- if (dummyHost != null)
- manifestBuf.append("Fragment-Host: " + dummyHost.getSymbolicName() + EOL);
-
- ByteArrayInputStream manifestStream = new ByteArrayInputStream(manifestBuf.toString().getBytes());
- Manifest manifest = new Manifest();
- manifest.read(manifestStream);
-
- dummyClasses.add(interfaceClass);
- for (Class<?> clazz : interfaceClass.getClasses()) {
- dummyClasses.add(clazz);
- }
-
- JarOutputStream jarOut = new JarOutputStream(out, manifest);
-
- for (int i = 0; i < dummyClasses.size(); i++) {
-
- Class<?> clazz = dummyClasses.get(i);
- String className = clazz.getName();
- className = clazz.getName().replaceAll("\\.", "/") + ".class";
- ZipEntry ze = new ZipEntry(className);
- jarOut.putNextEntry(ze);
- InputStream stream = clazz.getResourceAsStream(clazz.getSimpleName() + ".class");
-
- byte[] bytes = new byte[stream.available()];
- stream.read(bytes);
- jarOut.write(bytes);
- stream.close();
- }
-
- jarOut.close();
- out.close();
-
-
- ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
-
-
- Bundle bundle = bundleContext.installBundle(
- "file://" + bundleName + ".jar",
- in);
-
- if (dummyHost == null)
- bundle.start();
-
- return bundle;
-
- }
-
-
-
- public InstanceWrapper<?> createInstanceWrapper() throws ObjectCreationException {
-
- return new OSGiInstanceWrapper<Object>(this, osgiAnnotations, bundleContext);
- }
-
-
-
- private void resolveWireCreateDummyBundles(final Class interfaceClass) throws Exception {
-
-
- try {
-
- osgiBundle.loadClass(interfaceClass.getName());
-
- } catch (ClassNotFoundException e) {
-
- // The interface used by the proxy is not in the source bundle
- // A dummy bundle needs to be installed to create the proxy
- // Allow privileged access to file system. Requires FileSystem permission in security
- // policy.
- Bundle dummyBundle = AccessController.doPrivileged(new PrivilegedExceptionAction<Bundle>() {
- public Bundle run() throws Exception {
- return installDummyBundle(interfaceClass);
- }
- });
-
- if (packageAdmin != null) {
-
- packageAdmin.resolveBundles(new Bundle[]{dummyBundle, osgiBundle});
-
- }
-
- }
- }
-
- /**
- * For OSGi->Java wires, create a proxy corresponding to the Java interfaces
- * and register the proxy with the OSGi registry, so that the source OSGi bundle can
- * locate the target Java instance from the registry like a regular OSGi service.
- *
- * For OSGi->OSGi wires, start the target OSGi bundle, so that references of the
- * target are resolved before the source OSGi bundle is started. If the reference
- * has properties specified, create a Proxy and register a service with highest
- * possible ranking. The Proxy should wire to the correct OSGi instance specified
- * in the SCA composite.
- *
- * The first phase determines whether a proxy should be installed. It also registers
- * a dummy bundle if necessary to resolve the bundle. When phase1 is completed on all
- * wires of the component, the bundle should be resolved. Phase2 registers the proxy service.
- */
- private boolean resolveWireResolveReferences(Bundle bundle, Class interfaceClass, RuntimeWire wire,
- boolean isOSGiToOSGiWire) throws Exception {
-
-
- // FIXME: At the moment injection of values into instances require an instance to be obtained
- // through the instance wrapper, and hence requires a proxy. When we do this processing here,
- // we don't yet know whether the target requires any property or callback injection. So it is
- // safer to create a proxy all the time.
- boolean createProxy = true;
-
- ComponentReference scaRef = componentReferenceWires.get(wire);
- Hashtable<String, Object> targetProperties = new Hashtable<String, Object>();
- processProperties(implementation.getReferenceProperties(scaRef.getName()), targetProperties);
-
-
- if (isOSGiToOSGiWire) {
-
- OSGiImplementationProvider implProvider = (OSGiImplementationProvider)wire.getTarget().getComponent().getImplementationProvider();
-
- // This is an OSGi->OSGi wire
- isOSGiToOSGiWire = true;
-
- // If the target component is stateless, use a proxy to create a new service each time
- if (!implProvider.getScope().equals(Scope.COMPOSITE)) createProxy = true;
-
- Interface interfaze = wire.getTarget().getInterfaceContract().getInterface();
-
- // If the target interface is remotable, create a proxy to support pass-by-value semantics
- // AllowsPassByReference is not detected until the target instance is obtained.
- if (interfaze.isRemotable())
- createProxy = true;
-
- // If any of the operations in the target interface is non-blocking, create a proxy
- List<Operation> ops = interfaze.getOperations();
- for (Operation op : ops) {
- if (op.isNonBlocking())
- createProxy = true;
- }
-
- // If properties are specified for the reference, create a proxy since rewiring may be required
- if (targetProperties.size() > 0) {
- createProxy = true;
- }
-
- // If properties are specified for the component, create a proxy for configuring
- // the component services.
- if (componentProperties.size() > 0) {
- createProxy = true;
- }
-
- // Since this is an OSGi->OSGi wire, start the target bundle before starting the
- // source bundle if there is no proxy. For direct wiring without a proxy, this ordering
- // is irrelevant in terms of class resolution, but the target needs to be started at some
- // point. But there is no opportunity later on to start the target OSGi bundle without a proxy.
- // When a Proxy is used, the target bundle needs to be resolved for the source bundle
- // to be resolved so that the interface is visible to the source. In this case the bundle
- // will be started when an instance is needed.
- if (!createProxy) {
- implProvider.startBundle(false);
- }
- else {
- implProvider.resolveBundle();
- }
- }
- else {
- createProxy = true;
- }
-
- return createProxy;
- }
-
-
- // Register proxy service
- private void resolveWireRegisterProxyService(final Bundle bundle, final Class interfaceClass, RuntimeWire wire) throws Exception {
-
- ComponentReference scaRef = componentReferenceWires.get(wire);
- Hashtable<String, Object> targetProperties = new Hashtable<String, Object>();
- processProperties(implementation.getReferenceProperties(scaRef.getName()), targetProperties);
- targetProperties.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
-
- if (targetProperties.get(COMPONENT_SERVICE_NAME) == null && wire.getTarget().getComponent() != null) {
- String compServiceName = wire.getTarget().getComponent().getName() + "/" +
- wire.getTarget().getContract().getName();
- targetProperties.put(COMPONENT_SERVICE_NAME, compServiceName);
- }
-
-
- JDKProxyFactory proxyService = new JDKProxyFactory(messageFactory, mapper);
-
- // Allow privileged access to load classes. Requires getClassLoader permission in security
- // policy.
- final Class<?> proxyInterface = AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
- public Class<?> run() throws Exception {
- return bundle.loadClass(interfaceClass.getName());
- }
- });
-
- final Object proxy = proxyService.createProxy(proxyInterface, wire);
- final Hashtable<String, Object> finalTargetProperties = targetProperties;
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws Exception {
- bundleContext.registerService(proxyInterface.getName(), proxy, finalTargetProperties);
- return null;
- }
- });
-
-
- }
-
-
- private void refreshPackages() {
-
- if (packageAdmin != null) {
- synchronized (this) {
- packagesRefreshed = false;
- packageAdmin.refreshPackages(null);
-
- if (!packagesRefreshed) {
- try {
- this.wait(2000);
- } catch (InterruptedException e) {
- // ignore
- }
- }
- packagesRefreshed = false;
- }
- }
- }
-
-
- private void resolveBundle() throws ObjectCreationException {
-
-
- try {
-
- if (!wiresResolved) {
- wiresResolved = true;
-
- if (!setReferencesAndProperties()) {
- wiresResolved = false;
- return;
- }
-
- int refPlusServices = referenceWires.size() + runtimeComponent.getServices().size();
- boolean[] createProxyService = new boolean[refPlusServices];
- Class<?>[] interfaceClasses = new Class<?>[refPlusServices] ;
- boolean[] isOSGiToOSGiWire = new boolean[refPlusServices];
- boolean[] wireResolved = new boolean[refPlusServices];
- int index = 0;
- for (RuntimeWire wire : referenceWires.keySet()) {
-
- Reference reference = referenceWires.get(wire);
-
- isOSGiToOSGiWire[index] = wire.getTarget().getComponent() != null &&
- wire.getTarget().getComponent().getImplementationProvider()
- instanceof OSGiImplementationProvider;
-
- Interface refInterface = reference.getInterfaceContract().getInterface();
- if (refInterface instanceof JavaInterface) {
- interfaceClasses[index] = ((JavaInterface)refInterface).getJavaClass();
-
- if (!isOSGiToOSGiWire[index])
- resolveWireCreateDummyBundles(interfaceClasses[index]);
-
- }
-
- if (!resolvedWires.contains(wire)) {
- resolvedWires.add(wire);
- }
- else
- wireResolved[index] = true;
-
- index++;
- }
- for (ComponentService service : runtimeComponent.getServices()) {
- Interface callbackInterface = service.getInterfaceContract().getCallbackInterface();
- if (callbackInterface instanceof JavaInterface) {
- interfaceClasses[index] = ((JavaInterface)callbackInterface).getJavaClass();
-
- resolveWireCreateDummyBundles(interfaceClasses[index]);
- }
-
- index++;
- }
-
- index = 0;
- for (RuntimeWire wire : referenceWires.keySet()) {
-
- if (!wireResolved[index]) {
- createProxyService[index] = resolveWireResolveReferences(osgiBundle,
- interfaceClasses[index],
- wire,
- isOSGiToOSGiWire[index]);
- }
- index++;
- }
-
- refreshPackages();
-
-
- index = 0;
- for (RuntimeWire wire : referenceWires.keySet()) {
-
- if (createProxyService[index] && !wireResolved[index])
- resolveWireRegisterProxyService(osgiBundle, interfaceClasses[index], wire);
- index++;
- }
- }
- else if (osgiBundle.getState() == Bundle.INSTALLED && packageAdmin != null) {
- packageAdmin.resolveBundles(new Bundle[] {osgiBundle});
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- throw new ObjectCreationException(e);
- }
- }
-
-
- @SuppressWarnings("unchecked")
- private void configurePropertiesUsingConfigAdmin() {
-
- try {
-
- if (componentProperties.size() == 0)
- return;
-
- org.osgi.framework.ServiceReference configAdminReference =
- bundleContext.getServiceReference("org.osgi.service.cm.ConfigurationAdmin");
- if (configAdminReference != null) {
-
- Object cm = bundleContext.getService(configAdminReference);
- Class cmClass = cm.getClass().getClassLoader().loadClass("org.osgi.service.cm.ConfigurationAdmin");
- Method getConfigMethod = cmClass.getMethod("getConfiguration", String.class, String.class);
-
-
- Class configClass = cm.getClass().getClassLoader().loadClass("org.osgi.service.cm.Configuration");
-
- Method getMethod = configClass.getMethod("getProperties");
- Method updateMethod = configClass.getMethod("update", Dictionary.class);
-
- List<Service> services = implementation.getServices();
- HashSet<String> pidsProcessed = new HashSet<String>();
-
- for (Service service : services) {
-
- List<ComponentProperty> serviceProps = implementation.getServiceProperties(service.getName());
- String pid = null;
-
- if (serviceProps != null) {
- for (ComponentProperty prop : serviceProps) {
- if (prop.getName().equals("service.pid")) {
- ObjectFactory objFactory = propertyValueFactory.createValueFactory(prop,
- prop.getValue(), String.class);
- pid = (String)objFactory.getInstance();
- }
- }
- }
- if (pid == null || pidsProcessed.contains(pid))
- continue;
-
-
-
-
- Object config = getConfigMethod.invoke(cm, pid, null);
- Dictionary props = (Dictionary) getMethod.invoke(config);
- if (props == null)
- props = new Hashtable<String, Object>();
- for (String propertyName : componentProperties.keySet()) {
-
- props.put(propertyName, componentProperties.get(propertyName));
- }
-
- updateMethod.invoke(config, props);
-
-
- }
-
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
-
-
- public boolean isOptimizable() {
- return false;
- }
-
- public Scope getScope() {
- return osgiAnnotations.getScope();
- }
-
- public boolean isEagerInit() {
- return osgiAnnotations.isEagerInit();
- }
-
- public long getMaxAge() {
- return osgiAnnotations.getMaxAge();
- }
-
- public long getMaxIdleTime() {
- return osgiAnnotations.getMaxIdleTime();
- }
-
- protected ScopeContainer<?> getScopeContainer() {
- startBundle(true);
- return ((ScopedRuntimeComponent)runtimeComponent).getScopeContainer();
- }
-
- public Invoker createTargetInvoker(RuntimeComponentService service, Operation operation) {
-
-
- Interface serviceInterface = operation.getInterface();
- boolean isRemotable = serviceInterface.isRemotable();
-
-
- Invoker invoker = new OSGiTargetInvoker(operation, this, service);
- if (isRemotable) {
- return new OSGiRemotableInvoker(osgiAnnotations, dataBindingRegistry, operation, this, service);
- } else {
- return invoker;
- }
-
- }
-
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- return createTargetInvoker(service, operation);
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- private boolean setReferencesAndProperties() {
-
- for (Reference ref: implementation.getReferences()) {
- List<RuntimeWire> wireList = null;
- ComponentReference compRef = null;
- for (ComponentReference cRef : runtimeComponent.getReferences()) {
- if (cRef.getName().equals(ref.getName())) {
-
- wireList = ((RuntimeComponentReference)cRef).getRuntimeWires();
-
- compRef = cRef;
- break;
- }
- }
-
- if (ref.getMultiplicity() == Multiplicity.ONE_N || ref.getMultiplicity() == Multiplicity.ZERO_N) {
- for (RuntimeWire wire : wireList) {
- referenceWires.put(wire, ref);
- componentReferenceWires.put(wire, compRef);
- }
-
- } else {
- if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
- throw new IllegalStateException("Required reference is missing: " + ref.getName());
- }
- if (wireList != null && !wireList.isEmpty()) {
- RuntimeWire wire = wireList.get(0);
- referenceWires.put(wire, ref);
- componentReferenceWires.put(wire, compRef);
- }
-
- }
-
- }
-
- processProperties(runtimeComponent.getProperties(), componentProperties);
-
- return true;
-
- }
-
- public void start() {
- setReferencesAndProperties();
- }
-
- public void processAnnotations(boolean doWait) throws IntrospectionException {
-
- if (!enterMethod(doWait, processAnnotationsEntryCount))
- return;
-
- try {
- osgiAnnotations.processAnnotations();
-
- Scope scope = osgiAnnotations.getScope();
- if (scope.equals(Scope.SYSTEM) || scope.equals(Scope.COMPOSITE)) {
- // Nothing
- } else {
-
- if (runtimeComponent instanceof ScopedRuntimeComponent) {
-
- ScopedRuntimeComponent component = (ScopedRuntimeComponent) runtimeComponent;
-
- ScopeContainer oldScopeContainer = component.getScopeContainer();
- component.setScopeContainer(null);
- ScopeContainer scopeContainer = scopeRegistry.getScopeContainer(runtimeComponent);
-
- if (oldScopeContainer != null && oldScopeContainer.getLifecycleState() == ScopeContainer.RUNNING) {
- scopeContainer.start();
- }
-
- component.setScopeContainer(scopeContainer);
- }
-
- }
- } finally {
- exitMethod(processAnnotationsEntryCount);
- }
- }
-
- public void stop() {
-
- if (osgiServiceListener != null)
- bundleContext.removeServiceListener(osgiServiceListener);
- }
-
-
-
- public void frameworkEvent(FrameworkEvent event) {
- if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) {
- synchronized (this) {
- packagesRefreshed = true;
- this.notifyAll();
- }
- }
-
- }
-
- public void bundleChanged(BundleEvent event) {
- if (event.getType() == BundleEvent.RESOLVED && event.getBundle() == osgiBundle) {
- try {
- processAnnotations(false);
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
- }
-
- private class OSGiServiceListener implements ServiceListener {
-
- private Bundle bundle;
-
- OSGiServiceListener(Bundle bundle) {
- this.bundle = bundle;
- }
-
- public void serviceChanged(org.osgi.framework.ServiceEvent event) {
-
-
- org.osgi.framework.ServiceReference reference = event.getServiceReference();
-
- if (event.getType() == ServiceEvent.REGISTERED && reference.getBundle() == bundle) {
-
- synchronized (implementation) {
-
- implementation.notifyAll();
- }
- }
-
- if (event.getType() == ServiceEvent.UNREGISTERING && reference.getBundle() == bundle) {
- // TODO: Process deregistering of OSGi services.
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProviderFactory.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProviderFactory.java
deleted file mode 100644
index 814d37f203..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProviderFactory.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.osgi.runtime;
-
-
-import org.apache.tuscany.sca.context.ContextFactoryExtensionPoint;
-import org.apache.tuscany.sca.context.RequestContextFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-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.scope.ScopeRegistry;
-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.osgi.OSGiImplementation;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.osgi.framework.BundleException;
-
-
-/**
- * Builds a OSGi-based implementation provider from a component definition
- *
- * @version $Rev$ $Date$
- */
-public class OSGiImplementationProviderFactory implements ImplementationProviderFactory<OSGiImplementation> {
-
- private DataBindingExtensionPoint dataBindings;
- private JavaPropertyValueObjectFactory propertyFactory;
- private ProxyFactory proxyFactory;
- private ScopeRegistry scopeRegistry;
- private MessageFactory messageFactory;
- private InterfaceContractMapper mapper;
-
- private RequestContextFactory requestContextFactory;
-
- public OSGiImplementationProviderFactory(ExtensionPointRegistry extensionPoints ) {
-
- dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class);
- ProxyFactoryExtensionPoint proxyFactories = extensionPoints.getExtensionPoint(ProxyFactoryExtensionPoint.class);
- proxyFactory = new ExtensibleProxyFactory(proxyFactories);
- ContextFactoryExtensionPoint contextFactories = extensionPoints.getExtensionPoint(ContextFactoryExtensionPoint.class);
- requestContextFactory = contextFactories.getFactory(RequestContextFactory.class);
-
-
- // FIXME: Scope registry is not an extension point, and this usage is specific
- // to implementation.osgi since it needs to change scope after the component is
- // created. Do we need to find a better way?
- scopeRegistry = extensionPoints.getExtensionPoint(ScopeRegistry.class);
-
- TransformerExtensionPoint transformers = extensionPoints.getExtensionPoint(TransformerExtensionPoint.class);
- MediatorImpl mediator = new MediatorImpl(dataBindings, transformers);
- propertyFactory = new JavaPropertyValueObjectFactory(mediator);
-
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- messageFactory = modelFactories.getFactory(MessageFactory.class);
-
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- mapper = utilities.getUtility(InterfaceContractMapper.class);
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component,
- OSGiImplementation implementation) {
-
- try {
-
- return new OSGiImplementationProvider(component,
- implementation,
- dataBindings,
- propertyFactory,
- proxyFactory,
- scopeRegistry,
- requestContextFactory,
- messageFactory,
- mapper
- );
-
- } catch (BundleException e) {
- throw new RuntimeException(e);
- }
-
- }
-
- public Class<OSGiImplementation> getModelType() {
- return OSGiImplementation.class;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiInstanceWrapper.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiInstanceWrapper.java
deleted file mode 100644
index e775041592..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiInstanceWrapper.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.implementation.osgi.runtime;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Random;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.core.context.InstanceWrapper;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.TargetDestructionException;
-import org.apache.tuscany.sca.core.scope.TargetInitializationException;
-import org.apache.tuscany.sca.implementation.osgi.context.OSGiAnnotations;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Init;
-
-
-/**
- * InstanceWrapper for creating instances for OSGi components.
- * This class needs to implement InstanceWrapper since the wrapper is stored in
- * the scope container. But getInstance() is called on this wrapper only through the
- * OSGi target invoker. OSGiTargetInvoker always invokes getInstance for a specific
- * service since one OSGi SCA component can associate different objects with
- * different services (this is different from Java SCA components which always associate
- * a single component instance with multiple services).
- *
- * @version $Rev$ $Date$
- */
-public class OSGiInstanceWrapper<T> implements InstanceWrapper<T> {
- private static final Random RANDOM_NUMBER_GENERATOR = new Random();
-
- private OSGiAnnotations annotationProcessor;
- private OSGiImplementationProvider provider;
- private BundleContext bundleContext;
- private Hashtable<Object,InstanceInfo<T>> instanceInfoList =
- new Hashtable<Object,InstanceInfo<T>>();
-
- // Dummy bundles are used to create a new service object for scopes other than COMPOSITE
- private Bundle dummyReferenceBundle;
-
-
- public OSGiInstanceWrapper(OSGiImplementationProvider provider,
- OSGiAnnotations annotationProcessor,
- BundleContext bundleContext) {
-
- this.provider = provider;
- this.annotationProcessor = annotationProcessor;
- this.bundleContext = bundleContext;
- }
-
- public synchronized T getInstance(ComponentService service) throws TargetInitializationException {
-
- // If an instance corresponding to this service has already been created, return the instance.
- if (instanceInfoList.get(service) != null)
- return instanceInfoList.get(service).osgiInstance;
-
- // There is no strict relation between service and callback instances. The instance semantics
- // actually applies to the component instance in SCA. But for OSGi services, the callback
- // is just another OSGi service, and could correspond to any of the service instances in
- // the component. To implement the SCA scope semantics for callbacks, OSGi callbacks
- // should also be made on the service object which implements the callback. The following code
- // finds the first possible callback instance based on the interfaces implemented by the service
- // objects in this component. Note that the interfaces are checked by name rather than using
- // instanceof since the class seen by Tuscany could be from a different classloader from that
- // used by the bundle.
- if (service.isCallback()) {
- Iterator<InstanceInfo<T>> instances = instanceInfoList.values().iterator();
- while (instances.hasNext()) {
- InstanceInfo<T> instanceInfo = instances.next();
- Interface interfaze = service.getInterfaceContract().getInterface();
- if (interfaze instanceof JavaInterface && ((JavaInterface)interfaze).getJavaClass() != null) {
- String interfaceName = ((JavaInterface)interfaze).getJavaClass().getName();
- Class[] interfaces = instanceInfo.osgiInstance.getClass().getInterfaces();
- for (Class clazz : interfaces) {
- if (clazz.getName().equals(interfaceName)) {
- return instanceInfo.osgiInstance;
- }
- }
-
- }
-
- }
- }
-
- Bundle refBundle = provider.startBundle(true);
-
- // For scopes other than composite, the service object is obtained using a dummy reference
- // bundle to guarantee that a new instance is created each time. This combined with the Tuscany
- // scope container code guarantee SCA scope semantics for OSGi components as long as service
- // factories are used.
- if (!annotationProcessor.getScope().equals(Scope.COMPOSITE)) {
- refBundle = getDummyReferenceBundle();
- }
-
- InstanceInfo<T> instanceInfo = new InstanceInfo<T>();
-
- instanceInfo.refBundleContext = refBundle.getBundleContext();
-
- instanceInfo.osgiInstance = getInstanceObject(instanceInfo, service);
-
- try {
-
- if (!isInitialized(instanceInfo.osgiInstance)) {
-
- annotationProcessor.injectProperties(instanceInfo.osgiInstance);
- callLifecycleMethod(instanceInfo.osgiInstance, Init.class);
-
- instanceInfo.isFirstInstance = true;
- }
-
- instanceInfoList.put(service, instanceInfo);
-
- } catch (Exception e) {
- throw new TargetInitializationException(e);
- }
-
- return instanceInfo.osgiInstance;
- }
-
-
-
- // This method is provided purely to implement InstanceWrapper interface, and is never called.
- public T getInstance() {
-
- return null;
- }
-
- public void start() throws TargetInitializationException {
-
- if (provider.isEagerInit()) {
- List<ComponentService> services = provider.getRuntimeComponent().getServices();
- for (ComponentService service : services) {
- getInstance(service);
- }
- }
- }
-
- public synchronized void stop() throws TargetDestructionException {
-
- for (InstanceInfo<T> instanceInfo : instanceInfoList.values()) {
- if (instanceInfo.osgiInstance != null && instanceInfo.osgiServiceReference != null) {
-
- try {
-
- if (instanceInfo.isFirstInstance)
- callLifecycleMethod(instanceInfo.osgiInstance, Destroy.class);
-
- instanceInfo.refBundleContext.ungetService(instanceInfo.osgiServiceReference);
-
- instanceInfo.osgiInstance = null;
- instanceInfo.osgiServiceReference = null;
-
- } catch (Exception e) {
- throw new TargetDestructionException(e);
- }
- }
- }
- instanceInfoList.clear();
- if (dummyReferenceBundle != null) {
- try {
- dummyReferenceBundle.uninstall();
- } catch (BundleException e) {
- throw new TargetDestructionException(e);
- }
- dummyReferenceBundle = null;
- }
- }
-
- @SuppressWarnings("unchecked")
- private T getInstanceObject(InstanceInfo<T> instanceInfo, ComponentService service) {
-
- /**
- * Since implementation.osgi is not well integrated with the OSGi lifecycle
- * it is possible that the service is deactivated before the service instance
- * is obtained when using declarative services. Retry in this case.
- */
- int maxRetries = 10;
- for (int i = 0; i < maxRetries; i++) {
- instanceInfo.osgiServiceReference = provider.getOSGiServiceReference(service);
- if (instanceInfo.osgiServiceReference == null)
- return null;
- T obj = (T)instanceInfo.refBundleContext.getService(instanceInfo.osgiServiceReference);
- if (obj != null)
- return obj;
- }
- return null;
- }
-
- private Bundle getDummyReferenceBundle() throws TargetInitializationException {
-
- if (dummyReferenceBundle != null)
- return dummyReferenceBundle;
-
- ByteArrayOutputStream out = new ByteArrayOutputStream();
-
- String EOL = System.getProperty("line.separator");
- String bundleName = "dummy.sca." + RANDOM_NUMBER_GENERATOR.nextInt();
-
-
- String manifestStr = "Manifest-Version: 1.0" + EOL +
- "Bundle-ManifestVersion: 2" + EOL +
- "Bundle-Name: " + bundleName + EOL +
- "Bundle-SymbolicName: " + bundleName + EOL +
- "Bundle-Version: " + "1.0.0" + EOL +
- "Bundle-Localization: plugin" + EOL;
-
-
- StringBuilder manifestBuf = new StringBuilder();
- manifestBuf.append(manifestStr);
-
- try {
- ByteArrayInputStream manifestStream = new ByteArrayInputStream(manifestBuf.toString().getBytes());
- Manifest manifest = new Manifest();
- manifest.read(manifestStream);
-
-
- JarOutputStream jarOut = new JarOutputStream(out, manifest);
-
- jarOut.close();
- out.close();
-
-
- ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
-
- dummyReferenceBundle = bundleContext.installBundle("file://" + bundleName + ".jar", in);
-
- dummyReferenceBundle.start();
-
- } catch (Exception e) {
- throw new TargetInitializationException(e);
- }
-
- return dummyReferenceBundle;
-
- }
-
- private void callLifecycleMethod(Object instance,
- Class<? extends Annotation> annotationClass) throws Exception {
-
- Method method = null;
- if (annotationClass == Init.class) {
- method = annotationProcessor.getInitMethod(instance);
- } else if (annotationClass == Destroy.class) {
- method = annotationProcessor.getDestroyMethod(instance);
- }
-
- if (method != null) {
- method.setAccessible(true);
- method.invoke(instance);
- }
- }
-
- private boolean isInitialized(Object instance) {
- for (InstanceInfo<?> info : instanceInfoList.values()) {
- if (info.osgiInstance == instance)
- return true;
- }
- return false;
- }
-
- private static class InstanceInfo<T> {
- private T osgiInstance;
- private ServiceReference osgiServiceReference;
- private BundleContext refBundleContext;
- private boolean isFirstInstance;
-
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiRemotableInvoker.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiRemotableInvoker.java
deleted file mode 100644
index deb44d26fb..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiRemotableInvoker.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.implementation.osgi.runtime;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.IdentityHashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.databinding.DataBinding;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.implementation.osgi.context.OSGiAnnotations;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * An interceptor to enforce pass-by-value semantics for remotable interfaces
- *
- * @version $Rev$ $Date$
- */
-public class OSGiRemotableInvoker extends OSGiTargetInvoker implements DataExchangeSemantics {
-
- private DataBindingExtensionPoint registry;
- private Operation operation;
- private OSGiAnnotations osgiAnnotations;
-
- /**
- * @param registry
- * @param operation
- * @param method
- * @param component
- */
- public OSGiRemotableInvoker(OSGiAnnotations osgiAnnotations,
- DataBindingExtensionPoint registry,
- Operation operation,
- OSGiImplementationProvider provider,
- RuntimeComponentService service) {
- super(operation, provider, service);
- this.osgiAnnotations = osgiAnnotations;
- this.registry = registry;
- this.operation = operation;
- }
-
- @Override
- public Object invokeMethod(Object targetObject, Method m, Message msg) throws InvocationTargetException {
-
- Object result;
- if (osgiAnnotations.isAllowsPassByReference(targetObject, m)) {
- result = super.invokeMethod(targetObject, m, msg);
- } else {
- Object obj = msg.getBody();
- msg.setBody(copy((Object[])obj));
-
- result = super.invokeMethod(targetObject, m, msg);
-
- if (operation.getOutputType() != null) {
- String dataBindingId = operation.getOutputType().getDataBinding();
- DataBinding dataBinding = registry.getDataBinding(dataBindingId);
- result = copy(result, operation.getOutputType(), dataBinding);
- }
- }
- return result;
- }
-
- public Object[] copy(Object[] args) {
- if (args == null) {
- return null;
- }
- Object[] copiedArgs = new Object[args.length];
- Map<Object, Object> map = new IdentityHashMap<Object, Object>();
- for (int i = 0; i < args.length; i++) {
- if (args[i] == null) {
- copiedArgs[i] = null;
- } else {
- Object copiedArg = map.get(args[i]);
- if (copiedArg != null) {
- copiedArgs[i] = copiedArg;
- } else {
- DataType dt = operation.getInputType().getLogical().get(i);
- String dataBindingId = dt.getDataBinding();
- DataBinding dataBinding = registry.getDataBinding(dataBindingId);
- copiedArg = copy(args[i], dt, dataBinding);
- map.put(args[i], copiedArg);
- copiedArgs[i] = copiedArg;
- }
- }
- }
- return copiedArgs;
- }
-
- public Object copy(Object arg, DataType dataType, DataBinding argDataBinding) {
- if (arg == null) {
- return null;
- }
- Object copiedArg;
- if (argDataBinding != null) {
- copiedArg = argDataBinding.copy(arg, dataType, operation);
- } else {
- copiedArg = arg;
- dataType = registry.introspectType(arg, operation);
- if (dataType != null) {
- DataBinding binding = registry.getDataBinding(dataType.getDataBinding());
- if (binding != null) {
- copiedArg = binding.copy(arg, dataType, operation);
- }
- }
- // FIXME: What to do if it's not recognized?
- }
- return copiedArg;
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.PassByValueAware#allowsPassByReference()
- */
- public boolean allowsPassByReference() {
- return true;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTargetInvoker.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTargetInvoker.java
deleted file mode 100644
index deb39a47cd..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTargetInvoker.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.osgi.runtime;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.core.context.InstanceWrapper;
-import org.apache.tuscany.sca.core.invocation.TargetInvocationException;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.TargetResolutionException;
-import org.apache.tuscany.sca.interfacedef.ConversationSequence;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Java->OSGi references use OSGiTargetInvoker to call methods from OSGi bundles
- * OSGi->Java references use JDKProxyService and invocation handler and do not use this class
- * OSGi->OSGi references go through OSGi reference mechanisms when a proxy is not used
- * When a proxy is used, this invoker is used to call methods from OSGi bundles
- * A proxy is used for OSGi->OSGi if
- * 1) target reference properties are specified OR
- * 2) there are one or more non-blocking methods in the target interface OR
- * 3) scope is not COMPOSITE
- *
- * @version $Rev$ $Date$
- */
-public class OSGiTargetInvoker<T> implements Invoker {
-
- private Operation operation;
- protected InstanceWrapper<T> target;
-
- private final OSGiImplementationProvider provider;
- private final RuntimeComponentService service;
-
- // Scope container is reset by the OSGi implementation provider if @Scope
- // annotation is used to modify the scope (default is composite)
- // Hence this field is initialized on the first invoke.
- private ScopeContainer scopeContainer;
-
- public OSGiTargetInvoker(
- Operation operation,
- OSGiImplementationProvider provider,
- RuntimeComponentService service) {
-
-
- this.operation = operation;
- this.service = service;
- this.provider = provider;
-
- }
-
- /**
- * Resolves the target service instance or returns a cached one
- */
- @SuppressWarnings("unchecked")
- protected InstanceWrapper getInstance(Object contextId)
- throws TargetResolutionException, TargetInvocationException {
-
- if (scopeContainer == null)
- scopeContainer = provider.getScopeContainer();
-
-
- return scopeContainer.getWrapper(contextId);
-
- }
-
- @SuppressWarnings("unchecked")
- private Object invokeTarget(Message msg) throws InvocationTargetException {
-
- if (scopeContainer == null)
- scopeContainer = provider.getScopeContainer();
-
-
- Operation op = msg.getOperation();
- if (op == null) {
- op = this.operation;
- }
- ConversationSequence sequence = op.getConversationSequence();
-
- 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 {
-
- OSGiInstanceWrapper wrapper = (OSGiInstanceWrapper)getInstance(contextId);
- Object instance;
-
-
- // 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;
- }
-
- instance = wrapper.getInstance(service);
-
- Method m = JavaInterfaceUtil.findMethod(instance.getClass(), operation);
-
- Object ret = invokeMethod(instance, m, msg);
-
- 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);
- }
-
- return ret;
- } catch (InvocationTargetException e) {
- throw e;
- } catch (Exception e) {
- throw new InvocationTargetException(e);
- }
- }
-
- protected Object invokeMethod(Object instance, Method m, Message msg) throws InvocationTargetException {
-
- try {
-
- Object payload = msg.getBody();
-
- if (payload != null && !payload.getClass().isArray()) {
- return m.invoke(instance, payload);
- } else {
- return m.invoke(instance, (Object[])payload);
- }
-
- } catch (InvocationTargetException e) {
- throw e;
- } catch (Exception e) {
- throw new InvocationTargetException(e);
- }
- }
-
- public Message invoke(Message msg) {
- try {
- // Object messageId = msg.getMessageID();
- // Message workContext = ThreadMessageContext.getMessageContext();
- // if (messageId != null) {
- // workContext.setCorrelationID(messageId);
- // }
- Object resp = invokeTarget(msg);
- msg.setBody(resp);
- } catch (InvocationTargetException e) {
- msg.setFaultBody(e.getCause());
- }
- return msg;
- }
-
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java b/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java
deleted file mode 100644
index 7f246cb76c..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java
+++ /dev/null
@@ -1,550 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.osgi.xml;
-
-import static javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI;
-import static javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-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.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.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.osgi.BundleReference;
-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.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.implementation.osgi.impl.OSGiImplementationImpl;
-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.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.osgi.framework.Bundle;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- *
- * Process an <implementation.osgi/> element in a component definition. An instance of
- * OSGiImplementation is created.
- * Also associates the component type file with the implementation.
- *
- * @version $Rev$ $Date$
- */
-public class OSGiImplementationProcessor implements StAXArtifactProcessor<OSGiImplementationImpl> {
-
- public static final QName IMPLEMENTATION_OSGI = new QName(Constants.SCA10_TUSCANY_NS, "implementation.osgi");
-
- private static final String BUNDLE_SYMBOLICNAME= "bundleSymbolicName";
- private static final String BUNDLE_VERSION = "bundleVersion";
- private static final String CLASSES = "classes";
- private static final String IMPORTS = "imports";
-
- private static final QName PROPERTIES_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "properties");
- private static final QName PROPERTY_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "property");
-
- private JavaInterfaceFactory javaInterfaceFactory;
- private AssemblyFactory assemblyFactory;
- private ModelFactoryExtensionPoint modelFactories;
- private Monitor monitor;
-
- private static final DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
- static {
- domFactory.setNamespaceAware(true);
- }
-
- public OSGiImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.monitor = monitor;
- this.modelFactories = modelFactories;
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.javaInterfaceFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- }
-
- /**
- * Report a exception.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "impl-osgi-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 = new ProblemImpl(this.getClass().getName(), "impl-osgi-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return IMPLEMENTATION_OSGI;
- }
-
- public Class<OSGiImplementationImpl> getModelType() {
- return OSGiImplementationImpl.class;
- }
-
- private String[] tokenize(String str) {
- StringTokenizer tokenizer = new StringTokenizer(str);
- String[] tokens = new String[tokenizer.countTokens()];
- for (int i= 0; i < tokens.length; i++) {
- tokens[i] = tokenizer.nextToken();
- }
-
- return tokens;
- }
-
- public OSGiImplementationImpl read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- assert IMPLEMENTATION_OSGI.equals(reader.getName());
-
- String bundleSymbolicName = reader.getAttributeValue(null, BUNDLE_SYMBOLICNAME);
- String bundleVersion = reader.getAttributeValue(null, BUNDLE_VERSION);
- String imports = reader.getAttributeValue(null, IMPORTS);
- String[] importList;
- if (imports != null)
- importList = tokenize(imports);
- else
- importList = new String[0];
- String classes = reader.getAttributeValue(null, CLASSES);
- String[] classList;
- if (classes != null)
- classList = tokenize(classes);
- else
- classList = new String[0];
-
- Hashtable<String, List<ComponentProperty>> refProperties =
- new Hashtable<String, List<ComponentProperty>>();
- Hashtable<String, List<ComponentProperty>> serviceProperties =
- new Hashtable<String, List<ComponentProperty>>();
- Hashtable<String, List<ComponentProperty>> refCallbackProperties =
- new Hashtable<String, List<ComponentProperty>>();
- Hashtable<String, List<ComponentProperty>> serviceCallbackProperties =
- new Hashtable<String, List<ComponentProperty>>();
-
- while (reader.hasNext()) {
-
- int next = reader.next();
- if (next == END_ELEMENT && IMPLEMENTATION_OSGI.equals(reader.getName())) {
- break;
- }
- else if (next == START_ELEMENT && PROPERTIES_QNAME.equals(reader.getName())) {
-
- // FIXME: This is temporary code which allows reference and service properties used
- // for filtering OSGi services to be specified in <implementation.osgi/>
- // This should really be provided in the component type file since these
- // properties are associated with an implementation rather than a configured
- // instance of an implementation.
- String refName = reader.getAttributeValue(null, "reference");
- String serviceName = reader.getAttributeValue(null, "service");
- String refCallbackName = reader.getAttributeValue(null, "referenceCallback");
- String serviceCallbackName = reader.getAttributeValue(null, "serviceCallback");
- List<ComponentProperty> props = readProperties(reader);
- if (refName != null)
- refProperties.put(refName, props);
- else if (serviceName != null)
- serviceProperties.put(serviceName, props);
- else if (refCallbackName != null)
- refCallbackProperties.put(refCallbackName, props);
- else if (serviceCallbackName != null)
- serviceCallbackProperties.put(serviceCallbackName, props);
- else {
- error("PropertyShouldSpecifySR", reader);
- //throw new ContributionReadException("Properties in implementation.osgi should specify service or reference");
- }
- }
-
- }
-
- OSGiImplementationImpl implementation = new OSGiImplementationImpl(
- modelFactories,
- bundleSymbolicName,
- bundleVersion,
- importList,
- classList,
- refProperties,
- serviceProperties);
- implementation.setCallbackProperties(refCallbackProperties, serviceCallbackProperties);
-
- implementation.setUnresolved(true);
-
- return implementation;
-
- }
-
-
- public void resolve(OSGiImplementationImpl impl, ModelResolver resolver) throws ContributionResolveException {
-
- try {
-
- if (impl == null || !impl.isUnresolved())
- return;
-
- impl.setUnresolved(false);
-
- BundleReference bundleReference = new BundleReference(impl.getBundleSymbolicName(), impl.getBundleVersion());
- BundleReference resolvedBundle = resolver.resolveModel(BundleReference.class, bundleReference);
- Bundle bundle = (Bundle)resolvedBundle.getBundle();
- if (bundle != null) {
- impl.setOSGiBundle(bundle);
- } else {
- error("CouldNotLocateOSGiBundle", impl, impl.getBundleSymbolicName());
- //throw new ContributionResolveException("Could not locate OSGi bundle " +
- //impl.getBundleSymbolicName());
- return;
- }
-
- String bundleName = resolvedBundle.getBundleRelativePath();
- String ctURI = bundleName.endsWith(".jar") || bundleName.endsWith(".JAR")?
- bundleName.substring(0, bundleName.lastIndexOf(".")) : bundleName;
- ctURI = ctURI.replaceAll("\\.", "/");
- ctURI = ctURI + ".componentType";
-
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setURI(ctURI);
- componentType.setUnresolved(true);
- componentType = resolver.resolveModel(ComponentType.class, componentType);
- if (componentType.isUnresolved()) {
- error("MissingComponentTypeFile", impl, ctURI);
- //throw new ContributionResolveException("missing .componentType side file " + ctURI);
- return;
- }
-
- List<Service> services = componentType.getServices();
- for (Service service : services) {
- Interface interfaze = service.getInterfaceContract().getInterface();
- if (interfaze instanceof JavaInterface) {
- JavaInterface javaInterface = (JavaInterface)interfaze;
- if (javaInterface.getJavaClass() == null) {
-
- javaInterface.setJavaClass(getJavaClass(resolver, javaInterface.getName()));
- }
- Class<?> callback = null;
- if (service.getInterfaceContract().getCallbackInterface() instanceof JavaInterface) {
- JavaInterface callbackInterface = (JavaInterface)service.getInterfaceContract().getCallbackInterface();
- if (callbackInterface.getJavaClass() == null) {
- callbackInterface.setJavaClass(getJavaClass(resolver, callbackInterface.getName()));
- }
- callback = callbackInterface.getJavaClass();
- }
-
- Service serv = createService(service, javaInterface.getJavaClass(), callback);
- impl.getServices().add(serv);
- }
- }
-
- List<Reference> references = componentType.getReferences();
- for (Reference reference : references) {
- Interface interfaze = reference.getInterfaceContract().getInterface();
- if (interfaze instanceof JavaInterface) {
- JavaInterface javaInterface = (JavaInterface)interfaze;
- if (javaInterface.getJavaClass() == null) {
- javaInterface.setJavaClass(getJavaClass(resolver, javaInterface.getName()));
- }
- Reference ref = createReference(reference, javaInterface.getJavaClass());
- impl.getReferences().add(ref);
- }
- else
- impl.getReferences().add(reference);
- }
-
- List<Property> properties = componentType.getProperties();
- for (Property property : properties) {
- impl.getProperties().add(property);
- }
- impl.setConstrainingType(componentType.getConstrainingType());
-
- } catch (InvalidInterfaceException e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", resolver, ce);
- //throw ce;
- }
-
- }
-
-
- private Class getJavaClass(ModelResolver resolver, String className) {
- ClassReference ref = new ClassReference(className);
- ref = resolver.resolveModel(ClassReference.class, ref);
- return ref.getJavaClass();
- }
-
- private Service createService(Service serv, Class<?> interfaze, Class<?> callbackInterfaze) throws InvalidInterfaceException {
- Service service = assemblyFactory.createService();
- JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- service.setInterfaceContract(interfaceContract);
-
-
- // create a relative URI
- service.setName(serv.getName());
-
- JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(interfaze);
- service.getInterfaceContract().setInterface(callInterface);
-
- if (callbackInterfaze != null) {
- JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callbackInterfaze);
- service.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
- else if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
- service.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
- return service;
- }
-
- private Reference createReference(Reference ref, Class<?> clazz) throws InvalidInterfaceException {
- org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference();
- JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- reference.setInterfaceContract(interfaceContract);
-
- reference.setName(ref.getName());
- reference.setMultiplicity(ref.getMultiplicity());
-
- JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(clazz);
- reference.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
- reference.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
-
- return reference;
- }
-
- public void write(OSGiImplementationImpl model, XMLStreamWriter outputSource) throws ContributionWriteException, XMLStreamException {
-
- //FIXME Implement this method
- }
-
-
- private QName getQNameValue(XMLStreamReader reader, String value) {
- if (value != null) {
- int index = value.indexOf(':');
- String prefix = index == -1 ? "" : value.substring(0, index);
- String localName = index == -1 ? value : value.substring(index + 1);
- String ns = reader.getNamespaceContext().getNamespaceURI(prefix);
- if (ns == null) {
- ns = "";
- }
- return new QName(ns, localName, prefix);
- } else {
- return null;
- }
- }
-
- private void declareNamespace(Element element, String prefix, String ns) {
- String qname = null;
- if ("".equals(prefix)) {
- qname = "xmlns";
- } else {
- qname = "xmlns:" + prefix;
- }
- Node node = element;
- boolean declared = false;
- while (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
- NamedNodeMap attrs = node.getAttributes();
- if (attrs == null) {
- break;
- }
- Node attr = attrs.getNamedItem(qname);
- if (attr != null) {
- declared = ns.equals(attr.getNodeValue());
- break;
- }
- node = node.getParentNode();
- }
- if (!declared) {
- org.w3c.dom.Attr attr = element.getOwnerDocument().createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, qname);
- attr.setValue(ns);
- element.setAttributeNodeNS(attr);
- }
- }
-
- 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);
- }
-
- private void loadElement(XMLStreamReader reader, Element root) throws XMLStreamException {
- Document document = root.getOwnerDocument();
- Node current = root;
- while (true) {
- switch (reader.next()) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- Element child = createElement(document, name);
-
- // push the new element and make it the current one
- current.appendChild(child);
- current = child;
-
- declareNamespace(child, name.getPrefix(), name.getNamespaceURI());
-
- int count = reader.getNamespaceCount();
- for (int i = 0; i < count; i++) {
- String prefix = reader.getNamespacePrefix(i);
- String ns = reader.getNamespaceURI(i);
- declareNamespace(child, prefix, ns);
- }
-
- // add the attributes for this element
- count = reader.getAttributeCount();
- for (int i = 0; i < count; i++) {
- String ns = reader.getAttributeNamespace(i);
- String prefix = reader.getAttributePrefix(i);
- String localPart = reader.getAttributeLocalName(i);
- String value = reader.getAttributeValue(i);
- child.setAttributeNS(ns, localPart, value);
- declareNamespace(child, prefix, ns);
- }
-
- break;
- case XMLStreamConstants.CDATA:
- current.appendChild(document.createCDATASection(reader.getText()));
- break;
- case XMLStreamConstants.CHARACTERS:
- current.appendChild(document.createTextNode(reader.getText()));
- break;
- case XMLStreamConstants.END_ELEMENT:
- // if we are back at the root then we are done
- if (current == root) {
- return;
- }
-
- // pop the element off the stack
- current = current.getParentNode();
- }
- }
- }
-
- private Document readPropertyValue(XMLStreamReader reader, QName type)
- throws XMLStreamException, ParserConfigurationException {
-
- Document doc = domFactory.newDocumentBuilder().newDocument();
-
- // root element has no namespace and local name "value"
- Element root = doc.createElementNS(null, "value");
- if (type != null) {
- org.w3c.dom.Attr xsi = doc.createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, "xmlns:xsi");
- xsi.setValue(W3C_XML_SCHEMA_INSTANCE_NS_URI);
- root.setAttributeNodeNS(xsi);
-
- String prefix = type.getPrefix();
- if (prefix == null || prefix.length() == 0) {
- prefix = "ns";
- }
-
- declareNamespace(root, prefix, type.getNamespaceURI());
-
- org.w3c.dom.Attr xsiType = doc.createAttributeNS(W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi:type");
- xsiType.setValue(prefix + ":" + type.getLocalPart());
- root.setAttributeNodeNS(xsiType);
- }
- doc.appendChild(root);
-
- loadElement(reader, root);
- return doc;
- }
-
- private void readProperty(ComponentProperty prop, XMLStreamReader reader)
- throws XMLStreamException, ContributionReadException {
-
-
- prop.setName(reader.getAttributeValue(null, "name"));
- String xsdType = reader.getAttributeValue(null, "type");
- if (xsdType != null)
- prop.setXSDType(getQNameValue(reader, xsdType));
- else
- prop.setXSDType(SimpleTypeMapperImpl.XSD_STRING);
-
- try {
- Document value = readPropertyValue(reader, prop.getXSDType());
- prop.setValue(value);
- } catch (ParserConfigurationException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", reader, ce);
- throw ce;
- }
- }
-
- private List<ComponentProperty> readProperties(XMLStreamReader reader)
- throws XMLStreamException, ContributionReadException {
-
- List<ComponentProperty> properties = new ArrayList<ComponentProperty>();
-
- while (reader.hasNext()) {
-
- int next = reader.next();
- if (next == END_ELEMENT && PROPERTIES_QNAME.equals(reader.getName())) {
- break;
- }
- else if (next == START_ELEMENT && PROPERTY_QNAME.equals(reader.getName())) {
-
- ComponentProperty componentProperty = assemblyFactory.createComponentProperty();
- readProperty(componentProperty, reader);
- properties.add(componentProperty);
- }
- }
-
- return properties;
-
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/implementation-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 9ecff71874..0000000000
--- a/branches/sca-android/modules/implementation-osgi/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.osgi.xml.OSGiImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.osgi,model=org.apache.tuscany.sca.implementation.osgi.OSGiImplementation
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-android/modules/implementation-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index c2cd957351..0000000000
--- a/branches/sca-android/modules/implementation-osgi/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.osgi.runtime.OSGiImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.osgi.OSGiImplementation
diff --git a/branches/sca-android/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.properties b/branches/sca-android/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.properties
deleted file mode 100644
index 2503be0b13..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.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.
-#
-#
-ContributionReadException = ContributionReadException occured due to:
-ContributionResolveException = ContributionResolveException occured due to:
-PropertyShouldSpecifySR = Properties in implementation.osgi should specify service or reference
-CouldNotLocateOSGiBundle = Could not locate OSGi bundle: {0}
-MissingComponentTypeFile = Missing .componentType side file: {0} \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiPropertyTestCase.java b/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiPropertyTestCase.java
deleted file mode 100644
index fb4cb4207a..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiPropertyTestCase.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.osgi.runtime;
-
-import org.apache.tuscany.sca.implementation.osgi.test.OSGiTestBundles;
-import org.apache.tuscany.sca.implementation.osgi.test.OSGiTestInterface;
-import org.apache.tuscany.sca.implementation.osgi.test.OSGiTestWithPropertyImpl;
-
-
-/**
- *
- * Test the execution of an OSGi implementation type
- *
- * @version $Rev$ $Date$
- */
-public class OSGiPropertyTestCase extends OSGiTestCase {
-
- @Override
- protected void setUp() throws Exception {
-
- className = OSGiTestWithPropertyImpl.class.getName();
- compositeName = "osgiproptest.composite";
-
- OSGiTestBundles.createBundle("target/test-classes/OSGiTestService.jar",
- OSGiTestInterface.class,
- OSGiTestWithPropertyImpl.class);
-
- }
-
-
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTestCase.java b/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTestCase.java
deleted file mode 100644
index 6a6d80f15e..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTestCase.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.osgi.runtime;
-
-import java.lang.reflect.Proxy;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.apache.tuscany.sca.implementation.osgi.test.OSGiTestBundles;
-import org.apache.tuscany.sca.implementation.osgi.test.OSGiTestImpl;
-import org.apache.tuscany.sca.implementation.osgi.test.OSGiTestInterface;
-import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
-
-
-/**
- *
- * Test the execution of an OSGi implementation type
- *
- * @version $Rev$ $Date$
- */
-public class OSGiTestCase extends TestCase {
-
- protected String className;
- protected String compositeName;
-
- protected void setUp() throws Exception {
-
- className = OSGiTestImpl.class.getName();
- compositeName = "osgitest.composite";
- OSGiTestBundles.createBundle("target/test-classes/OSGiTestService.jar", OSGiTestInterface.class, OSGiTestImpl.class);
-
- }
-
-
- @Override
- protected void tearDown() throws Exception {
- OSGiRuntime.stop();
- }
-
- public void testOSGiComponent() throws Exception {
-
- SCADomain scaDomain = SCADomain.newInstance(compositeName);
- OSGiTestInterface testService = scaDomain.getService(OSGiTestInterface.class, "OSGiTestServiceComponent");
- assert(testService != null);
-
- assert(testService instanceof Proxy);
-
- String str = testService.testService();
-
- assertEquals(className, str);
-
- scaDomain.close();
-
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestBundles.java b/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestBundles.java
deleted file mode 100644
index 93b4dee033..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestBundles.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.osgi.test;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.net.URL;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-
-
-/**
- *
- * Utility class to create OSGi bundles
- *
- * @version $Rev$ $Date$
- */
-public class OSGiTestBundles {
- private static String getPackageName(Class<?> cls) {
- String name = cls.getName();
- int index = name.lastIndexOf('.');
- return index == -1 ? "" : name.substring(0, index);
- }
-
- public static void createBundle(String jarName,
- Class<?> interfaceClass, Class<?> implClass) throws Exception {
-
- ByteArrayOutputStream out = new ByteArrayOutputStream();
-
- String EOL = System.getProperty("line.separator");
-
- String packageName = getPackageName(interfaceClass);
- String bundleName = interfaceClass.getName();
-
- String manifestStr = "Manifest-Version: 1.0" + EOL
- + "Bundle-ManifestVersion: 2" + EOL + "Bundle-Name: "
- + bundleName + EOL + "Bundle-SymbolicName: " + bundleName + EOL
- + "Bundle-Version: " + "1.0.0" + EOL
- + "Bundle-Localization: plugin" + EOL;
-
- StringBuilder manifestBuf = new StringBuilder();
- manifestBuf.append(manifestStr);
- manifestBuf.append("Export-Package: " + packageName + EOL);
- manifestBuf.append("Import-Package: org.osgi.framework" + EOL);
- manifestBuf.append("Bundle-Activator: " + implClass.getName() + EOL);
-
- ByteArrayInputStream manifestStream = new ByteArrayInputStream(manifestBuf.toString().getBytes());
- Manifest manifest = new Manifest();
- manifest.read(manifestStream);
-
-
- JarOutputStream jarOut = new JarOutputStream(out, manifest);
-
- String interfaceClassName = interfaceClass.getName().replaceAll("\\.",
- "/")
- + ".class";
-
- URL url = interfaceClass.getClassLoader().getResource(
- interfaceClassName);
- String path = url.getPath();
-
- ZipEntry ze = new ZipEntry(interfaceClassName);
-
- jarOut.putNextEntry(ze);
- FileInputStream file = new FileInputStream(path);
- byte[] fileContents = new byte[file.available()];
- file.read(fileContents);
- jarOut.write(fileContents);
-
- String implClassName = implClass.getName().replaceAll("\\.",
- "/")
- + ".class";
-
- url = implClass.getClassLoader().getResource(implClassName);
- path = url.getPath();
-
- ze = new ZipEntry(implClassName);
-
- jarOut.putNextEntry(ze);
- file = new FileInputStream(path);
- fileContents = new byte[file.available()];
- file.read(fileContents);
- jarOut.write(fileContents);
-
- file.close();
-
- jarOut.close();
- out.close();
-
- FileOutputStream fileOut = new FileOutputStream(jarName);
- fileOut.write(out.toByteArray());
- fileOut.close();
-
-
- }
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestImpl.java b/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestImpl.java
deleted file mode 100644
index d412f6bd6a..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestImpl.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.osgi.test;
-
-import java.util.Hashtable;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- *
- * Test class - Implementation of an OSGi service
- *
- * @version $Rev$ $Date$
- */
-public class OSGiTestImpl implements OSGiTestInterface, BundleActivator {
-
- public String testService() {
-
- return OSGiTestImpl.class.getName();
-
- }
-
- public void start(BundleContext bc) throws Exception {
-
- bc.registerService(OSGiTestInterface.class.getName(), this, new Hashtable<String, Object>());
-
- }
-
- public void stop(BundleContext bc) throws Exception {
- }
-
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestInterface.java b/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestInterface.java
deleted file mode 100644
index feb9ce177e..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestInterface.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.osgi.test;
-
-/**
- *
- * Test class - Interface for an OSGi service
- *
- * @version $Rev$ $Date$
- */
-public interface OSGiTestInterface {
-
- String testService() throws Exception ;
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestWithPropertyImpl.java b/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestWithPropertyImpl.java
deleted file mode 100644
index 630c1502d1..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestWithPropertyImpl.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.osgi.test;
-
-import java.util.Hashtable;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osoa.sca.annotations.Property;
-
-/**
- *
- * Test class - Implementation of an OSGi service
- *
- * @version $Rev$ $Date$
- */
-public class OSGiTestWithPropertyImpl implements OSGiTestInterface, BundleActivator {
-
- @Property
- public double exchangeRate;
-
- private String currency;
-
- @Property
- public void setCurrency(String currency) {
- this.currency = currency;
- }
-
- public String testService() throws Exception {
-
- if (exchangeRate != 2.0)
- throw new Exception("Property exchangeRate not set correctly, expected 2.0, got " + exchangeRate);
- if (!"USD".equals(currency))
- throw new Exception("Property currency not set correctly, expected USD, got " + currency);
- return OSGiTestWithPropertyImpl.class.getName();
-
- }
-
- public void start(BundleContext bc) throws Exception {
-
- bc.registerService(OSGiTestInterface.class.getName(), this, new Hashtable<String, Object>());
-
- }
-
- public void stop(BundleContext bc) throws Exception {
- }
-
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java b/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java
deleted file mode 100644
index 1831587896..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.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.implementation.osgi.xml;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.implementation.osgi.impl.OSGiImplementationImpl;
-import org.apache.tuscany.sca.implementation.osgi.test.OSGiTestBundles;
-import org.apache.tuscany.sca.implementation.osgi.test.OSGiTestImpl;
-import org.apache.tuscany.sca.implementation.osgi.test.OSGiTestInterface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-
-/**
- * Test reading OSGi implementations.
- *
- * @version $Rev$ $Date$
- */
-public class OSGiReadImplTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private CompositeBuilder compositeBuilder;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
- IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, mapper, null);
-
- OSGiTestBundles.createBundle("target/test-classes/OSGiTestService.jar", OSGiTestInterface.class, OSGiTestImpl.class);
-
- }
-
- public void testReadComposite() throws Exception {
- InputStream is = getClass().getClassLoader().getResourceAsStream("osgitest.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
-
- compositeBuilder.build(composite);
- }
-
- public void testReadAndResolveComposite() throws Exception {
- InputStream is = getClass().getClassLoader().getResourceAsStream("osgitest.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
-
- is = getClass().getClassLoader().getResourceAsStream("OSGiTestService.componentType");
- reader = inputFactory.createXMLStreamReader(is);
- ComponentType componentType = (ComponentType)staxProcessor.read(reader);
-
- ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
- staxProcessor.resolve(componentType, resolver);
- resolver.addModel(componentType);
-
- staxProcessor.resolve(composite, resolver);
-
- compositeBuilder.build(composite);
- }
-
- public void testReadOSGiImplementation() throws Exception {
-
- String str = "<?xml version=\"1.0\" encoding=\"ASCII\"?>" +
- "<implementation.osgi xmlns=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://osgi\" " +
- "bundleSymbolicName=\"OSGiTestService\" " +
- "bundleVersion=\"2.0.0\" " +
- "imports=\"import1.jar import2.jar\"" +
- "/>";
- ByteArrayInputStream is = new ByteArrayInputStream(str.getBytes());
-
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- reader.next();
-
- OSGiImplementationImpl osgiImpl = (OSGiImplementationImpl)staxProcessor.read(reader);
-
- assertEquals(osgiImpl.getBundleSymbolicName(), "OSGiTestService");
- assertEquals(osgiImpl.getBundleVersion(), "2.0.0");
- assertTrue(osgiImpl.getImports().length == 2);
- assertEquals(osgiImpl.getImports()[0], "import1.jar");
- assertEquals(osgiImpl.getImports()[1], "import2.jar");
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/TestModelResolver.java b/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/TestModelResolver.java
deleted file mode 100644
index e1bbd97655..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/TestModelResolver.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.osgi.xml;
-
-import java.lang.ref.WeakReference;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.implementation.osgi.impl.OSGiImplementationImpl;
-
-
-/**
- * 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) {
-
- if (unresolved instanceof OSGiImplementationImpl && !(resolved instanceof OSGiImplementationImpl)) {
-
- OSGiImplementationImpl impl = ((OSGiImplementationImpl)unresolved);
- ComponentType componentType = (ComponentType)resolved;
-
- List<Property> properties = componentType.getProperties();
- for (Property property : properties) {
- impl.getProperties().add(property);
- }
- impl.setUnresolved(false);
- return unresolved;
- }
-
-
- // 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/branches/sca-android/modules/implementation-osgi/src/test/resources/OSGiTestService.componentType b/branches/sca-android/modules/implementation-osgi/src/test/resources/OSGiTestService.componentType
deleted file mode 100644
index 254ce99d59..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/resources/OSGiTestService.componentType
+++ /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.
--->
-<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <service name="OSGiTestService">
- <interface.java interface="org.apache.tuscany.sca.implementation.osgi.test.OSGiTestInterface"/>
- </service>
-
- <property name="currency" type="xsd:string" >GBP</property>
- <property name="exchangeRate" type="xsd:double" >1.0</property>
-
-</componentType>
diff --git a/branches/sca-android/modules/implementation-osgi/src/test/resources/osgiproptest.composite b/branches/sca-android/modules/implementation-osgi/src/test/resources/osgiproptest.composite
deleted file mode 100644
index 0b31145407..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/resources/osgiproptest.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"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- name="OSGiTestComposite">
-
- <component name="OSGiTestServiceComponent">
- <tuscany:implementation.osgi
- bundle="OSGiTestService"
- bundleSymbolicName="org.apache.tuscany.sca.implementation.osgi.test.OSGiTestInterface"
- classes="org.apache.tuscany.sca.implementation.osgi.test.OSGiTestWithPropertyImpl"
- />
-
- <property name="currency" type="xsd:string" >USD</property>
- <property name="exchangeRate" type="xsd:double" >2.0</property>
-
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-osgi/src/test/resources/osgitest.composite b/branches/sca-android/modules/implementation-osgi/src/test/resources/osgitest.composite
deleted file mode 100644
index 5465eec8d9..0000000000
--- a/branches/sca-android/modules/implementation-osgi/src/test/resources/osgitest.composite
+++ /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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- name="OSGiTestComposite">
-
- <component name="OSGiTestServiceComponent">
- <tuscany:implementation.osgi
- bundle="OSGiTestService"
- bundleSymbolicName="org.apache.tuscany.sca.implementation.osgi.test.OSGiTestInterface"
- />
-
- <property name="currency" type="xsd:string" >USD</property>
- <property name="exchangeRate" type="xsd:double" >2.0</property>
-
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-resource-runtime/LICENSE b/branches/sca-android/modules/implementation-resource-runtime/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/implementation-resource-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/branches/sca-android/modules/implementation-resource-runtime/META-INF/README b/branches/sca-android/modules/implementation-resource-runtime/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-resource-runtime/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-resource-runtime/NOTICE b/branches/sca-android/modules/implementation-resource-runtime/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/implementation-resource-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/branches/sca-android/modules/implementation-resource-runtime/pom.xml b/branches/sca-android/modules/implementation-resource-runtime/pom.xml
deleted file mode 100644
index cf63fd5766..0000000000
--- a/branches/sca-android/modules/implementation-resource-runtime/pom.xml
+++ /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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-resource-runtime</artifactId>
- <name>Apache Tuscany SCA Resource Implementation Runtime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-resource</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.implementation.resource.runtime</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.resource*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/GetResourceInvoker.java b/branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/GetResourceInvoker.java
deleted file mode 100644
index 582795625d..0000000000
--- a/branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/GetResourceInvoker.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.resource.provider;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-/**
- * An invoker for a get resource operation.
- *
- * @version $Rev$ $Date$
- */
-class GetResourceInvoker implements Invoker {
- private String locationURL;
-
- GetResourceInvoker(String locationURL) {
- this.locationURL = locationURL;
- }
-
- public Message invoke(Message msg) {
-
- // Get the resource id from the request message
- String id = (String)((Object[])msg.getBody())[0];
- try {
-
- // Return an input stream for the resource
- URL url = new URL(locationURL +'/' + id);
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- InputStream is = connection.getInputStream();
- msg.setBody(is);
- } catch (MalformedURLException e) {
-
- // Report exception as a fault
- msg.setFaultBody(e);
- } catch (IOException e) {
-
- // Report exception as a fault
- msg.setFaultBody(e);
- }
- return msg;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProvider.java b/branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProvider.java
deleted file mode 100644
index a974f68a7e..0000000000
--- a/branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProvider.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.resource.provider;
-
-import org.apache.tuscany.sca.implementation.resource.ResourceImplementation;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * The model representing a resource implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-class ResourceImplementationProvider implements ImplementationProvider {
-
- private ResourceImplementation implementation;
-
- /**
- * Constructs a new resource implementation provider.
- */
- ResourceImplementationProvider(RuntimeComponent component, ResourceImplementation implementation) {
- this.implementation = implementation;
- }
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- if ("get".equals(operation.getName())) {
-
- // Return an instance of our get resource invoker
- Invoker invoker = new GetResourceInvoker(implementation.getLocationURL().toString());
- return invoker;
-
- } else {
-
- // Return a dummy invoker that returns an "unsupported operation"
- // exception for now
- return new Invoker() {
- public Message invoke(Message msg) {
- msg.setFaultBody(new UnsupportedOperationException());
- return msg;
- }
- };
- }
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProviderFactory.java b/branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProviderFactory.java
deleted file mode 100644
index 47e70b5581..0000000000
--- a/branches/sca-android/modules/implementation-resource-runtime/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProviderFactory.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.resource.provider;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.resource.ResourceImplementation;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * A factory for resource implementation providers.
- *
- * @version $Rev$ $Date$
- */
-public class ResourceImplementationProviderFactory implements ImplementationProviderFactory<ResourceImplementation> {
-
- /**
- * Constructs a resource implementation.
- */
- public ResourceImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component, ResourceImplementation implementation) {
- return new ResourceImplementationProvider(component, implementation);
- }
-
- public Class<ResourceImplementation> getModelType() {
- return ResourceImplementation.class;
- }
-}
diff --git a/branches/sca-android/modules/implementation-resource-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-android/modules/implementation-resource-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index 656d8c2751..0000000000
--- a/branches/sca-android/modules/implementation-resource-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.resource.provider.ResourceImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.resource.ResourceImplementation
diff --git a/branches/sca-android/modules/implementation-resource-runtime/src/test/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationTestCase.java b/branches/sca-android/modules/implementation-resource-runtime/src/test/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationTestCase.java
deleted file mode 100644
index 03f10e78e8..0000000000
--- a/branches/sca-android/modules/implementation-resource-runtime/src/test/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationTestCase.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.implementation.resource;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ResourceImplementationTestCase extends TestCase {
-
- private SCADomain scaDomain;
-
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("resource.composite");
- }
-
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- public void testResource() throws Exception {
- Resource resource = scaDomain.getService(Resource.class, "ResourceServiceComponent");
- InputStream is = resource.get("test.html");
- String document = read(is);
- assertTrue(document.indexOf("<body><p>hello</body>") != -1);
- }
-
- /**
- * Read response stream from the given input stream.
- * @param is
- * @return
- * @throws IOException
- */
- 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();
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-resource-runtime/src/test/resources/content/test.html b/branches/sca-android/modules/implementation-resource-runtime/src/test/resources/content/test.html
deleted file mode 100644
index f4b79d7f01..0000000000
--- a/branches/sca-android/modules/implementation-resource-runtime/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/branches/sca-android/modules/implementation-resource-runtime/src/test/resources/resource.composite b/branches/sca-android/modules/implementation-resource-runtime/src/test/resources/resource.composite
deleted file mode 100644
index 4654056cd7..0000000000
--- a/branches/sca-android/modules/implementation-resource-runtime/src/test/resources/resource.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/resource"
- xmlns:sr="http://sample/resource"
- name="resource">
-
- <component name="ResourceServiceComponent">
- <tuscany:implementation.resource location="content"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-resource/LICENSE b/branches/sca-android/modules/implementation-resource/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/implementation-resource/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/implementation-resource/META-INF/README b/branches/sca-android/modules/implementation-resource/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-resource/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-resource/NOTICE b/branches/sca-android/modules/implementation-resource/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/implementation-resource/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/branches/sca-android/modules/implementation-resource/pom.xml b/branches/sca-android/modules/implementation-resource/pom.xml
deleted file mode 100644
index ec8c6638ac..0000000000
--- a/branches/sca-android/modules/implementation-resource/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-resource</artifactId>
- <name>Apache Tuscany SCA Resource Implementation Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.implementation.resource</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.resource*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/Resource.java b/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/Resource.java
deleted file mode 100644
index 68219de701..0000000000
--- a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/Resource.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.resource;
-
-import java.io.InputStream;
-
-import org.apache.tuscany.sca.data.collection.Collection;
-
-/**
- * The service interface of resource implementations. This is not an API for application
- * developers. Application developers should use the data collection API to invoke
- * resource components.
- *
- * @version $Rev: 548609 $ $Date: 2007-06-18 23:31:03 -0700 (Mon, 18 Jun 2007) $
- */
-public interface Resource extends Collection<String, InputStream> {
-}
diff --git a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementation.java b/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementation.java
deleted file mode 100644
index be136ee792..0000000000
--- a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementation.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.implementation.resource;
-
-import java.net.URL;
-
-import org.apache.tuscany.sca.assembly.Implementation;
-
-
-/**
- * The model representing a resource implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public interface ResourceImplementation extends Implementation {
-
- /**
- * The URI of the resource inside its contribution.
- * @return the URI of the resource
- */
- String getLocation();
-
- /**
- * Sets the URI of the resource inside its contribution.
- * @param location the URI of the resource
- */
- void setLocation(String location);
-
- /**
- * Returns the URL of the resource.
- * @return the URL of the resource
- */
- URL getLocationURL();
-
- /**
- * Sets the URL of the resource.
- * @param url the URL of the resource
- */
- void setLocationURL(URL url);
-
-}
diff --git a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationFactory.java b/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationFactory.java
deleted file mode 100644
index 95ac452c66..0000000000
--- a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationFactory.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.resource;
-
-/**
- * Factory for the resource implementation model.
- *
- * @version $Rev$ $Date$
- */
-public interface ResourceImplementationFactory {
-
- /**
- * Creates a new resource implementation.
- * @return a new resource implementation
- */
- ResourceImplementation createResourceImplementation();
-
-}
diff --git a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationFactoryImpl.java b/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationFactoryImpl.java
deleted file mode 100644
index d4db8772e4..0000000000
--- a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationFactoryImpl.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.resource.impl;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.implementation.resource.ResourceImplementation;
-import org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-
-/**
- * Factory for the resource implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class ResourceImplementationFactoryImpl implements ResourceImplementationFactory {
-
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
-
- public ResourceImplementationFactoryImpl(ModelFactoryExtensionPoint modelFactories) {
- assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- }
-
- public ResourceImplementation createResourceImplementation() {
- return new ResourceImplementationImpl(assemblyFactory, javaFactory);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationImpl.java b/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationImpl.java
deleted file mode 100644
index 9cad0890a3..0000000000
--- a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationImpl.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.implementation.resource.impl;
-
-import java.net.URL;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-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.resource.Resource;
-import org.apache.tuscany.sca.implementation.resource.ResourceImplementation;
-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;
-
-
-/**
- * The model representing a resource implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-class ResourceImplementationImpl implements ResourceImplementation {
-
- private Service resourceService;
-
- private String location;
- private URL url;
- private boolean unresolved;
-
- /**
- * Constructs a new resource implementation.
- */
- ResourceImplementationImpl(AssemblyFactory assemblyFactory,
- JavaInterfaceFactory javaFactory) {
-
- // Resource implementation always provide a single service exposing
- // the Resource interface, and have no references and properties
- resourceService = assemblyFactory.createService();
- resourceService.setName("Resource");
-
- // Create the Java interface contract for the Resource service
- JavaInterface javaInterface;
- try {
- javaInterface = javaFactory.createJavaInterface(Resource.class);
- } catch (InvalidInterfaceException e) {
- throw new IllegalArgumentException(e);
- }
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- interfaceContract.setInterface(javaInterface);
- resourceService.setInterfaceContract(interfaceContract);
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public URL getLocationURL() {
- return url;
- }
-
- public void setLocationURL(URL url) {
- this.url = url;
- }
-
- public ConstrainingType getConstrainingType() {
- // The resource implementation does not support constrainingTypes
- return null;
- }
-
- public List<Property> getProperties() {
- // The resource implementation does not support properties
- return Collections.emptyList();
- }
-
- public List<Service> getServices() {
- // The resource implementation does not support services
- return Collections.singletonList(resourceService);
- }
-
- public List<Reference> getReferences() {
- // The resource implementation does not support properties
- return Collections.emptyList();
- }
-
- public String getURI() {
- return location;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- // The resource implementation does not support constrainingTypes
- }
-
- public void setURI(String uri) {
- this.location = uri;
- }
-
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-}
diff --git a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java b/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java
deleted file mode 100644
index 6abef37b1a..0000000000
--- a/branches/sca-android/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.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.implementation.resource.impl;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import java.io.IOException;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.implementation.resource.ResourceImplementation;
-import org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-
-/**
- * Implements a StAX artifact processor for resource implementations.
- *
- * @version $Rev$ $Date$
- */
-public class ResourceImplementationProcessor implements StAXArtifactProcessor<ResourceImplementation> {
- private static final QName IMPLEMENTATION_RESOURCE = new QName(Constants.SCA10_TUSCANY_NS, "implementation.resource");
-
- private ContributionFactory contributionFactory;
- private ResourceImplementationFactory implementationFactory;
- private Monitor monitor;
-
- public ResourceImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- implementationFactory = modelFactories.getFactory(ResourceImplementationFactory.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 = new ProblemImpl(this.getClass().getName(), "impl-resource-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 = new ProblemImpl(this.getClass().getName(), "impl-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- // Returns the QName of the XML element processed by this processor
- return IMPLEMENTATION_RESOURCE;
- }
-
- public Class<ResourceImplementation> getModelType() {
- // Returns the type of model processed by this processor
- return ResourceImplementation.class;
- }
-
- public ResourceImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Read an <implementation.resource> element
-
- // Create and initialize the resource implementation model
- ResourceImplementation implementation = null;
-
- // Read the location attribute specifying the location of the resources
- String location = reader.getAttributeValue(null, "location");
- if (location != null) {
- implementation = implementationFactory.createResourceImplementation();
- implementation.setLocation(location);
- implementation.setUnresolved(true);
- } else {
- error("LocationAttributeMissing", reader);
- //throw new ContributionReadException(MSG_LOCATION_MISSING);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && IMPLEMENTATION_RESOURCE.equals(reader.getName())) {
- break;
- }
- }
-
- return implementation;
- }
-
- public void resolve(ResourceImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
-
- if (implementation == null)
- return;
-
- // Resolve the resource directory location
- Artifact artifact = contributionFactory.createArtifact();
- artifact.setURI(implementation.getLocation());
- Artifact resolved = resolver.resolveModel(Artifact.class, artifact);
- if (resolved.getLocation() != null) {
- try {
- implementation.setLocationURL(new URL(resolved.getLocation()));
- implementation.setUnresolved(false);
- } catch (IOException e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", resolver, ce);
- //throw ce;
- }
- } else {
- error("CouldNotResolveLocation", resolver, implementation.getLocation());
- //throw new ContributionResolveException("Could not resolve implementation.resource location: " + implementation.getLocation());
- }
- }
-
- public void write(ResourceImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <implementation.resource>
- writer.writeStartElement(IMPLEMENTATION_RESOURCE.getNamespaceURI(), IMPLEMENTATION_RESOURCE.getLocalPart());
-
- if (implementation.getLocation() != null) {
- writer.writeAttribute("location", implementation.getLocation());
- }
-
- writer.writeEndElement();
- }
-}
diff --git a/branches/sca-android/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index b5774c5c5b..0000000000
--- a/branches/sca-android/modules/implementation-resource/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.resource.impl.ResourceImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.resource,model=org.apache.tuscany.sca.implementation.resource.ResourceImplementation,factory=org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory
diff --git a/branches/sca-android/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory b/branches/sca-android/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory
deleted file mode 100644
index f77f723c3e..0000000000
--- a/branches/sca-android/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory
+++ /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.resource.impl.ResourceImplementationFactoryImpl
diff --git a/branches/sca-android/modules/implementation-resource/src/main/resources/impl-resource-validation-messages.properties b/branches/sca-android/modules/implementation-resource/src/main/resources/impl-resource-validation-messages.properties
deleted file mode 100644
index 7f619ef036..0000000000
--- a/branches/sca-android/modules/implementation-resource/src/main/resources/impl-resource-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.
-#
-#
-ContributionResolveException = ContributionResolveException occured due to:
-LocationAttributeMissing = Reading implementation.resource - location attribute missing
-CouldNotResolveLocation = Could not resolve implementation.resource location: {0}
diff --git a/branches/sca-android/modules/implementation-script/LICENSE b/branches/sca-android/modules/implementation-script/LICENSE
deleted file mode 100644
index 4b5ab74408..0000000000
--- a/branches/sca-android/modules/implementation-script/LICENSE
+++ /dev/null
@@ -1,251 +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 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.
-
-=================================================================================================================
diff --git a/branches/sca-android/modules/implementation-script/META-INF/README b/branches/sca-android/modules/implementation-script/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-script/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-script/NOTICE b/branches/sca-android/modules/implementation-script/NOTICE
deleted file mode 100644
index 5782e5ee9b..0000000000
--- a/branches/sca-android/modules/implementation-script/NOTICE
+++ /dev/null
@@ -1,12 +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/).
-
-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.
diff --git a/branches/sca-android/modules/implementation-script/pom.xml b/branches/sca-android/modules/implementation-script/pom.xml
deleted file mode 100644
index 60cfa5abd8..0000000000
--- a/branches/sca-android/modules/implementation-script/pom.xml
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-script</artifactId>
- <name>Apache Tuscany SCA Script Implementation Extension</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extension-helper</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-beta2</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>1.4-SNAPSHOT</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.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.5</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymockclassextension</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
-<!-- TODO: big hack to add script engine dependencies till extension dependencies fixed -->
-
- <dependency>
- <groupId>rhino</groupId>
- <artifactId>js</artifactId>
- <version>1.6R7</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- <version>1.1.3</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- </exclusion>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm-commons</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jline</groupId>
- <artifactId>jline</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.python</groupId>
- <artifactId>jython</artifactId>
- <version>2.2</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-all-minimal</artifactId>
- <version>1.5.4</version>
- <scope>compile</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.implementation.script</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.script*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java b/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java
deleted file mode 100644
index 87820c18ed..0000000000
--- a/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.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.script;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-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.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.extension.helper.utils.ResourceHelper;
-
-/**
- * Represents a Script implementation.
- *
- * @version $Rev$ $Date$
- */
-public class ScriptImplementation {
-
- protected String scriptName;
- protected URL scriptURL;
- protected String scriptSrc;
- protected String scriptLanguage;
-
- public String getScript() {
- return scriptName;
- }
-
- public void setScript(String scriptName) {
- this.scriptName = scriptName;
- }
-
- public void setLanguage(String language) {
- this.scriptLanguage = language;
- }
-
- public void setElementText(String elementText) {
- scriptSrc = elementText;
- }
-
- public String getScriptLanguage() {
- if (scriptLanguage == null || scriptLanguage.length() < 1) {
- int i = scriptName.lastIndexOf('.');
- if (i > 0) {
- scriptLanguage = scriptName.substring(i + 1);
- }
- }
- return scriptLanguage;
- }
-
- public String getScriptSrc() {
- if (scriptSrc == null) {
- if (scriptName == null) {
- throw new IllegalArgumentException("script name is null and no inline source used");
- }
- if (scriptURL == null) {
- throw new RuntimeException("No script: " + scriptName);
- }
-
- scriptSrc = ResourceHelper.readResource(scriptURL);
- }
- return scriptSrc;
- }
-
- public void resolve(ModelResolver resolver) {
-
- if (scriptName != null) {
- //FIXME The contribution factory should be injected
- ContributionFactory contributionFactory = new DefaultContributionFactory();
- Artifact artifact = contributionFactory.createArtifact();
- artifact.setURI(scriptName);
- artifact = resolver.resolveModel(Artifact.class, artifact);
- if (artifact.getLocation() != null) {
- try {
- scriptURL = new URL(artifact.getLocation());
- } catch (MalformedURLException e) {
- throw new RuntimeException(e);
- }
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationActivator.java b/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationActivator.java
deleted file mode 100644
index a7c4b9074f..0000000000
--- a/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationActivator.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.script;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.extension.helper.ImplementationActivator;
-import org.apache.tuscany.sca.extension.helper.InvokerFactory;
-import org.apache.tuscany.sca.extension.helper.utils.PropertyValueObjectFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class ScriptImplementationActivator implements ImplementationActivator<ScriptImplementation> {
-
- // TODO: seems wrong to need PropertyValueObjectFactory, could it be on Property somehow?
- protected PropertyValueObjectFactory propertyFactory;
-
- public ScriptImplementationActivator(PropertyValueObjectFactory propertyFactory) {
- this.propertyFactory = propertyFactory;
- }
-
- public Class<ScriptImplementation> getImplementationClass() {
- return ScriptImplementation.class;
- }
-
- public InvokerFactory createInvokerFactory(RuntimeComponent rc, ComponentType ct, ScriptImplementation implementation) {
- return new ScriptInvokerFactory(rc, ct, implementation, propertyFactory);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptInvoker.java b/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptInvoker.java
deleted file mode 100644
index 2ccb414be8..0000000000
--- a/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptInvoker.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.script;
-
-import javax.script.Invocable;
-import javax.script.ScriptEngine;
-import javax.script.ScriptException;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.bsf.xml.XMLHelper;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-/**
- * Perform the actual script invocation
- *
- * @version $Rev$ $Date$
- */
-public class ScriptInvoker implements Invoker {
-
- protected ScriptEngine scriptEngine;
- protected XMLHelper xmlHelper;
- protected Operation operation;
-
- public ScriptInvoker(ScriptEngine scriptEngine, XMLHelper xmlHelper, Operation operation) {
- this.scriptEngine = scriptEngine;
- this.xmlHelper = xmlHelper;
- this.operation = operation;
- }
-
- protected Object doInvoke(Object[] objects, Operation op) throws ScriptException {
- if (xmlHelper != null) {
- objects[0] = xmlHelper.toScriptXML((OMElement)objects[0]);
- }
-
- Operation oper = operation; // static setting
- if (oper.getName() == null) { // if no static setting
- oper = op; // use dynamic setting
- }
- Object response;
- try {
- response = ((Invocable)scriptEngine).invokeFunction(oper.getName(), objects);
- } catch (ScriptException e) {
- throw e;
- } catch (Exception e) {
- throw new ScriptException(e);
- }
-
- if (xmlHelper != null) {
- response = xmlHelper.toOMElement(response);
- }
-
- return response;
- }
-
- public Message invoke(Message msg) {
- try {
- Object resp = doInvoke((Object[])msg.getBody(), msg.getOperation());
- msg.setBody(resp);
- } catch (ScriptException e) {
- msg.setFaultBody(e.getCause());
- }
- return msg;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptInvokerFactory.java b/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptInvokerFactory.java
deleted file mode 100644
index 9359590424..0000000000
--- a/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptInvokerFactory.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.script;
-
-import java.io.StringReader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import javax.script.Invocable;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.bsf.xml.XMLHelper;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.extension.helper.InvokerFactory;
-import org.apache.tuscany.sca.extension.helper.utils.PropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.script.engines.TuscanyJRubyScriptEngine;
-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.wsdl.WSDLInterfaceContract;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class ScriptInvokerFactory implements InvokerFactory {
-
- protected ScriptEngine scriptEngine;
- protected XMLHelper xmlHelper;
-
- protected RuntimeComponent rc;
- protected ComponentType ct;
- protected ScriptImplementation implementation;
- protected PropertyValueObjectFactory propertyFactory;
-
-
- /**
- * @param rc
- * @param ct
- * @param implementation
- * @param propertyFactory
- */
- public ScriptInvokerFactory(RuntimeComponent rc,
- ComponentType ct,
- ScriptImplementation implementation,
- PropertyValueObjectFactory propertyFactory) {
- super();
- this.rc = rc;
- this.ct = ct;
- this.implementation = implementation;
- this.propertyFactory = propertyFactory;
- }
-
- public Invoker createInvoker(Operation operation) {
- init(rc, ct, implementation, propertyFactory);
- return new ScriptInvoker(scriptEngine, xmlHelper, operation);
- }
-
- protected synchronized void init(RuntimeComponent rc, ComponentType ct, ScriptImplementation implementation, PropertyValueObjectFactory propertyFactory) {
- if(scriptEngine!=null) {
- return;
- }
- try {
- scriptEngine = getScriptEngineByExtension(implementation.getScriptLanguage());
- if (scriptEngine == null) {
- throw new ObjectCreationException("no script engine found for language: " + implementation.getScriptLanguage());
- }
- if (!(scriptEngine instanceof Invocable)) {
- throw new ObjectCreationException("script engine does not support Invocable: " + scriptEngine);
- }
-
- for (Reference reference : ct.getReferences()) {
- scriptEngine.put(reference.getName(), createReferenceProxy(reference.getName(), rc));
- }
-
- for (Property property : ct.getProperties()) {
- ObjectFactory<?> propertyValueFactory = propertyFactory.createValueFactory(property);
- if ( propertyValueFactory != null) {
- scriptEngine.put(property.getName(), propertyValueFactory.getInstance());
- }
- }
-
- scriptEngine.eval(new StringReader(implementation.getScriptSrc()));
-
- } catch (ScriptException e) {
- throw new ObjectCreationException(e);
- }
-
- // set the databinding and XMLHelper for WSDL interfaces
- for (Service service : rc.getServices()) {
- InterfaceContract ic = service.getInterfaceContract();
- if (ic instanceof WSDLInterfaceContract) {
- // Set to use the Axiom data binding
- ic.getInterface().resetDataBinding(OMElement.class.getName());
- xmlHelper = XMLHelper.getArgHelper(scriptEngine);
- }
- }
- }
-
- /**
- * TODO: RuntimeComponent should provide a method like this
- */
- @SuppressWarnings("unchecked")
- protected Object createReferenceProxy(String name, RuntimeComponent component) {
- for (ComponentReference reference : component.getReferences()) {
- if (reference.getName().equals(name)) {
- Class iface = ((JavaInterface)reference.getInterfaceContract().getInterface()).getJavaClass();
- return component.getComponentContext().getService(iface, name);
- }
- }
- throw new IllegalArgumentException("reference " + name + " not found on component: " + component);
- }
-
- /**
- * Hack for now to work around a problem with the JRuby script engine
- */
- protected ScriptEngine getScriptEngineByExtension(String scriptExtn) {
- if ("rb".equals(scriptExtn)) {
- return new TuscanyJRubyScriptEngine();
- } else {
- if ("py".equals(scriptExtn)) {
- pythonCachedir();
- }
- // Allow privileged access to run access classes. Requires RuntimePermission
- // for accessClassInPackage.sun.misc.
- ScriptEngineManager scriptEngineManager =
- AccessController.doPrivileged(new PrivilegedAction<ScriptEngineManager>() {
- public ScriptEngineManager run() {
- return new ScriptEngineManager();
- }
- });
- return scriptEngineManager.getEngineByExtension(scriptExtn);
- }
- }
-
- /**
- * If the Python home isn't set then let Tuscany suppress messages other than errors
- * See TUSCANY-1950
- */
- protected void pythonCachedir() {
- if (System.getProperty("python.home") == null) {
- System.setProperty("python.verbose", "error");
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/engines/TuscanyJRubyScriptEngine.java b/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/engines/TuscanyJRubyScriptEngine.java
deleted file mode 100644
index 324246c32b..0000000000
--- a/branches/sca-android/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/engines/TuscanyJRubyScriptEngine.java
+++ /dev/null
@@ -1,697 +0,0 @@
-/*
-* 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.
-*/
-package org.apache.tuscany.sca.implementation.script.engines;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.io.Reader;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CoderResult;
-import java.nio.charset.CodingErrorAction;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.script.AbstractScriptEngine;
-import javax.script.Bindings;
-import javax.script.Compilable;
-import javax.script.CompiledScript;
-import javax.script.Invocable;
-import javax.script.ScriptContext;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineFactory;
-import javax.script.ScriptException;
-import javax.script.SimpleBindings;
-
-import org.jruby.Ruby;
-import org.jruby.RubyException;
-import org.jruby.RubyIO;
-import org.jruby.RubyObject;
-import org.jruby.ast.Node;
-import org.jruby.exceptions.RaiseException;
-import org.jruby.internal.runtime.GlobalVariable;
-import org.jruby.internal.runtime.GlobalVariables;
-import org.jruby.internal.runtime.ReadonlyAccessor;
-import org.jruby.internal.runtime.ValueAccessor;
-import org.jruby.javasupport.Java;
-import org.jruby.javasupport.JavaEmbedUtils;
-import org.jruby.javasupport.JavaObject;
-import org.jruby.javasupport.JavaUtil;
-import org.jruby.runtime.Block;
-import org.jruby.runtime.IAccessor;
-import org.jruby.runtime.builtin.IRubyObject;
-import org.jruby.util.KCode;
-
-import com.sun.script.jruby.JRubyScriptEngineFactory;
-
-/**
- * This class is a copy of the class com.sun.script.ruby.JRubyScriptEngine with some minor modifications
- * to work around problems with Tuscany setting SCA properties and references as global variable in JRuby
- * Should only need it temporarily till a new BSF release fixes it.
- *
- * @version $Rev$ $Date$
- */
-@SuppressWarnings("unchecked")
-public class TuscanyJRubyScriptEngine extends AbstractScriptEngine
- implements Compilable, Invocable {
-
- // my factory, may be null
- private ScriptEngineFactory factory;
- private Ruby runtime;
-
- public TuscanyJRubyScriptEngine() {
- // Allow privileged access to ready properties. Requires PropertyPermission in security
- // policy.
- String rubyPath = AccessController.doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty("com.sun.script.jruby.loadpath");
- }
- });
- init(rubyPath);
- }
-
- public TuscanyJRubyScriptEngine(String loadPath) {
- init(loadPath);
- }
-
- // my implementation for CompiledScript
- private class JRubyCompiledScript extends CompiledScript {
- // my compiled code
- private Node node;
-
- JRubyCompiledScript (Node node) {
- this.node = node;
- }
-
- public ScriptEngine getEngine() {
- return TuscanyJRubyScriptEngine.this;
- }
-
- public Object eval(ScriptContext ctx) throws ScriptException {
- return evalNode(node, ctx);
- }
- }
-
- // Compilable methods
- public CompiledScript compile(String script)
- throws ScriptException {
- Node node = compileScript(script, context);
- return new JRubyCompiledScript(node);
- }
-
- public CompiledScript compile (Reader reader)
- throws ScriptException {
- Node node = compileScript(reader, context);
- return new JRubyCompiledScript(node);
- }
-
- // Invocable methods
- public Object invokeFunction(String name, Object... args)
- throws ScriptException, NoSuchMethodException {
- return invokeImpl(null, name, args, Object.class);
- }
-
- public Object invokeMethod(Object obj, String name, Object... args)
- throws ScriptException, NoSuchMethodException {
- if (obj == null) {
- throw new IllegalArgumentException("script object is null");
- }
- return invokeImpl(obj, name, args, Object.class);
- }
-
- public Object getInterface(Object obj, Class clazz) {
- if (obj == null) {
- throw new IllegalArgumentException("script object is null");
- }
- return makeInterface(obj, clazz);
- }
-
- public Object getInterface(Class clazz) {
- return makeInterface(null, clazz);
- }
-
- private <T> T makeInterface(Object obj, Class<T> clazz) {
- if (clazz == null || !clazz.isInterface()) {
- throw new IllegalArgumentException("interface Class expected");
- }
- final Object thiz = obj;
- return (T) Proxy.newProxyInstance(
- clazz.getClassLoader(),
- new Class[] { clazz },
- new InvocationHandler() {
- public Object invoke(Object proxy, Method m, Object[] args)
- throws Throwable {
- return invokeImpl(thiz, m.getName(),
- args, m.getReturnType());
- }
- });
- }
-
- // ScriptEngine methods
- public synchronized Object eval(String str, ScriptContext ctx)
- throws ScriptException {
- Node node = compileScript(str, ctx);
- return evalNode(node, ctx);
- }
-
- public synchronized Object eval(Reader reader, ScriptContext ctx)
- throws ScriptException {
- Node node = compileScript(reader, ctx);
- return evalNode(node, ctx);
- }
-
- public ScriptEngineFactory getFactory() {
- synchronized (this) {
- if (factory == null) {
- factory = new JRubyScriptEngineFactory();
- }
- }
- return factory;
- }
-
- public Bindings createBindings() {
- return new SimpleBindings();
- }
-
- // package-private methods
- void setFactory(ScriptEngineFactory factory) {
- this.factory = factory;
- }
-
- // internals only below this point
-
- private Object rubyToJava(IRubyObject value) {
- return rubyToJava(value, Object.class);
- }
-
- private Object rubyToJava(IRubyObject value, Class type) {
- return JavaUtil.convertArgument(
- runtime,
- Java.ruby_to_java(value, value, Block.NULL_BLOCK),
- type);
- }
-
- private IRubyObject javaToRuby(Object value) {
- if (value instanceof IRubyObject) {
- return (IRubyObject) value;
- }
- IRubyObject result = JavaUtil.convertJavaToRuby(runtime, value);
- if (result instanceof JavaObject) {
- return runtime.getModule("JavaUtilities").callMethod(runtime.getCurrentContext(), "wrap", result);
- }
- return result;
- }
-
- private synchronized Node compileScript(String script, ScriptContext ctx)
- throws ScriptException {
- GlobalVariables oldGlobals = runtime.getGlobalVariables();
- try {
- setErrorWriter(ctx.getErrorWriter());
- setGlobalVariables(ctx);
- String filename = (String) ctx.getAttribute(ScriptEngine.FILENAME);
- if (filename == null) {
- filename = "<unknown>";
- }
- return runtime.parseEval(script, filename, null, 0);
- } catch (RaiseException e) {
- RubyException re = e.getException();
- runtime.printError(re);
- throw new ScriptException(e);
- } catch (Exception e) {
- throw new ScriptException(e);
- } finally {
- if (oldGlobals != null) {
- setGlobalVariables(oldGlobals);
- }
- }
- }
-
- private synchronized Node compileScript(Reader reader, ScriptContext ctx)
- throws ScriptException {
- GlobalVariables oldGlobals = runtime.getGlobalVariables();
- try {
- setErrorWriter(ctx.getErrorWriter());
- setGlobalVariables(ctx);
- String filename = (String) ctx.getAttribute(ScriptEngine.FILENAME);
- if (filename == null) {
- filename = "<unknown>";
- String script = getRubyScript(reader);
- return runtime.parseEval(script, filename, null, 0);
- }
- InputStream inputStream = getRubyReader(filename);
- return runtime.parseFile(inputStream, filename, null);
- } catch (RaiseException e) {
- RubyException re = e.getException();
- runtime.printError(re);
- throw new ScriptException(e);
- } catch (Exception exp) {
- throw new ScriptException(exp);
- } finally {
- if (oldGlobals != null) {
- setGlobalVariables(oldGlobals);
- }
- }
- }
-
- private String getRubyScript(Reader reader) throws IOException {
- StringBuffer sb = new StringBuffer();
- char[] cbuf;
- while (true) {
- cbuf = new char[8*1024];
- int chars = reader.read(cbuf, 0, cbuf.length);
- if (chars < 0) {
- break;
- }
- sb.append(cbuf, 0, chars);
- }
- cbuf = null;
- return (new String(sb)).trim();
- }
-
- private InputStream getRubyReader(String filename) throws FileNotFoundException {
- File file = new File(filename);
- return new FileInputStream(file);
- }
-
- private void setGlobalVariables(final ScriptContext ctx) {
- ctx.setAttribute("context", ctx, ScriptContext.ENGINE_SCOPE);
- setGlobalVariables(new GlobalVariables(runtime) {
- GlobalVariables parent = runtime.getGlobalVariables();
-
- @Override
- public void define(String name, IAccessor accessor) {
- assert name != null;
- assert accessor != null;
- assert name.startsWith("$");
- synchronized (ctx) {
- Bindings engineScope = ctx.getBindings(ScriptContext.ENGINE_SCOPE);
- engineScope.put(name, new GlobalVariable(accessor));
- }
- }
-
- @Override
- public void defineReadonly(String name, IAccessor accessor) {
- assert name != null;
- assert accessor != null;
- assert name.startsWith("$");
- synchronized (ctx) {
- Bindings engineScope = ctx.getBindings(ScriptContext.ENGINE_SCOPE);
- engineScope.put(name, new GlobalVariable(new
- ReadonlyAccessor(name, accessor)));
- }
- }
-
- @Override
- public boolean isDefined(String name) {
- assert name != null;
- assert name.startsWith("$");
- synchronized (ctx) {
- String modifiedName = name.substring(1);
- boolean defined = ctx.getAttributesScope(modifiedName) != -1;
- return defined ? true : parent.isDefined(name);
- }
- }
-
- @Override
- public void alias(String name, String oldName) {
- assert name != null;
- assert oldName != null;
- assert name.startsWith("$");
- assert oldName.startsWith("$");
-
- if (runtime.getSafeLevel() >= 4) {
- throw runtime.newSecurityError("Insecure: can't alias global variable");
- }
-
- synchronized (ctx) {
- int scope = ctx.getAttributesScope(name);
- if (scope == -1) {
- scope = ScriptContext.ENGINE_SCOPE;
- }
-
- IRubyObject value = get(oldName);
- ctx.setAttribute(name, rubyToJava(value), scope);
- }
- }
-
- @Override
- public IRubyObject get(String name) {
- assert name != null;
- assert name.startsWith("$");
-
- synchronized (ctx) {
- // skip '$' and try
- String modifiedName = name.substring(1);
- int scope = ctx.getAttributesScope(modifiedName);
- if (scope == -1) {
- return parent.get(name);
- }
-
- Object obj = ctx.getAttribute(modifiedName, scope);
- if (obj instanceof IAccessor) {
- return ((IAccessor)obj).getValue();
- } else {
- return javaToRuby(obj);
- }
- }
- }
-
- @Override
- public IRubyObject set(String name, IRubyObject value) {
- assert name != null;
- assert name.startsWith("$");
-
- if (runtime.getSafeLevel() >= 4) {
- throw runtime.newSecurityError("Insecure: can't change global variable value");
- }
-
- synchronized (ctx) {
- // skip '$' and try
- String modifiedName = name.substring(1);
- int scope = ctx.getAttributesScope(modifiedName);
- if (scope == -1) {
- scope = ScriptContext.ENGINE_SCOPE;
- }
- IRubyObject oldValue = get(name);
- Object obj = ctx.getAttribute(modifiedName, scope);
- if (obj instanceof IAccessor) {
- ((IAccessor)obj).setValue(value);
- } else {
- ctx.setAttribute(modifiedName, rubyToJava(value), scope);
- if ("KCODE".equals(modifiedName)) {
- setKCode((String)rubyToJava(value));
- } else if ("stdout".equals(modifiedName)) {
- equalOutputs((RubyObject)value);
- }
- }
- return oldValue;
- }
- }
-
- @Override
- public Set<String> getNames() {
- HashSet set = new HashSet();
- synchronized (ctx) {
- for (Object scope : ctx.getScopes()) {
- Bindings b = ctx.getBindings((Integer)scope);
- if (b != null) {
- for (Object key: b.keySet()) {
- set.add(key);
- }
- }
- }
- }
- for (Iterator<String> names = parent.getNames().iterator(); names.hasNext();) {
- set.add(names.next());
- }
- return Collections.unmodifiableSet(set);
- }
-
- @Override
- public IRubyObject getDefaultSeparator() {
- return parent.getDefaultSeparator();
- }
- });
- }
-
- private void setGlobalVariables(GlobalVariables globals) {
- runtime.setGlobalVariables(globals);
- }
-
- private synchronized Object evalNode(Node node, ScriptContext ctx)
- throws ScriptException {
- GlobalVariables oldGlobals = runtime.getGlobalVariables();
- try {
- setWriterOutputStream(ctx.getWriter());
- setErrorWriter(ctx.getErrorWriter());
- setGlobalVariables(ctx);
- return rubyToJava(runtime.runNormally(node, false));
- } catch (Exception exp) {
- throw new ScriptException(exp);
- } finally {
- try {
- JavaEmbedUtils.terminate(runtime);
- } catch (RaiseException e) {
- RubyException re = e.getException();
- runtime.printError(re);
- if (!runtime.fastGetClass("SystemExit").isInstance(re)) {
- throw new ScriptException(e);
- }
- } finally {
- if (oldGlobals != null) {
- setGlobalVariables(oldGlobals);
- }
- }
- }
- }
-
- private void init(final String loadPath) {
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- runtime = Ruby.newInstance();
- IAccessor d = new ValueAccessor(runtime.newString("<script>"));
- runtime.getGlobalVariables().define("$PROGRAM_NAME", d);
- runtime.getGlobalVariables().define("$0", d);
- String path = loadPath;
- if (path == null) {
- path = System.getProperty("java.class.path");
- }
- List list = Arrays.asList(path.split(File.pathSeparator));
- runtime.getLoadService().init(list);
- runtime.getLoadService().require("java");
- return null;
- }
- });
- }
-
- private synchronized Object invokeImpl(final Object obj, String method,
- Object[] args, Class returnType)
- throws ScriptException {
- if (method == null) {
- throw new NullPointerException("method name is null");
- }
- GlobalVariables oldGlobals = runtime.getGlobalVariables();
- try {
- setWriterOutputStream(context.getWriter());
- setErrorWriter(context.getErrorWriter());
- setGlobalVariables(context);
- IRubyObject rubyRecv = obj != null ?
- JavaUtil.convertJavaToRuby(runtime, obj) : runtime.getTopSelf();
-
- IRubyObject result;
- if (args != null && args.length > 0) {
- IRubyObject[] rubyArgs = JavaUtil.convertJavaArrayToRuby(runtime, args);
- // Create Ruby proxies for any input arguments that are not primitives.
- IRubyObject javaUtilities = runtime.getObject().getConstant("JavaUtilities");
- for (int i = 0; i < rubyArgs.length; i++) {
- IRubyObject tmp = rubyArgs[i];
- if (tmp instanceof JavaObject) {
- rubyArgs[i] = javaUtilities.callMethod(runtime.getCurrentContext(), "wrap", tmp);
- }
- }
- result = rubyRecv.callMethod(runtime.getCurrentContext(), method, rubyArgs);
- } else {
- result = rubyRecv.callMethod(runtime.getCurrentContext(), method);
- }
- return rubyToJava(result, returnType);
- } catch (Exception exp) {
- throw new ScriptException(exp);
- } finally {
- try {
- JavaEmbedUtils.terminate(runtime);
- } catch (RaiseException e) {
- RubyException re = e.getException();
- runtime.printError(re);
- if (!runtime.fastGetClass("SystemExit").isInstance(re)) {
- throw new ScriptException(e);
- }
- } finally {
- if (oldGlobals != null) {
- setGlobalVariables(oldGlobals);
- }
- }
- }
- }
-
- private void setKCode(String encoding) {
- KCode kcode = KCode.create(runtime, encoding);
- runtime.setKCode(kcode);
- }
-
- private void equalOutputs(RubyObject value) {
- runtime.getGlobalVariables().set("$>", value);
- runtime.getGlobalVariables().set("$defout", value);
- }
-
- private void setWriterOutputStream(Writer writer) {
- try {
- RubyIO dummy_io =
- new RubyIO(runtime, new PrintStream(new WriterOutputStream(new StringWriter())));
- runtime.getGlobalVariables().set("$stderr", dummy_io); //discard unwanted warnings
- RubyIO io =
- new RubyIO(runtime, new PrintStream(new WriterOutputStream(writer)));
- io.getOpenFile().getMainStream().setSync(true);
- runtime.defineGlobalConstant("STDOUT", io);
- runtime.getGlobalVariables().set("$>", io);
- runtime.getGlobalVariables().set("$stdout", io);
- runtime.getGlobalVariables().set("$defout", io);
- } catch (UnsupportedEncodingException exp) {
- throw new IllegalArgumentException(exp);
- }
- }
-
- private void setErrorWriter(Writer writer) {
- try {
- RubyIO dummy_io =
- new RubyIO(runtime, new PrintStream(new WriterOutputStream(new StringWriter())));
- runtime.getGlobalVariables().set("$stderr", dummy_io); //discard unwanted warnings
- RubyIO io =
- new RubyIO(runtime, new PrintStream(new WriterOutputStream(writer)));
- io.getOpenFile().getMainStream().setSync(true);
- runtime.defineGlobalConstant("STDERR", io);
- runtime.getGlobalVariables().set("$stderr", io);
- runtime.getGlobalVariables().set("$deferr", io);
- } catch (UnsupportedEncodingException exp) {
- throw new IllegalArgumentException(exp);
- }
- }
-
- private String getEncoding() {
- String enc = System.getProperty("sun.jnu.encoding");
- if (enc != null) {
- return enc;
- }
- return ((enc = System.getProperty("file.encoding")) == null) ? "UTF-8" : enc;
- }
-
- private class WriterOutputStream extends OutputStream {
-
- private Writer writer;
- private CharsetDecoder decoder;
-
- private WriterOutputStream(Writer writer) throws UnsupportedEncodingException {
- this(writer, getEncoding());
- }
-
- private WriterOutputStream(Writer writer, String enc) throws UnsupportedEncodingException {
- this.writer = writer;
- if (enc == null) {
- throw new UnsupportedEncodingException("encoding is " + enc);
- }
- try {
- decoder = Charset.forName(enc).newDecoder();
- } catch (Exception e) {
- throw new UnsupportedEncodingException("Unsupported: " + enc);
- }
- decoder.onMalformedInput(CodingErrorAction.REPLACE);
- decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
- }
-
- @Override
- public void close() throws IOException {
- synchronized(writer) {
- decoder = null;
- writer.close();
- }
- }
-
- @Override
- public void flush() throws IOException {
- synchronized(writer) {
- writer.flush();
- }
- }
-
- @Override
- public void write(int b) throws IOException {
- byte[] buffer = new byte[1];
- write(buffer, 0, 1);
- }
-
- @Override
- public void write(byte[] buffer) throws IOException {
- write(buffer, 0, buffer.length);
- }
-
- @Override
- public void write(byte[] buffer, int offset, int length) throws IOException {
- synchronized(writer) {
- if (offset < 0 || offset > buffer.length - length || length < 0) {
- throw new IndexOutOfBoundsException();
- }
- if (length == 0) {
- return;
- }
- ByteBuffer bytes = ByteBuffer.wrap(buffer, offset, length);
- CharBuffer chars = CharBuffer.allocate(length);
- convert(bytes, chars);
- char[] cbuf = new char[chars.length()];
- chars.get(cbuf, 0, chars.length());
- writer.write(cbuf);
- writer.flush();
- }
- }
-
- private void convert(ByteBuffer bytes, CharBuffer chars) throws IOException {
- decoder.reset();
- chars.clear();
- CoderResult result = decoder.decode(bytes, chars, true);
- if (result.isError() || result.isOverflow()) {
- throw new IOException(result.toString());
- } else if (result.isUnderflow()) {
- chars.flip();
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-script/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.ImplementationActivator b/branches/sca-android/modules/implementation-script/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.ImplementationActivator
deleted file mode 100644
index c8152b606f..0000000000
--- a/branches/sca-android/modules/implementation-script/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.ImplementationActivator
+++ /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.implementation.script.ScriptImplementationActivator
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/AbstractSCATestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/AbstractSCATestCase.java
deleted file mode 100644
index fc87f92ef1..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/AbstractSCATestCase.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.script.itests;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractSCATestCase<T> extends TestCase {
-
- protected SCADomain domain;
- protected T service;
-
- @Override
- @SuppressWarnings("unchecked")
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance(getCompositeName());
- service = (T) domain.getService(getServiceClass(), "ClientComponent");
- }
-
- protected abstract Class getServiceClass();
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
- protected String getCompositeName() {
- String className = this.getClass().getName();
- return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/AbstractHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/AbstractHelloWorldTestCase.java
deleted file mode 100644
index 09239cd38f..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/AbstractHelloWorldTestCase.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.implementation.script.itests.dynamic;
-
-import org.apache.tuscany.sca.implementation.script.itests.AbstractSCATestCase;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractHelloWorldTestCase extends AbstractSCATestCase<HelloWorld> {
-
- public void testHello() throws Exception {
- assertEquals("Hello petra", service.sayHello("petra"));
- }
-
- @Override
- protected Class<HelloWorld> getServiceClass() {
- return HelloWorld.class;
- }
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/HelloWorld.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/HelloWorld.java
deleted file mode 100644
index 5781f4f2c9..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/HelloWorld.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.implementation.script.itests.dynamic;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public interface HelloWorld {
-
- String sayHello(String s);
- String sayHelloFrom(String s);
-
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptDynamicRefTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptDynamicRefTestCase.java
deleted file mode 100644
index e88e44c7c0..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptDynamicRefTestCase.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.implementation.script.itests.dynamic;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaScriptDynamicRefTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptHelloWorldTestCase.java
deleted file mode 100644
index 331d5bcfd4..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptHelloWorldTestCase.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.script.itests.dynamic;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaScriptHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-
- public void testHelloFrom() throws Exception {
- System.out.println(service.sayHelloFrom("Venkat"));
- assertEquals("Hello petra from Tuscany", service.sayHelloFrom("petra"));
- }
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/AbstractHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/AbstractHelloWorldTestCase.java
deleted file mode 100644
index 1af3a295a4..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/AbstractHelloWorldTestCase.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.implementation.script.itests.helloworld;
-
-import org.apache.tuscany.sca.implementation.script.itests.AbstractSCATestCase;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractHelloWorldTestCase extends AbstractSCATestCase<HelloWorld> {
-
- public void testCalculator() throws Exception {
- assertEquals("Hello petra", service.sayHello("petra"));
- }
-
- @Override
- protected Class<HelloWorld> getServiceClass() {
- return HelloWorld.class;
- }
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/GroovyHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/GroovyHelloWorldTestCase.java
deleted file mode 100644
index 6a4f10dbbb..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/GroovyHelloWorldTestCase.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.implementation.script.itests.helloworld;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class GroovyHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/HelloWorld.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/HelloWorld.java
deleted file mode 100644
index f87cf104f3..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/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 org.apache.tuscany.sca.implementation.script.itests.helloworld;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public interface HelloWorld {
-
- String sayHello(String s);
-
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/HelloWorldProxy.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/HelloWorldProxy.java
deleted file mode 100644
index 980864869f..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/HelloWorldProxy.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.script.itests.helloworld;
-
-import org.osoa.sca.annotations.Reference;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class HelloWorldProxy implements HelloWorld {
-
- @Reference
- public HelloWorld delegate;
-
- public String sayHello(String s) {
- return delegate.sayHello(s);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JRubyHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JRubyHelloWorldTestCase.java
deleted file mode 100644
index ca4bd5ae6a..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JRubyHelloWorldTestCase.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.implementation.script.itests.helloworld;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JRubyHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScripInlineHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScripInlineHelloWorldTestCase.java
deleted file mode 100644
index 93d1949c50..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScripInlineHelloWorldTestCase.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.implementation.script.itests.helloworld;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaScripInlineHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScriptHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScriptHelloWorldTestCase.java
deleted file mode 100644
index 46ed9abce6..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScriptHelloWorldTestCase.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.implementation.script.itests.helloworld;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaScriptHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JythonHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JythonHelloWorldTestCase.java
deleted file mode 100644
index d694515829..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JythonHelloWorldTestCase.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.implementation.script.itests.helloworld;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JythonHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/AbstractHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/AbstractHelloWorldTestCase.java
deleted file mode 100644
index e7375253a3..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/AbstractHelloWorldTestCase.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.implementation.script.itests.properties;
-
-import org.apache.tuscany.sca.implementation.script.itests.AbstractSCATestCase;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractHelloWorldTestCase extends AbstractSCATestCase<HelloWorld> {
-
- public void testCalculator() throws Exception {
- // assertEquals("Hello petra from Tuscany", service.sayHello("petra"));
- }
-
- @Override
- protected Class<HelloWorld> getServiceClass() {
- return HelloWorld.class;
- }
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/GroovyHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/GroovyHelloWorldTestCase.java
deleted file mode 100644
index f93edc76d1..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/GroovyHelloWorldTestCase.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.implementation.script.itests.properties;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class GroovyHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/HelloWorld.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/HelloWorld.java
deleted file mode 100644
index 910d22ec83..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/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 org.apache.tuscany.sca.implementation.script.itests.properties;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public interface HelloWorld {
-
- String sayHello(String s);
-
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/HelloWorldProxy.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/HelloWorldProxy.java
deleted file mode 100644
index 47cdc03e0e..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/HelloWorldProxy.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.script.itests.properties;
-
-import org.osoa.sca.annotations.Reference;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class HelloWorldProxy implements HelloWorld {
-
- @Reference
- public HelloWorld delegate;
-
- public String sayHello(String s) {
- return delegate.sayHello(s);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JRubyHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JRubyHelloWorldTestCase.java
deleted file mode 100644
index 60c73359c0..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JRubyHelloWorldTestCase.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.implementation.script.itests.properties;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JRubyHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JavaScriptHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JavaScriptHelloWorldTestCase.java
deleted file mode 100644
index cde96b4b9b..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JavaScriptHelloWorldTestCase.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.implementation.script.itests.properties;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaScriptHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JythonHelloWorldTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JythonHelloWorldTestCase.java
deleted file mode 100644
index 0e6be74e09..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JythonHelloWorldTestCase.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.implementation.script.itests.properties;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JythonHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/GroovyReferenceTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/GroovyReferenceTestCase.java
deleted file mode 100644
index 6116581356..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/GroovyReferenceTestCase.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.implementation.script.itests.references;
-
-import org.apache.tuscany.sca.implementation.script.itests.helloworld.AbstractHelloWorldTestCase;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class GroovyReferenceTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/HelloWorldTarget.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/HelloWorldTarget.java
deleted file mode 100644
index dfcd37c46c..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/HelloWorldTarget.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.script.itests.references;
-
-import org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorld;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class HelloWorldTarget implements HelloWorld {
-
- public String sayHello(String s) {
- return "Hello " + s;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JRubyReferenceTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JRubyReferenceTestCase.java
deleted file mode 100644
index 83c2e99469..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JRubyReferenceTestCase.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.implementation.script.itests.references;
-
-import org.apache.tuscany.sca.implementation.script.itests.helloworld.AbstractHelloWorldTestCase;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JRubyReferenceTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JavaScriptReferenceTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JavaScriptReferenceTestCase.java
deleted file mode 100644
index 392e16411c..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JavaScriptReferenceTestCase.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.implementation.script.itests.references;
-
-import org.apache.tuscany.sca.implementation.script.itests.helloworld.AbstractHelloWorldTestCase;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaScriptReferenceTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JythonReferenceTestCase.java b/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JythonReferenceTestCase.java
deleted file mode 100644
index 8866ae6b70..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JythonReferenceTestCase.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.implementation.script.itests.references;
-
-import org.apache.tuscany.sca.implementation.script.itests.helloworld.AbstractHelloWorldTestCase;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JythonReferenceTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptDynamicRef.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptDynamicRef.composite
deleted file mode 100644
index 77ba095988..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptDynamicRef.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"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="JavaScriptHelloWorld">
-
- <component name="ClientComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworldProxy.js"/>
- <reference name="delegate" target="DelegateComponent">
- <interface.java interface="org.apache.tuscany.sca.implementation.script.itests.dynamic.HelloWorld" />
- </reference>
- </component>
-
- <component name="DelegateComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworld.js"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptHelloWorld.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptHelloWorld.composite
deleted file mode 100644
index 4e71a4a3e6..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/JavaScriptHelloWorld.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"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- name="JavaScriptHelloWorld">
-
- <component name="ClientComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworld.js"/>
- <property name="greeter" type="xsd:string">Tuscany</property>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworld.js b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworld.js
deleted file mode 100644
index beee72314d..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworld.js
+++ /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.
- */
-
-function sayHello(s) {
- return "Hello " + s;
-}
-
-function sayHelloFrom(s) {
- return "Hello " + s + " from " + greeter;
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworldProxy.js b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworldProxy.js
deleted file mode 100644
index 69a2f2e639..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/dynamic/helloworldProxy.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-function sayHello(s) {
- return delegate.sayHello(s);
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/GroovyHelloWorld.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/GroovyHelloWorld.composite
deleted file mode 100644
index ce377e4ed3..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/GroovyHelloWorld.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="GroovyHelloWorld">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"></reference>
- </component>
-
- <component name="HelloWorldComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.groovy"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JRubyHelloWorld.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JRubyHelloWorld.composite
deleted file mode 100644
index 4d32ed9f6b..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JRubyHelloWorld.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="JRubyHelloWorld">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"></reference>
- </component>
-
- <component name="HelloWorldComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.rb"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScripInlineHelloWorld.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScripInlineHelloWorld.composite
deleted file mode 100644
index 7ddf517b96..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScripInlineHelloWorld.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"
- name="JavaScriptHelloWorld">
-
- <component name="ClientComponent">
- <tuscany:implementation.script language="js">
-
- function sayHello(s) {
- return "Hello " + s;
- }
-
- </tuscany:implementation.script>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScriptHelloWorld.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScriptHelloWorld.composite
deleted file mode 100644
index 13cb94d511..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScriptHelloWorld.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="JavaScriptHelloWorld">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"></reference>
- </component>
-
- <component name="HelloWorldComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.js"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JythonHelloWorld.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JythonHelloWorld.composite
deleted file mode 100644
index c641b82cd6..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JythonHelloWorld.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="JythonHelloWorld">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"></reference>
- </component>
-
- <component name="HelloWorldComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.py"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.componentType b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.componentType
deleted file mode 100644
index bb0ddd002f..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.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"
- xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <service name="HelloWorldService">
- <interface.java interface="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorld" />
- </service>
-
-</componentType>
- \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.groovy b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.groovy
deleted file mode 100644
index 9f89bd373e..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.groovy
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-def sayHello(s) {
- return "Hello " + s
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.js b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.js
deleted file mode 100644
index eac2ab283f..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-function sayHello(s) {
-
- return "Hello " + s;
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.py b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.py
deleted file mode 100644
index f5dd0f8fcf..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.py
+++ /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.
-#
-
-def sayHello(s):
- return 'Hello ' + s \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.rb b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.rb
deleted file mode 100644
index cd2d3bcaea..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-def sayHello(s)
- return "Hello " + s
-end \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/GroovyHelloWorld.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/GroovyHelloWorld.composite
deleted file mode 100644
index 26574c6266..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/GroovyHelloWorld.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="GroovyProperties">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.properties.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"></reference>
- </component>
-
- <component name="HelloWorldComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.groovy"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JRubyHelloWorld.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JRubyHelloWorld.composite
deleted file mode 100644
index a3551cefc3..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JRubyHelloWorld.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="JRubyProperties">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.properties.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent" />
- </component>
-
- <component name="HelloWorldComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.rb"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JavaScriptHelloWorld.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JavaScriptHelloWorld.composite
deleted file mode 100644
index f72c6e922f..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JavaScriptHelloWorld.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="JavaScriptProperties">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.properties.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"></reference>
- </component>
-
- <component name="HelloWorldComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.js"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JythonHelloWorld.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JythonHelloWorld.composite
deleted file mode 100644
index bd754c8d2e..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JythonHelloWorld.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="JythonProperties">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.properties.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"></reference>
- </component>
-
- <component name="HelloWorldComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.py"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.componentType b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.componentType
deleted file mode 100644
index 06f261015e..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.componentType
+++ /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.
--->
-<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <service name="HelloWorldService">
- <interface.java interface="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorld" />
- </service>
-
- <property name="greeter" type="xsd:string">Tuscany</property>
-
-</componentType>
- \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.groovy b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.groovy
deleted file mode 100644
index a7eb446d37..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.groovy
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-def sayHello(s) {
- return "Hello " + s + " from " + greeter
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.js b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.js
deleted file mode 100644
index 64df3ebbef..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-function sayHello(s) {
-
- return "Hello " + s + " from " + greeter;
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.py b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.py
deleted file mode 100644
index 868cfa9eeb..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.py
+++ /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.
-#
-
-def sayHello(s):
- return 'Hello ' + s + ' from ' + greeter \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.rb b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.rb
deleted file mode 100644
index 2844f8b8d9..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-def sayHello(s)
- return "Hello " + s + " from " + $greeter
-end \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/GroovyReference.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/GroovyReference.composite
deleted file mode 100644
index 175bb79104..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/GroovyReference.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="GroovyReference">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="ReferenceComponent"></reference>
- </component>
-
- <component name="ReferenceComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/references/reference.groovy"/>
- <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/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JRubyReference.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JRubyReference.composite
deleted file mode 100644
index 7581b633cc..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JRubyReference.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="JRubyReference">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="ReferenceComponent"></reference>
- </component>
-
- <component name="ReferenceComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/references/reference.rb"/>
- <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/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JavaScriptReference.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JavaScriptReference.composite
deleted file mode 100644
index 91085b9eb2..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JavaScriptReference.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: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"/>
- <reference name="delegate" target="ReferenceComponent"></reference>
- </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/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JythonReference.composite b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JythonReference.composite
deleted file mode 100644
index 535164aae7..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JythonReference.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: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"/>
- <reference name="delegate" target="ReferenceComponent"></reference>
- </component>
-
- <component name="ReferenceComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/references/reference.py"/>
- <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/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.componentType b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.componentType
deleted file mode 100644
index 3edd075126..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.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" xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance">
-
- <service name="HelloWorldService">
- <interface.java interface="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorld" />
- </service>
-
- <reference name="ref">
- <interface.java interface="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorld" />
- </reference>
-
-</componentType>
- \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.groovy b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.groovy
deleted file mode 100644
index 5d2216d583..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.groovy
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-def sayHello(s) {
- return ref.sayHello(s)
-}
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.js b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.js
deleted file mode 100644
index ad0a932d26..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-function sayHello(s) {
- return ref.sayHello(s);
-} \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.py b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.py
deleted file mode 100644
index aee8bf991d..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.py
+++ /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.
-#
-
-def sayHello(s):
- return ref.sayHello(s)
diff --git a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.rb b/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.rb
deleted file mode 100644
index 87f0f56082..0000000000
--- a/branches/sca-android/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-def sayHello(s)
- return $ref.sayHello(s)
-end \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-spring/LICENSE b/branches/sca-android/modules/implementation-spring/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/implementation-spring/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/implementation-spring/META-INF/README b/branches/sca-android/modules/implementation-spring/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-spring/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-spring/NOTICE b/branches/sca-android/modules/implementation-spring/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/implementation-spring/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/branches/sca-android/modules/implementation-spring/pom.xml b/branches/sca-android/modules/implementation-spring/pom.xml
deleted file mode 100644
index 4d613ca9fa..0000000000
--- a/branches/sca-android/modules/implementation-spring/pom.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-spring</artifactId>
- <name>Apache Tuscany SCA Spring Framework Implementation Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <!-- Temporarily depend on implementation-script for a set of utility classes -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-script</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <!-- Spring dependencies... -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>2.0.8</version>
- </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.implementation.spring</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.spring*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAApplicationContext.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAApplicationContext.java
deleted file mode 100644
index b550fc3229..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAApplicationContext.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.implementation.spring;
-
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.AbstractXmlApplicationContext;
-import org.springframework.core.io.Resource;
-
-/**
- * An <code>ApplicationContext</code> specialization that registers namespace
- * handlers for SCA elements - in particular the <service/>, <reference/> and
- * <property/> elements which are provided as SCA extensions to the Spring
- * application context schema
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SCAApplicationContext extends AbstractXmlApplicationContext {
- public static final String APP_CONTEXT_PROP = "org.springframework.sca.application.context";
- private Resource appXml;
-
- public SCAApplicationContext(ApplicationContext parent, Resource appXml) {
- super(parent);
- this.appXml = appXml;
- //refresh();
- }
-
- @Override
- protected void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader) {
- ClassLoader cl = getClassLoader();
- beanDefinitionReader.setNamespaceHandlerResolver(new SCANamespaceHandlerResolver(cl));
- }
-
- @Override
- protected Resource[] getConfigResources() {
- return new Resource[] {appXml};
- }
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCANamespaceHandlerResolver.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCANamespaceHandlerResolver.java
deleted file mode 100644
index 32f575fe46..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCANamespaceHandlerResolver.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.implementation.spring;
-
-import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver;
-import org.springframework.beans.factory.xml.NamespaceHandler;
-
-/**
- * Overrides the default Spring namespace resolver to automatically register
- * {@link ScaNamespaceHandler} instead of requiring a value to be supplied in a
- * Spring configuration
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SCANamespaceHandlerResolver extends DefaultNamespaceHandlerResolver {
- private static final String SCA_NAMESPACE = "http://www.springframework.org/schema/sca";
-
- private ScaNamespaceHandler handler;
-
- public SCANamespaceHandlerResolver(ClassLoader classLoader) {
- super(classLoader);
- handler = new ScaNamespaceHandler(/*componentType*/);
- }
-
- public SCANamespaceHandlerResolver(String handlerMappingsLocation, ClassLoader classLoader) {
- super(classLoader, handlerMappingsLocation);
- handler = new ScaNamespaceHandler(/*componentType*/);
- }
-
- @Override
- public NamespaceHandler resolve(String namespaceUri) {
- if (SCA_NAMESPACE.equals(namespaceUri)) {
- return handler;
- }
- return super.resolve(namespaceUri);
- }
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAParentApplicationContext.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAParentApplicationContext.java
deleted file mode 100644
index d419d6db68..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAParentApplicationContext.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.implementation.spring;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.MessageSourceResolvable;
-import org.springframework.context.NoSuchMessageException;
-import org.springframework.core.io.Resource;
-
-/**
- * A Spring ParentApplicationContext for a given Spring Implementation
- *
- * The Parent application context is responsible for handling those entities within a Spring
- * application context that actually belong to SCA rather than to Spring. The principal things
- * are Properties and References. These may be present either through explicit <sca:property/>
- * and <sca:reference/> elements in the application context or they may be implicit through
- * unresolved Spring bean <property.../> elements. In either case, it is the Parent application
- * context that must provide Spring beans that correspond to the property or reference, as derived
- * from the SCA composite in which the Spring application context is an implementation.
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-class SCAParentApplicationContext implements ApplicationContext {
-
- // The Spring implementation for which this is the parent application context
- private SpringImplementation implementation;
- private RuntimeComponent component;
- private JavaPropertyValueObjectFactory propertyFactory;
-
- private static final String[] EMPTY_ARRAY = new String[0];
-
- public SCAParentApplicationContext(RuntimeComponent component,
- SpringImplementation implementation,
- ProxyFactory proxyService,
- JavaPropertyValueObjectFactory propertyValueObjectFactory) {
- this.implementation = implementation;
- this.component = component;
- this.propertyFactory = propertyValueObjectFactory;
- } // end constructor
-
- public Object getBean(String name) throws BeansException {
- return getBean(name, (Class) null);
- }
-
- /**
- * Get a Bean for a reference or for a property.
- *
- * @param name - the name of the Bean required
- * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
- * @return Object - a Bean which matches the requested bean
- */
- public Object getBean(String name, Class requiredType) throws BeansException {
- System.out.println("Spring parent context - getBean called for name: " + name);
- // The expectation is that the requested Bean is either a reference or a property
- // from the Spring context
- for (Reference reference : implementation.getReferences()) {
- if (reference.getName().equals(name)) {
- // Extract the Java interface for the reference (it can't be any other interface type
- // for a Spring application context)
- if (requiredType == null) {
- JavaInterface javaInterface = (JavaInterface)reference.getInterfaceContract().getInterface();
- requiredType = javaInterface.getJavaClass();
- }
- // Create and return the proxy for the reference
- return getService(requiredType, reference.getName());
- } // end if
- } // end for
-
- // For a property, get the name and the required Java type and create a Bean
- // of that type with the value inserted.
- for (Property property : implementation.getProperties()) {
- if (property.getName().equals(name)) {
- if (requiredType == null) {
- // The following code only deals with a subset of types and was superceded
- // by the information from the implementation (which uses Classes as found
- // in the Spring implementation itself.
- //requiredType = JavaXMLMapper.getJavaType( property.getXSDType() );
- requiredType = implementation.getPropertyClass(name);
- }
- return getPropertyBean(requiredType, property.getName());
- } // end if
- } // end for
- throw new NoSuchBeanDefinitionException("Unable to find Bean with name " + name);
-
- } // end method getBean( String, Class )
-
- public Object getBean(String name, Object[] args) throws BeansException {
- return getBean(name, ((Class)null));
- }
-
- /**
- * Creates a proxy Bean for a reference
- * @param <B> the Business interface type for the reference
- * @param businessInterface - the business interface as a Class
- * @param referenceName - the name of the Reference
- * @return an Bean of the type defined by <B>
- */
- private <B> B getService(Class<B> businessInterface, String referenceName) {
- return component.getComponentContext().getService(businessInterface, referenceName);
- }
-
- /**
- * Method to create a Java Bean for a Property value
- * @param <B> the class type of the Bean
- * @param requiredType - a Class object for the required type
- * @param name - the Property name
- * @return - a Bean of the specified property, with value set
- */
- private <B> B getPropertyBean(Class requiredType, String name) {
- B propertyObject = null;
- // Get the component's list of properties
- List<ComponentProperty> props = component.getProperties();
- for (ComponentProperty prop : props) {
- if (prop.getName().equals(name)) {
- // On finding the property, create a factory for it and create a Bean using
- // the factory
- ObjectFactory factory = propertyFactory.createValueFactory(prop, prop.getValue(), requiredType);
- propertyObject = (B)factory.getInstance();
- } // end if
- } // end for
-
- return propertyObject;
- }
-
- public boolean containsBean(String name) {
- // TODO
- System.out.println("Spring parent context - containsBean called for name: " + name);
- return false;
- }
-
- public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
- // TODO
- return false;
- }
-
- public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException {
- throw new UnsupportedOperationException();
- }
-
- public Class getType(String name) throws NoSuchBeanDefinitionException {
- return null;
- }
-
- public String[] getAliases(String name) throws NoSuchBeanDefinitionException {
- return EMPTY_ARRAY;
- }
-
- public ApplicationContext getParent() {
- return null;
- }
-
- public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException {
- return null;
- }
-
- public String getId() {
- return this.toString();
- }
-
- public String getDisplayName() {
- return implementation.getURI();
- }
-
- public long getStartupDate() {
- return 0;
- }
-
- public boolean containsBeanDefinition(String beanName) {
- return false;
- }
-
- public int getBeanDefinitionCount() {
- return 0;
- }
-
- public String[] getBeanDefinitionNames() {
- return new String[0];
- }
-
- public String[] getBeanNamesForType(Class type) {
- return new String[0];
- }
-
- public String[] getBeanNamesForType(Class type, boolean includePrototypes, boolean includeFactoryBeans) {
- return new String[0];
- }
-
- public Map getBeansOfType(Class type) throws BeansException {
- return null;
- }
-
- public Map getBeansOfType(Class type, boolean includePrototypes, boolean includeFactoryBeans) throws BeansException {
- return null;
- }
-
- public boolean isPrototype(String theString) {
- return false;
- }
-
- public BeanFactory getParentBeanFactory() {
- return null;
- }
-
- public boolean containsLocalBean(String name) {
- return false;
- }
-
- public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
- return null;
- }
-
- public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException {
- return null;
- }
-
- public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {
- return null;
- }
-
- public void publishEvent(ApplicationEvent event) {
-
- }
-
- public Resource[] getResources(String locationPattern) throws IOException {
- return new Resource[0];
- }
-
- public Resource getResource(String location) {
- return null;
- }
-
- public ClassLoader getClassLoader() {
- // REVIEW: this is almost certainly flawed, but it's not clear how the SCA runtime's
- // resource loading mechanism is exposed right now.
- return this.getClass().getClassLoader();
- }
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaNamespaceHandler.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaNamespaceHandler.java
deleted file mode 100644
index 45f00ce1af..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaNamespaceHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2002-2006 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
-
-/**
- * Handler for the &lt;sca:&gt; namespace in an application context
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class ScaNamespaceHandler extends NamespaceHandlerSupport {
-
- public ScaNamespaceHandler() {
- init();
- }
-
- public final void init() {
- registerBeanDefinitionParser("reference", new ScaReferenceBeanDefinitionParser());
- registerBeanDefinitionParser("service", new ScaServiceBeanDefinitionParser());
- registerBeanDefinitionParser("property", new ScaPropertyBeanDefinitionParser());
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaPropertyBeanDefinitionParser.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaPropertyBeanDefinitionParser.java
deleted file mode 100644
index dc532ce20d..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaPropertyBeanDefinitionParser.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2002-2006 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.xml.BeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-
-/**
- * Parser for the &lt;sca:reference&gt; element
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser {
-
- public BeanDefinition parse(Element element, ParserContext parserContext) {
- // do nothing, this is handled by Tuscany
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaReferenceBeanDefinitionParser.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaReferenceBeanDefinitionParser.java
deleted file mode 100644
index 1dd44cd752..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaReferenceBeanDefinitionParser.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2002-2006 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.xml.BeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-
-/**
- * Parser for the &lt;sca:reference&gt; element
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser {
-
- public BeanDefinition parse(Element element, ParserContext parserContext) {
- // do nothing, this is handled by Tuscany
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaServiceBeanDefinitionParser.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaServiceBeanDefinitionParser.java
deleted file mode 100644
index 9dadcd2f49..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/ScaServiceBeanDefinitionParser.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2002-2006 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.xml.BeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-
-/**
- * Parser for the &lt;sca:service/&gt; element
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class ScaServiceBeanDefinitionParser implements BeanDefinitionParser {
-
- public BeanDefinition parse(Element element, ParserContext parserContext) {
- // do nothing, handled by Tuscany
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanNotFoundException.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanNotFoundException.java
deleted file mode 100644
index 35df76fabc..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanNotFoundException.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.spring;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SpringBeanNotFoundException extends Exception {
-
- private static final long serialVersionUID = -1157790036638157553L;
-
- public SpringBeanNotFoundException(String msg) {
- super(msg);
- }
-
- public SpringBeanNotFoundException(Throwable e) {
- super(e);
- }
-
- public SpringBeanNotFoundException(String msg, Throwable e) {
- super(msg,e);
- }
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java
deleted file mode 100644
index 56af997fae..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.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.implementation.spring;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Extensible;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
-import org.apache.tuscany.sca.implementation.spring.xml.SpringBeanElement;
-import org.springframework.core.io.Resource;
-
-/**
- * Represents a Spring implementation.
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringImplementation extends ImplementationImpl implements Implementation, Extensible {
-
- // The location attribute which points to the Spring application-context XML file
- private String location;
- // The application-context file as a Spring Resource
- private Resource resource;
- private ComponentType componentType;
- // Mapping of Services to Beans
- private Hashtable<String, SpringBeanElement> serviceMap;
- // Mapping of property names to Java class
- private Hashtable<String, Class> propertyMap;
-
- protected SpringImplementation() {
- this.location = null;
- this.resource = null;
- setUnresolved(true);
- serviceMap = new Hashtable<String, SpringBeanElement>();
- propertyMap = new Hashtable<String, Class>();
- } // end method SpringImplementation
-
- /* Returns the location attribute for this Spring implementation */
- public String getLocation() {
- return location;
- }
-
- /**
- * Sets the location attribute for this Spring implementation
- * location - a URI to the Spring application-context file
- */
- public void setLocation(String location) {
- this.location = location;
- return;
- }
-
- public void setResource(Resource resource) {
- this.resource = resource;
- }
-
- public Resource getResource() {
- return resource;
- }
-
- /*
- * Returns the componentType for this Spring implementation
- */
- public ComponentType getComponentType() {
- return componentType;
- }
-
- /*
- * Sets the componentType for this Spring implementation
- */
- public void setComponentType(ComponentType componentType) {
- this.componentType = componentType;
- }
-
- @Override
- public List<Service> getServices() {
- return componentType.getServices();
- }
-
- @Override
- public List<Reference> getReferences() {
- return componentType.getReferences();
- }
-
- @Override
- public List<Property> getProperties() {
- return componentType.getProperties();
- }
-
- /**
- * Returns the Spring Bean which implements a particular service
- * @param service the service
- * @return the bean which implements the service, as a SpringBeanElement
- */
- public SpringBeanElement getBeanFromService(Service service) {
- SpringBeanElement theBean = serviceMap.get(service.getName());
- return theBean;
- }
-
- /**
- * Sets the mapping from a service to the Spring Bean that implements the service
- * @param service the service
- * @param theBean a SpringBeanElement for the Bean implementing the service
- */
- public void setBeanForService(Service service, SpringBeanElement theBean) {
- serviceMap.put(service.getName(), theBean);
- }
-
- /**
- * Add a mapping from a SCA property name to a Java class for the property
- * @param propertyName
- * @param propertyClass
- */
- public void setPropertyClass(String propertyName, Class propertyClass) {
- if (propertyName == null || propertyClass == null)
- return;
- propertyMap.put(propertyName, propertyClass);
- return;
- } // end method setPropertyClass
-
- /**
- * Gets the Java Class for an SCA property
- * @param propertyName - the property name
- * @return - a Class object for the type of the property
- */
- public Class getPropertyClass(String propertyName) {
- return propertyMap.get(propertyName);
- } // end method getPropertyClass
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java
deleted file mode 100644
index c886c0390c..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.implementation.spring.xml.SpringXMLComponentTypeLoader;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * SpringArtifactProcessor is responsible for processing the XML of an <implementation.spring.../>
- * element in an SCA SCDL file.
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringImplementationProcessor implements StAXArtifactProcessor<SpringImplementation> {
-
- private static final String LOCATION = "location";
- private static final String IMPLEMENTATION_SPRING = "implementation.spring";
- private static final QName IMPLEMENTATION_SPRING_QNAME = new QName(Constants.SCA10_NS, IMPLEMENTATION_SPRING);
- private static final String MSG_LOCATION_MISSING = "Reading implementation.spring - location attribute missing";
-
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
- private PolicyFactory policyFactory;
- private PolicyAttachPointProcessor policyProcessor;
- private Monitor monitor;
-
- public SpringImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- this.monitor = monitor;
- }
-
- /**
- * Report a exception.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /*
- * Read the XML and parse out the attributes.
- *
- * <implementation.spring.../> has a single required attribute:
- * "location" - which is the target URI of of an archive file or a directory that contains the Spring
- * application context files.
- * If the resource identified by the location attribute is an archive file, then the file
- * META-INF/MANIFEST.MF is read from the archive.
- * If the location URI identifies a directory, then META-INF/MANIFEST.MF must exist
- * underneath that directory.
- * If the manifest file contains a header "Spring-Context" of the format:
- * Spring-Context ::= path ( ';' path )*
- *
- * Where path is a relative path with respect to the location URI, then the set of paths
- * specified in the header identify the context configuration files.
- * If there is no MANIFEST.MF file or no Spring-Context header within that file,
- * then the default behaviour is to build an application context using all the *.xml files
- * in the METAINF/spring directory.
- */
- public SpringImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Create the Spring implementation
- SpringImplementation springImplementation = null;
-
- // Read the location attribute for the spring implementation
- String springLocation = reader.getAttributeValue(null, LOCATION);
- if (springLocation != null) {
- springImplementation = new SpringImplementation();
- springImplementation.setLocation(springLocation);
- springImplementation.setUnresolved(true);
- processComponentType(springImplementation);
- } else {
- error("LocationAttributeMissing", reader);
- //throw new ContributionReadException(MSG_LOCATION_MISSING);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && IMPLEMENTATION_SPRING_QNAME.equals(reader.getName())) {
- break;
- }
- } // end while
-
- return springImplementation;
- } // end read
-
- /*
- * Handles the component type for the Spring implementation
- * @param springImplementation - a Spring implementation. The component type information
- * is created for this implementation
- *
- */
- private void processComponentType(SpringImplementation springImplementation) {
-
- // Create a ComponentType and mark it unresolved
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setUnresolved(true);
- springImplementation.setComponentType(componentType);
- } // end processComponentType
-
- /*
- * Write out the XML representation of the Spring implementation
- * <implementation.spring location="..." />
- */
- public void write(SpringImplementation springImplementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <implementation.spring>
- policyProcessor.writePolicyPrefixes(springImplementation, writer);
- writer.writeStartElement(Constants.SCA10_NS, IMPLEMENTATION_SPRING);
- policyProcessor.writePolicyAttributes(springImplementation, writer);
-
- if (springImplementation.getLocation() != null) {
- writer.writeAttribute(LOCATION, springImplementation.getLocation());
- }
-
- writer.writeEndElement();
-
- } // end write
-
- /**
- * Resolves the Spring implementation - loads the Spring application-context XML and
- * derives the spring implementation componentType from it
- */
- public void resolve(SpringImplementation springImplementation, ModelResolver resolver)
- throws ContributionResolveException {
-
- if (springImplementation == null)
- return;
-
- /* Load the Spring component type by reading the Spring application context */
- SpringXMLComponentTypeLoader springLoader =
- new SpringXMLComponentTypeLoader(assemblyFactory, javaFactory, policyFactory);
- try {
- // Load the Spring Implementation information from its application context file...
- springLoader.load(springImplementation);
- } catch (ContributionReadException e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", resolver, ce);
- throw ce;
- }
-
- ComponentType ct = springImplementation.getComponentType();
- if (ct.isUnresolved()) {
- // If the introspection fails to resolve, try to find a side file...
- ComponentType componentType = resolver.resolveModel(ComponentType.class, ct);
- if (componentType.isUnresolved()) {
- error("UnableToResolveComponentType", resolver);
- //throw new ContributionResolveException("SpringArtifactProcessor: unable to resolve componentType for Spring component");
- } else {
- springImplementation.setComponentType(componentType);
- springImplementation.setUnresolved(false);
- }
-
- } // end if
-
- } // end method resolve
-
- public QName getArtifactType() {
- return IMPLEMENTATION_SPRING_QNAME;
- }
-
- public Class<SpringImplementation> getModelType() {
- return SpringImplementation.class;
- }
-
-} // end class SpringArtifactProcessor
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProvider.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProvider.java
deleted file mode 100644
index d7724f1723..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProvider.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.implementation.spring;
-
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-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;
-import org.springframework.context.support.AbstractApplicationContext;
-
-// TODO - create a working version of this class...
-/**
- * A provider class for runtime Spring implementation instances
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringImplementationProvider implements ImplementationProvider {
- private RuntimeComponent component;
-
- // A Spring application context object
- private AbstractApplicationContext springContext;
-
- /**
- * Constructor for the provider - takes a component definition and a Spring implementation
- * description
- * @param component - the component in the assembly
- * @param implementation - the implementation
- */
- public SpringImplementationProvider(RuntimeComponent component,
- SpringImplementation implementation,
- ProxyFactory proxyService,
- JavaPropertyValueObjectFactory propertyValueObjectFactory) {
- super();
- this.component = component;
- SCAParentApplicationContext scaParentContext =
- new SCAParentApplicationContext(component, implementation, proxyService, propertyValueObjectFactory);
- springContext = new SCAApplicationContext(scaParentContext, implementation.getResource());
- } // end constructor
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- return new SpringInvoker(component, springContext, service, operation);
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- /**
- * Start this Spring implementation instance
- */
- public void start() {
- // Do refresh here to ensure that Spring Beans are not touched before the SCA config process
- // is complete...
- springContext.refresh();
- springContext.start();
- // System.out.println("SpringImplementationProvider: Spring context started");
- } // end method start()
-
- /**
- * Stop this implementation instance
- */
- public void stop() {
- // TODO - complete
- springContext.stop();
- //System.out.println("SpringImplementationProvider: Spring context stopped");
- } // end method stop
-
-} // end class SpringImplementationProvider
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProviderFactory.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProviderFactory.java
deleted file mode 100644
index f2bb1fd6e8..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProviderFactory.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.implementation.spring;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint;
-import org.apache.tuscany.sca.databinding.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.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * ImplementationProviderFactory for Spring implementation type
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- *
- */
-public class SpringImplementationProviderFactory implements ImplementationProviderFactory<SpringImplementation> {
-
- private ProxyFactory proxyFactory;
- private JavaPropertyValueObjectFactory propertyFactory;
-
- /**
- * Simple constructor
- *
- */
- public SpringImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- super();
-
- ProxyFactoryExtensionPoint proxyFactories = extensionPoints.getExtensionPoint(ProxyFactoryExtensionPoint.class);
- proxyFactory = new ExtensibleProxyFactory(proxyFactories);
-
- // TODO: could the runtime have a default PropertyValueObjectFactory?
- DataBindingExtensionPoint dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class);
- TransformerExtensionPoint transformers = extensionPoints.getExtensionPoint(TransformerExtensionPoint.class);
- MediatorImpl mediator = new MediatorImpl(dataBindings, transformers);
- propertyFactory = new JavaPropertyValueObjectFactory(mediator);
- }
-
- /**
- * Returns a SpringImplementationProvider for a given component and Spring implementation
- * @param component the component for which implementation instances are required
- * @param implementation the Spring implementation with details of the component
- * implementation
- * @return the SpringImplementationProvider for the specified component
- */
- public ImplementationProvider createImplementationProvider(RuntimeComponent component,
- SpringImplementation implementation) {
- return new SpringImplementationProvider(component, implementation, proxyFactory, propertyFactory);
- }
-
- /**
- * Returns the class of the Spring implementation
- */
- public Class<SpringImplementation> getModelType() {
- return SpringImplementation.class;
- }
-} // end class SpringImplementationProviderFactory
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvocationException.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvocationException.java
deleted file mode 100644
index 410525a054..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvocationException.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.spring;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SpringInvocationException extends Exception {
-
- private static final long serialVersionUID = -1157790036638157513L;
-
- public SpringInvocationException(String msg) {
- super(msg);
- }
-
- public SpringInvocationException(Throwable e) {
- super(e);
- }
-
- public SpringInvocationException(String msg,Throwable e) {
- super(msg,e);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvoker.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvoker.java
deleted file mode 100644
index 5eeb802727..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvoker.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.implementation.spring;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.implementation.spring.xml.SpringBeanElement;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.springframework.beans.BeansException;
-import org.springframework.context.support.AbstractApplicationContext;
-
-/**
- * Initial implementation of a Spring bean invoker
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringInvoker implements Invoker {
-
- private Method theMethod = null;
- private Object bean;
- private SpringBeanElement beanElement;
- private boolean badInvoker = false;
-
- private AbstractApplicationContext springContext;
- private Operation operation;
-
- /**
- * SpringInvoker constructor
- * @param component - the Spring component to invoke
- * @param service - the service to invoke
- * @param operation - the operation to invoke
- */
- public SpringInvoker(RuntimeComponent component,
- AbstractApplicationContext springContext,
- RuntimeComponentService service,
- Operation operation) {
-
- this.springContext = springContext;
- this.operation = operation;
-
- // From the component and the service, identify the Spring Bean which is the target
- SpringImplementation theImplementation = (SpringImplementation)component.getImplementation();
- beanElement = theImplementation.getBeanFromService(service.getService());
-
- if (beanElement == null) {
- badInvoker = true;
- return;
- }
-
- } // end constructor SpringInvoker
-
- // Lazy-load the method to avoid timing problems with the Spring Context
- private void setupMethod() throws SpringInvocationException{
- try {
- bean = springContext.getBean(beanElement.getId());
- Class<?> beanClass = bean.getClass();
- theMethod = JavaInterfaceUtil.findMethod(beanClass, operation);
- //System.out.println("SpringInvoker - found method " + theMethod.getName() );
- } catch (BeansException e) {
- throw new SpringInvocationException(e);
- } catch (NoSuchMethodException e) {
- throw new SpringInvocationException(e);
- }
- }
-
- private Object doInvoke(Object payload) throws SpringInvocationException {
- if (theMethod == null)
- setupMethod();
-
- if (badInvoker)
- throw new SpringInvocationException("Spring invoker incorrectly configured");
- // Invoke the method on the Spring bean using the payload, returning the results
- try {
- Object ret;
-
- if (payload != null && !payload.getClass().isArray()) {
- ret = theMethod.invoke(bean, payload);
- } else {
- ret = theMethod.invoke(bean, (Object[])payload);
- }
- return ret;
- } catch (InvocationTargetException e) {
- throw new SpringInvocationException("Spring invoker invoke method '"+ theMethod.getName()+"' error.",e);
- } catch (Exception e) {
- throw new SpringInvocationException("Spring invoker invoke method '"+ theMethod.getName()+"' error.",e);
- }
-
- } // end method doInvoke
-
- /**
- * @param msg the message to invoke on the target bean
- */
- public Message invoke(Message msg) {
- try {
- Object resp = doInvoke(msg.getBody());
- msg.setBody(resp);
- } catch (SpringInvocationException e) {
- msg.setFaultBody(e.getCause());
- }catch (Throwable e) {
- msg.setFaultBody(e);
- }
- //System.out.println("Spring Invoker - invoke called");
- return msg;
- } // end method invoke
-
-} // end class SpringInvoker
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringOperationNotFoundException.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringOperationNotFoundException.java
deleted file mode 100644
index b34b1ee0b1..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringOperationNotFoundException.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.spring;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SpringOperationNotFoundException extends Exception {
-
- private static final long serialVersionUID = -1157790036638157554L;
-
- public SpringOperationNotFoundException(String msg) {
- super(msg);
- }
-
- public SpringOperationNotFoundException(Throwable e) {
- super(e);
- }
-
- public SpringOperationNotFoundException(String msg,Throwable e) {
- super(msg,e);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyValueObjectFactory.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyValueObjectFactory.java
deleted file mode 100644
index 3f98180498..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyValueObjectFactory.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.spring;
-
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-
-/**
- *
- * Factory class for PropertyValueObjects for Spring implementations
- *
- * 6th May 2007: Chosen a very simple design for this class - since Spring implementations are a form
- * of Java POJO, the simple design chosen for this class is to re-use the PropertyValueObjectFactory
- * implementation from the base implementation-java-runtime package of Tuscany SCA Java, since the
- * same properties are going to be rendered in the same way to simple Tuscany POJOs and to Spring
- * Bean POJOs. Mike Edwards
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringPropertyValueObjectFactory extends JavaPropertyValueObjectFactory {
-
- /**
- * Constructor simply defers to the superclass, along with the complete implementation...
- */
- public SpringPropertyValueObjectFactory(Mediator mediator) {
- super(mediator);
- } // end constructor JavaPropertyValueObjectFactory(Mediator mediator)
-
-} // end class SpringPropertyValueObjectFactory
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/Constants.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/Constants.java
deleted file mode 100644
index 92f980fdfe..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/Constants.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.spring.xml;
-
-import javax.xml.namespace.QName;
-
-/**
- * Constants used in Spring Application Context XML files.
- */
-public interface Constants {
-
- String SCA_NS = "http://www.springframework.org/schema/sca";
- String SPRING_NS = "http://www.springframework.org/schema/beans";
-
- String PROPERTY = "property";
- QName SCAPROPERTY_ELEMENT = new QName(SCA_NS, PROPERTY);
- QName PROPERTY_ELEMENT = new QName(SPRING_NS, PROPERTY);
-
- String SERVICE = "service";
- QName SERVICE_ELEMENT = new QName(SCA_NS, SERVICE);
-
- String REFERENCE = "reference";
- QName REFERENCE_ELEMENT = new QName(SCA_NS, REFERENCE);
-
- String BEANS = "beans";
- QName BEANS_ELEMENT = new QName(SPRING_NS, BEANS);
-
- String IMPORT = "import";
- QName IMPORT_ELEMENT = new QName(SPRING_NS, IMPORT);
-
- String BEAN = "bean";
- QName BEAN_ELEMENT = new QName(SPRING_NS, BEAN);
-
- String CONSTRUCTORARG = "constructor-arg";
- QName CONSTRUCTORARG_ELEMENT = new QName(SPRING_NS, CONSTRUCTORARG);
-
- String LIST = "list";
- QName LIST_ELEMENT = new QName(SPRING_NS, LIST);
-
- String VALUE = "value";
- QName VALUE_ELEMENT = new QName(SPRING_NS, VALUE);
-
- String REF = "ref";
- QName REF_ELEMENT = new QName(SPRING_NS, REF);
-
- String APPLICATION_CONTEXT = "application-context.xml";
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanElement.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanElement.java
deleted file mode 100644
index f9a9fee58f..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanElement.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.spring.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Represents a <bean> element in a Spring application-context
- * - this has id and className attributes
- * - plus zero or more property elements as children
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringBeanElement {
-
- private String id;
- private String className;
- private List<SpringPropertyElement> properties = new ArrayList<SpringPropertyElement>();
- private List<SpringConstructorArgElement> constructorargs = new ArrayList<SpringConstructorArgElement>();
-
- public SpringBeanElement(String id, String className) {
- this.id = id;
- this.className = className;
- }
-
- public String getClassName() {
- return className;
- }
-
- public String getId() {
- return id;
- }
-
- public List<SpringPropertyElement> getProperties() {
- return properties;
- }
-
- public void addProperty(SpringPropertyElement property) {
- properties.add(property);
- }
-
- public List<SpringConstructorArgElement> getCustructorArgs() {
- return constructorargs;
- }
-
- public void addCustructorArgs(SpringConstructorArgElement args) {
- constructorargs.add(args);
- }
-
-} // end class SpringBeanElement
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanIntrospector.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanIntrospector.java
deleted file mode 100644
index 625a46b12b..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanIntrospector.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.implementation.spring.xml;
-
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.AllowsPassByReferenceProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.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.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;
-
-/**
- * Provides introspection functions for Spring beans
- * This version leans heavily on the implementation-java classes
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringBeanIntrospector {
-
- private JavaImplementationFactory javaImplementationFactory;
-
- /**
- * The constructor sets up the various visitor elements that will be used to introspect
- * the Spring bean and extract SCA information.
- *
- * @param assemblyFactory The Assembly Factory to use
- * @param javaFactory The Java Interface Factory to use
- * @param policyFactory The Policy Factory to use.
- */
- public SpringBeanIntrospector(AssemblyFactory assemblyFactory,
- JavaInterfaceFactory javaFactory,
- PolicyFactory policyFactory) {
-
- javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- // Create the list of class visitors
- BaseJavaClassVisitor[] extensions =
- new BaseJavaClassVisitor[] {
- new ConstructorProcessor(assemblyFactory),
- new AllowsPassByReferenceProcessor(assemblyFactory),
- new ComponentNameProcessor(assemblyFactory),
- new ContextProcessor(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)};
- for (JavaClassVisitor extension : extensions) {
- javaImplementationFactory.addClassVisitor(extension);
- }
-
- } // end constructor
-
- /**
- * Introspect a Spring Bean and extract the features important to SCA
- * @param beanClass the Spring Bean class to introspect
- * @param componentType the componentType that is filled in through the introspection
- * process (assumed empty on invocation, filled on return
- * @return a Map of property names to JavaElementImpl
- * @throws ContributionResolveException - if there was a problem resolving the
- * Spring Bean or its componentType
- *
- */
- public Map<String, JavaElementImpl> introspectBean(Class<?> beanClass, ComponentType componentType)
- throws ContributionResolveException {
-
- if (componentType == null)
- throw new ContributionResolveException("Introspect Spring bean: supplied componentType is null");
-
- // Create a Java implementation ready for the introspection
- JavaImplementation javaImplementation = javaImplementationFactory.createJavaImplementation();
-
- try {
- // Introspect the bean...the results of the introspection are placed into the Java implementation
- javaImplementationFactory.createJavaImplementation(javaImplementation, beanClass);
-
- // Extract the services, references & properties found through introspection
- // put the services, references and properties into the component type
- componentType.getServices().addAll(javaImplementation.getServices());
- componentType.getReferences().addAll(javaImplementation.getReferences());
- componentType.getProperties().addAll(javaImplementation.getProperties());
- } catch (IntrospectionException e) {
- throw new ContributionResolveException(e);
- } // end try
-
- //List<Service> services = javaImplementation.getServices();
- //for (Service service : services) {
- //String name = service.getName();
- //System.out.println("Spring Bean: found service with name: " + name);
- //} // end for
-
- return javaImplementation.getPropertyMembers();
-
- } // end method introspectBean
-
-} // end class SpringBeanIntrospector
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringConstructorArgElement.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringConstructorArgElement.java
deleted file mode 100644
index 57f4a26ba3..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringConstructorArgElement.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.spring.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Represents a <constructor-arg> element in a Spring application-context
- * - this has ref attribute
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringConstructorArgElement {
-
- private String ref;
- private String type;
- private List<String> values = new ArrayList<String>();
-
- public SpringConstructorArgElement(String ref, String type) {
- this.ref = ref;
- this.type = type;
- }
-
- public String getType() {
- return this.type;
- }
-
- public String getRef() {
- return this.ref;
- }
-
- public void setRef(String ref) {
- this.ref = ref;
- }
-
- public List<String> getValues() {
- return this.values;
- }
-
- public void addValue(String value) {
- this.values.add(value);
- }
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringPropertyElement.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringPropertyElement.java
deleted file mode 100644
index 39e1286f32..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringPropertyElement.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.implementation.spring.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Represents a <property> element in a Spring application-context
- * - this has name and ref attributes
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringPropertyElement {
-
- private String name;
- private String ref;
- private List<String> values = new ArrayList<String>();
-
- public SpringPropertyElement(String name, String ref) {
- this.name = name;
- this.ref = ref;
- }
-
- public String getName() {
- return name;
- }
-
- public String getRef() {
- return ref;
- }
-
- public void setRef(String ref) {
- this.ref = ref;
- }
-
- public List<String> getProperties() {
- return values;
- }
-
- public void addProperty(String value) {
- values.add(value);
- }
-
-} // end class SpringPropertyElement
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAPropertyElement.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAPropertyElement.java
deleted file mode 100644
index 2f37ab6504..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAPropertyElement.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.spring.xml;
-
-/**
- * Represents an <sca:property> element in a Spring application-context
- * - this has name and type attributes
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringSCAPropertyElement {
-
- private String name;
- private String type;
-
- public SpringSCAPropertyElement(String name, String type) {
- this.name = name;
- this.type = type;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getType() {
- return type;
- }
-
-} // end class SpringPropertyElement
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAPropertyElement.java.orig b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAPropertyElement.java.orig
deleted file mode 100644
index 19874ad35d..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAPropertyElement.java.orig
+++ /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.spring.xml;
-
-/**
- * Represents an <sca:property> element in a Spring application-context
- * - this has name and type attributes
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringSCAPropertyElement {
-
- private String name;
- private String type;
-
- public SpringSCAPropertyElement(String name, String type) {
- this.name = name;
- this.type = type;
- }
-
- public String getName() {
- return name;
- }
-
- public String getType() {
- return type;
- }
-
-} // end class SpringPropertyElement
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAReferenceElement.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAReferenceElement.java
deleted file mode 100644
index b3f45415fd..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAReferenceElement.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.spring.xml;
-
-/**
- * Represents a <sca:reference> element in a Spring application-context
- * - this has id and className attributes
- * - plus zero or more property elements as children
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringSCAReferenceElement {
-
- private String name;
- private String type;
-
- public SpringSCAReferenceElement(String name, String type) {
- this.name = name;
- this.type = type;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getType() {
- return type;
- }
-
-} // end class SpringSCAReferenceElement
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAServiceElement.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAServiceElement.java
deleted file mode 100644
index 2eb5686270..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringSCAServiceElement.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.spring.xml;
-
-/**
- * Represents a <sca:service> element in a Spring application-context
- * - this has id and className attributes
- * - plus zero or more property elements as children
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringSCAServiceElement {
-
- private String name;
- private String type;
- private String target;
-
- public SpringSCAServiceElement(String name, String type, String target) {
- this.name = name;
- this.type = type;
- this.target = target;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getType() {
- return type;
- }
-
- public void setTarget(String target) {
- this.target = target;
- }
-
- public String getTarget() {
- return target;
- }
-
-} // end class SpringSCAServiceElement
diff --git a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLComponentTypeLoader.java b/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLComponentTypeLoader.java
deleted file mode 100644
index 9f41fd306f..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLComponentTypeLoader.java
+++ /dev/null
@@ -1,635 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.Attributes;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.UrlResource;
-
-/**
- * Introspects a Spring XML application-context configuration file to create <implementation-spring../>
- * component type information.
- *
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringXMLComponentTypeLoader {
-
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
- private ClassLoader cl;
-
- private SpringBeanIntrospector beanIntrospector;
-
- public SpringXMLComponentTypeLoader(AssemblyFactory assemblyFactory,
- JavaInterfaceFactory javaFactory,
- PolicyFactory policyFactory) {
- super();
- this.assemblyFactory = assemblyFactory;
- this.javaFactory = javaFactory;
- beanIntrospector =
- new SpringBeanIntrospector(assemblyFactory, javaFactory, policyFactory);
- }
-
- protected Class<SpringImplementation> getImplementationClass() {
- return SpringImplementation.class;
- }
-
- /**
- * Base method which loads the component type from the application-context attached to the
- * Spring implementation
- *
- */
- public void load(SpringImplementation implementation) throws ContributionReadException {
- //System.out.println("Spring TypeLoader - load method start");
- ComponentType componentType = implementation.getComponentType();
- /* Check that there is a component type object already set */
- if (componentType == null) {
- throw new ContributionReadException("SpringXMLLoader load: implementation has no ComponentType object");
- }
- if (componentType.isUnresolved()) {
- /* Fetch the location of the application-context file from the implementation */
- loadFromXML(implementation);
- if (!componentType.isUnresolved())
- implementation.setUnresolved(false);
- } // end if
- //System.out.println("Spring TypeLoader - load method complete");
- } // end method load
-
- /**
- * Method which fills out the component type for a Spring implementation by reading the
- * Spring application-context.xml file.
- *
- * @param implementation SpringImplementation into which to load the component type information
- * @throws ContributionReadException Failed to read the contribution
- */
- private void loadFromXML(SpringImplementation implementation) throws ContributionReadException {
- XMLStreamReader reader;
- List<SpringBeanElement> beans = new ArrayList<SpringBeanElement>();
- List<SpringSCAServiceElement> services = new ArrayList<SpringSCAServiceElement>();
- List<SpringSCAReferenceElement> references = new ArrayList<SpringSCAReferenceElement>();
- List<SpringSCAPropertyElement> scaproperties = new ArrayList<SpringSCAPropertyElement>();
-
- Resource resource;
-
- String location = implementation.getLocation();
-
- try {
- // FIXME - is the ContextClassLoader the right place to start the search?
- cl = Thread.currentThread().getContextClassLoader();
-
- resource = getApplicationContextResource(location, cl);
- implementation.setResource(resource);
- // The URI is used to uniquely identify the Implementation
- implementation.setURI(resource.getURL().toString());
- // FIXME - need a better way to handle the XMLInputFactory than allocating a new one every time
- XMLInputFactory xmlFactory = XMLInputFactory.newInstance();
- reader = xmlFactory.createXMLStreamReader(resource.getInputStream());
-
- // System.out.println("Spring TypeLoader - starting to read context file");
- readBeanDefinition(reader, beans, services, references, scaproperties);
-
- } catch (IOException e) {
- throw new ContributionReadException(e);
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
-
- /* At this point, the complete application-context.xml file has been read and its contents */
- /* stored in the lists of beans, services, references. These are now used to generate */
- /* the implied componentType for the application context */
- generateComponentType(implementation, beans, services, references, scaproperties);
-
- return;
- } // end method loadFromXML
-
- /**
- * Method which returns the XMLStreamReader for the Spring application-context.xml file
- * specified in the location attribute
- */
- private XMLStreamReader getApplicationContextReader (String location) throws ContributionReadException {
-
- try {
- // FIXME - is the ContextClassLoader the right place to start the search?
- cl = Thread.currentThread().getContextClassLoader();
- Resource resource = getApplicationContextResource(location, cl);
- // FIXME - need a better way to handle the XMLInputFactory than allocating a new one every time
- XMLInputFactory xmlFactory = XMLInputFactory.newInstance();
- XMLStreamReader reader = xmlFactory.createXMLStreamReader(resource.getInputStream());
- return reader;
- } catch (IOException e) {
- throw new ContributionReadException(e);
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
- }
-
- /**
- * Method which reads the bean definitions from Spring application-context.xml file and identifies
- * the defined beans, properties, services and references
- */
- private void readBeanDefinition(XMLStreamReader reader,
- List<SpringBeanElement> beans,
- List<SpringSCAServiceElement> services,
- List<SpringSCAReferenceElement> references,
- List<SpringSCAPropertyElement> scaproperties) throws ContributionReadException {
-
- SpringBeanElement bean = null;
- SpringPropertyElement property = null;
- SpringConstructorArgElement constructorArg = null;
-
- try {
- boolean completed = false;
- while (!completed) {
- switch (reader.next()) {
- case START_ELEMENT:
- QName qname = reader.getName();
- //System.out.println("Spring TypeLoader - found element with name: " + qname.toString());
- if (Constants.IMPORT_ELEMENT.equals(qname)) {
- //FIXME - put the sequence of code below which gets the ireader into a subsidiary method
- String location = reader.getAttributeValue(null, "resource");
- if (location != null) {
- XMLStreamReader ireader = getApplicationContextReader(location);
- // Read the bean definition for the identified imported resource
- readBeanDefinition(ireader, beans, services, references, scaproperties);
- }
- } else if (Constants.SERVICE_ELEMENT.equals(qname)) {
- SpringSCAServiceElement service =
- new SpringSCAServiceElement(reader.getAttributeValue(null, "name"), reader
- .getAttributeValue(null, "type"), reader.getAttributeValue(null, "target"));
- services.add(service);
- } else if (Constants.REFERENCE_ELEMENT.equals(qname)) {
- SpringSCAReferenceElement reference =
- new SpringSCAReferenceElement(reader.getAttributeValue(null, "name"), reader
- .getAttributeValue(null, "type"));
- references.add(reference);
- } else if (Constants.SCAPROPERTY_ELEMENT.equals(qname)) {
- SpringSCAPropertyElement scaproperty =
- new SpringSCAPropertyElement(reader.getAttributeValue(null, "name"), reader
- .getAttributeValue(null, "type"));
- scaproperties.add(scaproperty);
- } else if (Constants.BEAN_ELEMENT.equals(qname)) {
- bean = new SpringBeanElement(reader.getAttributeValue(null, "id"), reader
- .getAttributeValue(null, "class"));
- //beans.add(bean);
- } else if (Constants.PROPERTY_ELEMENT.equals(qname)) {
- property = new SpringPropertyElement(reader.getAttributeValue(null, "name"), reader
- .getAttributeValue(null, "ref"));
- //bean.addProperty(property);
- } else if (Constants.CONSTRUCTORARG_ELEMENT.equals(qname)) {
- constructorArg = new SpringConstructorArgElement(reader.getAttributeValue(null, "ref"),
- reader.getAttributeValue(null, "type"));
- } else if (Constants.REF_ELEMENT.equals(qname)) {
- String ref = reader.getAttributeValue(null, "bean");
- // Check if the parent element is a property
- if (property != null) property.setRef(ref);
- // Check if the parent element is a constructor-arg
- if (constructorArg != null) constructorArg.setRef(ref);
- } else if (Constants.VALUE_ELEMENT.equals(qname)) {
- String value = reader.getElementText();
- // Check if the parent element is a constructor-arg
- if (constructorArg != null) {
- constructorArg.addValue(value);
- // Identify the XML resource specified for the constructor-arg element
- if ((value.indexOf(".xml") != -1)) {
- if ((bean.getClassName().indexOf(".ClassPathXmlApplicationContext") != -1) ||
- (bean.getClassName().indexOf(".FileSystemXmlApplicationContext") != -1)) {
- XMLStreamReader creader = getApplicationContextReader(value);
- // Read the bean definition for the constructor-arg resources
- readBeanDefinition(creader, beans, services, references, scaproperties);
- }
- }
- }
- } // end if
- break;
- case END_ELEMENT:
- if (Constants.BEANS_ELEMENT.equals(reader.getName())) {
- //System.out.println("Spring TypeLoader - finished read of context file");
- completed = true;
- break;
- } else if (Constants.BEAN_ELEMENT.equals(reader.getName())) {
- beans.add(bean);
- bean = null;
- } else if (Constants.PROPERTY_ELEMENT.equals(reader.getName())) {
- bean.addProperty(property);
- property = null;
- } else if (Constants.CONSTRUCTORARG_ELEMENT.equals(reader.getName())) {
- bean.addCustructorArgs(constructorArg);
- constructorArg = null;
- } // end if
- } // end switch
- } // end while
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
- }
-
- /**
- * Generates the Spring implementation component type from the configuration contained in the
- * lists of beans, services, references and scaproperties derived from the application context
- */
- private void generateComponentType(SpringImplementation implementation,
- List<SpringBeanElement> beans,
- List<SpringSCAServiceElement> services,
- List<SpringSCAReferenceElement> references,
- List<SpringSCAPropertyElement> scaproperties) throws ContributionReadException {
- /*
- * 1. Each service becomes a service in the component type
- * 2. Each reference becomes a reference in the component type
- * 3. IF there are no explicit service elements, each bean becomes a service
- * 4. Each bean property which is a reference not pointing at another bean in the
- * application context becomes a reference unless it is pointing at one of the references
- * 5. Each scaproperty becomes a property in the component type
- * 6. Each bean property which is not a reference and which is not pointing
- * at another bean in the application context becomes a property in the component type
- */
-
- ComponentType componentType = implementation.getComponentType();
-
- try {
- // Deal with the services first....
- Iterator<SpringSCAServiceElement> its = services.iterator();
- while (its.hasNext()) {
- SpringSCAServiceElement serviceElement = its.next();
- Class<?> interfaze = cl.loadClass(serviceElement.getType());
- Service theService = createService(interfaze, serviceElement.getName());
- componentType.getServices().add(theService);
- // Add this service to the Service / Bean map
- String beanName = serviceElement.getTarget();
- for (SpringBeanElement beanElement : beans) {
- if (beanName.equals(beanElement.getId())) {
- implementation.setBeanForService(theService, beanElement);
- }
- } // end for
- } // end while
-
- // Next handle the references
- Iterator<SpringSCAReferenceElement> itr = references.iterator();
- while (itr.hasNext()) {
- SpringSCAReferenceElement referenceElement = itr.next();
- Class<?> interfaze = cl.loadClass(referenceElement.getType());
- Reference theReference = createReference(interfaze, referenceElement.getName());
- componentType.getReferences().add(theReference);
- } // end while
-
- // Finally deal with the beans
- Iterator<SpringBeanElement> itb;
- // If there are no explicit service elements, then expose all the beans
- if (services.isEmpty()) {
- itb = beans.iterator();
- // Loop through all the beans found
- while (itb.hasNext()) {
- SpringBeanElement beanElement = itb.next();
- // Load the Spring bean class
- Class<?> beanClass = cl.loadClass(beanElement.getClassName());
- // Introspect the bean
- ComponentType beanComponentType = assemblyFactory.createComponentType();
- beanIntrospector.introspectBean(beanClass, beanComponentType);
- // Get the service interface defined by this Spring Bean and add to
- // the component type of the Spring Assembly
- List<Service> beanServices = beanComponentType.getServices();
- componentType.getServices().addAll(beanServices);
- // Add these services to the Service / Bean map
- for (Service beanService : beanServices) {
- implementation.setBeanForService(beanService, beanElement);
- }
- } // end while
- } // end if
- // Now check to see if there are any more references from beans that are not satisfied
- itb = beans.iterator();
- while (itb.hasNext()) {
- SpringBeanElement beanElement = itb.next();
- boolean unresolvedProperties = false;
- if (!beanElement.getProperties().isEmpty()) {
- // Scan through the properties
- Iterator<SpringPropertyElement> itp = beanElement.getProperties().iterator();
- while (itp.hasNext()) {
- SpringPropertyElement propertyElement = itp.next();
- if (propertyRefUnresolved(propertyElement.getRef(), beans, references, scaproperties)) {
- // This means an unresolved reference from the spring bean...
- unresolvedProperties = true;
- } // end if
- } // end while
- // If there are unresolved properties, then find which ones are references
- if (unresolvedProperties) {
- Class<?> beanClass = cl.loadClass(beanElement.getClassName());
- // Introspect the bean
- ComponentType beanComponentType = assemblyFactory.createComponentType();
- Map<String, JavaElementImpl> propertyMap =
- beanIntrospector.introspectBean(beanClass, beanComponentType);
- // Get the references by this Spring Bean and add the unresolved ones to
- // the component type of the Spring Assembly
- List<Reference> beanReferences = beanComponentType.getReferences();
- List<Property> beanProperties = beanComponentType.getProperties();
- itp = beanElement.getProperties().iterator();
- while (itp.hasNext()) {
- SpringPropertyElement propertyElement = itp.next();
- if (propertyRefUnresolved(propertyElement.getRef(), beans, references, scaproperties)) {
- boolean resolved = false;
- // This means an unresolved reference from the spring bean...add it to
- // the references for the Spring application context
- for (Reference reference : beanReferences) {
- if (propertyElement.getName().equals(reference.getName())) {
- // The name of the reference in this case is the string in
- // the @ref attribute of the Spring property element, NOT the
- // name of the field in the Spring bean....
- reference.setName(propertyElement.getRef());
- componentType.getReferences().add(reference);
- resolved = true;
- } // end if
- } // end for
- if (!resolved) {
- // If the bean property is not already resolved as a reference
- // then it must be an SCA property...
- for (Property scaproperty : beanProperties) {
- if (propertyElement.getName().equals(scaproperty.getName())) {
- // The name of the reference in this case is the string in
- // the @ref attribute of the Spring property element, NOT the
- // name of the field in the Spring bean....
- scaproperty.setName(propertyElement.getRef());
- componentType.getProperties().add(scaproperty);
- // Fetch and store the type of the property
- implementation.setPropertyClass(scaproperty.getName(), propertyMap
- .get(scaproperty.getName()).getType());
- resolved = true;
- } // end if
- } // end for
- } // end if
- } // end if
- } // end while
- } // end if
- } // end if
-
- } // end while
-
- Iterator<SpringSCAPropertyElement> itsp = scaproperties.iterator();
- while (itsp.hasNext()) {
- SpringSCAPropertyElement scaproperty = itsp.next();
- // Create a component type property if the SCA property element has a name
- // and a type declared...
- if (scaproperty.getType() != null && scaproperty.getName() != null) {
- Property theProperty = assemblyFactory.createProperty();
- theProperty.setName(scaproperty.getName());
- // Get the Java class and then an XSD element type for the property
- Class<?> propType = Class.forName(scaproperty.getType());
- theProperty.setXSDType(JavaXMLMapper.getXMLType(propType));
- componentType.getProperties().add(theProperty);
- // Remember the Java Class (ie the type) for this property
- implementation.setPropertyClass(theProperty.getName(), propType);
- } // end if
- } // end while
-
- } catch (ClassNotFoundException e) {
- // Means that either an interface class, property class or a bean was not found
- throw new ContributionReadException(e);
- } catch (InvalidInterfaceException e) {
- throw new ContributionReadException(e);
- } catch (ContributionResolveException e) {
-
- } // end try
-
- // If we get here, the Spring assembly component type is resolved
- componentType.setUnresolved(false);
- implementation.setComponentType(componentType);
- return;
- } // end method generateComponentType
-
- /*
- * Determines whether a reference attribute of a Spring property element is resolved either
- * by a bean in the application context or by an SCA reference element or by an SCA property
- * element
- * @param ref - a String containing the name of the reference - may be null
- * @param beans - a List of SpringBean elements
- * @param references - a List of SCA reference elements
- * @return true if the property is not resolved, false if it is resolved
- */
- private boolean propertyRefUnresolved(String ref,
- List<SpringBeanElement> beans,
- List<SpringSCAReferenceElement> references,
- List<SpringSCAPropertyElement> scaproperties) {
- boolean unresolved = true;
-
- if (ref != null) {
- // Scan over the beans looking for a match
- Iterator<SpringBeanElement> itb = beans.iterator();
- while (itb.hasNext()) {
- SpringBeanElement beanElement = itb.next();
- // Does the bean name match the ref?
- if (ref.equals(beanElement.getId())) {
- unresolved = false;
- break;
- } // end if
- } // end while
- // Scan over the SCA reference elements looking for a match
- if (unresolved) {
- Iterator<SpringSCAReferenceElement> itr = references.iterator();
- while (itr.hasNext()) {
- SpringSCAReferenceElement referenceElement = itr.next();
- if (ref.equals(referenceElement.getName())) {
- unresolved = false;
- break;
- } // end if
- } // end while
- } // end if
- // Scan over the SCA property elements looking for a match
- if (unresolved) {
- Iterator<SpringSCAPropertyElement> itsp = scaproperties.iterator();
- while (itsp.hasNext()) {
- SpringSCAPropertyElement propertyElement = itsp.next();
- if (ref.equals(propertyElement.getName())) {
- unresolved = false;
- break;
- } // end if
- } // end while
- } // end if
- } else {
- // In the case where ref = null, the property is not going to be a reference of any
- // kind and can be ignored
- unresolved = false;
- } // end if
-
- return unresolved;
-
- } // end method propertyRefUnresolved
-
- /**
- * Gets hold of the application-context.xml file as a Spring resource
- * @param locationAttr - the location attribute from the <implementation.spring../> element
- * @param cl - the ClassLoader for the Spring implementation
- */
- protected Resource getApplicationContextResource(String locationAttr, ClassLoader cl)
- throws ContributionReadException {
- File manifestFile = null;
- File appXmlFile;
- File locationFile = null;
-
- URL url = cl.getResource(locationAttr);
- if (url != null) {
- String path = url.getPath();
- locationFile = new File(path);
- } else {
- throw new ContributionReadException(
- "SpringXMLLoader getApplicationContextResource: " + "unable to find resource file "
- + locationAttr);
- }
-
- if (locationFile.isDirectory()) {
- try {
- manifestFile = new File(locationFile, "META-INF"+ File.separator +"MANIFEST.MF");
- if (manifestFile.exists()) {
- Manifest mf = new Manifest(new FileInputStream(manifestFile));
- Attributes mainAttrs = mf.getMainAttributes();
- String appCtxPath = mainAttrs.getValue("Spring-Context");
- if (appCtxPath != null) {
- appXmlFile = new File(locationFile, appCtxPath);
- if (appXmlFile.exists()) {
- return new UrlResource(appXmlFile.toURL());
- }
- }
- }
- // no manifest-specified Spring context, use default
- appXmlFile = new File(locationFile, "META-INF" + File.separator + "spring"
- + File.separator + Constants.APPLICATION_CONTEXT);
- if (appXmlFile.exists()) {
- return new UrlResource(appXmlFile.toURL());
- }
- } catch (IOException e) {
- throw new ContributionReadException("Error reading manifest " + manifestFile);
- }
- } else {
- if (locationFile.isFile() && locationFile.getName().indexOf(".jar") < 0) {
- return new UrlResource(url);
- }
- else {
- try {
- JarFile jf = new JarFile(locationFile);
- JarEntry je;
- Manifest mf = jf.getManifest();
- if (mf != null) {
- Attributes mainAttrs = mf.getMainAttributes();
- String appCtxPath = mainAttrs.getValue("Spring-Context");
- if (appCtxPath != null) {
- je = jf.getJarEntry(appCtxPath);
- if (je != null) {
- // TODO return a Spring specific Resource type for jars
- return new UrlResource(new URL("jar:" + locationFile.toURI().toURL() + "!/" + appCtxPath));
- }
- }
- }
- je = jf.getJarEntry("META-INF" + File.separator + "spring"
- + File.separator + Constants.APPLICATION_CONTEXT);
- if (je != null) {
- return new UrlResource(new URL("jar:" + locationFile.toURI().toURL() + "!/" + Constants.APPLICATION_CONTEXT));
- }
- } catch (IOException e) {
- // bad archive
- // TODO: create a more appropriate exception type
- throw new ContributionReadException(
- "SpringXMLLoader getApplicationContextResource: " + " IO exception reading context file.",
- e);
- }
- }
- }
-
- throw new ContributionReadException("SpringXMLLoader getApplicationContextResource: "
- + "META-INF/spring/" + Constants.APPLICATION_CONTEXT + "not found");
- } // end method getApplicationContextResource
-
- /**
- * Creates a Service for the component type based on its name and Java interface
- */
- public Service createService(Class<?> interfaze, String name) throws InvalidInterfaceException {
- Service service = assemblyFactory.createService();
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- service.setInterfaceContract(interfaceContract);
-
- // Set the name for the service
- service.setName(name);
-
- // Set the call interface and, if present, the callback interface
- JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
- service.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
- service.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
- return service;
- } // end method createService
-
- /**
- * Creates a Reference for the component type based on its name and Java interface
- */
- private org.apache.tuscany.sca.assembly.Reference createReference(Class<?> interfaze, String name)
- throws InvalidInterfaceException {
- org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference();
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- reference.setInterfaceContract(interfaceContract);
-
- // Set the name of the reference to the supplied name and the multiplicity of the reference
- // to 1..1 - for Spring implementations, this is the only multiplicity supported
- reference.setName(name);
- reference.setMultiplicity(Multiplicity.ONE_ONE);
-
- // Set the call interface and, if present, the callback interface
- JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
- reference.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
- reference.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
-
- return reference;
- }
-} // end class SpringXMLComponentTypeLoader
diff --git a/branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 4b71cef6c4..0000000000
--- a/branches/sca-android/modules/implementation-spring/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.spring.SpringImplementationProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#implementation.spring,model=org.apache.tuscany.sca.implementation.spring.SpringImplementation
diff --git a/branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index ab707cfd68..0000000000
--- a/branches/sca-android/modules/implementation-spring/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.spring.SpringImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.spring.SpringImplementation
diff --git a/branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/spring.handlers b/branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/spring.handlers
deleted file mode 100644
index 7f9a7b17b0..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/spring.handlers
+++ /dev/null
@@ -1 +0,0 @@
-http\://www.springframework.org/schema/sca=org.apache.tuscany.sca.implementation.spring.ScaNamespaceHandler
diff --git a/branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/spring.schemas b/branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/spring.schemas
deleted file mode 100644
index 249cc21c13..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/resources/META-INF/spring.schemas
+++ /dev/null
@@ -1 +0,0 @@
-http\://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd=org/springframework/sca/xml/spring-sca.xsd
diff --git a/branches/sca-android/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties b/branches/sca-android/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties
deleted file mode 100644
index 6fce02664a..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/resources/impl-spring-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.
-#
-#
-LocationAttributeMissing = Reading implementation.spring - location attribute missing
-ContributionResolveException = ContributionResolveException occured due to:
-UnableToResolveComponentType = SpringArtifactProcessor: unable to resolve componentType for Spring component \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-spring/src/main/resources/org/springframework/sca/xml/spring-sca.xsd b/branches/sca-android/modules/implementation-spring/src/main/resources/org/springframework/sca/xml/spring-sca.xsd
deleted file mode 100644
index e20f4e8158..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/main/resources/org/springframework/sca/xml/spring-sca.xsd
+++ /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.
--->
-<xsd:schema xmlns="http://www.springframework.org/schema/sca" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- attributeFormDefault="unqualified" elementFormDefault="qualified"
- targetNamespace="http://www.springframework.org/schema/sca">
-
- <xsd:element name="composite">
- <xsd:complexType>
- <xsd:attribute name="component" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="sca-adapter-class" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="reference">
- <xsd:complexType>
- <xsd:attribute name="name" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="type" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="default" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="property">
- <xsd:complexType>
- <xsd:attribute name="id" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="name" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="type" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="service">
- <xsd:complexType>
- <xsd:attribute name="name" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="type" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="target" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
-
-</xsd:schema>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/AbstractSCATestCase.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/AbstractSCATestCase.java
deleted file mode 100644
index 6b2d114756..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/AbstractSCATestCase.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.spring.itests;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractSCATestCase<T> extends TestCase {
-
- protected SCADomain domain;
- protected T service;
-
- @Override
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance(getCompositeName());
- service = (T)domain.getService(getServiceClass(), "ClientComponent");
- }
-
- protected abstract Class getServiceClass();
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
- protected String getCompositeName() {
- String className = this.getClass().getName();
- String compositeName = className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
- System.out.println("Using composite: " + compositeName);
- return compositeName;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/AbstractHelloWorldTestCase.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/AbstractHelloWorldTestCase.java
deleted file mode 100644
index c9b30b1688..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/AbstractHelloWorldTestCase.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.spring.itests.helloworld;
-
-import org.apache.tuscany.sca.implementation.spring.itests.AbstractSCATestCase;
-
-/**
- * Basic "hello world" style test case for testing Spring component implementation
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractHelloWorldTestCase extends AbstractSCATestCase<HelloWorld> {
-
- /**
- * Calls the hello world service and checks that it gives the right response...
- */
- public void testCalculator() throws Exception {
- assertEquals("Hello petra", service.sayHello("petra"));
- System.out.println("Test " + this.getClass().getSimpleName() + " completed successfully");
- }
-
- @Override
- protected Class<HelloWorld> getServiceClass() {
- return HelloWorld.class;
- }
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorld.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorld.java
deleted file mode 100644
index fd295daaf6..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorld.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.spring.itests.helloworld;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Interface for the "hello world" service - predictably simple with a single operation
- * "sayHello"
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface HelloWorld {
-
- String sayHello(String s);
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorldImpl.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorldImpl.java
deleted file mode 100644
index 65ab096855..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorldImpl.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.implementation.spring.itests.helloworld;
-
-/**
- * A simple proxy Java class which implements the HelloWorld interface but which uses
- * a reference "delegate" to actually provide the HelloWorld service
- *
- * @version $Rev$ $Date$
- */
-public class HelloWorldImpl implements HelloWorld {
-
- static String hello = "Hello ";
-
- public String sayHello(String s) {
- // Simply call the reference to satisfy the service request...
- System.out.println("HelloWorldImpl - sayHello called");
- return (hello + s);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorldProxy.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorldProxy.java
deleted file mode 100644
index bd35e9f3b9..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/HelloWorldProxy.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.spring.itests.helloworld;
-
-import org.osoa.sca.annotations.Reference;
-
-/**
- * A simple proxy Java class which implements the HelloWorld interface but which uses
- * a reference "delegate" to actually provide the HelloWorld service
- *
- * @version $Rev$ $Date$
- */
-public class HelloWorldProxy implements HelloWorld {
-
- // Here is the reference "delegate" - it implements the HelloWorld interface...
- @Reference
- public HelloWorld delegate;
-
- public String sayHello(String s) {
- // Simply call the reference to satisfy the service request...
- System.out.println("HelloWorldProxy - calling sayHello");
- return delegate.sayHello(s);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringContextAccessTestCase.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringContextAccessTestCase.java
deleted file mode 100644
index d77f183a66..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringContextAccessTestCase.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.spring.itests.helloworld;
-
-/**
- * A test case to check the ability of Spring Beans used as an SCA implementation
- * to access the Spring application context without problems:
- * 1) A composite containing a component with a Spring implementation
- * 2) The composite has a component with a Java POJO implementation which uses the
- * Spring implementation to satisfy a reference
- * 3) The Spring Bean accesses the Spring application context and only returns data
- * if it is successful
- *
- * @version $Rev$ $Date$
- */
-public class SpringContextAccessTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitHelloWorldTestCase.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitHelloWorldTestCase.java
deleted file mode 100644
index 86f979fe15..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitHelloWorldTestCase.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.spring.itests.helloworld;
-
-/**
- * A basic test case of:
- * 1) A composite containing a component with a Spring implementation
- * 2) The composite has a component with a Java POJO implementation which uses the
- * Spring implementation to satisfy a reference
- * 3) The <implementation.spring.../> element references an application context that
- * uses an explicit sca: element to identify the service offered by the Spring application
- *
- * @version $Rev$ $Date$
- */
-public class SpringExplicitHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitReferenceTestCase.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitReferenceTestCase.java
deleted file mode 100644
index 44016ad249..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitReferenceTestCase.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.spring.itests.helloworld;
-
-/**
- * A test case designed to test the implementation of References from a Spring application
- * context, where the references are explicit, through the presence of an sca:reference
- * element within the Spring application context
- *
- * The artifacts involved in this test are:
- *
- * 1) A composite containing a component with a Spring implementation which makes
- * a reference to a second component
- * 2) The composite has a component with a Java POJO implementation which satisfies the reference
- * 3) The <implementation.spring.../> element references an application context that
- * uses an explicit sca:reference element to identify the reference made by the Spring application
- *
- * @version $Rev$ $Date$
- */
-public class SpringExplicitReferenceTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringHelloWorldTestCase.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringHelloWorldTestCase.java
deleted file mode 100644
index 74dcf32723..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringHelloWorldTestCase.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.spring.itests.helloworld;
-
-/**
- * A basic test case of:
- * 1) A composite containing a component with a Spring implementation
- * 2) The composite has a component with a Java POJO implementation which uses the
- * Spring implementation to satisfy a reference
- *
- * @version $Rev$ $Date$
- */
-public class SpringHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImplicitReferenceTestCase.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImplicitReferenceTestCase.java
deleted file mode 100644
index 97f91ff91e..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImplicitReferenceTestCase.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.spring.itests.helloworld;
-
-/**
- * A test case designed to test the implementation of References from a Spring application
- * context, where the references are implicit, through the presence of Bean properties with a
- * ref attribute which is not satisfied by a Bean within the application context.
- *
- * The artifacts involved in this test are:
- *
- * 1) A composite containing a component with a Spring implementation which makes
- * a reference to a second component
- * 2) The composite has a component with a Java POJO implementation which satisfies the reference
- * 3) The <implementation.spring.../> element references an application context that
- * does not use an explicit sca:reference element to identify the reference made by the
- * Spring application, but relies on an unsatisfied Bean property with a ref attribute.
- *
- * @version $Rev$ $Date$
- */
-public class SpringImplicitReferenceTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
-
-
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImportHelloWorldTestCase.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImportHelloWorldTestCase.java
deleted file mode 100644
index bfe3d64cf3..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImportHelloWorldTestCase.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.spring.itests.helloworld;
-
-/**
- * A basic test case of:
- * 1) A composite containing a component with a Spring implementation
- * 2) The composite has a component with a Java POJO implementation which uses the
- * Spring implementation to satisfy a reference
- *
- * @version $Rev$ $Date$
- */
-public class SpringImportHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringSCAPropertyTestCase.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringSCAPropertyTestCase.java
deleted file mode 100644
index 2c46f8c066..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringSCAPropertyTestCase.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.spring.itests.helloworld;
-
-/**
- * A test case designed to test the implementation of Properties from a Spring application
- * context, where the properties are explicit, through the presence of an sca:property
- * element within the Spring application context
- *
- * The artifacts involved in this test are:
- *
- * 1) A composite containing a component with a Spring implementation
- * 2) The <implementation.spring.../> element references an application context that
- * uses an explicit sca:property element which is used to compute the response to an invocation
- * of the service of the implementation
- *
- * @version $Rev$ $Date$
- */
-public class SpringSCAPropertyTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
-
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestBean.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestBean.java
deleted file mode 100644
index 4d60bffef8..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestBean.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.implementation.spring.itests.mock;
-
-/**
- * @version $Rev: 430937 $ $Date: 2006-08-12 02:17:56 +0100 (Sat, 12 Aug 2006) $
- */
-public interface TestBean {
- String echo(String msg);
-
- TestBean getBean();
-
- void setBean(TestBean bean);
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestBeanImpl.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestBeanImpl.java
deleted file mode 100644
index acad9f2fea..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestBeanImpl.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.spring.itests.mock;
-
-/**
- * @version $Rev: 441406 $ $Date: 2006-09-08 08:20:10 +0100 (Fri, 08 Sep 2006) $
- */
-public class TestBeanImpl implements TestBean {
-
- private TestBean bean;
-
- public TestBeanImpl() {
- }
-
- public String echo(String msg) {
- return msg;
- }
-
- public TestBean getBean() {
- return bean;
- }
-
- public void setBean(TestBean bean) {
- this.bean = bean;
- }
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestContextAccessBean.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestContextAccessBean.java
deleted file mode 100644
index 79de2b32a0..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestContextAccessBean.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.implementation.spring.itests.mock;
-
-/**
- * Spring bean test class for testing the access to the Spring Context from within
- * a Spring Bean running as part of an SCA Component.
- *
- * This class accesses the Spring Context and only returns non-null data if the
- * Context is successfully accessed.
- *
- * The design to receive the application context is as follows:
- * - the Bean implements the ApplicationContextAware interface
- * - this interface provides getter and setter methods for the Spring application
- * context
- * - when the Bean is created at runtime, the setter method is called, injecting
- * the context
- */
-
-import org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorld;
-
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-
-
-public class TestContextAccessBean implements HelloWorld, ApplicationContextAware {
-
- private static ApplicationContext ctx;
- static String hello = "Hello ";
-
- // Return the hello string only if the application context is successfully accessed
- public String sayHello(String message) {
- System.out.println("TestContextAccessBean - sayHello called");
- ApplicationContext theContext = getApplicationContext();
-
- if( theContext == null ) return null;
-
- // A simple check to see if the context contains this bean, which it should...
- if ( !theContext.containsBean( "testBean" ) ) return null;
-
- return (hello + message);
- } // end sayHello()
-
- /**
- * Application context setter
- */
- public void setApplicationContext(ApplicationContext appContext) throws BeansException {
- // Wiring the ApplicationContext into a static method
- ctx = appContext;
- }
-
- /**
- * Application context getter
- * @return
- */
- public static ApplicationContext getApplicationContext() {
- return ctx;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestHelloWorldBean.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestHelloWorldBean.java
deleted file mode 100644
index f165bb8b75..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestHelloWorldBean.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.spring.itests.mock;
-
-/**
- * A simple test Spring bean which provides the HelloWorld service
- *
- * @version $Rev$ $Date$
- */
-
-import org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorld;
-
-public class TestHelloWorldBean implements HelloWorld {
-
- static String hello = "Hello ";
-
- // Classic "Hello xxx" response to any input message
- public String sayHello(String message) {
- System.out.println("TestHelloWorldBean - sayHello called");
- return (hello + message);
- }
-
-} // end class TestHelloWorldBean
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestReference.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestReference.java
deleted file mode 100644
index a1d9b5a2f4..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestReference.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.implementation.spring.itests.mock;
-
-/**
- * @version $Rev: 536115 $ $Date: 2007-05-08 09:04:20 +0100 (Tue, 08 May 2007) $
- */
-public interface TestReference {
- String echo(String msg);
-}
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestReferenceBean.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestReferenceBean.java
deleted file mode 100644
index ab4c07d059..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestReferenceBean.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.implementation.spring.itests.mock;
-
-/**
- * A test Spring bean which provides the HelloWorld service by calling a reference
- * to provide the content of the response
- *
- * @version $Rev$ $Date$
- */
-
-import org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorld;
-
-public class TestReferenceBean implements HelloWorld {
-
- // The reference
- private HelloWorld bean;
-
- // Classic "Hello xxx" response to any input message
- public String sayHello(String message) {
- System.out.println("TestReferenceBean - sayHello called");
- return (bean.sayHello(message));
- }
-
- /**
- * Setter for the bean reference
- * @param theBean
- */
- public void setBean(HelloWorld theBean) {
- this.bean = theBean;
- }
-
- /**
- * Getter for the reference
- * @return
- */
- public HelloWorld getBean() {
- return this.bean;
- }
-
-} // end class TestReferenceBean
diff --git a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestSCAPropertyBean.java b/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestSCAPropertyBean.java
deleted file mode 100644
index 0f00c7e480..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/java/org/apache/tuscany/sca/implementation/spring/itests/mock/TestSCAPropertyBean.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.spring.itests.mock;
-
-/**
- * A test Spring bean which provides the HelloWorld service.
- * This bean has a single String property called "hello" which must be set through
- * external configuration to give the correct response message, otherwise an (incorrect)
- * default message is generated
- *
- * @version $Rev$ $Date$
- */
-
-import org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorld;
-
-public class TestSCAPropertyBean implements HelloWorld {
-
- private String hello = "Go away";
-
- /**
- * Provides the operation of the "HelloWorld" interface - a simple string response
- * to a string input message, where the response is a greeting followed by the original
- * input message.
- */
- public String sayHello(String message) {
- System.out.println("TestHelloWorldBean - sayHello called");
- return (hello + " " + message);
- }
-
- /**
- * Public setter for the (unannotated) field "hello" which constitutes an SCA
- * property
- * @param message - the message to use for the response to "sayHello"
- */
- public void setHello(String message) {
- hello = message;
- }
-
-} // end class TestSCAPropertyBean
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringContextAccess-context.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringContextAccess-context.xml
deleted file mode 100644
index a7d30bf201..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringContextAccess-context.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.
--->
-<!-- Application context for the SpringHelloWorld testcase -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.sca.implementation.spring.itests.mock.TestContextAccessBean" lazy-init="true">
- </bean>
-
-</beans>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringExplicitHelloWorld-context.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringExplicitHelloWorld-context.xml
deleted file mode 100644
index 7c358ac01c..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringExplicitHelloWorld-context.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.
--->
-<!-- Application context for the SpringExplicitHelloWorld testcase
-In this case, the service offered by the Spring application is specified
-explicitly using an sca:service element -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <sca:service name="fooService"
- type="org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorld"
- target="testBean"/>
-
- <bean id="testBean"
- class="org.apache.tuscany.sca.implementation.spring.itests.mock.TestHelloWorldBean"
- lazy-init="true">
- </bean>
-
-</beans> \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringExplicitReference-context.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringExplicitReference-context.xml
deleted file mode 100644
index 38e90b41fa..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringExplicitReference-context.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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.sca.implementation.spring.itests.mock.TestReferenceBean">
- <property name="bean" ref="testReference"/>
- </bean>
-
- <sca:reference name="testReference" type="org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorld"/>
-
-</beans>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringHelloWorld-Imported-context.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringHelloWorld-Imported-context.xml
deleted file mode 100644
index 18ce21805c..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringHelloWorld-Imported-context.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.
--->
-<!-- Application context for the SpringHelloWorld testcase -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.sca.implementation.spring.itests.mock.TestHelloWorldBean" lazy-init="true">
- </bean>
-
-</beans> \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringHelloWorld-context.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringHelloWorld-context.xml
deleted file mode 100644
index 18ce21805c..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringHelloWorld-context.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.
--->
-<!-- Application context for the SpringHelloWorld testcase -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.sca.implementation.spring.itests.mock.TestHelloWorldBean" lazy-init="true">
- </bean>
-
-</beans> \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringImplicitReference-context.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringImplicitReference-context.xml
deleted file mode 100644
index e6b69e8cad..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringImplicitReference-context.xml
+++ /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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.sca.implementation.spring.itests.mock.TestReferenceBean">
- <!-- Here is the implicit reference - a property with a ref not satisifed within the
- * Spring application context.
- -->
- <property name="bean" ref="testReference"/>
- </bean>
-
-</beans>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringImportHelloWorld-context.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringImportHelloWorld-context.xml
deleted file mode 100644
index 8e18a56cca..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/SpringImportHelloWorld-context.xml
+++ /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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <import resource="SpringHelloWorld-Imported-context.xml"/>
-
-</beans>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/testReferenceContext.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/testReferenceContext.xml
deleted file mode 100644
index fdbbeeced2..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/testReferenceContext.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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.container.spring.mock.TestBeanImpl">
- <property name="bean" ref="testReference"/>
- </bean>
-
- <sca:reference name="testReference" type="org.apache.tuscany.container.spring.mock.TestBean"/>
-
-</beans>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/testServiceContext.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/testServiceContext.xml
deleted file mode 100644
index 6b3f1f9890..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/META-INF/sca/testServiceContext.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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <sca:service name="fooService" type="org.apache.tuscany.container.spring.mock.TestBeanImpl" target="testBean"/>
-
- <bean id="testBean" class="org.apache.tuscany.container.spring.mock.TestBeanImpl"/>
-
-</beans>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/SpringHelloWorld-Imported-context.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/SpringHelloWorld-Imported-context.xml
deleted file mode 100644
index 18ce21805c..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/SpringHelloWorld-Imported-context.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.
--->
-<!-- Application context for the SpringHelloWorld testcase -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.sca.implementation.spring.itests.mock.TestHelloWorldBean" lazy-init="true">
- </bean>
-
-</beans> \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringContextAccess.composite b/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringContextAccess.composite
deleted file mode 100644
index 0b260b5dcf..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringContextAccess.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"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:c="http://SpringContextAccess"
- targetNamespace="http://SpringContextAccess"
- name="SpringContextAccess">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.spring location="META-INF/sca/SpringContextAccess-context.xml"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitHelloWorld.composite b/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitHelloWorld.composite
deleted file mode 100644
index 79f4041fe6..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitHelloWorld.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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- name="SpringExplicitHelloWorld">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.spring location="META-INF/sca/SpringExplicitHelloWorld-context.xml"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitReference.composite b/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitReference.composite
deleted file mode 100644
index 87353b69ea..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringExplicitReference.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"
- name="SpringExplicitReference">
-
- <component name="ClientComponent">
- <implementation.spring location="META-INF/sca/SpringExplicitReference-context.xml"/>
- <reference name="testReference" target="ReferenceComponent"/>
- </component>
-
- <component name="ReferenceComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorldImpl"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringHelloWorld.composite b/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringHelloWorld.composite
deleted file mode 100644
index ebb693d243..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringHelloWorld.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"
- name="SpringHelloWorld">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.spring location="META-INF/sca/SpringHelloWorld-context.xml"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImplicitReference.composite b/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImplicitReference.composite
deleted file mode 100644
index 9f51277d22..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImplicitReference.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 for the SpringImplicitReferenceTestCase
- * This composite has a ClientComponent implemented with a Spring implementation where
- * Spring application context uses an implicit reference definition through a Bean with
- * a property with an unsatisfied ref attribute, which forms the reference.
- * The reference is satisified by a wire to a ReferenceComponent which is implemented
- * by a plain Java POJO.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- name="SpringImplicitReference">
-
- <component name="ClientComponent">
- <implementation.spring location="META-INF/sca/SpringImplicitReference-context.xml"/>
- <reference name="testReference" target="ReferenceComponent"/>
- </component>
-
- <component name="ReferenceComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorldImpl"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImportHelloWorld.composite b/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImportHelloWorld.composite
deleted file mode 100644
index 95dd9131eb..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringImportHelloWorld.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"
- name="SpringHelloWorld">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.spring location="META-INF/sca/SpringImportHelloWorld-context.xml"/>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringSCAProperty.composite b/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringSCAProperty.composite
deleted file mode 100644
index af1b3be0a5..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/org/apache/tuscany/sca/implementation/spring/itests/helloworld/SpringSCAProperty.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 for the SpringSCAPropertyTestCase
- * This composite has the HelloWorldComponent implemented with a Spring implementation where
- * the Spring application context uses an explicit SCA property. The value of the property
- * is set in this composite and is used to compute the response to a service invocation from
- * the ClientComponent.
- -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- name="SpringSCAProperty">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.spring.itests.helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.spring location="spring"/>
- <property name="TestProperty">Hello</property>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/spring/META-INF/MANIFEST.MF b/branches/sca-android/modules/implementation-spring/src/test/resources/spring/META-INF/MANIFEST.MF
deleted file mode 100644
index 950dbeba4c..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/spring/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Spring-Context: META-INF/spring/SpringSCAProperty-context.xml
-
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/spring/META-INF/spring/SpringSCAProperty-context.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/spring/META-INF/spring/SpringSCAProperty-context.xml
deleted file mode 100644
index f1ee21686d..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/spring/META-INF/spring/SpringSCAProperty-context.xml
+++ /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.
--->
-<!-- Application context for the SpringHelloWorld testcase -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.sca.implementation.spring.itests.mock.TestSCAPropertyBean" lazy-init="true">
- <property name="hello" ref="TestProperty"/>
- </bean>
-
- <sca:property id="foo" name="TestProperty" type="java.lang.String"/>
-
-</beans> \ No newline at end of file
diff --git a/branches/sca-android/modules/implementation-spring/src/test/resources/test.xml b/branches/sca-android/modules/implementation-spring/src/test/resources/test.xml
deleted file mode 100644
index f2d684f766..0000000000
--- a/branches/sca-android/modules/implementation-spring/src/test/resources/test.xml
+++ /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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.sca.implementation.spring.itests.mock.TestBeanImpl" />
-
-</beans>
diff --git a/branches/sca-android/modules/implementation-widget-runtime/LICENSE b/branches/sca-android/modules/implementation-widget-runtime/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/implementation-widget-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/branches/sca-android/modules/implementation-widget-runtime/META-INF/README b/branches/sca-android/modules/implementation-widget-runtime/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-widget-runtime/NOTICE b/branches/sca-android/modules/implementation-widget-runtime/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/implementation-widget-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/branches/sca-android/modules/implementation-widget-runtime/pom.xml b/branches/sca-android/modules/implementation-widget-runtime/pom.xml
deleted file mode 100644
index 79d6d10ee4..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/pom.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-widget-runtime</artifactId>
- <name>Apache Tuscany SCA Widget Implementation Runtime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-widget</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-http-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-atom-abdera</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </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>
-
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.implementation.widget.runtime</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.widget*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java b/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java
deleted file mode 100644
index 49f7a4e120..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.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.implementation.widget.provider;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * Implements an invoker for resource component implementations.
- *
- * @version $Rev$ $Date$
- */
-class WidgetImplementationInvoker implements Invoker {
- private RuntimeComponent component;
- private String widgetName;
- private String widgetFolderURL;
- private String widgetLocationURL;
-
- WidgetImplementationInvoker(RuntimeComponent component, String widgetName, String widgetFolderURL, String widgetLocationURL) {
- this.component = component;
- this.widgetName = widgetName + ".js";
- this.widgetFolderURL = widgetFolderURL;
- this.widgetLocationURL = widgetLocationURL;
- }
-
- public Message invoke(Message msg) {
-
- // Get the resource id from the request message
- String id = (String)((Object[])msg.getBody())[0];
- try {
-
- if (id.length() == 0) {
-
- // Return an input stream for the widget resource
- URL url = new URL(widgetLocationURL);
- InputStream is = url.openStream();
- msg.setBody(is);
-
- } else if (id.equals(widgetName)) {
-
- // Generate JavaScript header for use in the Widget
- InputStream is = generateWidgetCode();
- msg.setBody(is);
-
- } else {
-
- // Return an input stream for a resource inside the
- // widget folder
- URL url = new URL(widgetFolderURL +'/' + id);
- InputStream is = url.openStream();
- msg.setBody(is);
- }
- } catch (MalformedURLException e) {
-
- // Report exception as a fault
- msg.setFaultBody(e);
-
- } catch (URISyntaxException e) {
-
- // Report exception as a fault
- msg.setFaultBody(e);
-
- } catch (IOException e) {
-
- // Report exception as a fault
- msg.setFaultBody(e);
- }
- return msg;
- }
-
- /**
- * This helper class concatenates the necessary JavaScript client code into a
- * single JavaScript per component
- */
- private InputStream generateWidgetCode() throws IOException, URISyntaxException {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- PrintWriter pw = new PrintWriter(bos);
-
- pw.println();
- pw.println("/* Apache Tuscany SCA Widget header */");
- pw.println();
-
- Map<String, Boolean> bindingClientProcessed = new HashMap<String, Boolean>();
-
- for(ComponentReference reference : component.getReferences()) {
- for(Binding binding : reference.getBindings()) {
- String bindingProxyName = WidgetProxyHelper.getJavaScriptProxyFile(binding.getClass().getName());
- //check if binding client code was already processed and inject to the generated script
- Boolean processedFlag = bindingClientProcessed.get(bindingProxyName);
- if( processedFlag == null || processedFlag.booleanValue() == false) {
- if(bindingProxyName != null) {
- generateJavaScriptBindingProxy(pw,bindingProxyName);
- bindingClientProcessed.put(bindingProxyName, Boolean.TRUE);
- }
- }
- }
- }
-
- //process properties
- generateJavaScriptPropertyFunction(pw);
-
- //process references
- generateJavaScriptReferenceFunction(pw);
-
-
- pw.println();
- pw.println("/** End of Apache Tuscany SCA Widget */");
- pw.println();
- pw.flush();
- pw.close();
-
- return new ByteArrayInputStream(bos.toByteArray());
- }
-
- /**
- * Retrieve the binding proxy based on the bind name
- * and embedded the JavaScript into this js
- */
- private void generateJavaScriptBindingProxy(PrintWriter pw, String bindingProxyName) throws IOException {
- //FIXME: Handle the case where the JavaScript binding client is not found
- InputStream is = getClass().getClassLoader().getResourceAsStream(bindingProxyName);
- if (is != null) {
- int i;
- while ((i = is.read()) != -1) {
- pw.write(i);
- }
- }
-
- pw.println();
- pw.println();
- }
-
- /**
- * Generate JavaScript code to inject SCA Properties
- * @param pw
- * @throws IOException
- */
- private void generateJavaScriptPropertyFunction(PrintWriter pw) throws IOException {
-
- pw.println("var propertyMap = new String();");
- for(ComponentProperty property : component.getProperties()) {
- String propertyName = property.getName();
-
- pw.println("propertyMap." + propertyName + " = \"" + getPropertyValue(property) + "\"");
- }
-
- pw.println("function Property(name) {");
- pw.println(" return propertyMap[name];");
- pw.println("}");
- }
-
- /**
- * Convert property value to String
- * @param property
- * @return
- */
- private String getPropertyValue(ComponentProperty property) {
- Document doc = (Document)property.getValue();
- Element rootElement = doc.getDocumentElement();
-
- String value = null;
-
- //FIXME : Provide support for isMany and other property types
-
- if (rootElement.getChildNodes().getLength() > 0) {
- value = rootElement.getChildNodes().item(0).getTextContent();
- }
-
- return value;
- }
-
- /**
- * Generate JavaScript code to inject SCA References
- * @param pw
- * @throws IOException
- */
- private void generateJavaScriptReferenceFunction (PrintWriter pw) throws IOException, URISyntaxException {
-
- pw.println("var referenceMap = new Object();");
- for(ComponentReference reference : component.getReferences()) {
- String referenceName = reference.getName();
- Binding binding = reference.getBindings().get(0);
- if (binding != null) {
-
- String proxyClient = WidgetProxyHelper.getJavaScriptProxyClient(binding.getClass().getName());
- if(proxyClient != null) {
-
- // Generate the JavaScript proxy configuration code
- // Proxies are configured with the target URI path, as at this point we shouldn't
- // be generating proxies that communicate with other hosts (if a proxy needs to
- // communicate with another host it should be generated on and served by
- // that particular host)
- URI targetURI = URI.create(binding.getURI());
- String targetPath = targetURI.getPath();
-
- if(proxyClient.equals("JSONRpcClient")) {
- //FIXME Proxies should follow the same pattern, saving us from having to test
- // for JSONRpc here
- pw.println("referenceMap." + referenceName + " = new " + proxyClient + "(\"" + targetPath + "\").Service;");
- } else {
- pw.println("referenceMap." + referenceName + " = new " + proxyClient + "(\"" + targetPath + "\");");
- }
- }
- }
- }
-
- pw.println("function Reference(name) {");
- pw.println(" return referenceMap[name];");
- pw.println("}");
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java b/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java
deleted file mode 100644
index 61176d912c..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.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.widget.provider;
-
-import org.apache.tuscany.sca.implementation.widget.WidgetImplementation;
-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;
-
-
-/**
- * The model representing a resource implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-class WidgetImplementationProvider implements ImplementationProvider {
- private RuntimeComponent component;
- private String widgetLocationURL;
- private String widgetFolderURL;
- private String widgetName;
-
- /**
- * Constructs a new resource implementation provider.
- */
- WidgetImplementationProvider(RuntimeComponent component, WidgetImplementation implementation) {
- this.component = component;
- widgetLocationURL = implementation.getLocationURL().toString();
- int s = widgetLocationURL.lastIndexOf('/');
- widgetFolderURL = widgetLocationURL.substring(0, s);
- widgetName = widgetLocationURL.substring(s +1);
- widgetName = widgetName.substring(0, widgetName.lastIndexOf('.'));
- }
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- WidgetImplementationInvoker invoker = new WidgetImplementationInvoker(component, widgetName, widgetFolderURL, widgetLocationURL);
- return invoker;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProviderFactory.java b/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProviderFactory.java
deleted file mode 100644
index c57680fa1c..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProviderFactory.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.widget.provider;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.widget.WidgetImplementation;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * The model representing a resource implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public class WidgetImplementationProviderFactory implements ImplementationProviderFactory<WidgetImplementation> {
-
- /**
- * Constructs a resource implementation.
- */
- public WidgetImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component, WidgetImplementation implementation) {
- return new WidgetImplementationProvider(component, implementation);
- }
-
- public Class<WidgetImplementation> getModelType() {
- return WidgetImplementation.class;
- }
-}
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetProxyHelper.java b/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetProxyHelper.java
deleted file mode 100644
index 5a0146a749..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetProxyHelper.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.widget.provider;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-class WidgetProxyHelper {
- private static Map<String, String> proxyFileRegistry = new HashMap<String, String>();
- private static Map<String, String> proxyClient = new HashMap<String, String>();
-
- static {
- proxyFileRegistry.put("org.apache.tuscany.sca.binding.atom.impl.AtomBindingImpl", "binding-atom.js");
- proxyClient.put("org.apache.tuscany.sca.binding.atom.impl.AtomBindingImpl", "AtomClient");
-
- proxyFileRegistry.put("org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding", "binding-jsonrpc.js");
- proxyClient.put("org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding", "JSONRpcClient");
-
- proxyFileRegistry.put("org.apache.tuscany.sca.binding.http.impl.HTTPBindingImpl", "binding-http.js");
- proxyClient.put("org.apache.tuscany.sca.binding.http.impl.HTTPBindingImpl", "HTTPClient");
- }
-
- static String getJavaScriptProxyFile(String bindingClass) {
- return proxyFileRegistry.get(bindingClass);
- }
-
- static String getJavaScriptProxyClient(String bindingClass) {
- return proxyClient.get(bindingClass);
- }
-}
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index d0f73cbdbb..0000000000
--- a/branches/sca-android/modules/implementation-widget-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.widget.provider.WidgetImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.widget.WidgetImplementation
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-atom.js b/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-atom.js
deleted file mode 100644
index 2719e9a9b9..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-atom.js
+++ /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.
- */
-
-function AtomClient(uri) {
-
- this.msxmlNames = [ "MSXML2.XMLHTTP.5.0",
- "MSXML2.XMLHTTP.4.0",
- "MSXML2.XMLHTTP.3.0",
- "MSXML2.XMLHTTP",
- "Microsoft.XMLHTTP" ];
-
- this.uri=uri;
-
- this.get = function(id, responseFunction) {
- var xhr = this.createXMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- var strDocument = xhr.responseText;
- var xmlDocument = xhr.responseXML;
- if(!xmlDocument || xmlDocument.childNodes.length==0){
- xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml");
- }
- if (responseFunction != null) responseFunction(xmlDocument);
- } else {
- alert("get - Error getting data from the server");
- }
- }
- }
- xhr.open("GET", uri + '/' + id, true);
- xhr.send(null);
- }
-
- this.post = function (entry, responseFunction) {
- var xhr = this.createXMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 201) {
- var strDocument = xhr.responseText;
- var xmlDocument = xhr.responseXML;
- if(!xmlDocument || xmlDocument.childNodes.length==0){
- xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml");
- }
- if (responseFunction != null) responseFunction(xmlDocument);
- } else {
- alert("post - Error getting data from the server");
- }
- }
- }
- xhr.open("POST", uri, true);
- xhr.setRequestHeader("Content-Type", "application/atom+xml");
- xhr.send(entry);
- }
-
- this.put = function (id, entry, responseFunction) {
- var xhr = this.createXMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- var strDocument = xhr.responseText;
- var xmlDocument = xhr.responseXML;
- if(!xmlDocument || xmlDocument.childNodes.length==0){
- xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml");
- }
- if (responseFunction != null) responseFunction(xmlDocument);
- } else {
- alert("put - Error getting data from the server");
- }
- }
- }
- xhr.open("PUT", uri + '/' + id, true);
- xhr.setRequestHeader("Content-Type", "application/atom+xml");
- xhr.send(entry);
- }
-
- this.del = function (id, responseFunction) {
- var xhr = this.createXMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (responseFunction != null) responseFunction();
- } else {
- alert("delete - Error getting data from the server");
- }
- }
- }
- xhr.open("DELETE", uri + '/' + id, true);
- xhr.send(null);
- }
- this.createXMLHttpRequest = function () {
- /* Mozilla XMLHttpRequest */
- try {return new XMLHttpRequest();} catch(e) {}
-
- /* Microsoft MSXML ActiveX */
- for (var i=0;i < this.msxmlNames.length; i++) {
- try {return new ActiveXObject(this.msxmlNames[i]);} catch (e) {}
- }
- alert("XML http request not supported");
- return null;
- }
- if (typeof DOMParser == "undefined") {
- DOMParser = function () {}
-
- DOMParser.prototype.parseFromString = function (str, contentType) {
- if (typeof ActiveXObject != "undefined") {
- var d = new ActiveXObject("MSXML.DomDocument");
- d.loadXML(str);
- return d;
- } else if (typeof XMLHttpRequest != "undefined") {
- var req = new XMLHttpRequest;
- req.open("GET", "data:" + (contentType || "application/xml") +
- ";charset=utf-8," + encodeURIComponent(str), false);
- if (req.overrideMimeType) {
- req.overrideMimeType(contentType);
- }
- req.send(null);
- return req.responseXML;
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-http.js b/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-http.js
deleted file mode 100644
index 60bd841679..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-http.js
+++ /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.
- */
-
-function HTTPClient(uri) {
-
- this.msxmlNames = [ "MSXML2.XMLHTTP.5.0",
- "MSXML2.XMLHTTP.4.0",
- "MSXML2.XMLHTTP.3.0",
- "MSXML2.XMLHTTP",
- "Microsoft.XMLHTTP" ];
-
- this.uri=uri;
-
- this.get = function(id, responseFunction) {
- var xhr = this.createXMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- var strDocument = xhr.responseText;
- if (responseFunction != null) responseFunction(strDocument);
- } else {
- alert("get - Error getting data from the server");
- }
- }
- }
- xhr.open("GET", uri + '/' + id, true);
- xhr.send(null);
- }
-
- this.post = function (entry, responseFunction) {
- var xhr = this.createXMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 201) {
- var strDocument = xhr.responseText;
- if (responseFunction != null) responseFunction(strDocument);
- } else {
- alert("post - Error getting data from the server");
- }
- }
- }
- xhr.open("POST", uri, true);
- xhr.setRequestHeader("Content-Type", "text/xml");
- xhr.send(entry);
- }
-
- this.put = function (id, entry, responseFunction) {
- var xhr = this.createXMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- var strDocument = xhr.responseText;
- if (responseFunction != null) responseFunction(strDocument);
- } else {
- alert("put - Error getting data from the server");
- }
- }
- }
- xhr.open("PUT", uri + '/' + id, true);
- xhr.setRequestHeader("Content-Type", "text/xml");
- xhr.send(entry);
- }
-
- this.del = function (id, responseFunction) {
- var xhr = this.createXMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (responseFunction != null) responseFunction();
- } else {
- alert("delete - Error getting data from the server");
- }
- }
- }
- xhr.open("DELETE", uri + '/' + id, true);
- xhr.send(null);
- }
- this.createXMLHttpRequest = function () {
- /* Mozilla XMLHttpRequest */
- try {return new XMLHttpRequest();} catch(e) {}
-
- /* Microsoft MSXML ActiveX */
- for (var i=0;i < this.msxmlNames.length; i++) {
- try {return new ActiveXObject(this.msxmlNames[i]);} catch (e) {}
- }
- alert("XML http request not supported");
- return null;
- }
-}
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-jsonrpc.js b/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-jsonrpc.js
deleted file mode 100644
index ca3c2a8605..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/main/resources/binding-jsonrpc.js
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
- * JSON-RPC JavaScript client
- *
- * $Id: jsonrpc.js,v 1.36.2.3 2006/03/08 15:09:37 mclark Exp $
- *
- * Copyright (c) 2003-2004 Jan-Klaas Kollhof
- * Copyright (c) 2005 Michael Clark, Metaparadigm Pte Ltd
- *
- * This code is based on Jan-Klaas' JavaScript o lait library (jsolait).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/*
- * Modifications for Apache Tuscany:
- * - JSONRpcClient_createMethod changed so callback is last arg
- */
-
-/* escape a character */
-
-escapeJSONChar =
-function escapeJSONChar(c)
-{
- if(c == "\"" || c == "\\") return "\\" + c;
- else if (c == "\b") return "\\b";
- else if (c == "\f") return "\\f";
- else if (c == "\n") return "\\n";
- else if (c == "\r") return "\\r";
- else if (c == "\t") return "\\t";
- var hex = c.charCodeAt(0).toString(16);
- if(hex.length == 1) return "\\u000" + hex;
- else if(hex.length == 2) return "\\u00" + hex;
- else if(hex.length == 3) return "\\u0" + hex;
- else return "\\u" + hex;
-};
-
-
-/* encode a string into JSON format */
-
-escapeJSONString =
-function escapeJSONString(s)
-{
- /* The following should suffice but Safari's regex is b0rken
- (doesn't support callback substitutions)
- return "\"" + s.replace(/([^\u0020-\u007f]|[\\\"])/g,
- escapeJSONChar) + "\"";
- */
-
- /* Rather inefficient way to do it */
- var parts = s.split("");
- for(var i=0; i < parts.length; i++) {
- var c =parts[i];
- if(c == '"' ||
- c == '\\' ||
- c.charCodeAt(0) < 32 ||
- c.charCodeAt(0) >= 128)
- parts[i] = escapeJSONChar(parts[i]);
- }
- return "\"" + parts.join("") + "\"";
-};
-
-
-/* Marshall objects to JSON format */
-
-toJSON = function toJSON(o)
-{
- if(o == null) {
- return "null";
- } else if(o.constructor == String) {
- return escapeJSONString(o);
- } else if(o.constructor == Number) {
- return o.toString();
- } else if(o.constructor == Boolean) {
- return o.toString();
- } else if(o.constructor == Date) {
- return '{javaClass: "java.util.Date", time: ' + o.valueOf() +'}';
- } else if(o.constructor == Array) {
- var v = [];
- for(var i = 0; i < o.length; i++) v.push(toJSON(o[i]));
- return "[" + v.join(", ") + "]";
- } else {
- var v = [];
- for(attr in o) {
- if(o[attr] == null) v.push("\"" + attr + "\": null");
- else if(typeof o[attr] == "function"); /* skip */
- else v.push(escapeJSONString(attr) + ": " + toJSON(o[attr]));
- }
- return "{" + v.join(", ") + "}";
- }
-};
-
-
-/* JSONRpcClient constructor */
-
-JSONRpcClient =
-function JSONRpcClient_ctor(serverURL, user, pass, objectID)
-{
- this.serverURL = serverURL;
- this.user = user;
- this.pass = pass;
- this.objectID = objectID;
-
- /* Add standard methods */
- if(this.objectID) {
- this._addMethods(["listMethods"]);
- var req = this._makeRequest("listMethods", []);
- } else {
- this._addMethods(["system.listMethods"]);
- var req = this._makeRequest("system.listMethods", []);
- }
- var m = this._sendRequest(req);
- this._addMethods(m);
-};
-
-
-/* JSONRpcCLient.Exception */
-
-JSONRpcClient.Exception =
-function JSONRpcClient_Exception_ctor(code, message, javaStack)
-{
- this.code = code;
- var name;
- if(javaStack) {
- this.javaStack = javaStack;
- var m = javaStack.match(/^([^:]*)/);
- if(m) name = m[0];
- }
- if(name) this.name = name;
- else this.name = "JSONRpcClientException";
- this.message = message;
-};
-
-JSONRpcClient.Exception.CODE_REMOTE_EXCEPTION = 490;
-JSONRpcClient.Exception.CODE_ERR_CLIENT = 550;
-JSONRpcClient.Exception.CODE_ERR_PARSE = 590;
-JSONRpcClient.Exception.CODE_ERR_NOMETHOD = 591;
-JSONRpcClient.Exception.CODE_ERR_UNMARSHALL = 592;
-JSONRpcClient.Exception.CODE_ERR_MARSHALL = 593;
-
-JSONRpcClient.Exception.prototype = new Error();
-
-JSONRpcClient.Exception.prototype.toString =
-function JSONRpcClient_Exception_toString(code, msg)
-{
- return this.name + ": " + this.message;
-};
-
-
-/* Default top level exception handler */
-
-JSONRpcClient.default_ex_handler =
-function JSONRpcClient_default_ex_handler(e) { alert(e); };
-
-
-/* Client settable variables */
-
-JSONRpcClient.toplevel_ex_handler = JSONRpcClient.default_ex_handler;
-JSONRpcClient.profile_async = false;
-JSONRpcClient.max_req_active = 1;
-JSONRpcClient.requestId = 1;
-
-
-/* JSONRpcClient implementation */
-
-JSONRpcClient.prototype._createMethod =
-function JSONRpcClient_createMethod(methodName)
-{
- var fn=function()
- {
- var args = [];
- var callback = null;
- for(var i=0;i<arguments.length;i++) args.push(arguments[i]);
-
-/* TUSCANY change callback to be last arg instead of first to match binding.ajax
- if(typeof args[0] == "function") callback = args.shift();
-*/
- if(typeof args[arguments.length-1] == "function") callback = args.pop();
-
- var req = fn.client._makeRequest.call(fn.client, fn.methodName,
- args, callback);
- if(callback == null) {
- return fn.client._sendRequest.call(fn.client, req);
- } else {
- JSONRpcClient.async_requests.push(req);
- JSONRpcClient.kick_async();
- return req.requestId;
- }
- };
- fn.client = this;
- fn.methodName = methodName;
- return fn;
-};
-
-JSONRpcClient.prototype._addMethods =
-function JSONRpcClient_addMethods(methodNames)
-{
- for(var i=0; i<methodNames.length; i++) {
- var obj = this;
- var names = methodNames[i].split(".");
- for(var n=0; n<names.length-1; n++) {
- var name = names[n];
- if(obj[name]) {
- obj = obj[name];
- } else {
- obj[name] = new Object();
- obj = obj[name];
- }
- }
- var name = names[names.length-1];
- if(!obj[name]) {
- var method = this._createMethod(methodNames[i]);
- obj[name] = method;
- }
- }
-};
-
-JSONRpcClient._getCharsetFromHeaders =
-function JSONRpcClient_getCharsetFromHeaders(http)
-{
- try {
- var contentType = http.getResponseHeader("Content-type");
- var parts = contentType.split(/\s*;\s*/);
- for(var i =0; i < parts.length; i++) {
- if(parts[i].substring(0, 8) == "charset=")
- return parts[i].substring(8, parts[i].length);
- }
- } catch (e) {}
- return "UTF-8"; /* default */
-};
-
-/* Async queue globals */
-JSONRpcClient.async_requests = [];
-JSONRpcClient.async_inflight = {};
-JSONRpcClient.async_responses = [];
-JSONRpcClient.async_timeout = null;
-JSONRpcClient.num_req_active = 0;
-
-JSONRpcClient._async_handler =
-function JSONRpcClient_async_handler()
-{
- JSONRpcClient.async_timeout = null;
-
- while(JSONRpcClient.async_responses.length > 0) {
- var res = JSONRpcClient.async_responses.shift();
- if(res.canceled) continue;
- if(res.profile) res.profile.dispatch = new Date();
- try {
- res.cb(res.result, res.ex, res.profile);
- } catch(e) {
- JSONRpcClient.toplevel_ex_handler(e);
- }
- }
-
- while(JSONRpcClient.async_requests.length > 0 &&
- JSONRpcClient.num_req_active < JSONRpcClient.max_req_active) {
- var req = JSONRpcClient.async_requests.shift();
- if(req.canceled) continue;
- req.client._sendRequest.call(req.client, req);
- }
-};
-
-JSONRpcClient.kick_async =
-function JSONRpcClient_kick_async()
-{
- if(JSONRpcClient.async_timeout == null)
- JSONRpcClient.async_timeout =
- setTimeout(JSONRpcClient._async_handler, 0);
-};
-
-JSONRpcClient.cancelRequest =
-function JSONRpcClient_cancelRequest(requestId)
-{
- /* If it is in flight then mark it as canceled in the inflight map
- and the XMLHttpRequest callback will discard the reply. */
- if(JSONRpcClient.async_inflight[requestId]) {
- JSONRpcClient.async_inflight[requestId].canceled = true;
- return true;
- }
-
- /* If its not in flight yet then we can just mark it as canceled in
- the the request queue and it will get discarded before being sent. */
- for(var i in JSONRpcClient.async_requests) {
- if(JSONRpcClient.async_requests[i].requestId == requestId) {
- JSONRpcClient.async_requests[i].canceled = true;
- return true;
- }
- }
-
- /* It may have returned from the network and be waiting for its callback
- to be dispatched, so mark it as canceled in the response queue
- and the response will get discarded before calling the callback. */
- for(var i in JSONRpcClient.async_responses) {
- if(JSONRpcClient.async_responses[i].requestId == requestId) {
- JSONRpcClient.async_responses[i].canceled = true;
- return true;
- }
- }
-
- return false;
-};
-
-JSONRpcClient.prototype._makeRequest =
-function JSONRpcClient_makeRequest(methodName, args, cb)
-{
- var req = {};
- req.client = this;
- req.requestId = JSONRpcClient.requestId++;
-
- var obj = {};
- obj.id = req.requestId;
- if (this.objectID)
- obj.method = ".obj#" + this.objectID + "." + methodName;
- else
- obj.method = methodName;
- obj.params = args;
-
- if (cb) req.cb = cb;
- if (JSONRpcClient.profile_async)
- req.profile = { "submit": new Date() };
- req.data = toJSON(obj);
-
- return req;
-};
-
-JSONRpcClient.prototype._sendRequest =
-function JSONRpcClient_sendRequest(req)
-{
- if(req.profile) req.profile.start = new Date();
-
- /* Get free http object from the pool */
- var http = JSONRpcClient.poolGetHTTPRequest();
- JSONRpcClient.num_req_active++;
-
- /* Send the request */
- if (typeof(this.user) == "undefined") {
- http.open("POST", this.serverURL, (req.cb != null));
- } else {
- http.open("POST", this.serverURL, (req.cb != null), this.user, this.pass);
- }
-
- /* setRequestHeader is missing in Opera 8 Beta */
- try { http.setRequestHeader("Content-type", "text/plain"); } catch(e) {}
-
- /* Construct call back if we have one */
- if(req.cb) {
- var self = this;
- http.onreadystatechange = function() {
- if(http.readyState == 4) {
- http.onreadystatechange = function () {};
- var res = { "cb": req.cb, "result": null, "ex": null};
- if (req.profile) {
- res.profile = req.profile;
- res.profile.end = new Date();
- }
- try { res.result = self._handleResponse(http); }
- catch(e) { res.ex = e; }
- if(!JSONRpcClient.async_inflight[req.requestId].canceled)
- JSONRpcClient.async_responses.push(res);
- delete JSONRpcClient.async_inflight[req.requestId];
- JSONRpcClient.kick_async();
- }
- };
- } else {
- http.onreadystatechange = function() {};
- }
-
- JSONRpcClient.async_inflight[req.requestId] = req;
-
- try {
- http.send(req.data);
- } catch(e) {
- JSONRpcClient.poolReturnHTTPRequest(http);
- JSONRpcClient.num_req_active--;
- throw new JSONRpcClient.Exception
- (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed");
- }
-
- if(!req.cb) return this._handleResponse(http);
-};
-
-JSONRpcClient.prototype._handleResponse =
-function JSONRpcClient_handleResponse(http)
-{
- /* Get the charset */
- if(!this.charset) {
- this.charset = JSONRpcClient._getCharsetFromHeaders(http);
- }
-
- /* Get request results */
- var status, statusText, data;
- try {
- status = http.status;
- statusText = http.statusText;
- data = http.responseText;
- } catch(e) {
- JSONRpcClient.poolReturnHTTPRequest(http);
- JSONRpcClient.num_req_active--;
- JSONRpcClient.kick_async();
- throw new JSONRpcClient.Exception
- (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed");
- }
-
- /* Return http object to the pool; */
- JSONRpcClient.poolReturnHTTPRequest(http);
- JSONRpcClient.num_req_active--;
-
- /* Unmarshall the response */
- if(status != 200) {
- throw new JSONRpcClient.Exception(status, statusText);
- }
- var obj;
- try {
- eval("obj = " + data);
- } catch(e) {
- throw new JSONRpcClient.Exception(550, "error parsing result");
- }
- if(obj.error)
- throw new JSONRpcClient.Exception(obj.error.code, obj.error.msg,
- obj.error.trace);
- var res = obj.result;
-
- /* Handle CallableProxy */
- if(res && res.objectID && res.JSONRPCType == "CallableReference")
- return new JSONRpcClient(this.serverURL, this.user,
- this.pass, res.objectID);
-
- return res;
-};
-
-
-/* XMLHttpRequest wrapper code */
-
-/* XMLHttpRequest pool globals */
-JSONRpcClient.http_spare = [];
-JSONRpcClient.http_max_spare = 8;
-
-JSONRpcClient.poolGetHTTPRequest =
-function JSONRpcClient_pool_getHTTPRequest()
-{
- if(JSONRpcClient.http_spare.length > 0) {
- return JSONRpcClient.http_spare.pop();
- }
- return JSONRpcClient.getHTTPRequest();
-};
-
-JSONRpcClient.poolReturnHTTPRequest =
-function JSONRpcClient_poolReturnHTTPRequest(http)
-{
- if(JSONRpcClient.http_spare.length >= JSONRpcClient.http_max_spare)
- delete http;
- else
- JSONRpcClient.http_spare.push(http);
-};
-
-JSONRpcClient.msxmlNames = [ "MSXML2.XMLHTTP.5.0",
- "MSXML2.XMLHTTP.4.0",
- "MSXML2.XMLHTTP.3.0",
- "MSXML2.XMLHTTP",
- "Microsoft.XMLHTTP" ];
-
-JSONRpcClient.getHTTPRequest =
-function JSONRpcClient_getHTTPRequest()
-{
- /* Mozilla XMLHttpRequest */
- try {
- JSONRpcClient.httpObjectName = "XMLHttpRequest";
- return new XMLHttpRequest();
- } catch(e) {}
-
- /* Microsoft MSXML ActiveX */
- for (var i=0;i < JSONRpcClient.msxmlNames.length; i++) {
- try {
- JSONRpcClient.httpObjectName = JSONRpcClient.msxmlNames[i];
- return new ActiveXObject(JSONRpcClient.msxmlNames[i]);
- } catch (e) {}
- }
-
- /* None found */
- JSONRpcClient.httpObjectName = null;
- throw new JSONRpcClient.Exception(0, "Can't create XMLHttpRequest object");
-};
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/test/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationTestCase.java b/branches/sca-android/modules/implementation-widget-runtime/src/test/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationTestCase.java
deleted file mode 100644
index 3b5c6f89b2..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/test/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationTestCase.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.widget;
-
-import java.net.Socket;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WidgetImplementationTestCase extends TestCase {
-
- private SCADomain scaDomain;
-
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("widget.composite");
- }
-
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- public void testPing() throws Exception {
- new Socket("127.0.0.1", 8085);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/Catalog.java b/branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/Catalog.java
deleted file mode 100644
index 370474f29f..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/Catalog.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 store;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Interface for the Catalog Service.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface Catalog {
- String[] get();
-}
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/CatalogImpl.java b/branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/CatalogImpl.java
deleted file mode 100644
index f694c758dc..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/CatalogImpl.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 store;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.osoa.sca.annotations.Init;
-
-/**
- * Implementation of the Catalog Service.
- *
- * @version $Rev$ $Date$
- */
-public class CatalogImpl implements Catalog {
- private List<String> catalog = new ArrayList<String>();
-
- @Init
- public void init() {
- catalog.add("Apple - US$ 2.99");
- catalog.add("Orange - US$ 3.55");
- catalog.add("Pear - US$ 1.55");
- }
-
- public String[] get() {
- String[] catalogArray = new String[catalog.size()];
- catalog.toArray(catalogArray);
- return catalogArray;
- }
-}
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/ShoppingCartImpl.java b/branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/ShoppingCartImpl.java
deleted file mode 100644
index d4d2810d5c..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/test/java/store/ShoppingCartImpl.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 store;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.abdera.Abdera;
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.model.Feed;
-import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.binding.atom.collection.NotFoundException;
-
-/**
- * Implementation of a Shopping Cart.
- *
- * @version $Rev$ $Date$
- */
-public class ShoppingCartImpl implements Collection {
-
- private static Map<String, Entry> cart = new HashMap<String, Entry>();
-
- public Feed getFeed() {
- Feed feed = Abdera.getNewFactory().newFeed();
- feed.setTitle("shopping cart");
- feed.setSubtitle("Total : " + getTotal());
-
- for (Entry entry : cart.values()) {
- feed.addEntry(entry);
- }
-
- return feed;
- }
-
- public Feed query(String queryString) {
- if (queryString.startsWith("name=")) {
- String name = queryString.substring(5);
-
- Feed feed = Abdera.getNewFactory().newFeed();
- feed.setTitle("shopping cart");
- feed.setSubtitle("Total : " + getTotal());
-
- for (Entry entry : cart.values()) {
- if (entry.getTitle().contains(name)) {
- feed.addEntry(entry);
- }
- }
- return feed;
-
- } else {
- return getFeed();
- }
- }
-
- public Entry get(String id) throws NotFoundException {
- return cart.get(id);
- }
-
- public Entry post(Entry entry) {
- System.out.println("post" + entry);
- String id = "cart-" + UUID.randomUUID().toString();
- entry.setId(id);
-
- entry.addLink(id, "edit");
- entry.addLink(id, "alternate");
-
- entry.setEdited(new Date());
-
- cart.put(id, entry);
- return entry;
- }
-
- public void put(String id, Entry entry) throws NotFoundException {
- entry.setUpdated(new Date());
- cart.put(id, entry);
- }
-
- public void delete(String id) throws NotFoundException {
- if (id.equals(""))
- cart.clear();
- else
- cart.remove(id);
- }
-
- private String getTotal() {
- float total = 0;
- String currencySymbol = "";
- if (!cart.isEmpty()) {
- String item = ((Entry)cart.values().iterator().next()).getContent();
- currencySymbol = item.substring(item.indexOf("-") + 2, item.indexOf("-") + 3);
- }
- for (Entry entry : cart.values()) {
- String item = entry.getContent();
-
- int index = item.length()-1;
- char digit;
- while ((digit = item.charAt(index)) == '.' || Character.isDigit(digit)) {
- index--;
- }
-
- total += Float.valueOf(item.substring(index));
- }
- return currencySymbol + String.valueOf(total);
- }
-}
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/test/resources/content/store.html b/branches/sca-android/modules/implementation-widget-runtime/src/test/resources/content/store.html
deleted file mode 100644
index 58f9f560a7..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/test/resources/content/store.html
+++ /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.
--->
-<html>
-<head>
-<title>Store</TITLE>
-
-<!-- one js include per sca component -->
-<script type="text/javascript" src="store.js"></script>
-
-<script language="JavaScript">
-
- //@Reference
- var catalog = new Reference("Catalog");
-
- //@Reference
- var shoppingCart = new Reference("ShoppingCart");
-
- //@Property
- var locale = Property("locale");
-
- function catalog_getResponse(items,exception) {
- if(exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++)
- catalog += '<input name="items" type="checkbox" value="' +
- items[i] + '">' + items[i]+ ' <br>';
- document.getElementById('catalog').innerHTML=catalog;
- }
-
- function shoppingCart_getResponse(feed) {
- if (feed != null) {
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var item = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
- list += item + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
- document.getElementById('total').innerHTML = feed.getElementsByTagName("subtitle")[0].firstChild.nodeValue;
- }
- }
- function shoppingCart_postResponse(entry) {
- shoppingCart.get("", shoppingCart_getResponse);
- }
-
-
- function addToCart() {
- var items = document.catalogForm.items;
- var j = 0;
- for (var i=0; i<items.length; i++)
- if (items[i].checked) {
- var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>cart-item</title><content type="text">'+items[i].value+'</content></entry>'
- shoppingCart.post(entry, shoppingCart_postResponse);
- items[i].checked = false;
- }
- }
- function checkoutCart() {
- document.getElementById('store').innerHTML='<h2>' +
- 'Thanks for Shopping With Us!</h2>'+
- '<h2>Your Order</h2>'+
- '<form name="orderForm" action="/ufs/store.html">'+
- document.getElementById('shoppingCart').innerHTML+
- '<br>'+
- document.getElementById('total').innerHTML+
- '<br>'+
- '<br>'+
- '<input type="submit" value="Continue Shopping">'+
- '</form>';
- shoppingCart.del("", null);
- }
- function deleteCart() {
- shoppingCart.del("", null);
- document.getElementById('shoppingCart').innerHTML = "";
- document.getElementById('total').innerHTML = "";
- }
-
- //alert(locale);
- catalog.get(catalog_getResponse);
- shoppingCart.get("", shoppingCart_getResponse);
-</script>
-
-</head>
-
-<body>
-<h1>Store</h1>
- <div id="store">
- <h2>Catalog</h2>
- <form name="catalogForm">
- <div id="catalog" ></div>
- <br>
- <input type="button" onClick="addToCart()" value="Add to Cart">
- </form>
-
- <br>
-
- <h2>Your Shopping Cart</h2>
- <form name="shoppingCartForm">
- <div id="shoppingCart"></div>
- <br>
- <div id="total"></div>
- <br>
- <input type="button" onClick="checkoutCart()" value="Checkout">
- <input type="button" onClick="deleteCart()" value="Empty">
- <a href="../ShoppingCart/">(feed)</a>
- </form>
- </div>
-</body>
-</html>
diff --git a/branches/sca-android/modules/implementation-widget-runtime/src/test/resources/widget.composite b/branches/sca-android/modules/implementation-widget-runtime/src/test/resources/widget.composite
deleted file mode 100644
index f23d6a20f5..0000000000
--- a/branches/sca-android/modules/implementation-widget-runtime/src/test/resources/widget.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"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://sample/resource"
- xmlns:sr="http://sample/resource"
- name="resource">
-
- <component name="store">
- <tuscany:implementation.widget location="content/store.html"/>
- <property name="locale">en</property>
- <service name="Widget">
- <tuscany:binding.http uri="http://localhost:8085/store"/>
- </service>
- <reference name="Catalog" target="Catalog">
- <tuscany:binding.jsonrpc uri="http://localhost:8085/Catalog"/>
- </reference>
- <reference name="ShoppingCart" target="ShoppingCart">
- <tuscany:binding.atom uri="http://localhost:8085/ShoppingCart"/>
- </reference>
- </component>
-
- <component name="Catalog">
- <implementation.java class="store.CatalogImpl"/>
- <service name="Catalog">
- <tuscany:binding.jsonrpc uri="http://localhost:8085/Catalog"/>
- </service>
- </component>
-
- <component name="ShoppingCart">
- <implementation.java class="store.ShoppingCartImpl"/>
- <service name="Collection">
- <tuscany:binding.atom uri="http://localhost:8085/ShoppingCart"/>
- </service>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/implementation-widget/LICENSE b/branches/sca-android/modules/implementation-widget/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/implementation-widget/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/implementation-widget/META-INF/README b/branches/sca-android/modules/implementation-widget/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-widget/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-widget/NOTICE b/branches/sca-android/modules/implementation-widget/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/implementation-widget/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/branches/sca-android/modules/implementation-widget/pom.xml b/branches/sca-android/modules/implementation-widget/pom.xml
deleted file mode 100644
index ec717b9b35..0000000000
--- a/branches/sca-android/modules/implementation-widget/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-widget</artifactId>
- <name>Apache Tuscany SCA Widget Implementation Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.implementation.widget</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.widget*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/Widget.java b/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/Widget.java
deleted file mode 100644
index f47850a05c..0000000000
--- a/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/Widget.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.widget;
-
-import java.io.InputStream;
-
-import org.apache.tuscany.sca.data.collection.Collection;
-
-/**
- * The service interface of widget implementations. This is not an API for application
- * developers. Application developers should use the data collection API to invoke
- * widget components.
- *
- * @version $Rev$ $Date$
- */
-public interface Widget extends Collection<String, InputStream> {
-}
diff --git a/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementation.java b/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementation.java
deleted file mode 100644
index b35cc41dd4..0000000000
--- a/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementation.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.implementation.widget;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.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;
-
-
-/**
- * The model representing a widget implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public class WidgetImplementation implements Implementation {
- private Service widgetService;
- private List<Reference> references = new ArrayList<Reference>();
- private List<Property> properties = new ArrayList<Property>();
-
- private String location;
- private URL url;
- private boolean unresolved;
-
- /**
- * Constructs a new resource implementation.
- */
- WidgetImplementation(AssemblyFactory assemblyFactory,
- JavaInterfaceFactory javaFactory) {
-
- // Resource implementation always provide a single service exposing
- // the Resource interface, and have no references and properties
- widgetService = assemblyFactory.createService();
- widgetService.setName("Widget");
-
- // Create the Java interface contract for the Resource service
- JavaInterface javaInterface;
- try {
- javaInterface = javaFactory.createJavaInterface(Widget.class);
- } catch (InvalidInterfaceException e) {
- throw new IllegalArgumentException(e);
- }
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- interfaceContract.setInterface(javaInterface);
- widgetService.setInterfaceContract(interfaceContract);
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public URL getLocationURL() {
- return url;
- }
-
- public void setLocationURL(URL url) {
- this.url = url;
- }
-
- public ConstrainingType getConstrainingType() {
- // The resource implementation does not support constrainingTypes
- return null;
- }
-
- public List<Property> getProperties() {
- return properties;
- }
-
- public List<Service> getServices() {
- // The resource implementation does not support services
- return Collections.singletonList(widgetService);
- }
-
- public List<Reference> getReferences() {
- return references;
- }
-
- public String getURI() {
- return location;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- // The resource implementation does not support constrainingTypes
- }
-
- public void setURI(String uri) {
- this.location = uri;
- }
-
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- @Override
- public String toString() {
- return "Widget : " + getLocation();
- }
-}
diff --git a/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationFactory.java b/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationFactory.java
deleted file mode 100644
index 2493b97f5c..0000000000
--- a/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationFactory.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.widget;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-
-/**
- * Factory for the widget implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class WidgetImplementationFactory {
-
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
-
- public WidgetImplementationFactory(ModelFactoryExtensionPoint modelFactories) {
- assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- }
-
- public WidgetImplementation createWidgetImplementation() {
- return new WidgetImplementation(assemblyFactory, javaFactory);
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationIntrospector.java b/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationIntrospector.java
deleted file mode 100644
index abe00bac5b..0000000000
--- a/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationIntrospector.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.implementation.widget;
-
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Scanner;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-class WidgetImplementationIntrospector {
- private static final String WEB_REFERENCE_ANNOTATION = "//@Reference";
- private static final String WEB_PROPERTY_ANNOTATION = "//@Property";
-
- private AssemblyFactory assemblyFactory;
- private WidgetImplementation widgetImplementation;
-
- WidgetImplementationIntrospector(AssemblyFactory assemblyFactory, WidgetImplementation widgetImplementation) {
- this.widgetImplementation = widgetImplementation;
- this.assemblyFactory = assemblyFactory;
- }
-
-
- /**
- * Introspect and populate a given widget implementation
- */
- public void introspectImplementation() {
- URL htmlWidget = widgetImplementation.getLocationURL();
-
- try {
- URLConnection connection = htmlWidget.openConnection();
- connection.setUseCaches(false);
- Scanner scanner = new Scanner(connection.getInputStream());
- while(scanner.hasNextLine()) {
- String line = scanner.nextLine();
- if(line.contains(WEB_PROPERTY_ANNOTATION)) {
- //process the next line, as it has the property info
- if (scanner.hasNextLine()) {
- Property property = processPropertyScript(scanner.nextLine());
- if (property != null) {
- widgetImplementation.getProperties().add(property);
- }
- }
-
- } else if(line.contains(WEB_REFERENCE_ANNOTATION)) {
- //process the next line, as it has the reference info
- if (scanner.hasNextLine()) {
- Reference reference = processReferenceScript(scanner.nextLine());
- if(reference != null){
- widgetImplementation.getReferences().add(reference);
- }
-
- }
- }
- }
-
- } catch(Exception e) {
-
- }
-
-
- }
-
-
- /**
- * Process Property declaration in JavaScript code
- * Supported ways:
- * //@Property
- * var locale = Property("locale");
- *
- * //@Property
- * locale = Property("locale");
- *
- * @param scriptContent
- * @return
- */
- private Property processPropertyScript(String scriptContent) {
- Property property = null;
- String propertyName = null;
-
- String tokens[] = scriptContent.split("=");
- tokens = tokens[0].split(" ");
- propertyName = tokens[tokens.length -1];
-
- if(propertyName != null) {
- property = assemblyFactory.createProperty();
- property.setName(propertyName);
- }
-
- return property;
- }
-
- /**
- * Process Reference declaration in JavaScript code
- * Supported ways :
- * //@Reference
- * var catalog = new Reference("catalog");
- *
- * //@Reference
- * catalog = new Reference("catalog");
- *
- * @param scriptContent
- * @return
- */
- private Reference processReferenceScript(String scriptContent) {
- Reference reference = null;
- String referenceName = null;
-
- String tokens[] = scriptContent.split("=");
-
- // find the string between the quotes
- tokens = tokens[1].split("\"");
- referenceName = tokens[1];
-
- if(referenceName != null) {
- reference = assemblyFactory.createReference();
- reference.setName(referenceName);
- }
-
- return reference;
- }
-}
diff --git a/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java b/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
deleted file mode 100644
index bd91dd7632..0000000000
--- a/branches/sca-android/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.widget;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import java.io.IOException;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-
-/**
- * Implements a StAX artifact processor for Widget implementations.
- *
- * @version $Rev$ $Date$
- */
-public class WidgetImplementationProcessor implements StAXArtifactProcessor<WidgetImplementation> {
- private static final QName IMPLEMENTATION_WIDGET = new QName(Constants.SCA10_TUSCANY_NS, "implementation.widget");
-
- private AssemblyFactory assemblyFactory;
- private ContributionFactory contributionFactory;
- private WidgetImplementationFactory implementationFactory;
- private Monitor monitor;
-
- public WidgetImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- implementationFactory = new WidgetImplementationFactory(modelFactories);
- 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 = new ProblemImpl(this.getClass().getName(), "impl-widget-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 = new ProblemImpl(this.getClass().getName(), "impl-widget-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- // Returns the QName of the XML element processed by this processor
- return IMPLEMENTATION_WIDGET;
- }
-
- public Class<WidgetImplementation> getModelType() {
- // Returns the type of model processed by this processor
- return WidgetImplementation.class;
- }
-
- public WidgetImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Read an <implementation.widget> element
-
- // Create and initialize the resource implementation model
- WidgetImplementation implementation = null;
-
- // Read the location attribute specifying the location of the resources
- String location = reader.getAttributeValue(null, "location");
- if (location != null) {
- implementation = implementationFactory.createWidgetImplementation();
- implementation.setLocation(location);
- implementation.setUnresolved(true);
- } else {
- error("LocationAttributeMissing", reader);
- //throw new ContributionReadException(MSG_LOCATION_MISSING);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && IMPLEMENTATION_WIDGET.equals(reader.getName())) {
- break;
- }
- }
-
- return implementation;
- }
-
- public void resolve(WidgetImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
-
- if (implementation != null) {
- // Resolve the resource directory location
- Artifact artifact = contributionFactory.createArtifact();
- artifact.setURI(implementation.getLocation());
- Artifact resolved = resolver.resolveModel(Artifact.class, artifact);
- if (resolved.getLocation() != null) {
- try {
- implementation.setLocationURL(new URL(resolved.getLocation()));
-
- //introspect implementation
- WidgetImplementationIntrospector widgetIntrospector =
- new WidgetImplementationIntrospector(assemblyFactory, implementation);
- widgetIntrospector.introspectImplementation();
-
- implementation.setUnresolved(false);
- } catch (IOException e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", resolver, ce);
- //throw ce;
- }
- } else {
- error("CouldNotResolveLocation", resolver, implementation.getLocation());
- //throw new ContributionResolveException("Could not resolve implementation.widget location: " + implementation.getLocation());
- }
- }
- }
-
- public void write(WidgetImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <implementation.widget>
- writer.setPrefix("widget",IMPLEMENTATION_WIDGET.getNamespaceURI());
- writer.writeStartElement(IMPLEMENTATION_WIDGET.getNamespaceURI(), IMPLEMENTATION_WIDGET.getLocalPart());
- writer.writeNamespace("widget",IMPLEMENTATION_WIDGET.getNamespaceURI());
-
-
- if (implementation.getLocation() != null) {
- writer.writeAttribute("location", implementation.getLocation());
- }
-
- writer.writeEndElement();
- }
-}
diff --git a/branches/sca-android/modules/implementation-widget/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/implementation-widget/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 6c167a6b31..0000000000
--- a/branches/sca-android/modules/implementation-widget/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.widget.WidgetImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.widget,model=org.apache.tuscany.sca.implementation.widget.WidgetImplementation
diff --git a/branches/sca-android/modules/implementation-widget/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.widget.WidgetImplementationFactory b/branches/sca-android/modules/implementation-widget/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.widget.WidgetImplementationFactory
deleted file mode 100644
index fc45baa16d..0000000000
--- a/branches/sca-android/modules/implementation-widget/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.widget.WidgetImplementationFactory
+++ /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.widget.WidgetImplementationFactory
diff --git a/branches/sca-android/modules/implementation-widget/src/main/resources/impl-widget-validation-messages.properties b/branches/sca-android/modules/implementation-widget/src/main/resources/impl-widget-validation-messages.properties
deleted file mode 100644
index 3778bd4c50..0000000000
--- a/branches/sca-android/modules/implementation-widget/src/main/resources/impl-widget-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.
-#
-#
-ContributionResolveException = ContributionResolveException occured due to:
-LocationAttributeMissing = Reading implementation.widget - location attribute missing
-CouldNotResolveLocation = Could not resolve implementation.widget location: {0}
diff --git a/branches/sca-android/modules/implementation-xquery/LICENSE b/branches/sca-android/modules/implementation-xquery/LICENSE
deleted file mode 100644
index d645695673..0000000000
--- a/branches/sca-android/modules/implementation-xquery/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/branches/sca-android/modules/implementation-xquery/META-INF/README b/branches/sca-android/modules/implementation-xquery/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/implementation-xquery/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/implementation-xquery/NOTICE b/branches/sca-android/modules/implementation-xquery/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/implementation-xquery/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/branches/sca-android/modules/implementation-xquery/pom.xml b/branches/sca-android/modules/implementation-xquery/pom.xml
deleted file mode 100644
index c094de3c7e..0000000000
--- a/branches/sca-android/modules/implementation-xquery/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-xquery</artifactId>
- <name>Apache Tuscany SCA XQuery Implementation Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-saxon</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.implementation.xquery</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.xquery*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementation.java b/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementation.java
deleted file mode 100644
index f5bc5dd9b8..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementation.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.xquery;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import net.sf.saxon.query.XQueryExpression;
-
-import org.apache.tuscany.sca.assembly.Implementation;
-
-/**
- * Class representing the XQuery implementation type
- * @version $Rev$ $Date$
- */
-public interface XQueryImplementation extends Implementation {
-
- /**
- * Location of the XQuery implementation file
- * @return
- */
- String getLocation();
-
- void setLocation(String location);
-
- String getLocationURL();
-
- void setLocationURL(String location);
-
- /**
- * The XQuery expression that is loaded from the XQuery implementation file
- * @return
- */
- String getXqExpression();
-
- void setXqExpression(String expression);
-
- /**
- * The XQuery expression should be extended for with additional
- * script, which provides the external variables needed to invoke
- * a function. In this way for each function that is defined in the
- * original XQuery expression additional expression is defined, which
- * can invoke this function, using external variables as input.
- * These expression extensions are stored in this map. It provides for
- * each method of a service interface that is implemented by this component
- * type corresponding expression extension
- * @return
- */
- Map<Method, String> getXqExpressionExtensionsMap();
-
- /**
- * This map is a kind of cache for function invocations. If a given
- * XQuery function of this implementation has been invoked already
- * its compiled expression can be reused. In this manner the performance
- * can be increased
- * @return
- */
- Map<String, XQueryExpression> getCompiledExpressionsCache();
-}
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationFactory.java b/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationFactory.java
deleted file mode 100644
index bdfd390499..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationFactory.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.xquery;
-
-import org.apache.tuscany.sca.implementation.xquery.impl.XQueryImplementationFactoryImpl;
-
-/**
- * Provides instances of XQueryImplementation classes
- * @version $Rev$ $Date$
- */
-public interface XQueryImplementationFactory {
-
- XQueryImplementationFactory INSTANCE = new XQueryImplementationFactoryImpl();
-
- XQueryImplementation createXQueryImplementation();
-}
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationProvider.java b/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationProvider.java
deleted file mode 100644
index 63a3a49e13..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationProvider.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.implementation.xquery;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.databinding.javabeans.SimpleJavaDataBinding;
-import org.apache.tuscany.sca.databinding.saxon.SaxonNodeDataBinding;
-import org.apache.tuscany.sca.databinding.saxon.SaxonValueDataBinding;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-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.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-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;
-
-/**
- * Provides the runtime configuration of XQuery-typed component.
- *
- * Generally the following is done:
- * 1. During construction all services and references are provided
- * with the Saxon data binding, which is the one required by the
- * XQueryInvoker
- *
- * 2. During startup:
- * - a proxy is created for each reference and it is kept in the referenceProxies
- * map, which is used later by the invoker to configure the Saxon parser;
- * - each property value is read and put into the properties map. This is
- * again used by the invoker to configure the Saxon parser
- *
- * @version $Rev$ $Date$
- */
-public class XQueryImplementationProvider implements ImplementationProvider {
-
- private RuntimeComponent component;
- private XQueryImplementation implementation;
- private Map<String, Object> referenceProxies = new HashMap<String, Object>();
- private Map<String, Object> properties = new HashMap<String, Object>();
- private JavaPropertyValueObjectFactory javaFactory;
-
- public XQueryImplementationProvider(RuntimeComponent component,
- XQueryImplementation implementation,
- JavaPropertyValueObjectFactory factory) {
- this.component = component;
- this.implementation = implementation;
- this.javaFactory = factory;
- init();
- }
-
- private void init() {
- List<Service> services = implementation.getServices();
- for (Service sevice : services) {
- InterfaceContract interfaceContract = sevice.getInterfaceContract();
- //interfaceContract.getInterface().setDefaultDataBinding(ValueRepresentation.class.getName());
- setDataBinding(interfaceContract.getInterface(), false);
- }
-
- List<Reference> references = implementation.getReferences();
- for (Reference reference : references) {
- InterfaceContract interfaceContract = reference.getInterfaceContract();
- //interfaceContract.getInterface().setDefaultDataBinding(ValueRepresentation.class.getName());
- setDataBinding(interfaceContract.getInterface(), true);
- }
- }
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- return new XQueryInvoker(service, operation, implementation, referenceProxies, properties);
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
-
- for (Reference reference : component.getReferences()) {
- String refName = reference.getName();
- if (refName.startsWith("$self$.")) {
- continue;
- }
- Class interfaze = ((JavaInterface)reference.getInterfaceContract().getInterface()).getJavaClass();
- Object refProxy = component.getComponentContext().getService(interfaze, refName);
- referenceProxies.put(refName, refProxy);
- }
-
- for (ComponentProperty property : component.getProperties()) {
- String propName = property.getName();
- QName xmlType = property.getXSDType();
- Class clazz = JavaXMLMapper.getJavaType(xmlType);
-
- Object propertyValue = null;
- if (clazz == null || java.lang.Object.class.equals(clazz)) {
- propertyValue = property.getValue();
- } else {
- ObjectFactory objfactory = javaFactory.createValueFactory(property, property.getValue(), clazz);
- propertyValue = objfactory.getInstance();
- }
- properties.put(propName, propertyValue);
- }
- }
-
- private void setDataBinding(Interface interfaze, boolean isReference) {
- List<Operation> operations = interfaze.getOperations();
- for (Operation operation : operations) {
- operation.setDataBinding(SaxonNodeDataBinding.NAME);
- DataType<List<DataType>> inputType = operation.getInputType();
- if (inputType != null) {
- List<DataType> logical = inputType.getLogical();
- for (DataType inArg : logical) {
- if (SimpleJavaDataBinding.NAME.equals(inArg.getDataBinding())) {
- if (!isReference) {
- inArg.setDataBinding(SaxonValueDataBinding.NAME);
- }
- } else {
- inArg.setDataBinding(SaxonNodeDataBinding.NAME);
- }
- }
- }
- DataType outputType = operation.getOutputType();
- if (outputType != null) {
- if (SimpleJavaDataBinding.NAME.equals(outputType.getDataBinding())) {
- if (!isReference) {
- outputType.setDataBinding(SaxonValueDataBinding.NAME);
- }
- } else {
- outputType.setDataBinding(SaxonNodeDataBinding.NAME);
- }
- }
- }
- }
-
- public void stop() {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationProviderFactory.java b/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationProviderFactory.java
deleted file mode 100644
index 57536e502b..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryImplementationProviderFactory.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.xquery;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-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.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * A factory for XQuery implementation providers
- * @version $Rev$ $Date$
- */
-public class XQueryImplementationProviderFactory implements ImplementationProviderFactory<XQueryImplementation> {
-
- private JavaPropertyValueObjectFactory javaFactory;
-
- public XQueryImplementationProviderFactory(ExtensionPointRegistry registry) {
- DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class);
- TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class);
- MediatorImpl mediator = new MediatorImpl(dataBindings, transformers);
- this.javaFactory = new JavaPropertyValueObjectFactory(mediator);
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component,
- XQueryImplementation implementation) {
- return new XQueryImplementationProvider(component, implementation, javaFactory);
- }
-
- public Class<XQueryImplementation> getModelType() {
- return XQueryImplementation.class;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryInvokationException.java b/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryInvokationException.java
deleted file mode 100644
index 0c628b3715..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryInvokationException.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.xquery;
-
-/**
- * Exception class used by the XQueryInvoker to report problems in
- * XQuery script invocation
- * @version $Rev$ $Date$
- */
-public class XQueryInvokationException extends Exception {
-
- private static final long serialVersionUID = -2674411654705699541L;
-
- public XQueryInvokationException(String msg) {
- super(msg);
- }
-}
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryInvoker.java b/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryInvoker.java
deleted file mode 100644
index 2a9673068b..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/XQueryInvoker.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.implementation.xquery;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import net.sf.saxon.Configuration;
-import net.sf.saxon.event.Builder;
-import net.sf.saxon.om.DocumentInfo;
-import net.sf.saxon.om.Item;
-import net.sf.saxon.om.NodeInfo;
-import net.sf.saxon.om.SequenceIterator;
-import net.sf.saxon.query.DynamicQueryContext;
-import net.sf.saxon.query.QueryResult;
-import net.sf.saxon.query.StaticQueryContext;
-import net.sf.saxon.query.XQueryExpression;
-import net.sf.saxon.trans.XPathException;
-import net.sf.saxon.value.Value;
-
-import org.apache.tuscany.sca.databinding.saxon.SaxonDataBindingHelper;
-import org.apache.tuscany.sca.databinding.saxon.collection.ItemList;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Performs the invocation of a requested XQuery function
- * @version $Rev$ $Date$
- */
-public class XQueryInvoker implements Invoker {
-
- private RuntimeComponentService service;
- private Operation operation;
- private Method theMethod;
- private XQueryImplementation implementation;
- private Map<String, Object> referenceProxies;
- private Map<String, Object> properties;
-
- /**
- * Constructs a new instance of the xquery invoker.
- * Also performs a search of java.lang.Method instance
- * that corresponds to the invoked operation
- */
- public XQueryInvoker(RuntimeComponentService service,
- Operation operation,
- XQueryImplementation implementation,
- Map<String, Object> referenceProxies,
- Map<String, Object> properties) {
- this.service = service;
- this.operation = operation;
- this.implementation = implementation;
- this.referenceProxies = referenceProxies;
- this.properties = properties;
-
- findMatchingMethod();
- }
-
- /**
- * This method contains the XQuery invocation logic
- * The following steps are performed:
- * 1. XQuery expression is produced by combining the original expression
- * and the function invocation extension (See XQueryImplementation.getXqExpressionExtensionsMap()
- * for details)
- * 2. A check is performed if this expression has been invoked already. If yes -
- * it is taken from the cache
- * 3. Configuration for the execution is either created or retrieved from
- * the cached expression
- * 4. The input parameters of the operation to be invoked are taken from the
- * payload and transformed to ones that are built with the current
- * configuration.
- * NOTE: This is unnecessary overhead - can the Configuration
- * object be attached in some way to the invocation request?
- * 5. All parameters, reference proxies and property values are mapped
- * to external variables of the XQuery script
- * 6. The query is executed and all the results are stored in a ItemList object
- *
- * NOTE: During execution of the XQuery a static variable is set with
- * the current configuration. This variable is used by the NodeInfo transformers
- * to produce the correct NodeInfo for all Output2Output transformations, which
- * happen as result of the XQuery component invoking some reference components
- * The old state of the static configuration is preserved and in this way allowing
- * to nest XQuery component invocations (i.e. one XQuery component invokes another
- * one)
- */
- private Object doInvoke(Object payload) throws XQueryInvokationException, XPathException {
- if (theMethod == null) {
- throw new XQueryInvokationException("No java method for operation: " + operation.getName());
- }
- String xqExpression =
- implementation.getXqExpression() + implementation.getXqExpressionExtensionsMap().get(theMethod);
-
- Configuration config = null;
- Properties props = new Properties();
- props.setProperty(OutputKeys.METHOD, "xml");
- props.setProperty(OutputKeys.INDENT, "yes");
-
- XQueryExpression exp = implementation.getCompiledExpressionsCache().get(xqExpression);
- if (exp == null) {
- config = new Configuration();
- StaticQueryContext sqc = new StaticQueryContext(config);
- exp = sqc.compileQuery(xqExpression);
- implementation.getCompiledExpressionsCache().put(xqExpression, exp);
- } else {
- config = exp.getStaticContext().getConfiguration();
- }
-
- Object[] params = prepareParameters(payload, config, props);
-
- DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
-
- // Setting the parameters for function invocation
- String methodName = theMethod.getName();
- for (int i = 0; i < params.length; i++) {
- dynamicContext.setParameter(methodName + "_" + i, params[i]);
- }
-
- // Setting references
- for (Map.Entry<String, Object> entry : referenceProxies.entrySet()) {
- dynamicContext.setParameter(entry.getKey(), entry.getValue());
- }
-
- // Setting properties
- for (Map.Entry<String, Object> entry : properties.entrySet()) {
- dynamicContext.setParameter(entry.getKey(), transformProperty(entry.getValue(), config));
- }
-
- SequenceIterator iterator = null;
- Configuration oldConfigValue = SaxonDataBindingHelper.CURR_EXECUTING_CONFIG;
- SaxonDataBindingHelper.CURR_EXECUTING_CONFIG = config;
- try {
- iterator = exp.iterator(dynamicContext);
- } finally {
- SaxonDataBindingHelper.CURR_EXECUTING_CONFIG = oldConfigValue;
- }
-
- ItemList list = new ItemList();
- Item item = iterator.next();
-
- while (item != null) {
- list.add(item);
- item = iterator.next();
-
- }
-
- if (list.size() == 0) {
- return null;
-
- } else if (list.size() == 1) {
-
- item = list.iterator().next();
-
- if (item instanceof NodeInfo) {
- return item;
- } else {
- return Value.asValue(item);
- }
-
- }
-
- return list;
-
- }
-
- public Message invoke(Message msg) {
- try {
- Object resp = doInvoke(msg.getBody());
- msg.setBody(resp);
- } catch (XQueryInvokationException e) {
- msg.setFaultBody(e.getCause());
- } catch (XPathException e) {
- msg.setFaultBody(e.getCause());
- }
- return msg;
- }
-
- private void findMatchingMethod() {
- Class<?> interfaze = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
-
- for (Method method : interfaze.getMethods()) {
- if (match(operation, method)) {
- theMethod = method;
- }
- }
- }
-
- private static boolean match(Operation operation, Method method) {
- Class<?>[] params = method.getParameterTypes();
- DataType<List<DataType>> 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];
- if (!clazz.equals(operation.getInputType().getLogical().get(i).getPhysical())) {
- matched = false;
- }
- }
- } else {
- matched = false;
- }
- return matched;
-
- }
-
- private Object[] prepareParameters(Object payload, Configuration configuration, Properties props) {
- if (payload == null) {
- return new Object[0];
- }
- Object[] inputArguments = null;
- if (payload.getClass().isArray()) {
- inputArguments = (Object[])payload;
- } else {
- inputArguments = new Object[1];
- inputArguments[0] = payload;
- }
-
- Object[] parameters = new Object[inputArguments.length];
-
- for (int i = 0; i < inputArguments.length; i++) {
- if (inputArguments[i] instanceof NodeInfo) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- StreamResult sw = new StreamResult(baos);
- try {
- QueryResult.serialize((NodeInfo)inputArguments[i], sw, props, ((NodeInfo)inputArguments[i]).getConfiguration());
- baos.close();
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- StreamSource ss = new StreamSource(bais);
- parameters[i] = Builder.build(ss, null, configuration);
- } catch (Exception e) {
- e.printStackTrace();
- parameters[i] = null;
- }
- } else {
- parameters[i] = inputArguments[i];
- }
- }
-
- return parameters;
- }
-
- private Object transformProperty(Object argument, Configuration configuration) {
- Object parameter = argument;
- if (argument instanceof Document) {
- try {
- Document doc = (Document)argument;
- Node valueNode = doc.getFirstChild();
- DocumentInfo docInfo = null;
- if (valueNode instanceof Element && valueNode.getNodeName().equals("value")) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- StreamResult sr = new StreamResult(baos);
- try {
- Node element = null;
- NodeList list = valueNode.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- if (list.item(i).getNodeType() == Node.ELEMENT_NODE) {
- element = list.item(i);
- break;
- }
- }
- if (element == null) {
- element = valueNode.getFirstChild();
- }
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.transform(new DOMSource(element), sr);
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- docInfo = (DocumentInfo)Builder.build(new StreamSource(bais), null, configuration);
- } catch (Exception e) {
- e.printStackTrace();
- return parameter;
- }
- } else {
- docInfo = (DocumentInfo)Builder.build(new DOMSource(doc), null, configuration);
- }
- parameter = docInfo;
- } catch (XPathException e) {
- e.printStackTrace();
- return parameter;
- }
- }
-
- return parameter;
- }
-}
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/impl/XQueryImplementationFactoryImpl.java b/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/impl/XQueryImplementationFactoryImpl.java
deleted file mode 100644
index 5e77575c3c..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/impl/XQueryImplementationFactoryImpl.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.xquery.impl;
-
-import org.apache.tuscany.sca.implementation.xquery.XQueryImplementation;
-import org.apache.tuscany.sca.implementation.xquery.XQueryImplementationFactory;
-
-/**
- * Actual implementation of the XQuery implementation factory
- * @version $Rev$ $Date$
- */
-public class XQueryImplementationFactoryImpl implements XQueryImplementationFactory {
-
- public XQueryImplementation createXQueryImplementation() {
- XQueryImplementation implementation = new XQueryImplementationImpl();
- return implementation;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/impl/XQueryImplementationImpl.java b/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/impl/XQueryImplementationImpl.java
deleted file mode 100644
index 77c8eea511..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/impl/XQueryImplementationImpl.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.implementation.xquery.impl;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-import net.sf.saxon.query.XQueryExpression;
-
-import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
-import org.apache.tuscany.sca.implementation.xquery.XQueryImplementation;
-
-/**
- * Actual implementation of the XQuery implementation
- * @version $Rev$ $Date$
- */
-public class XQueryImplementationImpl extends ImplementationImpl implements XQueryImplementation {
-
- private String location;
- private String locationURL;
- private String xqExpression;
-
- private Map<String, XQueryExpression> compiledExpressionsCache = new HashMap<String, XQueryExpression>();
- private Map<Method, String> xqExpressionExtensionsMap = new HashMap<Method, String>();
-
- public XQueryImplementationImpl() {
- setUnresolved(true);
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public String getLocationURL() {
- return locationURL;
- }
-
- public void setLocationURL(String locationURL) {
- this.locationURL = locationURL;
- }
-
- public String getXqExpression() {
- return xqExpression;
- }
-
- public void setXqExpression(String xqExpression) {
- this.xqExpression = xqExpression;
- }
-
- public Map<String, XQueryExpression> getCompiledExpressionsCache() {
- return compiledExpressionsCache;
- }
-
- public Map<Method, String> getXqExpressionExtensionsMap() {
- return xqExpressionExtensionsMap;
- }
-
- @Override
- public int hashCode() {
- final int PRIME = 31;
- int result = super.hashCode();
- result = PRIME * result + ((location == null) ? 0 : location.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null || getClass() != obj.getClass())
- return false;
- final XQueryImplementationImpl other = (XQueryImplementationImpl)obj;
- if (location == null) {
- if (other.location != null)
- return false;
- } else if (!location.equals(other.location))
- return false;
- return true;
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java b/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java
deleted file mode 100644
index 9adce78310..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.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.implementation.xquery.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.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.implementation.xquery.XQueryImplementation;
-import org.apache.tuscany.sca.implementation.xquery.XQueryImplementationFactory;
-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;
-
-/**
- * Processor for the XQuery implementation type artifact
- * @version $Rev$ $Date$
- */
-public class XQueryImplementationProcessor implements StAXArtifactProcessor<XQueryImplementation> {
-
- private static final String LOCATION = "location";
- private static final String IMPLEMENTATION_XQUERY = "implementation.xquery";
- private static final QName IMPLEMENTATION_XQUERY_QNAME =
- new QName(Constants.SCA10_TUSCANY_NS, IMPLEMENTATION_XQUERY);
-
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
- private ContributionFactory contributionFactory;
- private Monitor monitor;
-
- public XQueryImplementationProcessor(ModelFactoryExtensionPoint modelFactoryExtensionPoint, Monitor monitor) {
- assemblyFactory = modelFactoryExtensionPoint.getFactory(AssemblyFactory.class);
- javaFactory = modelFactoryExtensionPoint.getFactory(JavaInterfaceFactory.class);
- contributionFactory = modelFactoryExtensionPoint.getFactory(ContributionFactory.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 = new ProblemImpl(this.getClass().getName(), "impl-xquery-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return IMPLEMENTATION_XQUERY_QNAME;
- }
-
- /**
- * Reads from the stream and sets the location attribute of the implementation correspondingly
- */
- public XQueryImplementation read(XMLStreamReader reader)
- throws ContributionReadException, XMLStreamException {
-
- /* Create the XQuery implementation and set the location into it */
- XQueryImplementation xqueryImplementation = null;
-
- /* Read the location attribute for the XQuery implementation */
- String xqueryLocation = reader.getAttributeValue(null, LOCATION);
- if (xqueryLocation != null) {
- xqueryImplementation = XQueryImplementationFactory.INSTANCE.createXQueryImplementation();
- xqueryImplementation.setLocation(xqueryLocation);
- xqueryImplementation.setUnresolved(true);
- } else {
- error("LocationAttributeMissing", reader);
- //throw new ContributionReadException(MSG_LOCATION_MISSING);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && IMPLEMENTATION_XQUERY_QNAME.equals(reader.getName())) {
- break;
- }
- } // end while
-
- return xqueryImplementation;
- }
-
- public void write(XQueryImplementation xqueryImplementation, XMLStreamWriter writer)
- throws ContributionWriteException, XMLStreamException {
-
- writer.writeStartElement(Constants.SCA10_TUSCANY_NS, IMPLEMENTATION_XQUERY);
- if (xqueryImplementation.getLocation() != null) {
- writer.writeAttribute(LOCATION, xqueryImplementation.getLocation());
- }
- writer.writeEndElement();
-
- }
-
- public Class<XQueryImplementation> getModelType() {
- return XQueryImplementation.class;
- }
-
- /**
- * Resolves the implementation: its services and references, by invoking the XQuery
- * introspector
- */
- public void resolve(XQueryImplementation xqueryImplementation, ModelResolver resolver)
- throws ContributionResolveException {
-
- if (xqueryImplementation != null) {
- Artifact artifact = contributionFactory.createArtifact();
- artifact.setURI(xqueryImplementation.getLocation());
- artifact = resolver.resolveModel(Artifact.class, artifact);
- if (artifact.getLocation() != null) {
- xqueryImplementation.setLocationURL(artifact.getLocation());
-
- XQueryIntrospector introspector = new XQueryIntrospector(assemblyFactory, javaFactory);
-
- boolean success = introspector.introspect(xqueryImplementation, resolver);
- if (success) {
- xqueryImplementation.setUnresolved(false);
- }
- } else {
- error("CouldNotLocateFile", resolver, xqueryImplementation.getLocation());
- //throw new ContributionResolveException("Could not locate file: " + xqueryImplementation.getLocation());
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryIntrospector.java b/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryIntrospector.java
deleted file mode 100644
index 6f18e518bd..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryIntrospector.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.xquery.xml;
-
-import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import net.sf.saxon.Configuration;
-import net.sf.saxon.om.NamespaceResolver;
-import net.sf.saxon.query.StaticQueryContext;
-import net.sf.saxon.query.XQueryExpression;
-import net.sf.saxon.trans.XPathException;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.implementation.xquery.XQueryImplementation;
-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;
-
-/**
- * This class introspects an XQuery file and extracts out of it
- * all implemented service, references and properties
- * It also creates expression extensions for each operation
- * in the implemented services
- * @version $Rev$ $Date$
- */
-public class XQueryIntrospector {
-
- private static final String SCA_SERVICE_PREFIX = "scaservice:java/";
- private static final String SCA_REFERENCE_PREFIX = "scareference:java/";
- private static final String SCA_PROPERTY_JAVA_PREFIX = "scaproperty:java/";
- private static final String SCA_PROPERTY_XML_PREFIX = "scaproperty:xml/";
-
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
-
- public XQueryIntrospector(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory) {
- super();
- this.assemblyFactory = assemblyFactory;
- this.javaFactory = javaFactory;
- }
-
- public boolean introspect(XQueryImplementation xqueryImplementation, ModelResolver resolver) throws ContributionResolveException {
-
- String xqExpression = null;
- try {
- URL url = new URL(xqueryImplementation.getLocationURL());
- xqExpression = loadXQExpression(url);
- } catch (FileNotFoundException e) {
- throw new ContributionResolveException(e);
- } catch (IOException e) {
- throw new ContributionResolveException(e);
- }
-
- if (xqExpression == null) {
- return false;
- }
-
- xqueryImplementation.setXqExpression(xqExpression);
-
- xqExpression += "\r\n<dummy></dummy>";
-
- Configuration config = new Configuration();
- StaticQueryContext sqc = new StaticQueryContext(config);
- XQueryExpression exp = null;
- try {
- exp = sqc.compileQuery(xqExpression);
- } catch (XPathException e) {
- throw new ContributionResolveException(e);
- }
-
- if (exp == null) {
- return false;
- }
- xqueryImplementation.getCompiledExpressionsCache().put(xqExpression, exp);
-
- try {
- introspectServicesAndReferences(xqueryImplementation, exp, resolver);
- } catch (ClassNotFoundException e) {
- throw new ContributionResolveException(e);
- } catch (InvalidInterfaceException e) {
- throw new ContributionResolveException(e);
- }
-
- fillExpressionExtensions(xqueryImplementation);
-
- return true;
- }
-
- /**
- * Loads the XQuery expression from the location that is provided with the implementation
- */
- private String loadXQExpression(URL locationURL) throws FileNotFoundException, IOException {
-
- InputStream xqResourceStream = locationURL.openStream();
-
- if (xqResourceStream == null) {
- return null;
- }
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- int i = 0;
- while ((i = xqResourceStream.read()) >= 0) {
- baos.write(i);
- }
- xqResourceStream.close();
- baos.flush();
- baos.close();
-
- String xqExpression = baos.toString();
-
- return xqExpression;
- }
-
- private Class<?> resolveClass(ModelResolver resolver, String className) throws ClassNotFoundException {
- ClassReference classReference = new ClassReference(className);
- classReference = resolver.resolveModel(ClassReference.class, classReference);
- Class<?> javaClass = classReference.getJavaClass();
- if (javaClass == null) {
- throw new ClassNotFoundException(className);
- } else {
- return javaClass;
- }
- }
-
- /**
- * From the compiled XQuery expression get all namespaces and see if they
- * are services, references or properties declarations
- */
- private void introspectServicesAndReferences(XQueryImplementation xqueryImplementation, XQueryExpression exp, ModelResolver resolver)
- throws ClassNotFoundException, InvalidInterfaceException {
- NamespaceResolver namespaceResolver = exp.getStaticContext().getNamespaceResolver();
- Iterator declaredPrefixesIterator = namespaceResolver.iteratePrefixes();
- while (declaredPrefixesIterator.hasNext()) {
- String prefix = (String)declaredPrefixesIterator.next();
- String uri = namespaceResolver.getURIForPrefix(prefix, false);
- if (uri.startsWith(SCA_SERVICE_PREFIX)) {
- String serviceName = prefix;
- String className = uri.substring(SCA_SERVICE_PREFIX.length());
- Class<?> interfaze = resolveClass(resolver, className);
- Service theService = createService(interfaze, serviceName);
- xqueryImplementation.getServices().add(theService);
- } else if (uri.startsWith(SCA_REFERENCE_PREFIX)) {
- String referenceName = prefix;
- String className = uri.substring(SCA_REFERENCE_PREFIX.length());
- Class<?> interfaze = resolveClass(resolver, className);
- Reference theReference = createReference(interfaze, referenceName);
- xqueryImplementation.getReferences().add(theReference);
- } else if (uri.startsWith(SCA_PROPERTY_JAVA_PREFIX)) {
- String propertyName = prefix;
- String className = uri.substring(SCA_PROPERTY_JAVA_PREFIX.length());
- Class<?> clazz = resolveClass(resolver, className);
- QName xmlType = JavaXMLMapper.getXMLType(clazz);
- Property theProperty = createProperty(xmlType, propertyName);
- xqueryImplementation.getProperties().add(theProperty);
- } else if (uri.startsWith(SCA_PROPERTY_XML_PREFIX)) {
- String propertyName = prefix;
- String namespaceAndLocalname = uri.substring(SCA_PROPERTY_XML_PREFIX.length());
- int localNameDelimiterPostition = namespaceAndLocalname.lastIndexOf(':');
- String localName = null;
- String namespace = null;
- if (localNameDelimiterPostition < 0) {
- localName = namespaceAndLocalname;
- namespace = "";
- } else {
- namespace = namespaceAndLocalname.substring(0, localNameDelimiterPostition);
- localName = namespaceAndLocalname.substring(localNameDelimiterPostition + 1);
- }
- QName xmlType = new QName(namespace, localName);
- Property theProperty = createProperty(xmlType, propertyName);
- xqueryImplementation.getProperties().add(theProperty);
- }
- }
- }
-
- /**
- * Creates a Service for the component type based on its name and Java interface
- */
- private Service createService(Class<?> interfaze, String name) throws InvalidInterfaceException {
- Service service = assemblyFactory.createService();
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- service.setInterfaceContract(interfaceContract);
-
- // Set the name for the service
- service.setName(name);
-
- // Set the call interface and, if present, the callback interface
- JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
- //setDataBindingForInterface(callInterface, DataObject.class.getName());
- service.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
- //setDataBindingForInterface(callbackInterface, DataObject.class.getName());
- service.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
- return service;
- } // end method createService
-
- protected Property createProperty(QName type, String name) {
-
- Property property = assemblyFactory.createProperty();
- property.setName(name);
- property.setXSDType(type);
-
- property.setMany(false);
- return property;
-
- }
-
- /**
- * Creates a Reference for the component type based on its name and Java interface
- */
- private Reference createReference(Class<?> interfaze, String name) throws InvalidInterfaceException {
- Reference reference = assemblyFactory.createReference();
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- reference.setInterfaceContract(interfaceContract);
-
- // Set the name of the reference to the supplied name and the multiplicity of the reference
- // to 1..1 - for XQuery implementations, this is the only multiplicity supported
- reference.setName(name);
- reference.setMultiplicity(Multiplicity.ONE_ONE);
-
- // Set the call interface and, if present, the callback interface
- JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
- reference.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
- reference.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
-
- return reference;
- }
-
- /**
- * For the methods of each implemented service corresponding expression extension
- * is generated
- * @param xqueryImplementation
- */
- private void fillExpressionExtensions(XQueryImplementation xqueryImplementation) {
- for (Service service : xqueryImplementation.getServices()) {
- Class<?> interfaze = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
-
- // For each of the methods
- for (Method method : interfaze.getMethods()) {
- String expressionExtension = createExpressionExtension(method, interfaze, service.getName());
- xqueryImplementation.getXqExpressionExtensionsMap().put(method, expressionExtension);
- }
- }
- }
-
- private String createExpressionExtension(Method method, Class<?> interfaze, String serviceName) {
- StringBuffer exprBuf = new StringBuffer();
-
- exprBuf.append("\r\n");
-
- String methodName = method.getName();
-
- // For each of the declared parameters
- for (int i = 0; i < method.getParameterTypes().length; i++) {
- exprBuf.append("declare variable $" + methodName + "_" + i + " external;\r\n");
- }
-
- exprBuf.append(serviceName + ":" + methodName + "(");
-
- for (int i = 0; i < method.getParameterTypes().length; i++) {
- exprBuf.append("$" + methodName + "_" + i);
- if (i != method.getParameterTypes().length - 1) {
- exprBuf.append(", ");
- }
- }
- exprBuf.append(")");
-
- return exprBuf.toString();
- }
-}
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/implementation-xquery/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index a51995e56d..0000000000
--- a/branches/sca-android/modules/implementation-xquery/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.xquery.xml.XQueryImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.xquery,model=org.apache.tuscany.sca.implementation.xquery.XQueryImplementation
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-android/modules/implementation-xquery/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index 7ccc08d1ee..0000000000
--- a/branches/sca-android/modules/implementation-xquery/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.xquery.XQueryImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.xquery.XQueryImplementation
diff --git a/branches/sca-android/modules/implementation-xquery/src/main/resources/impl-xquery-validation-messages.properties b/branches/sca-android/modules/implementation-xquery/src/main/resources/impl-xquery-validation-messages.properties
deleted file mode 100644
index 33c605de27..0000000000
--- a/branches/sca-android/modules/implementation-xquery/src/main/resources/impl-xquery-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.
-#
-#
-CouldNotLocateFile = Could not locate file: {0}
-LocationAttributeMissing = Reading implementation.xquery - location attribute missing \ No newline at end of file
diff --git a/branches/sca-android/modules/interface-java-jaxws/LICENSE b/branches/sca-android/modules/interface-java-jaxws/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/META-INF/README b/branches/sca-android/modules/interface-java-jaxws/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/interface-java-jaxws/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/interface-java-jaxws/NOTICE b/branches/sca-android/modules/interface-java-jaxws/NOTICE
deleted file mode 100644
index 94481d6cfa..0000000000
--- a/branches/sca-android/modules/interface-java-jaxws/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2007 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/branches/sca-android/modules/interface-java-jaxws/pom.xml b/branches/sca-android/modules/interface-java-jaxws/pom.xml
deleted file mode 100644
index 1a738e0f16..0000000000
--- a/branches/sca-android/modules/interface-java-jaxws/pom.xml
+++ /dev/null
@@ -1,274 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-interface-java-jaxws</artifactId>
- <name>Apache Tuscany Java Interface for JAXWS</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</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-all</artifactId>
- <version>3.1</version>
- <scope>compile</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.9</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>
- -->
-
- <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.interface.java.jaxws</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.interfacedef.java.jaxws*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>default-tools.jar</id>
- <activation>
- <property>
- <name>java.vendor</name>
- <value>Sun Microsystems Inc.</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>com.sun</groupId>
- <artifactId>tools</artifactId>
- <version>1.5.0</version>
- <scope>system</scope>
- <systemPath>${java.home}/../lib/tools.jar</systemPath>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
-</project>
diff --git a/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java b/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java
deleted file mode 100644
index 4cf56fed0c..0000000000
--- a/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.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.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) {
- 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/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/XmlJavaTypeAdapter;", true);
- ada.visit("value", ((XmlJavaTypeAdapter)ann).value());
- ada.visit("type", ((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/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java b/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java
deleted file mode 100644
index b05715b54e..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGenerator.java b/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGenerator.java
deleted file mode 100644
index 40fbefa3ed..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedClassLoader.java b/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedClassLoader.java
deleted file mode 100644
index f36dd3a443..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedDataTypeImpl.java b/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedDataTypeImpl.java
deleted file mode 100644
index c3f568ef48..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java b/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java
deleted file mode 100644
index 75a0aa8131..0000000000
--- a/branches/sca-android/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.osoa.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/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
deleted file mode 100644
index d1b36fa17c..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java b/branches/sca-android/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java
deleted file mode 100644
index 764c10ff00..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java
deleted file mode 100644
index 1b07e25bad..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java
deleted file mode 100644
index d38a21ba52..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java
deleted file mode 100644
index 7b9375063d..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java
deleted file mode 100644
index 567591f166..0000000000
--- a/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.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;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.annotation.Annotation;
-
-import javax.xml.bind.JAXBContext;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.util.CheckClassAdapter;
-
-/**
- * @version $Rev$ $Date$
- */
-public class FaultBeanGeneratorTestCase extends TestCase {
- 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);
- }
-
- 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/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java
deleted file mode 100644
index 108d283584..0000000000
--- a/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.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.java.jaxws;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-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 com.example.stock.StockExceptionTest;
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JAXWSJavaInterfaceProcessorTestCase extends TestCase {
- private JAXWSJavaInterfaceProcessor interfaceProcessor;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- DataBindingExtensionPoint db = new DefaultDataBindingExtensionPoint();
- XMLAdapterExtensionPoint xa = new DefaultXMLAdapterExtensionPoint();
- interfaceProcessor = new JAXWSJavaInterfaceProcessor(db, new JAXWSFaultExceptionMapper(db, xa), xa);
- }
-
- 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)}.
- */
- 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/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java
deleted file mode 100644
index b3c7102a78..0000000000
--- a/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.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.interfacedef.java.jaxws;
-
-import java.lang.reflect.Field;
-
-import junit.framework.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/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java
deleted file mode 100644
index 4df0517de6..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java
deleted file mode 100644
index 78527193d5..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java
deleted file mode 100644
index 2ecf822904..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java
deleted file mode 100644
index a6a3375eff..0000000000
--- a/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.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.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.ws.Holder;
-
-import org.osoa.sca.annotations.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);
-}
diff --git a/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java b/branches/sca-android/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java
deleted file mode 100644
index b14ef19939..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl b/branches/sca-android/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl
deleted file mode 100644
index 882408ade6..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl b/branches/sca-android/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl
deleted file mode 100644
index 4fee9e9756..0000000000
--- a/branches/sca-android/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>
- <!-- 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" />
-
- </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/branches/sca-android/modules/interface-wsdl-xml/LICENSE b/branches/sca-android/modules/interface-wsdl-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/META-INF/README b/branches/sca-android/modules/interface-wsdl-xml/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/interface-wsdl-xml/NOTICE b/branches/sca-android/modules/interface-wsdl-xml/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/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/branches/sca-android/modules/interface-wsdl-xml/pom.xml b/branches/sca-android/modules/interface-wsdl-xml/pom.xml
deleted file mode 100644
index 62b224c586..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/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.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>1.4-SNAPSHOT</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.interface.wsdl.xml</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.interfacedef.wsdl.xml*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java b/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java
deleted file mode 100644
index 13203d4adc..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.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.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.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/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELPartnerLinkTypeExt.java b/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELPartnerLinkTypeExt.java
deleted file mode 100644
index 67124832f3..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/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.xml;
-
-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/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java b/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java
deleted file mode 100644
index f9ddda6d98..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.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.xml;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-
-/**
- * Constants for WSDL.
- *
- * @version $Rev$ $Date$
- */
-public interface WSDLConstants {
-
- String INTERFACE_WSDL = "interface.wsdl";
- QName INTERFACE_WSDL_QNAME = new QName(Constants.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/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java b/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
deleted file mode 100644
index 6302913c25..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.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.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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-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.XSDefinition;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-
-/**
- * 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(ModelFactoryExtensionPoint 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 = new ProblemImpl(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/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java b/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
deleted file mode 100644
index e04a4d6743..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.wsdl.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(ModelFactoryExtensionPoint 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 = new ProblemImpl(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 = new ProblemImpl(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 = new ProblemImpl(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(Constants.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/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java b/branches/sca-android/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
deleted file mode 100644
index 9c23458743..0000000000
--- a/branches/sca-android/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.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionRuntimeException;
-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, ModelFactoryExtensionPoint 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/branches/sca-android/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/main/resources/interface-wsdlxml-validation-messages.properties b/branches/sca-android/modules/interface-wsdl-xml/src/main/resources/interface-wsdlxml-validation-messages.properties
deleted file mode 100644
index 2f8c3e0500..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java b/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java
deleted file mode 100644
index f0228edb1f..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.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.wsdl;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.xsd.XSDFactory;
-
-/**
- * Test case for WSDLOperation.
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractWSDLTestCase extends TestCase {
- protected URLArtifactProcessor<Object> documentProcessor;
- protected ModelResolver resolver;
- protected WSDLFactory wsdlFactory;
- protected XSDFactory xsdFactory;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.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/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
deleted file mode 100644
index dc7e1ced38..0000000000
--- a/branches/sca-android/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 junit.framework.Assert;
-
-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.AbstractWSDLTestCase;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-
-/**
- * Test case for InterfaceWSDLIntrospectorImpl.
- *
- * @version $Rev$ $Date$
- */
-public class WSDLInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
- private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
-
- private PortType portType;
- private WSDLDefinition definition;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected 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);
- }
-
- @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/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
deleted file mode 100644
index c392b92f8a..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.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.interfacedef.wsdl.introspect;
-
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.Operation;
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-
-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.AbstractWSDLTestCase;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLOperationIntrospectorImpl;
-
-/**
- * Test case for WSDLOperation.
- *
- * @version $Rev$ $Date$
- */
-public class WSDLOperationIntrospectorTestCase extends AbstractWSDLTestCase {
- private static final QName PORTTYPE_NAME =
- new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
-
-
- @SuppressWarnings("unchecked")
- 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);
- Operation operation = portType.getOperation("getLastTradePrice", null, null);
-
- WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(xsdFactory, operation, definition, "org.w3c.dom.Node", resolver);
-
- 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().getWrapperInfo().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().getWrapperInfo().getUnwrappedOutputType();
- Assert.assertEquals(new QName(null, "price"), childType.getLogical().getElementName());
- }
-
- 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);
-
- Operation operation = portType.getOperation("getLastTradePrice1", null, null);
- WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(xsdFactory, operation, definition, "org.w3c.dom.Node", resolver);
- Assert.assertFalse(op.isWrapperStyle());
- Assert.assertEquals(1, op.getInputType().getLogical().size());
-
- operation = portType.getOperation("getLastTradePrice2", null, null);
- op = new WSDLOperationIntrospectorImpl(xsdFactory, operation, definition, "org.w3c.dom.Node", resolver);
- Assert.assertFalse(op.isWrapperStyle());
- Assert.assertEquals(2, op.getInputType().getLogical().size());
- }
-
- 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);
-
- Operation operation = portType.getOperation("getLastTradePrice", null, null);
- WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(xsdFactory, operation, definition, "org.w3c.dom.Node", resolver);
-
- try {
- op.isWrapperStyle();
- fail("InvalidWSDLException should have been thrown");
- } catch (InvalidInterfaceException e) {
- // Expected
- }
-
- }
-
-}
diff --git a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java b/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
deleted file mode 100644
index cf379a1b11..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.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.wsdl.introspect;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-
-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.AbstractWSDLTestCase;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.policy.Intent;
-
-/**
- * Test case for InterfaceWSDLIntrospectorImpl.
- *
- * @version $Rev$ $Date$
- */
-public class WSDLPolicyAnnotatedInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
- private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
- private static final QName INTENT = new QName("http://example.com/stockquote.wsdl", "PolicyIntent");
-
- private PortType portType;
- private WSDLDefinition definition;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected 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);
- }
-
- @SuppressWarnings("unchecked")
- 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/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java b/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
deleted file mode 100644
index ff18c65c69..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.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.introspect;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.wsdl.Operation;
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLOperationIntrospectorImpl;
-
-/**
- * Test case for WSDLOperation.
- *
- * @version $Rev$ $Date$
- */
-public class WrapperStyleOperationTestCase extends AbstractWSDLTestCase {
- private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
-
- 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);
- Operation operation = portType.getOperation("getLastTradePrice", null, null);
- WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(xsdFactory, operation, definition, "org.w3c.dom.Node", resolver);
- Assert.assertTrue(op.isWrapperStyle());
- Assert.assertEquals(1, op.getWrapper().getInputChildElements().size());
- Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size());
- }
-
- 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);
- Operation operation = portType.getOperation("getLastTradePrice1", null, null);
- WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(xsdFactory, operation, definition, "org.w3c.dom.Node", resolver);
- Assert.assertFalse(op.isWrapperStyle());
- operation = portType.getOperation("getLastTradePrice2", null, null);
- op = new WSDLOperationIntrospectorImpl(xsdFactory, operation, definition, "org.w3c.dom.Node", resolver);
- Assert.assertFalse(op.isWrapperStyle());
- }
-
-}
diff --git a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java b/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
deleted file mode 100644
index f23b0d2b59..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/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.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.UtilityExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-
-/**
- * Test reading WSDL interfaces.
- *
- * @version $Rev$ $Date$
- */
-public class ReadTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private CompositeBuilder compositeBuilder;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
- IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, mapper, null);
- }
-
- public void testReadComponentType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- ComponentType componentType = (ComponentType)staxProcessor.read(reader);
- assertNotNull(componentType);
- }
-
- public void testReadConstrainingType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- ConstrainingType constrainingType = (ConstrainingType)staxProcessor.read(reader);
- assertNotNull(constrainingType);
- }
-
- 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);
- }
-
-}
diff --git a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java b/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
deleted file mode 100644
index 2d3a3a54ff..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.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.xml;
-
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.Import;
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WSDLDocumentProcessorTestCase extends AbstractWSDLTestCase {
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
- /**
- * @throws java.lang.Exception
- */
- @After
- @Override
- public void tearDown() throws Exception {
- }
-
- @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/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java b/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java
deleted file mode 100644
index c27a1dbd70..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.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.interfacedef.wsdl.xml;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.interfacedef.wsdl.WSDLDefinition;
-
-/**
- * Test reading WSDL interfaces.
- *
- * @version $Rev$ $Date$
- */
-public class WSDLTestCase extends TestCase {
-
- private ExtensibleURLArtifactProcessor documentProcessor;
- private WSDLModelResolver wsdlResolver;
-
- @Override
- public void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
-
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- wsdlResolver = new WSDLModelResolver(null, modelFactories);
- }
-
- 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");
- }
-
- 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));
- }
-
- 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/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java b/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java
deleted file mode 100644
index 6448291f41..0000000000
--- a/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.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.xml;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.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;
-
-/**
- * Test reading/write WSDL interfaces.
- *
- * @version $Rev$ $Date$
- */
-public class WriteTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- }
-
- public void 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));
- }
-
- 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));
- }
-
- 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/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java b/branches/sca-android/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java
deleted file mode 100644
index eb276a1908..0000000000
--- a/branches/sca-android/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 junit.framework.Assert;
-
-import org.apache.tuscany.sca.xsd.xml.XMLDocumentHelper;
-
-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");
- Assert.assertEquals("http://helloworld", tns);
- }
-
-}
diff --git a/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite
deleted file mode 100644
index 875fdf35d2..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType
deleted file mode 100644
index 3eb81b61bd..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType
deleted file mode 100644
index aea7046a3d..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl
deleted file mode 100644
index 5e8e5dad0d..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd
deleted file mode 100644
index 241ec15d36..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl
deleted file mode 100644
index 39cd5547d9..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl
deleted file mode 100644
index 8e26f7b4b5..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd
deleted file mode 100644
index c2210f4a94..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl
deleted file mode 100644
index 529b395fd5..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/policy/stockquote_policy.wsdl b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/policy/stockquote_policy.wsdl
deleted file mode 100644
index 7cdf801692..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl
deleted file mode 100644
index b0b6644e7f..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl
deleted file mode 100644
index 0a7979e308..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd
deleted file mode 100644
index 635ca25bfc..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd
deleted file mode 100644
index bb0c9bc7b7..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd b/branches/sca-android/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd
deleted file mode 100644
index 300de931ec..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/LICENSE b/branches/sca-android/modules/interface-wsdl/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/META-INF/README b/branches/sca-android/modules/interface-wsdl/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/interface-wsdl/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/interface-wsdl/NOTICE b/branches/sca-android/modules/interface-wsdl/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/interface-wsdl/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/branches/sca-android/modules/interface-wsdl/pom.xml b/branches/sca-android/modules/interface-wsdl/pom.xml
deleted file mode 100644
index 4d39d9e6f7..0000000000
--- a/branches/sca-android/modules/interface-wsdl/pom.xml
+++ /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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- <version>1.3.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>
-
-
- <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.interface.wsdl</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.interfacedef.wsdl*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java
deleted file mode 100644
index 2a5dd07d08..0000000000
--- a/branches/sca-android/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.contribution.ModelFactoryExtensionPoint;
-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(ModelFactoryExtensionPoint modelFactories) {
- super(modelFactories);
- }
-
-}
diff --git a/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLDefinition.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLDefinition.java
deleted file mode 100644
index 039e75f437..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLFactory.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLFactory.java
deleted file mode 100644
index 95985dcc28..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java
deleted file mode 100644
index c0da060af2..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterfaceContract.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterfaceContract.java
deleted file mode 100644
index 59db17116b..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLObject.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLObject.java
deleted file mode 100644
index 0b707163da..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLOperation.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLOperation.java
deleted file mode 100644
index d73cccb714..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/InvalidWSDLException.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/InvalidWSDLException.java
deleted file mode 100644
index 1e7b4faa32..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java
deleted file mode 100644
index 16e9cf43f3..0000000000
--- a/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 static org.apache.tuscany.sca.xsd.impl.XSDefinitionImpl.getXmlSchemaObject;
-
-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.XmlSchema;
-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();
- }
- XmlSchema schema = xsd.getSchema();
- XmlSchemaElement element = getXmlSchemaObject(schema, name, XmlSchemaElement.class);
- 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();
- }
- XmlSchema schema = xsd.getSchema();
- XmlSchemaType type = getXmlSchemaObject(schema, name, XmlSchemaType.class);
- 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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java
deleted file mode 100644
index 1f2263e1c9..0000000000
--- a/branches/sca-android/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.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-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(ModelFactoryExtensionPoint 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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceContractImpl.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceContractImpl.java
deleted file mode 100644
index e10bc0d178..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
deleted file mode 100644
index 3719bbd79a..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
deleted file mode 100644
index 18fce72f90..0000000000
--- a/branches/sca-android/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.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-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(ModelFactoryExtensionPoint 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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLObjectImpl.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLObjectImpl.java
deleted file mode 100644
index f18eaef27b..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationImpl.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationImpl.java
deleted file mode 100644
index 317b9cce81..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java b/branches/sca-android/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
deleted file mode 100644
index ab6467bfd7..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/interface-wsdl/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory b/branches/sca-android/modules/interface-wsdl/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory
deleted file mode 100644
index c11d22d7b2..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/monitor-logging/LICENSE b/branches/sca-android/modules/monitor-logging/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/monitor-logging/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/monitor-logging/META-INF/README b/branches/sca-android/modules/monitor-logging/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/monitor-logging/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/monitor-logging/NOTICE b/branches/sca-android/modules/monitor-logging/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/monitor-logging/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/branches/sca-android/modules/monitor-logging/pom.xml b/branches/sca-android/modules/monitor-logging/pom.xml
deleted file mode 100644
index 32dd2fc235..0000000000
--- a/branches/sca-android/modules/monitor-logging/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-monitor-logging</artifactId>
- <name>Apache Tuscany SCA Monitor Default Logging Implementation</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-monitor</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.monitor.logging</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.monitor*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/DefaultLoggingMonitorImpl.java b/branches/sca-android/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/DefaultLoggingMonitorImpl.java
deleted file mode 100644
index 8a9701b8fc..0000000000
--- a/branches/sca-android/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/DefaultLoggingMonitorImpl.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.monitor.logging.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 DefaultLoggingMonitorImpl implements Monitor {
- private static final Logger logger = Logger.getLogger(DefaultLoggingMonitorImpl.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 getLastLoggedProblem() {
- if (problemCache.isEmpty()) {
- return null;
- }
- return problemCache.get(problemCache.size() - 1);
- }
-
- public boolean isMessageLogged(String messageId) {
- for (Problem problem : problemCache){
- if (problem.getMessageId().equals(messageId)){
- return true;
- }
- }
-
- return false;
- }
-
- public Problem getProblem(String messageId) {
- for (Problem problem : problemCache){
- if (problem.getMessageId().equals(messageId)){
- return problem;
- }
- }
-
- return null;
- }
-}
diff --git a/branches/sca-android/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/MonitorFactoryImpl.java b/branches/sca-android/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/MonitorFactoryImpl.java
deleted file mode 100644
index a3162a3267..0000000000
--- a/branches/sca-android/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/MonitorFactoryImpl.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.logging.impl;
-
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-
-
-/**
- * A factory for creating validation monitors
- *
- * @version $Rev$ $Date$
- */
-public class MonitorFactoryImpl implements MonitorFactory {
-
- private Monitor monitor = null;
-
- public Monitor createMonitor() {
- if (monitor == null){
- monitor = new DefaultLoggingMonitorImpl();
- }
- return monitor ;
- }
-}
diff --git a/branches/sca-android/modules/monitor-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.monitor.MonitorFactory b/branches/sca-android/modules/monitor-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.monitor.MonitorFactory
deleted file mode 100644
index b46d552fb5..0000000000
--- a/branches/sca-android/modules/monitor-logging/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.logging.impl.MonitorFactoryImpl
diff --git a/branches/sca-android/modules/monitor-logging/src/test/java/org/apache/tuscany/sca/monitor/MonitorTestCase.java b/branches/sca-android/modules/monitor-logging/src/test/java/org/apache/tuscany/sca/monitor/MonitorTestCase.java
deleted file mode 100644
index c5fa6c4da6..0000000000
--- a/branches/sca-android/modules/monitor-logging/src/test/java/org/apache/tuscany/sca/monitor/MonitorTestCase.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.monitor;
-
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.monitor.logging.impl.MonitorFactoryImpl;
-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 MonitorFactoryImpl();
- }
-
- @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 = new ProblemImpl(this.getClass().getName(),
- "tuscany-monitor-test-messages",
- Severity.WARNING,
- dummyModelObject,
- "MESSAGE1" );
- monitor.problem(problem);
-
- String param = "Some Parameter";
-
- problem = new ProblemImpl(this.getClass().getName(),
- "tuscany-monitor-test-messages",
- Severity.WARNING,
- dummyModelObject,
- "MESSAGE2",
- param);
- monitor.problem(problem);
-
- problem = new ProblemImpl(this.getClass().getName(),
- "tuscany-monitor-test-messages",
- Severity.WARNING,
- dummyModelObject,
- "MESSAGE3",
- 8,
- 9,
- 4);
- monitor.problem(problem);
-
- Exception ex = new IllegalStateException("TEST_MESSAGE");
-
- problem = new ProblemImpl(this.getClass().getName(),
- "tuscany-monitor-test-messages",
- Severity.ERROR,
- dummyModelObject,
- "MESSAGE4",
- ex);
- monitor.problem(problem);
-
- }
-}
diff --git a/branches/sca-android/modules/monitor-logging/src/test/resources/tuscany-monitor-test-messages.properties b/branches/sca-android/modules/monitor-logging/src/test/resources/tuscany-monitor-test-messages.properties
deleted file mode 100644
index 523263da40..0000000000
--- a/branches/sca-android/modules/monitor-logging/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/branches/sca-android/modules/monitor-logging/src/test/resources/tuscany-monitor-test-messages_it.properties b/branches/sca-android/modules/monitor-logging/src/test/resources/tuscany-monitor-test-messages_it.properties
deleted file mode 100644
index 523263da40..0000000000
--- a/branches/sca-android/modules/monitor-logging/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/branches/sca-android/modules/node-launcher-equinox/LICENSE b/branches/sca-android/modules/node-launcher-equinox/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/node-launcher-equinox/META-INF/README b/branches/sca-android/modules/node-launcher-equinox/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/node-launcher-equinox/NOTICE b/branches/sca-android/modules/node-launcher-equinox/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/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/branches/sca-android/modules/node-launcher-equinox/pom.xml b/branches/sca-android/modules/node-launcher-equinox/pom.xml
deleted file mode 100644
index 4459ec0038..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/pom.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</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> <!-- To be compatible with Jetty 6 -->
- <scope>provided</scope>
- </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>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility-equinox</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-domain-manager</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-http-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</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>
- </manifest>
- </archive>
- </configuration>
- </plugin>
-
- <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.node.launcher.equinox</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.node.equinox.launcher*</Export-Package>
- <Eclipse-AutoStart>true</Eclipse-AutoStart>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/Contribution.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/Contribution.java
deleted file mode 100644
index 892412b395..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/DomainManagerLauncher.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/DomainManagerLauncher.java
deleted file mode 100644
index 61187eecac..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/DomainManagerLauncher.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.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;
- }
-
- public void run() {
- try {
- stopDomainManager(domainManager);
- } catch (Exception e) {
- // Ignore
- }
- try {
- equinox.stop();
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java
deleted file mode 100644
index 6efdcb0da5..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.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.node.equinox.launcher;
-
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.bundleLocation;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.string;
-import static org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-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;
-
-/**
- * Wraps the Equinox runtime.
- */
-public class EquinoxHost {
- private static Logger logger = Logger.getLogger(EquinoxHost.class.getName());
-
- private BundleContext bundleContext;
- private Bundle launcherBundle;
- private EquinoxLauncherBundleHelper launcherActivator;
-
- 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 {
- // Configure Eclipse properties
- Map<Object, Object> props = new HashMap<Object, Object>();
-
- // Set system packages
- props.put("org.osgi.framework.system.packages", systemPackages);
-
- // Use the boot classloader as the parent classloader
- props.put("osgi.contextClassLoaderParent", "boot");
-
- // Set startup properties
- props.put(EclipseStarter.PROP_CLEAN, "true");
-
- if (logger.isLoggable(Level.FINE)) {
- props.put("osgi.console", "8085");
- }
-
- // Set location properties
- // FIXME Use proper locations
- props.put(LocationManager.PROP_INSTANCE_AREA, new File("target/workspace").toURI().toString());
- props.put(LocationManager.PROP_INSTALL_AREA, new File("target/eclipse/install").toURI().toString());
- props.put(LocationManager.PROP_CONFIG_AREA, new File("target/eclipse/config").toURI().toString());
- props.put(LocationManager.PROP_USER_AREA, new File("target/eclipse/user").toURI().toString());
-
- // Find the Tuscany JARs
- File tuscanyInstallDir = findTuscanyInstallDir();
- List<URL> urls;
- if (tuscanyInstallDir != null) {
- urls = JarFileFinder.findJarFiles(tuscanyInstallDir, new JarFileFinder.StandAloneJARFileNameFilter());
- } else {
- urls = JarFileFinder.getClassPathEntries(JarFileFinder.class.getClassLoader(), false);
- }
-
- // Sort out which are bundles (and not already installed) and which are just
- // regular JARs
- StringBuffer bundleFiles = new StringBuffer();
- StringBuffer bundleNames = new StringBuffer();
- StringBuffer jarFiles = new StringBuffer();
- for (URL url : urls) {
- File file = NodeLauncherUtil.file(url);
- String bundleName = getBundleName(file);
- if (bundleName != null) {
- bundleFiles.append(url.toString() + ";");
- bundleNames.append(bundleName + ";");
- } else {
- if (file.isFile()) {
- jarFiles.append(url.toString() + ";");
- }
- }
- }
- props.put("org.apache.tuscany.sca.node.launcher.equinox.bundleFiles", bundleFiles.toString());
- props.put("org.apache.tuscany.sca.node.launcher.equinox.bundleNames", bundleNames.toString());
- props.put("org.apache.tuscany.sca.node.launcher.equinox.jarFiles", jarFiles.toString());
-
- EclipseStarter.setInitialProperties(props);
-
- // Start Eclipse
- bundleContext = EclipseStarter.startup(new String[]{}, null);
-
- // Install the launcher bundle
- String bundleLocation = bundleLocation();
- logger.info("Installing launcher bundle: " + bundleLocation);
- launcherBundle = bundleContext.installBundle(bundleLocation);
- logger.info("Starting bundle: " + string(launcherBundle, false));
- launcherBundle.start();
-
- // Manually call the LauncherBundleActivator for now
- launcherActivator = new EquinoxLauncherBundleHelper();
- launcherActivator.start(launcherBundle.getBundleContext());
-
- // Start all bundles for now to help diagnose any class loading issues
- long activateStart = System.currentTimeMillis();
- for (Bundle bundle: bundleContext.getBundles()) {
- if ((bundle.getState() & Bundle.ACTIVE) == 0) {
- logger.info("Starting bundle: " + string(bundle, false));
- try {
- bundle.start();
- } catch (Exception e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- logger.info("Bundle: " + string(bundle, false));
- }
- }
- logger.info("Tuscany bundles are started in " + (System.currentTimeMillis() - activateStart) + " ms.");
- return bundleContext;
-
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- public void stop() {
- try {
-
- // Uninstall the launcher bundle
- if (launcherActivator != null) {
- launcherActivator.stop(launcherBundle.getBundleContext());
- }
- if (launcherBundle != null) {
- logger.info("Uninstalling bundle: " + string(launcherBundle, false));
- launcherBundle.uninstall();
- }
-
- // Shutdown Eclipse
- EclipseStarter.shutdown();
-
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- private static File findTuscanyInstallDir() throws IOException {
- String tuscanyDirName = JarFileFinder.getProperty(JarFileFinder.TUSCANY_HOME);
- if (tuscanyDirName != null) {
- File tuscanyInstallDir = new File(tuscanyDirName);
- if (tuscanyInstallDir.exists() && tuscanyInstallDir.isDirectory())
- return tuscanyInstallDir;
- }
- return null;
- }
-
- /**
- * Returns the name of a bundle, or null if the given file is not a bundle.
- *
- * @param file
- * @return
- * @throws IOException
- */
- private static String getBundleName(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;
- }
-
-}
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxLauncherBundleHelper.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxLauncherBundleHelper.java
deleted file mode 100644
index 3f88bd89e9..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxLauncherBundleHelper.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-import static java.lang.System.currentTimeMillis;
-import static java.lang.System.getProperty;
-import static java.lang.System.setProperty;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.libraryBundle;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.string;
-
-import java.io.InputStream;
-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 org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.BundleListener;
-
-/**
- * Bundle activator which installs Tuscany modules into an OSGi runtime.
- *
- */
-public class EquinoxLauncherBundleHelper implements BundleListener {
- private static Logger logger = Logger.getLogger(EquinoxLauncherBundleHelper.class.getName());
-
- private List<Bundle> installedBundles = new ArrayList<Bundle>();
- private BundleContext bundleContext;
-
- public EquinoxLauncherBundleHelper() {
- super();
- }
-
- public void start(BundleContext bundleContext) throws Exception {
- this.bundleContext = bundleContext;
- this.bundleContext.addBundleListener(this);
-
- // Install the Tuscany bundles
- long start = currentTimeMillis();
-
- // FIXME: SDO bundles dont have the correct dependencies
- setProperty("commonj.sdo.impl.HelperProvider", "org.apache.tuscany.sdo.helper.HelperProviderImpl");
-
- // Get the list of JAR files to install
- String jarFilesProperty = getProperty("org.apache.tuscany.sca.node.launcher.equinox.jarFiles");
- String[] jarFiles = jarFilesProperty.split(";");
-
- // Create a single 'library' bundle for them
- long libraryStart = currentTimeMillis();
- InputStream library = libraryBundle(jarFiles);
- logger.info("Third-party library bundle generated in " + (currentTimeMillis() - libraryStart) + " ms.");
- libraryStart = currentTimeMillis();
- Bundle libraryBundle = bundleContext.installBundle("org.apache.tuscany.sca.node.launcher.equinox.libraries", library);
- logger.info("Third-party library bundle installed in " + (currentTimeMillis() - libraryStart) + " ms: " + string(libraryBundle, false));
- installedBundles.add(libraryBundle);
-
- // Get the set of already installed bundles
- Set<String> alreadyInstalledBundleNames = new HashSet<String>();
- for (Bundle bundle: bundleContext.getBundles()) {
- alreadyInstalledBundleNames.add(bundle.getSymbolicName());
- }
-
- // Get the list of bundle files and names to install
- String bundleFilesProperty = getProperty("org.apache.tuscany.sca.node.launcher.equinox.bundleFiles");
- String[] bundleFiles = bundleFilesProperty.split(";");
- String bundleNamesProperty = getProperty("org.apache.tuscany.sca.node.launcher.equinox.bundleNames");
- String[] bundleNames = bundleNamesProperty.split(";");
-
- // Install all the bundles that are not already installed
- for (int i =0, n = bundleFiles.length; i < n; i++) {
- String bundleFile = bundleFiles[i];
- String bundleName = bundleNames[i];
- if (!alreadyInstalledBundleNames.contains(bundleName)) {
- if (bundleName.contains("org.eclipse.jdt.junit")) {
- continue;
- }
- long installStart = currentTimeMillis();
- Bundle bundle = bundleContext.installBundle(bundleFile);
- logger.info("Bundle installed in " + (currentTimeMillis() - installStart) + " ms: " + string(bundle, false));
- installedBundles.add(bundle);
- }
- }
-
- long end = currentTimeMillis();
- logger.info("Tuscany bundles are installed in " + (end - start) + " ms.");
- }
-
- public void stop(BundleContext bundleContext) throws Exception {
-
- // 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.info("Uninstalling bundle: " + string(bundle, false));
- //}
- bundle.uninstall();
- } catch (Exception e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- }
- installedBundles.clear();
-
- this.bundleContext.removeBundleListener(this);
- this.bundleContext = null;
- }
-
- public void bundleChanged(BundleEvent event) {
- }
-
-}
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/JarFileFinder.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/JarFileFinder.java
deleted file mode 100644
index 0f595df758..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/JarFileFinder.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.file;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilenameFilter;
-import java.io.IOException;
-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.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.logging.Logger;
-
-/**
- *
- */
-public class JarFileFinder {
- /**
- * A file name filter used to filter JAR files.
- */
- static class StandAloneJARFileNameFilter implements FilenameFilter {
-
- public boolean accept(File dir, String name) {
- 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;
- }
-
- // 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.
- */
- static class WebAppJARFileNameFilter extends StandAloneJARFileNameFilter {
-
- 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;
- }
- }
-
- private static final Logger logger = Logger.getLogger(JarFileFinder.class.getName());
-
- static final String TUSCANY_HOME = "TUSCANY_HOME";
- private static final String TUSCANY_PATH = "TUSCANY_PATH";
-
- /**
- * Collect JAR files in the given directory
- * @param directory
- * @param urls
- * @param filter
- * @throws MalformedURLException
- */
- private static void collectJARFiles(File directory, List<URL> urls, FilenameFilter filter)
- throws MalformedURLException {
- String[] files = directory.list(filter);
- if (files != null) {
- URL directoryURL = new URL(directory.toURI().toString() + "/");
- int count = 0;
- for (String file : files) {
- URL url = new URL(directoryURL, file);
- urls.add(url);
- count++;
- }
- if (count != 0) {
- logger.fine("Runtime classpath: " + count
- + " JAR"
- + (count > 1 ? "s" : "")
- + " from "
- + directory.toString());
- }
- }
- }
-
- /**
- * 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,
- List<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);
-
- // 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);
- }
-
- // 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);
- }
- }
- }
-
- /**
- * Returns a ClassLoader for the Tuscany runtime JARs.
- *
- * @param parentClassLoader
- * @param filter
- *
- * @return
- */
- public static List<URL> findJarFiles(File root, FilenameFilter filter) throws FileNotFoundException,
- URISyntaxException, MalformedURLException {
-
- // Build list of runtime JARs
- Set<URL> jarDirectoryURLs = new HashSet<URL>();
- List<URL> jarURLs = new ArrayList<URL>();
-
- URL url = null;
- if (root != null) {
- url = root.toURI().toURL();
- } else {
- // First determine the path to the launcher class
- String resource = JarFileFinder.class.getName().replace('.', '/') + ".class";
- url = JarFileFinder.class.getClassLoader().getResource(resource);
- if (url == null) {
- throw new FileNotFoundException(resource);
- }
-
- url = getContainer(url, 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
- if (url != null && "file".equals(url.getProtocol())) {
-
- 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);
- collectJARFiles(jarDirectory, jarURLs, filter);
-
- File homeDirectory = jarDirectory.getParentFile();
- if (homeDirectory != null && homeDirectory.exists()) {
-
- // Collect JARs from the ../modules directory
- File modulesDirectory = new File(homeDirectory, "modules");
- URL modulesDirectoryURL = modulesDirectory.toURI().toURL();
- if (!jarDirectoryURLs.contains(modulesDirectoryURL) && modulesDirectory.exists()) {
- jarDirectoryURLs.add(modulesDirectoryURL);
- collectJARFiles(modulesDirectory, jarURLs, filter);
- }
-
- // Collect JARs from the ../lib directory
- File libDirectory = new File(homeDirectory, "lib");
- URL libDirectoryURL = libDirectory.toURI().toURL();
- if (!jarDirectoryURLs.contains(libDirectoryURL) && libDirectory.exists()) {
- jarDirectoryURLs.add(libDirectoryURL);
- collectJARFiles(libDirectory, 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 = getProperty(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 = getProperty(TUSCANY_PATH);
- if (ext != null && ext.length() != 0) {
- logger.fine(TUSCANY_PATH + ": " + ext);
- String separator = getProperty("path.separator");
- for (StringTokenizer tokens = new StringTokenizer(ext, separator); tokens.hasMoreTokens();) {
- collectJARFiles(tokens.nextToken(), jarDirectoryURLs, jarURLs, filter);
- }
- }
-
- return jarURLs;
-
- }
-
-
- /**
- * Returns contribution JARs available on the classpath.
- *
- * @return
- */
- static List<URL> getClassPathEntries(ClassLoader classLoader, boolean recursive) {
- Set<URL> entries = new HashSet<URL>();
- list(entries, classLoader, recursive);
- return new ArrayList<URL>(entries);
- }
-
- /**
- * Collect JARs on the classpath of a URLClassLoader
- * @param urls
- * @param cl
- */
- private static void list(Set<URL> urls, ClassLoader cl, boolean recursive) {
- if (cl == null) {
- return;
- }
-
- // 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);
- }
- }
- }
-
- // Collect JARs from the parent ClassLoader
- if (recursive) {
- list(urls, cl.getParent(), recursive);
- }
- }
-
-
- 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;
- }
- }
- });
- }
-
- private static URL getContainer(URL resourceURL, String resourceName) {
- URL root = null;
- // "jar:file://....../something.jar!/a/b/c/app.composite"
- try {
- String url = resourceURL.toExternalForm();
- String protocol = resourceURL.getProtocol();
- if ("file".equals(protocol)) {
- // directory contribution
- if (url.endsWith("/" + resourceName)) {
- final String location = url.substring(0, url.length() - resourceName.length() - 1);
- // workaround from evil URL/URI form Maven
- // contributionURL = FileHelper.toFile(new URL(location)).toURI().toURL();
- // Allow privileged access to open URL stream. Add FilePermission to added to
- // security policy file.
- try {
- root = AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {
- public URL run() throws IOException {
- return file(new URL(location)).toURI().toURL();
- }
- });
- } catch (PrivilegedActionException e) {
- throw (MalformedURLException)e.getException();
- }
- }
-
- } else if ("jar".equals(protocol)) {
- // jar contribution
- String location = url.substring(4, url.lastIndexOf("!/"));
- // workaround for evil URL/URI from Maven
- root = file(new URL(location)).toURI().toURL();
-
- } else if ("wsjar".equals(protocol)) {
- // See https://issues.apache.org/jira/browse/TUSCANY-2219
- // wsjar contribution
- String location = url.substring(6, url.lastIndexOf("!/"));
- // workaround for evil url/uri from maven
- root = file(new URL(location)).toURI().toURL();
-
- } else if (protocol != null && (protocol.equals("bundle") || protocol.equals("bundleresource"))) {
- root = new URL(resourceURL.getProtocol(), resourceURL.getHost(), resourceURL.getPort(), "/");
- }
- } catch (MalformedURLException mfe) {
- throw new IllegalArgumentException(mfe);
- }
- return root;
- }
-
-}
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherException.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherException.java
deleted file mode 100644
index b9bb70b5d7..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeDaemonLauncher.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeDaemonLauncher.java
deleted file mode 100644
index b77382d6a0..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeDaemonLauncher.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.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;
- }
-
- public void run() {
- try {
- stopNode(node);
- } catch (Exception e) {
- // Ignore
- }
- try {
- equinox.stop();
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
deleted file mode 100644
index f3bb8c04ae..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.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.node.equinox.launcher;
-
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node;
-
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.osgi.framework.BundleContext;
-
-/**
- * A launcher for SCA nodes.
- *
- * @version $Rev$ $Date$
- */
-public class NodeLauncher {
-
- static final Logger logger = Logger.getLogger(NodeLauncher.class.getName());
- private EquinoxHost host;
- private BundleContext bundleContext;
-
- /**
- * Constructs a new node launcher.
- */
- private NodeLauncher() {
- host = new EquinoxHost();
- bundleContext = host.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 createNodeFromURL(String configurationURL) throws LauncherException {
- return (T)node(configurationURL, null, 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, null, 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, null, bundleContext);
- }
-
- /**
- * 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, bundleContext);
- }
-
- public static void main(String[] args) throws Exception {
- logger.info("Apache Tuscany SCA Node is starting...");
-
- // Create a node launcher
- NodeLauncher launcher = newInstance();
-
- EquinoxHost equinox = launcher.host;
- Object node = null;
- ShutdownThread shutdown = null;
- try {
-
- if (args.length ==1) {
-
- // Create a node from a configuration URI
- String configurationURI = args[0];
- logger.info("SCA Node configuration: " + configurationURI);
- node = launcher.createNodeFromURL(configurationURI);
- } else {
-
- // Create a node from a composite URI and a contribution location
- String compositeURI = args[0];
- String contributionLocation = args[1];
- logger.info("SCA composite: " + compositeURI);
- logger.info("SCA contribution: " + contributionLocation);
- node = launcher.createNode(compositeURI, new Contribution("default", contributionLocation));
- }
-
- // 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) {
- stopNode(node);
- }
- if (equinox != null) {
- equinox.stop();
- }
- }
- }
-
- public void destroy() {
- if (host != null) {
- host.stop();
- bundleContext = null;
- }
- }
-
- /**
- * 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;
- private EquinoxHost equinox;
-
- public ShutdownThread(Object node, EquinoxHost equinox) {
- super();
- this.node = node;
- this.equinox = equinox;
- }
-
- public void run() {
- try {
- stopNode(node);
- } catch (Exception e) {
- // Ignore
- }
- try {
- equinox.stop();
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-}
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
deleted file mode 100644
index bf65c3f323..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.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.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.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.logging.Level;
-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;
-
-/**
- * Common functions and constants used by the admin components.
- *
- * @version $Rev$ $Date$
- */
-final class NodeLauncherUtil {
-
- private static final String LAUNCHER_EQUINOX_LIBRARIES = "org.apache.tuscany.sca.node.launcher.equinox.libraries";
-
- private static final String SCANODE_FACTORY = "org.apache.tuscany.sca.node.SCANodeFactory";
-
- 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";
-
- /**
- * Collect JAR files under the given directory.
- * @param contributions
- * @param bundleContext TODO
- * @throws LauncherException
- */
- static Object node(String configurationURI,
- String compositeURI,
- String compositeContent,
- Contribution[] contributions,
- ClassLoader contributionClassLoader, BundleContext bundleContext) throws LauncherException {
- try {
- 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 (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);
- try {
- Class<?> type = Class.forName(SCANODE_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);
- }
- }
-
- 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);
- }
- }
-
- static Pattern pattern = Pattern.compile("-([0-9.]+)");
-
- private static String version(String jarFile) {
- Matcher matcher = pattern.matcher(jarFile);
- String version = "1.0.0";
- if (matcher.find()) {
- version = matcher.group();
- if (version.endsWith(".")) {
- version = version.substring(1, version.length() - 1);
- } else {
- version = version.substring(1);
- }
- }
- return version;
- }
-
- private static void addPackages(String jarFile, Set<String> packages) throws IOException {
- String version = ";version=" + version(jarFile);
- ZipInputStream is = new ZipInputStream(new FileInputStream(file(new URL(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) {
- String pkg = entryName.substring(0, entryName.lastIndexOf("/")).replace('/', '.') + version;
- packages.add(pkg);
- }
- }
- is.close();
- }
-
- static Manifest libraryManifest(String[] jarFiles) 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 (String jarFile : jarFiles) {
- addPackages(jarFile, packages);
- classpath.append("\"external:");
- classpath.append(file(new URL(jarFile)).getPath().replace(File.separatorChar, '/'));
- classpath.append("\",");
- }
-
- Set<String> importPackages = new HashSet<String>();
- for (String pkg : packages) {
- exports.append(pkg);
- exports.append(',');
-
- 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);
- }
- }
-
- // 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, LAUNCHER_EQUINOX_LIBRARIES);
- attributes.putValue(EXPORT_PACKAGE, exports.substring(0, exports.length() - 1));
- attributes.putValue(IMPORT_PACKAGE, imports.substring(0, imports.length() - 1));
- attributes.putValue(BUNDLE_CLASSPATH, classpath.substring(0, classpath.length() - 1));
- attributes.putValue(DYNAMICIMPORT_PACKAGE, "*");
-
- return manifest;
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- }
-
- static InputStream libraryBundle(String[] jarFiles) throws IOException {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- Manifest mf = libraryManifest(jarFiles);
- JarOutputStream jos = new JarOutputStream(bos, mf);
- jos.close();
- return new ByteArrayInputStream(bos.toByteArray());
- }
-
- /**
- * Returns the location of this bundle.
- *
- * @return
- * @throws IOException
- */
- static String bundleLocation() 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 = url.toURI();
-
- 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 String string(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");
- }
-
- if (verbose) {
- sb.append(" ").append(b.getLocation());
- sb.append(" ").append(b.getHeaders());
- }
- return sb.toString();
- }
-}
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeMain.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeMain.java
deleted file mode 100644
index 17172dbd5e..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeMain.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.node.equinox.launcher;
-
-
-/**
- * Main class for this JAR.
- * With no arguments this class launches the SCA Node Daemon.
- * With a "domain" 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 {
- if (args.length != 0) {
- if (args[0].equals("domain")) {
- DomainManagerLauncher.main(args);
- } else {
- NodeLauncher.main(args);
- }
- } else {
- NodeDaemonLauncher.main(args);
- }
- }
-}
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/test/java/hello/HelloWorld.java b/branches/sca-android/modules/node-launcher-equinox/src/test/java/hello/HelloWorld.java
deleted file mode 100644
index 2f519cb81d..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.Remotable;
-
-/**
- * HelloWorld interface
- */
-@Remotable
-public interface HelloWorld {
- String hello(String name);
-}
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java b/branches/sca-android/modules/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java
deleted file mode 100644
index 11e008619c..0000000000
--- a/branches/sca-android/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.osoa.sca.annotations.EagerInit;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.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/branches/sca-android/modules/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java b/branches/sca-android/modules/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java
deleted file mode 100644
index e51d3c79d9..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java b/branches/sca-android/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java
deleted file mode 100644
index da0ab774a3..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.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.node.equinox.launcher;
-
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import junit.framework.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 testStartTwice() {
- EquinoxHost host = new EquinoxHost();
- 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/branches/sca-android/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java b/branches/sca-android/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
deleted file mode 100644
index b16045a103..0000000000
--- a/branches/sca-android/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.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.node.equinox.launcher;
-
-import org.apache.tuscany.sca.node.SCANode;
-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() {
- try {
- launcher = NodeLauncher.newInstance();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void tearDown() {
- if (launcher != null) {
- launcher.destroy();
- }
-
- }
-
- @Test
- public void testLaunch() throws Exception {
- SCANode node = launcher.createNodeFromClassLoader("HelloWorld.composite", getClass().getClassLoader());
- node.start();
- node.stop();
- }
-
- @Test
- @Ignore("contribution-osgi issue")
- public void testLaunchDomain() throws Exception {
- DomainManagerLauncher.main(new String[] {});
- }
-
-}
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite b/branches/sca-android/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite
deleted file mode 100644
index 0608e70ca5..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/node-launcher-webapp/LICENSE b/branches/sca-android/modules/node-launcher-webapp/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/node-launcher-webapp/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/node-launcher-webapp/META-INF/README b/branches/sca-android/modules/node-launcher-webapp/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/node-launcher-webapp/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/node-launcher-webapp/NOTICE b/branches/sca-android/modules/node-launcher-webapp/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/node-launcher-webapp/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/branches/sca-android/modules/node-launcher-webapp/pom.xml b/branches/sca-android/modules/node-launcher-webapp/pom.xml
deleted file mode 100644
index c0c911e63a..0000000000
--- a/branches/sca-android/modules/node-launcher-webapp/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-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-node-launcher-webapp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Node WebApp</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</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.node.launcher.webapp</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.node*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/node-launcher-webapp/src/main/webapp/META-INF/sca-contribution.xml b/branches/sca-android/modules/node-launcher-webapp/src/main/webapp/META-INF/sca-contribution.xml
deleted file mode 100644
index 78bbebbb83..0000000000
--- a/branches/sca-android/modules/node-launcher-webapp/src/main/webapp/META-INF/sca-contribution.xml
+++ /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.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0">
-</contribution>
diff --git a/branches/sca-android/modules/node-launcher-webapp/src/main/webapp/WEB-INF/web.xml b/branches/sca-android/modules/node-launcher-webapp/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 6c2c943c99..0000000000
--- a/branches/sca-android/modules/node-launcher-webapp/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
-Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
-
- <display-name>Apache Tuscany SCA Node</display-name>
-
- <filter>
- <filter-name>tuscany</filter-name>
- <filter-class>org.apache.tuscany.sca.node.launcher.NodeServletFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>tuscany</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <welcome-file-list id="WelcomeFileList">
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
-
-</web-app>
diff --git a/branches/sca-android/modules/node-launcher-webapp/src/main/webapp/index.jsp b/branches/sca-android/modules/node-launcher-webapp/src/main/webapp/index.jsp
deleted file mode 100644
index 3cc6c7b504..0000000000
--- a/branches/sca-android/modules/node-launcher-webapp/src/main/webapp/index.jsp
+++ /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.
---%>
-
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<html>
-<head><title>Apache Tuscany SCA Node</title></head>
-
-<body>
-<h1>It works!</h1>
-</body>
-</html>
diff --git a/branches/sca-android/modules/node-manager/LICENSE b/branches/sca-android/modules/node-manager/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/node-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/branches/sca-android/modules/node-manager/META-INF/README b/branches/sca-android/modules/node-manager/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/node-manager/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/node-manager/NOTICE b/branches/sca-android/modules/node-manager/NOTICE
deleted file mode 100644
index 94481d6cfa..0000000000
--- a/branches/sca-android/modules/node-manager/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2007 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/branches/sca-android/modules/node-manager/pom.xml b/branches/sca-android/modules/node-manager/pom.xml
deleted file mode 100644
index 08152a6344..0000000000
--- a/branches/sca-android/modules/node-manager/pom.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-node-manager</artifactId>
- <name>Apache Tuscany SCA Node Manager Application</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.4-SNAPSHOT</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>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-atom-abdera</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.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.node.manager</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.node.manager*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeManagerUtil.java b/branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeManagerUtil.java
deleted file mode 100644
index 8dfae91314..0000000000
--- a/branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeManagerUtil.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.manager;
-
-/**
- * Utility methods for node implementation launchers.
- *
- * @version $Rev$ $Date$
- */
-public class NodeManagerUtil {
-
- 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/branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeProcessCollectionImpl.java b/branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeProcessCollectionImpl.java
deleted file mode 100644
index 019c2562ec..0000000000
--- a/branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeProcessCollectionImpl.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, 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.manager;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.data.collection.ItemCollection;
-import org.apache.tuscany.sca.data.collection.LocalItemCollection;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.apache.tuscany.sca.node.launcher.NodeLauncher;
-import org.osoa.sca.ServiceRuntimeException;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a node process collection service.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(interfaces={ItemCollection.class, LocalItemCollection.class})
-public class NodeProcessCollectionImpl implements ItemCollection, LocalItemCollection {
-
- private static final Logger logger = Logger.getLogger(NodeProcessCollectionImpl.class.getName());
-
- private List<SCANodeVM> nodeVMs = new ArrayList<SCANodeVM>();
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() {
- }
-
- public Entry<String, Item>[] getAll() {
- logger.fine("getAll");
-
- // Return all the running VMs
- List<Entry<String, Item>> entries = new ArrayList<Entry<String, Item>>();
- for (SCANodeVM vm: nodeVMs) {
- entries.add(entry(vm));
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
- public Item get(String key) throws NotFoundException {
- logger.fine("get " + key);
-
- // Return the specified VM
- SCANodeVM vm = vm(key);
- if (vm == null) {
- throw new NotFoundException();
- }
-
- return item(vm);
- }
-
- public String post(String key, Item item) {
- logger.fine("post " + key);
-
- // If the VM is already running just return it
- SCANodeVM vm = vm(key);
- if (vm != null) {
- if (vm.isAlive()) {
- return key;
- } else {
- // Remove dead VM entry
- try {
- vm.stop();
- } catch (InterruptedException e) {
- throw new ServiceRuntimeException(e);
- }
- nodeVMs.remove(vm);
- }
- }
-
- // Start a new VM and add it to the collection
- vm = new SCANodeVM(key);
- nodeVMs.add(0, vm);
- try {
- vm.start();
- } catch (IOException e) {
- throw new ServiceRuntimeException(e);
- }
-
- return key;
- }
-
- public void put(String key, Item item) throws NotFoundException {
- throw new UnsupportedOperationException();
- }
-
- public void delete(String key) throws NotFoundException {
- logger.fine("delete " + key);
-
- // Stop a VM and remove it from the collection
- SCANodeVM vm = vm(key);
- if (vm != null) {
- try {
- vm.stop();
- } catch (InterruptedException e) {
- throw new ServiceRuntimeException(e);
- }
- nodeVMs.remove(vm);
- } else {
- //throw new NotFoundException();
- }
- }
-
- public Entry<String, Item>[] query(String queryString) {
- logger.fine("query " + queryString);
-
- if (queryString.startsWith("node=")) {
-
- // Return the log for the specified VM
- String key = queryString.substring(queryString.indexOf('=') + 1);
- List<Entry<String, Item>> entries = new ArrayList<Entry<String, Item>>();
- for (SCANodeVM vm: nodeVMs) {
- if (vm.getNodeName().equals(key)) {
- entries.add(entry(vm));
- }
- }
- return entries.toArray(new Entry[entries.size()]);
-
- } else {
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * Returns the specified VM.
- *
- * @param key
- * @return
- */
- private SCANodeVM vm(String key) {
- for (SCANodeVM vm: nodeVMs) {
- if (key.equals(vm.getNodeName())) {
- return vm;
- }
- }
- return null;
- }
-
- /**
- * Returns an entry representing a VM.
- *
- * @param vm
- * @return
- */
- private static Entry<String, Item> entry(SCANodeVM vm) {
- Entry<String, Item> entry = new Entry<String, Item>();
- entry.setKey(vm.getNodeName());
- entry.setData(item(vm));
- return entry;
- }
-
- /**
- * Returns an item representing a VM.
- *
- * @param vm
- * @return
- */
- private static Item item(SCANodeVM vm) {
- Item item = new Item();
- String key = vm.getNodeName();
- item.setTitle(title(key));
- item.setLink("/node-config/" + vm.getNodeName());
- item.setContents("<span id=\"log\" style=\"white-space: nowrap; font-size: small\">" + vm.getLog().toString() + "</span>");
- return item;
- }
-
- /**
- * Represent a child Java VM running an SCA node.
- */
- private static class SCANodeVM {
- private String nodeName;
- private StringBuffer log;
- private Process process;
- private Thread monitor;
- private int status;
-
- SCANodeVM(String nodeName) {
- log = new StringBuffer();
- this.nodeName =nodeName;
- }
-
- /**
- * Starts a node in a new VM.
- */
- private void start() throws IOException {
-
- // Determine the node configuration URI
- String nodeConfigurationURI = NodeManagerUtil.nodeConfigurationURI(nodeName);
-
- // Build the Java VM command line
- Properties props = System.getProperties();
- String java = props.getProperty("java.home") + "/bin/java";
- String cp = props.getProperty("java.class.path");
- String main = NodeLauncher.class.getName();
- final List<String> command = new ArrayList<String>();
- command.add(java);
- command.add("-cp");
- command.add(cp);
-
- // Propagate TUSCANY properties
- String tuscanyHome = props.getProperty("TUSCANY_HOME");
- if (tuscanyHome != null) {
- command.add("-DTUSCANY_HOME=" + tuscanyHome);
- }
- String tuscanyPath = props.getProperty("TUSCANY_PATH");
- if (tuscanyPath != null) {
- command.add("-DTUSCANY_PATH=" + tuscanyPath);
- }
-
- // Specify the main class and parameters
- command.add(main);
- command.add(nodeConfigurationURI);
-
- logger.info("Starting " + "java " + main + " " + nodeConfigurationURI);
-
- // Start the VM
- ProcessBuilder builder = new ProcessBuilder(command);
- builder.redirectErrorStream(true);
- process = builder.start();
-
- logger.info("Started " + process);
-
- // Start a thread to monitor the process
- final BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
- monitor = new Thread(new Runnable() {
- public void run() {
- try {
- for (;;) {
- String s = reader.readLine();
- if (s != null) {
- logger.info(s);
- log.append(s + "<br>");
- } else {
- break;
- }
- }
- status = process.waitFor();
- } catch (IOException e) {
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- });
- monitor.start();
- }
-
- /**
- * Returns the composite used to start this VM.
- * @return
- */
- String getNodeName() {
- return nodeName;
- }
-
- /**
- * Returns the log for this VM.
- *
- * @return
- */
- StringBuffer getLog() {
- return log;
- }
-
- /**
- * Returns true if the VM is alive
- *
- * @return
- */
- private boolean isAlive() {
- return monitor.isAlive();
- }
-
- /**
- * Returns the VM status code.
- * @return
- */
- int getStatus() {
- return status;
- }
-
- /**
- * Stops the VM.
- *
- * @throws InterruptedException
- */
- private void stop() throws InterruptedException {
- logger.info("Stopping " + process);
-
- process.destroy();
- monitor.join();
-
- logger.info("Stopped " + process);
- }
- }
-
- /**
- * Returns a node title.
- *
- * @param key
- * @return
- */
- private static String title(String key) {
- return key;
- }
-
-}
diff --git a/branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/PingServiceImpl.java b/branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/PingServiceImpl.java
deleted file mode 100644
index d0475e1dd3..0000000000
--- a/branches/sca-android/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/PingServiceImpl.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.implementation.node.manager;
-
-import java.io.IOException;
-import java.util.logging.Logger;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Implementation of a ping service component.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@Service(interfaces={Servlet.class})
-public class PingServiceImpl extends HttpServlet {
- private static final long serialVersionUID = -3477992129462720901L;
-
- private static final Logger logger = Logger.getLogger(PingServiceImpl.class.getName());
-
- /**
- * Initialize the component.
- */
- @Init
- public void initialize() throws ParserConfigurationException {
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- logger.fine("ping");
- response.getWriter().print("<html><body><span id=\"ping\">OK</span></body></html>");
- }
-
-}
diff --git a/branches/sca-android/modules/node-manager/src/main/resources/NodeDaemon.composite b/branches/sca-android/modules/node-manager/src/main/resources/NodeDaemon.composite
deleted file mode 100644
index cb587b02fd..0000000000
--- a/branches/sca-android/modules/node-manager/src/main/resources/NodeDaemon.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:t="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
- name="NodeDaemon">
-
- <component name="NodeProcessCollectionComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.node.manager.NodeProcessCollectionImpl"/>
- <service name="ItemCollection">
- <t:binding.atom uri="http://localhost:9990/node/processes" title="Log"/>
- </service>
- </component>
-
- <component name="PingServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.node.manager.PingServiceImpl"/>
- <service name="Servlet">
- <t:binding.http uri="http://localhost:9990/ping"/>
- </service>
- </component>
-
-</composite>
diff --git a/branches/sca-android/modules/policy-logging/LICENSE b/branches/sca-android/modules/policy-logging/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/policy-logging/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/policy-logging/META-INF/README b/branches/sca-android/modules/policy-logging/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/policy-logging/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/policy-logging/NOTICE b/branches/sca-android/modules/policy-logging/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/policy-logging/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/branches/sca-android/modules/policy-logging/pom.xml b/branches/sca-android/modules/policy-logging/pom.xml
deleted file mode 100644
index 8e2659f171..0000000000
--- a/branches/sca-android/modules/policy-logging/pom.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-policy-logging</artifactId>
- <name>Apache Tuscany Logging Policy Model</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</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.policy.logging</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.policy.logging*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/LoggingPolicyDefinitionsProvider.java b/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/LoggingPolicyDefinitionsProvider.java
deleted file mode 100644
index 4220caab80..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/LoggingPolicyDefinitionsProvider.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.logging;
-
-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.SCADefinitions;
-import org.apache.tuscany.sca.provider.SCADefinitionsProvider;
-import org.apache.tuscany.sca.provider.SCADefinitionsProviderException;
-
-/**
- * Provider for Policy Intents and PolicySet definitions related to security
- *
- * @version $Rev$ $Date$
- */
-public class LoggingPolicyDefinitionsProvider implements SCADefinitionsProvider {
- private String definitionsFile = "org/apache/tuscany/sca/policy/logging/definitions.xml";
- URLArtifactProcessor urlArtifactProcessor = null;
-
- public LoggingPolicyDefinitionsProvider(ExtensionPointRegistry registry) {
- URLArtifactProcessorExtensionPoint documentProcessors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- urlArtifactProcessor = (URLArtifactProcessor)documentProcessors.getProcessor(SCADefinitions.class);
- }
-
- public SCADefinitions getSCADefinition() throws SCADefinitionsProviderException {
- // 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);
- }
- });
-
- Object scaDefn = null;
- try {
- URI uri = new URI(definitionsFile);
- return (SCADefinitions)urlArtifactProcessor.read(null,
- uri,
- definitionsFileUrl);
- } catch ( Exception e ) {
- throw new SCADefinitionsProviderException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingImplementationPolicyProvider.java b/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingImplementationPolicyProvider.java
deleted file mode 100644
index c53c37ccf6..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingImplementationPolicyProvider.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.logging.jdk;
-
-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 JDKLoggingImplementationPolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private Implementation implementation;
-
- public JDKLoggingImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
- super();
- this.component = component;
- this.implementation = implementation;
- }
-
- private String getContext() {
- return "component.implementation: " + component.getURI() + "(" + implementation.getClass().getName() + ")";
- }
-
- private PolicySet findPolicySet(Operation operation) {
- for (PolicySet ps : component.getPolicySets()) {
- for (Object p : ps.getPolicies()) {
- if (JDKLoggingPolicy.class.isInstance(p)) {
- return ps;
- }
- }
- }
-
- if ( component instanceof OperationsConfigurator ) {
- for ( ConfiguredOperation confOp : ((OperationsConfigurator)component).getConfiguredOperations() ) {
- if ( confOp.getName().equals(operation.getName())) {
- for (PolicySet ps : confOp.getPolicySets()) {
- for (Object p : ps.getPolicies()) {
- if (JDKLoggingPolicy.class.isInstance(p)) {
- return ps;
- }
- }
- }
- }
- }
- }
-
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
- */
- public Interceptor createInterceptor(Operation operation) {
- PolicySet ps = findPolicySet(operation);
- return ps == null ? null : new JDKLoggingPolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.IMPLEMENTATION_POLICY;
- }
-
-}
diff --git a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java b/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java
deleted file mode 100644
index 731b2d8d62..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.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.policy.logging.jdk;
-
-import java.util.logging.Level;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * Implementation for policies that could be injected as parameter
- * into the axis2config.
- *
- * @version $Rev$ $Date$
- */
-public class JDKLoggingPolicy implements Policy {
- private static final QName JDK_LOGGING_POLICY_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "jdkLogger");
-
- private String loggerName;
- private String resourceBundleName;
- private Level logLevel;
- private boolean useParentHandlers = false;
-
- public String getLoggerName() {
- return loggerName;
- }
-
- public void setLoggerName(String loggerName) {
- this.loggerName = loggerName;
- }
-
- public Level getLogLevel() {
- return logLevel;
- }
-
- public void setLogLevel(Level logLevel) {
- this.logLevel = logLevel;
- }
-
- public String getResourceBundleName() {
- return resourceBundleName;
- }
-
- public void setResourceBundleName(String resourceBundleName) {
- this.resourceBundleName = resourceBundleName;
- }
-
- public boolean isUseParentHandlers() {
- return useParentHandlers;
- }
-
- public void setUseParentHandlers(boolean useParentHandlers) {
- this.useParentHandlers = useParentHandlers;
- }
-
- public QName getSchemaName() {
- return JDK_LOGGING_POLICY_QNAME;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-}
diff --git a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyInterceptor.java b/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyInterceptor.java
deleted file mode 100644
index 58a6d21ee7..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyInterceptor.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.policy.logging.jdk;
-
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-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 JDKLoggingPolicyInterceptor implements Interceptor {
- public static final String loggingPolicy = "JDKLoggingPolicy";
- public static final QName policySetQName = new QName(Constants.SCA10_TUSCANY_NS, loggingPolicy);
- private Logger logger = null;
-
- private Invoker next;
- private Operation operation;
- private PolicySet policySet = null;
- private String context;
-
- public JDKLoggingPolicyInterceptor(String context, Operation operation, PolicySet policySet) {
- super();
- this.operation = operation;
- this.policySet = policySet;
- this.context = context;
- init();
- }
-
- private void init() {
- if (policySet != null) {
- JDKLoggingPolicy policy = (JDKLoggingPolicy)policySet.getPolicies().get(0);
- logger = Logger.getLogger(policy.getLoggerName());
- logger.setLevel(policy.getLogLevel());
- logger.setUseParentHandlers(policy.isUseParentHandlers());
-
- boolean found = false;
- for (Handler handler : logger.getHandlers()) {
- if (handler instanceof ConsoleHandler) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- ConsoleHandler consoleHandler = new ConsoleHandler();
- consoleHandler.setLevel(Level.ALL);
- logger.addHandler(consoleHandler);
- }
- }
- }
-
- public Message invoke(Message msg) {
- if (logger == null) {
- return getNext().invoke(msg);
- }
- Object msgBody = msg.getBody();
- if (msgBody instanceof Object[]) {
- logger.logp(Level.INFO, context, "", "Invoking operation - " + operation.getName());
-
- StringBuffer sb = new StringBuffer();
- if (msgBody == null) {
- sb.append("");
- } else {
- Object[] args = (Object[])msgBody;
- for (int i = 0; i < args.length; i++) {
- sb.append(args[i]);
- if (i != args.length - 1) {
- sb.append(", ");
- }
- }
- }
-
- Object[] logParams = new Object[] {operation.getName(), sb.toString()};
- logger.logp(Level.FINER, context, "", "Invoking operation {0} with arguments {1}", logParams);
- }
-
- Message responseMsg = null;
- try {
- responseMsg = getNext().invoke(msg);
- return responseMsg;
- } catch (RuntimeException e) {
- logger.logp(Level.SEVERE, context, "", "Exception thrown from operation - " + operation.getName(), e);
- throw e;
- } finally {
- if (responseMsg != null) {
- Object[] logParams = new Object[] {operation.getName(), responseMsg.getBody()};
- logger.logp(Level.INFO, context, "", "Returned from operation - " + operation.getName());
- logger.logp(Level.FINER, context, "", "Returning from operation {0} with return value {1}", logParams);
- }
- }
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-}
diff --git a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProcessor.java b/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProcessor.java
deleted file mode 100644
index 83526e0f03..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProcessor.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.policy.logging.jdk;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.logging.Level;
-
-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.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JDKLoggingPolicyProcessor implements StAXArtifactProcessor<JDKLoggingPolicy> {
- private static final QName JDK_LOGGING_POLICY_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "jdkLogger");
- private static final String LOG_LEVEL = "logLevel";
- private static final String RESOURCE_BUNDLE = "resourceBundle";
- private static final String USE_PARENT_HANDLERS = "useParentHandlers";
- private static final String TUSACNY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
-
- public QName getArtifactType() {
- return JDK_LOGGING_POLICY_QNAME;
- }
-
- public JDKLoggingPolicyProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- }
-
-
- public JDKLoggingPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- JDKLoggingPolicy policy = new JDKLoggingPolicy();
- int event = reader.getEventType();
- QName name = null;
-
-
- while (reader.hasNext()) {
- event = reader.getEventType();
- switch (event) {
- case START_ELEMENT : {
- name = reader.getName();
- if ( name.equals(JDK_LOGGING_POLICY_QNAME) ) {
- String loggerName = reader.getAttributeValue(null, Constants.NAME);
- policy.setLoggerName(loggerName);
- } else if ( LOG_LEVEL.equals(name.getLocalPart()) ) {
- policy.setLogLevel(Level.parse(reader.getElementText()));
- } else if ( RESOURCE_BUNDLE.equals(name.getLocalPart()) ) {
- policy.setResourceBundleName(reader.getElementText());
- } else if ( USE_PARENT_HANDLERS.equals(name.getLocalPart()) ) {
- policy.setUseParentHandlers(Boolean.getBoolean(reader.getElementText()));
- }
- break;
- }
- }
-
- if ( event == END_ELEMENT ) {
- if ( JDK_LOGGING_POLICY_QNAME.equals(reader.getName()) ) {
- break;
- }
- }
-
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
-
- return policy;
- }
-
- public void write(JDKLoggingPolicy policy, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- String prefix = "tuscany";
- writer.writeStartElement(prefix,
- JDK_LOGGING_POLICY_QNAME.getLocalPart(),
- JDK_LOGGING_POLICY_QNAME.getNamespaceURI());
- writer.writeNamespace("tuscany", Constants.SCA10_TUSCANY_NS);
-
- if (policy.getLoggerName() != null) {
- writer.writeAttribute(Constants.NAME, policy.getLoggerName());
- }
- if ( policy.getLogLevel() != null ) {
- writer.writeStartElement(prefix,
- LOG_LEVEL,
- JDK_LOGGING_POLICY_QNAME.getNamespaceURI());
- writer.writeCharacters(policy.getLogLevel().getLocalizedName());
- writer.writeEndElement();
- }
-
- if ( policy.getResourceBundleName() != null ) {
- writer.writeStartElement(prefix,
- RESOURCE_BUNDLE,
- JDK_LOGGING_POLICY_QNAME.getNamespaceURI());
- writer.writeCharacters(policy.getResourceBundleName());
- writer.writeEndElement();
- }
-
- writer.writeEndElement();
- }
-
- public Class<JDKLoggingPolicy> getModelType() {
- return JDKLoggingPolicy.class;
- }
-
- public void resolve(JDKLoggingPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
-}
diff --git a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProviderFactory.java b/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProviderFactory.java
deleted file mode 100644
index 9bbae8956f..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProviderFactory.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.logging.jdk;
-
-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 JDKLoggingPolicyProviderFactory implements PolicyProviderFactory<JDKLoggingPolicy> {
- private ExtensionPointRegistry registry;
-
- public JDKLoggingPolicyProviderFactory(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 JDKLoggingImplementationPolicyProvider(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 JDKLoggingReferencePolicyProvider(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 JDKLoggingServicePolicyProvider(component, service, binding);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class getModelType() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingReferencePolicyProvider.java b/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingReferencePolicyProvider.java
deleted file mode 100644
index feddc8c056..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingReferencePolicyProvider.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.logging.jdk;
-
-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 JDKLoggingReferencePolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private RuntimeComponentReference reference;
- private Binding binding;
-
- public JDKLoggingReferencePolicyProvider(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 (JDKLoggingPolicy.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 JDKLoggingPolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.REFERENCE_POLICY;
- }
-
-}
diff --git a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingServicePolicyProvider.java b/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingServicePolicyProvider.java
deleted file mode 100644
index 472f76c680..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingServicePolicyProvider.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.logging.jdk;
-
-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 JDKLoggingServicePolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private Binding binding;
-
- public JDKLoggingServicePolicyProvider(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 (JDKLoggingPolicy.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 JDKLoggingPolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.SERVICE_POLICY;
- }
-
-}
diff --git a/branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index f56f96e4b9..0000000000
--- a/branches/sca-android/modules/policy-logging/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.logging.jdk.JDKLoggingPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#jdkLogger,model=org.apache.tuscany.sca.policy.logging.jdk.JDKLoggingPolicy
diff --git a/branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory b/branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
deleted file mode 100644
index e14c657d80..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
+++ /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 policy extension
-org.apache.tuscany.sca.policy.logging.jdk.JDKLoggingPolicyProviderFactory;model=org.apache.tuscany.sca.policy.logging.jdk.JDKLoggingPolicy
diff --git a/branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider b/branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider
deleted file mode 100644
index ec40cb7dc5..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider
+++ /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.logging.LoggingPolicyDefinitionsProvider \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml b/branches/sca-android/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml
deleted file mode 100644
index 39627ae876..0000000000
--- a/branches/sca-android/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/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">
-
- <!-- Policy Intents Defined by the SCA Runtime -->
- <intent name="logging"
- constrains="sca:implementation.java">
- <description>
- All messages to and from this implementation must be logged
- </description>
- </intent>
-</definitions> \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-logging/src/test/java/org/apache/tuscany/sca/policy/logging/jdk/PolicyReadTestCase.java b/branches/sca-android/modules/policy-logging/src/test/java/org/apache/tuscany/sca/policy/logging/jdk/PolicyReadTestCase.java
deleted file mode 100644
index d5b1b9eedc..0000000000
--- a/branches/sca-android/modules/policy-logging/src/test/java/org/apache/tuscany/sca/policy/logging/jdk/PolicyReadTestCase.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.logging.jdk;
-
-
-import java.io.InputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.net.URL;
-import java.util.logging.Level;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import junit.framework.TestCase;
-
-/**
- * Test the reading of ws config params policy.
- *
- * @version $Rev$ $Date$
- */
-public class PolicyReadTestCase extends TestCase {
-
- @Override
- public void setUp() throws Exception {
- }
-
- @Override
- public void tearDown() throws Exception {
- }
-
- public void testPolicyReading() throws Exception {
- JDKLoggingPolicyProcessor processor = new JDKLoggingPolicyProcessor(null, null);
-
- URL url = getClass().getResource("mock_policies.xml");
- XMLInputFactory inputFactory = XMLInputFactory.newInstance();
-
- InputStream urlStream = url.openStream();
- XMLStreamReader reader = inputFactory.createXMLStreamReader(urlStream);
-
-
- JDKLoggingPolicy policy = processor.read(reader);
- assertEquals(policy.getLoggerName(), "test.logger");
- assertEquals(policy.getLogLevel(), Level.INFO );
- assertEquals(policy.getResourceBundleName(), "Trace_Messages.properties");
- }
-
- public void testPolicyWriting() throws Exception {
- JDKLoggingPolicyProcessor processor = new JDKLoggingPolicyProcessor(null, null);
-
- JDKLoggingPolicy policy = new JDKLoggingPolicy();
- policy.setLoggerName("test.logger");
- policy.setLogLevel(Level.INFO);
- policy.setResourceBundleName("Trace_Messages.properties");
-
- XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
- StringWriter sw = new StringWriter();
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
- processor.write(policy, writer);
- writer.close();
-
- XMLInputFactory inputFactory = XMLInputFactory.newInstance();
- StringReader sr = new StringReader(sw.toString());
- XMLStreamReader reader = inputFactory.createXMLStreamReader(sr);
-
- policy = processor.read(reader);
- assertEquals(policy.getLoggerName(), "test.logger");
- assertEquals(policy.getLogLevel(), Level.INFO );
- assertEquals(policy.getResourceBundleName(), "Trace_Messages.properties");
-
- }
-
-}
diff --git a/branches/sca-android/modules/policy-logging/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml b/branches/sca-android/modules/policy-logging/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml
deleted file mode 100644
index fabb554236..0000000000
--- a/branches/sca-android/modules/policy-logging/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml
+++ /dev/null
@@ -1,23 +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:jdkLogger xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" name="test.logger">
- <logLevel>INFO</logLevel>
- <resourceBundle>Trace_Messages.properties</resourceBundle>
-</tuscany:jdkLogger> \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-security-jsr250/LICENSE b/branches/sca-android/modules/policy-security-jsr250/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/modules/policy-security-jsr250/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/policy-security-jsr250/META-INF/README b/branches/sca-android/modules/policy-security-jsr250/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/policy-security-jsr250/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/policy-security-jsr250/NOTICE b/branches/sca-android/modules/policy-security-jsr250/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/policy-security-jsr250/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/branches/sca-android/modules/policy-security-jsr250/pom.xml b/branches/sca-android/modules/policy-security-jsr250/pom.xml
deleted file mode 100644
index 467742f575..0000000000
--- a/branches/sca-android/modules/policy-security-jsr250/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-policy-security-jsr250</artifactId>
- <name>Apache Tuscany SCA Java JSR250 Implementation</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <version>1.0</version>
- </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.implementation.java</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.implementation.java*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JSR250Activator.java b/branches/sca-android/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JSR250Activator.java
deleted file mode 100644
index befe398129..0000000000
--- a/branches/sca-android/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JSR250Activator.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.java.impl;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.JSR250PolicyProcessor;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * A module activator for the Java implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class JSR250Activator implements ModuleActivator {
-
- public void start(ExtensionPointRegistry registry) {
- ModelFactoryExtensionPoint modelFactories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- PolicyFactory policyFactory = modelFactories.getFactory(PolicyFactory.class);
-
- JavaImplementationFactory javaImplementationFactory = modelFactories.getFactory(JavaImplementationFactory.class);
- javaImplementationFactory.addClassVisitor(new JSR250PolicyProcessor(assemblyFactory, policyFactory));
-
- }
-
- public void stop(ExtensionPointRegistry registry) {
-
- }
-
-}
diff --git a/branches/sca-android/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JSR250PolicyProcessor.java b/branches/sca-android/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JSR250PolicyProcessor.java
deleted file mode 100644
index f639bc679f..0000000000
--- a/branches/sca-android/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JSR250PolicyProcessor.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Method;
-
-import javax.annotation.security.DenyAll;
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
-import javax.annotation.security.RunAs;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.authorization.AuthorizationPolicy;
-import org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicy;
-
-/**
- * Processes an {@link javax.annotation.security.*} annotation
- * Below is a list of annotations
- *
- * Type Method
- * RunAs x
- * RolesAllowed x x
- * PermitAll x x
- * DenyAll x
- *
- * @version $Rev$ $Date$
- */
-public class JSR250PolicyProcessor extends BaseJavaClassVisitor {
- private static final QName RUN_AS = new QName("http://www.osoa.org/xmlns/sca/1.0","runAs");
- private static final QName ALLOW = new QName("http://www.osoa.org/xmlns/sca/1.0","allow");
- private static final QName PERMIT_ALL = new QName("http://www.osoa.org/xmlns/sca/1.0","permitAll");
- private static final QName DENY_ALL = new QName("http://www.osoa.org/xmlns/sca/1.0","denyAll");
-
- private PolicyFactory policyFactory;
-
- public JSR250PolicyProcessor(AssemblyFactory assemblyFactory, PolicyFactory policyFactory) {
- super(assemblyFactory);
- this.policyFactory = policyFactory;
- }
-
-
- @Override
- public <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
-
- RunAs runAs = clazz.getAnnotation(javax.annotation.security.RunAs.class);
- if (runAs != null) {
-
- String roleName = runAs.value();
- if(roleName == null) {
- //FIXME handle monitor or error
- }
-
- SecurityIdentityPolicy policy = new SecurityIdentityPolicy();
- policy.setRunAsRole(roleName);
-
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(RUN_AS);
- policySet.getPolicies().add(policy);
- policySet.setUnresolved(false);
- ((org.apache.tuscany.sca.policy.PolicySetAttachPoint)type).getPolicySets().add(policySet);
- }
-
- RolesAllowed rolesAllowed = clazz.getAnnotation(javax.annotation.security.RolesAllowed.class);
- if(rolesAllowed != null) {
- if(rolesAllowed.value().length == 0) {
- //FIXME handle monitor or error
- }
-
- AuthorizationPolicy policy = new AuthorizationPolicy();
- policy.setAccessControl(AuthorizationPolicy.AcessControl.allow);
-
- for(String role : rolesAllowed.value()) {
- policy.getRoleNames().add(role);
- }
-
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(ALLOW);
- policySet.getPolicies().add(policy);
- policySet.setUnresolved(false);
- ((org.apache.tuscany.sca.policy.PolicySetAttachPoint)type).getPolicySets().add(policySet);
- }
-
- PermitAll permitAll = clazz.getAnnotation(javax.annotation.security.PermitAll.class);
- if(permitAll != null) {
- AuthorizationPolicy policy = new AuthorizationPolicy();
- policy.setAccessControl(AuthorizationPolicy.AcessControl.permitAll);
-
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(PERMIT_ALL);
- policySet.getPolicies().add(policy);
- policySet.setUnresolved(false);
- ((org.apache.tuscany.sca.policy.PolicySetAttachPoint)type).getPolicySets().add(policySet);
- }
-
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- RolesAllowed rolesAllowed = method.getAnnotation(javax.annotation.security.RolesAllowed.class);
- if(rolesAllowed != null) {
- if(rolesAllowed.value().length == 0) {
- //FIXME handle monitor or error
- }
-
- AuthorizationPolicy policy = new AuthorizationPolicy();
- policy.setAccessControl(AuthorizationPolicy.AcessControl.allow);
-
- for(String role : rolesAllowed.value()) {
- policy.getRoleNames().add(role);
- }
-
- ConfiguredOperation confOp = assemblyFactory.createConfiguredOperation();
- confOp.setName(method.getName());
- ((OperationsConfigurator)type).getConfiguredOperations().add(confOp);
-
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(ALLOW);
- policySet.getPolicies().add(policy);
- policySet.setUnresolved(false);
- confOp.getPolicySets().add(policySet);
- }
-
- PermitAll permitAll = method.getAnnotation(javax.annotation.security.PermitAll.class);
- if(permitAll != null) {
- AuthorizationPolicy policy = new AuthorizationPolicy();
- policy.setAccessControl(AuthorizationPolicy.AcessControl.permitAll);
-
- ConfiguredOperation confOp = assemblyFactory.createConfiguredOperation();
- confOp.setName(method.getName());
- ((OperationsConfigurator)type).getConfiguredOperations().add(confOp);
-
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(PERMIT_ALL);
- policySet.getPolicies().add(policy);
- policySet.setUnresolved(false);
- confOp.getPolicySets().add(policySet);
- }
-
- DenyAll denyAll = method.getAnnotation(javax.annotation.security.DenyAll.class);
- if(denyAll != null) {
- AuthorizationPolicy policy = new AuthorizationPolicy();
- policy.setAccessControl(AuthorizationPolicy.AcessControl.denyAll);
-
- ConfiguredOperation confOp = assemblyFactory.createConfiguredOperation();
- confOp.setName(method.getName());
- ((OperationsConfigurator)type).getConfiguredOperations().add(confOp);
-
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(DENY_ALL);
- policySet.getPolicies().add(policy);
- policySet.setUnresolved(false);
- confOp.getPolicySets().add(policySet);
- }
- }
-}
diff --git a/branches/sca-android/modules/policy-security-jsr250/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-android/modules/policy-security-jsr250/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index 550e6d3708..0000000000
--- a/branches/sca-android/modules/policy-security-jsr250/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.impl.JSR250Activator
diff --git a/branches/sca-android/modules/policy-security-jsr250/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCaseFIXME.java b/branches/sca-android/modules/policy-security-jsr250/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCaseFIXME.java
deleted file mode 100644
index 894117354e..0000000000
--- a/branches/sca-android/modules/policy-security-jsr250/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCaseFIXME.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.implementation.java.introspect.impl;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-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.osoa.sca.annotations.Requires;
-import org.osoa.sca.annotations.Service;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PolicyProcessorTestCaseFIXME extends TestCase {
- private ServiceProcessor serviceProcessor;
- private JSR250PolicyProcessor 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);
- }
-
- 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);
- }
- }
- }
- }
- }
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- serviceProcessor = new ServiceProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory());
- policyProcessor = new JSR250PolicyProcessor(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/branches/sca-android/modules/policy-security-ws/LICENSE b/branches/sca-android/modules/policy-security-ws/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/policy-security-ws/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/policy-security-ws/META-INF/README b/branches/sca-android/modules/policy-security-ws/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/policy-security-ws/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/policy-security-ws/NOTICE b/branches/sca-android/modules/policy-security-ws/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/policy-security-ws/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/branches/sca-android/modules/policy-security-ws/pom.xml b/branches/sca-android/modules/policy-security-ws/pom.xml
deleted file mode 100644
index f733f7f4c6..0000000000
--- a/branches/sca-android/modules/policy-security-ws/pom.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-policy-security-ws</artifactId>
- <name>Apache Tuscany Security Policy WS Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security</artifactId>
- <version>1.4-SNAPSHOT</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.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-kernel</artifactId>
- <version>1.3</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.0</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.neethi</groupId>
- <artifactId>neethi</artifactId>
- <version>2.0.2</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.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</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.policy.security.ws</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.policy.security.ws*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicy.java b/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicy.java
deleted file mode 100644
index 13129efe5b..0000000000
--- a/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/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.policy.security.ws;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-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 {
- public static final QName NAME = new QName(Constants.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/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicyHandler.java b/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicyHandler.java
deleted file mode 100644
index 51e0e00ffa..0000000000
--- a/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/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.policy.security.ws;
-
-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/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicyProcessor.java b/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicyProcessor.java
deleted file mode 100644
index ca2e439e3b..0000000000
--- a/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicyProcessor.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.policy.security.ws;
-
-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.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.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(ModelFactoryExtensionPoint 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, Constants.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/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicyProviderFactory.java b/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/Axis2ConfigParamPolicyProviderFactory.java
deleted file mode 100644
index 2faf7bef14..0000000000
--- a/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/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.policy.security.ws;
-
-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.osoa.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/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/WSSecurityPolicyHandler.java b/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/WSSecurityPolicyHandler.java
deleted file mode 100644
index 2a4d36fa0a..0000000000
--- a/branches/sca-android/modules/policy-security-ws/src/main/java/org/apache/tuscany/sca/policy/security/ws/WSSecurityPolicyHandler.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.security.ws;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.neethi.Policy;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-
-/**
- * Policy handler to handle PolicySet containing Policy (WS-Security-Policy) instances
- *
- * @version $Rev$ $Date$
- */
-public class WSSecurityPolicyHandler implements PolicyHandler {
- private PolicySet applicablePolicySet = null;
-
- public void setUp(Object... context) {
- for ( Object contextObject : context ) {
- if ( contextObject instanceof ConfigurationContext ) {
- ConfigurationContext configContext = (ConfigurationContext)contextObject;
- for ( Object policy : applicablePolicySet.getPolicies() ) {
- if ( policy instanceof Policy ) {
- Policy wsPolicy = (Policy)policy;
- try {
- configContext.getAxisConfiguration().applyPolicy(wsPolicy);
- } 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/branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 71783b1306..0000000000
--- a/branches/sca-android/modules/policy-security-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.security.ws.Axis2ConfigParamPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#wsConfigParam,model=org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicy \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler b/branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
deleted file mode 100644
index 5bae401538..0000000000
--- a/branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
+++ /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.
-#
-# PolicyHandlerClasses to interpret specific PolicyModels against specific QoS infrastructures
-# handler classname;intent=<policy intent addressed>;model=<policy model class>
-org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#authentication,model=org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicy
-org.apache.tuscany.sca.policy.security.ws.WSSecurityPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#authentication,model=org.apache.neethi.Policy
-org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#integrity,model=org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicy
-org.apache.tuscany.sca.policy.security.ws.WSSecurityPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#integrity,model=org.apache.neethi.Policy
-org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#confidentiality,model=org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicy
-org.apache.tuscany.sca.policy.security.ws.WSSecurityPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#confidentiality,model=org.apache.neethi.Policy \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory b/branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
deleted file mode 100644
index 352d6c693e..0000000000
--- a/branches/sca-android/modules/policy-security-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
+++ /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 policy extension
diff --git a/branches/sca-android/modules/policy-security-ws/src/test/java/org/apache/tuscany/sca/policy/security/ws/PolicyReadTestCase.java b/branches/sca-android/modules/policy-security-ws/src/test/java/org/apache/tuscany/sca/policy/security/ws/PolicyReadTestCase.java
deleted file mode 100644
index 4bdd1c465b..0000000000
--- a/branches/sca-android/modules/policy-security-ws/src/test/java/org/apache/tuscany/sca/policy/security/ws/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.policy.security.ws;
-
-
-import java.io.InputStream;
-import java.net.URL;
-
-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.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-
-import junit.framework.TestCase;
-
-/**
- *
- * 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/branches/sca-android/modules/policy-security-ws/src/test/resources/org/apache/tuscany/sca/policy/security/ws/mock_policies.xml b/branches/sca-android/modules/policy-security-ws/src/test/resources/org/apache/tuscany/sca/policy/security/ws/mock_policies.xml
deleted file mode 100644
index 8fc1a7b669..0000000000
--- a/branches/sca-android/modules/policy-security-ws/src/test/resources/org/apache/tuscany/sca/policy/security/ws/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/branches/sca-android/modules/policy-security/LICENSE b/branches/sca-android/modules/policy-security/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/policy-security/META-INF/README b/branches/sca-android/modules/policy-security/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/policy-security/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/policy-security/NOTICE b/branches/sca-android/modules/policy-security/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/policy-security/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/branches/sca-android/modules/policy-security/pom.xml b/branches/sca-android/modules/policy-security/pom.xml
deleted file mode 100644
index 640d131642..0000000000
--- a/branches/sca-android/modules/policy-security/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-policy-security</artifactId>
- <name>Apache Tuscany Security Policy Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</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.policy.security</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.policy.security*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicy.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicy.java
deleted file mode 100644
index 14bff2dca6..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicy.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.policy.authentication.basic;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-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 {
- public static final QName BASIC_AUTHENTICATION_POLICY_QNAME = new QName(Constants.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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProcessor.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProcessor.java
deleted file mode 100644
index 082dfc9fdb..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProcessor.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.policy.authentication.basic;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.logging.Level;
-
-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.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class BasicAuthenticationPolicyProcessor implements StAXArtifactProcessor<BasicAuthenticationPolicy> {
-
- private static final String USER_NAME = "userName";
- private static final String PASSWORD = "password";
-
-
- public QName getArtifactType() {
- return BasicAuthenticationPolicy.BASIC_AUTHENTICATION_POLICY_QNAME;
- }
-
- public BasicAuthenticationPolicyProcessor(ModelFactoryExtensionPoint 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 ( USER_NAME.equals(name.getLocalPart()) ) {
- policy.setUserName(reader.getElementText());
- } else if ( 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", Constants.SCA10_TUSCANY_NS);
-
- if ( policy.getUserName() != null ) {
- writer.writeStartElement(prefix,
- USER_NAME,
- getArtifactType().getNamespaceURI());
- writer.writeCharacters(policy.getUserName());
- writer.writeEndElement();
- }
-
- if ( policy.getPassword() != null ) {
- writer.writeStartElement(prefix,
- 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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProviderFactory.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProviderFactory.java
deleted file mode 100644
index 348934bd6c..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyInterceptor.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyInterceptor.java
deleted file mode 100644
index 83b1d20e9e..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyInterceptor.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.logging.ConsoleHandler;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-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.Policy;
-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 BasicAuthenticationReferencePolicyInterceptor implements Interceptor {
- public static final QName policySetQName = new QName(Constants.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) {
- // could call out here to some 3rd part system to get credentials
- msg.getQoSContext().put(BasicAuthenticationPolicy.BASIC_AUTHENTICATION_USERNAME,
- policy.getUserName());
- msg.getQoSContext().put(BasicAuthenticationPolicy.BASIC_AUTHENTICATION_PASSWORD,
- policy.getPassword());
-
- return getNext().invoke(msg);
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-}
diff --git a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyProvider.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyProvider.java
deleted file mode 100644
index f6453e2b65..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyProvider.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.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.policy.util.PolicyHandler;
-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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyInterceptor.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyInterceptor.java
deleted file mode 100644
index 1b8ceb1515..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyInterceptor.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 javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-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 BasicAuthenticationServicePolicyInterceptor implements Interceptor {
- public static final QName policySetQName = new QName(Constants.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) {
-
- String username = (String)msg.getQoSContext().get(BasicAuthenticationPolicy.BASIC_AUTHENTICATION_USERNAME);
- String password = (String)msg.getQoSContext().get(BasicAuthenticationPolicy.BASIC_AUTHENTICATION_PASSWORD);
-
- if (username != null) {
-
- System.out.println("Username: " + username + " Password: " + password);
- // could call out here to some 3rd part system to do whatever you
- // need to turn credentials into a principal
-
- msg.getQoSContext().put(Message.QOS_CTX_SECURITY_PRINCIPAL, username);
- }
-
- return getNext().invoke(msg);
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-}
diff --git a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyProvider.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyProvider.java
deleted file mode 100644
index 9bbb0e2d33..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyProvider.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.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.policy.util.PolicyHandler;
-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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicy.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicy.java
deleted file mode 100644
index d58fa51256..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicy.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.policy.authorization;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * Models the SCA Implementation Security Policy Assertion for Authorization.
- *
- * @version $Rev$ $Date$
- */
-public class AuthorizationPolicy implements Policy {
- public static final QName NAME = new QName(Constants.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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicyProcessor.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicyProcessor.java
deleted file mode 100644
index dcc85f809c..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicyProcessor.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.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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.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(ModelFactoryExtensionPoint 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 = new ProblemImpl(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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicy.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicy.java
deleted file mode 100644
index 8f848ef06a..0000000000
--- a/branches/sca-android/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.assembly.xml.Constants;
-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 {
- public static final QName NAME = new QName(Constants.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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProcessor.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProcessor.java
deleted file mode 100644
index bdf40f999f..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProcessor.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.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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.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(ModelFactoryExtensionPoint 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 = new ProblemImpl(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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityPolicyDefinitionsProvider.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityPolicyDefinitionsProvider.java
deleted file mode 100644
index cfe856e0f2..0000000000
--- a/branches/sca-android/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.SCADefinitions;
-import org.apache.tuscany.sca.definitions.util.SCADefinitionsUtil;
-import org.apache.tuscany.sca.provider.SCADefinitionsProvider;
-import org.apache.tuscany.sca.provider.SCADefinitionsProviderException;
-
-/**
- * Provider for Policy Intents and PolicySet definitions related to security
- *
- * @version $Rev$ $Date$
- */
-public class SecurityPolicyDefinitionsProvider implements SCADefinitionsProvider {
- 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(SCADefinitions.class);
- }
-
- public SCADefinitions getSCADefinition() throws SCADefinitionsProviderException {
- SCADefinitions scaDefns = null;
- SCADefinitions 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 = (SCADefinitions)urlArtifactProcessor.read(null,
- uri,
- definitionsFileUrl);
-
- definitionsFileUrl = AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- return getClass().getClassLoader().getResource(tuscanyDefinitionsFile);
- }
- });
-
- uri = new URI(definitionsFile);
- tuscanyDefns = (SCADefinitions)urlArtifactProcessor.read(null,
- uri,
- definitionsFileUrl);
-
- SCADefinitionsUtil.aggregateSCADefinitions(tuscanyDefns, scaDefns);
- return scaDefns;
-
- } catch ( Exception e ) {
- throw new SCADefinitionsProviderException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationImplementationPolicyProvider.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationImplementationPolicyProvider.java
deleted file mode 100644
index 185982a749..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationInterceptor.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationInterceptor.java
deleted file mode 100644
index 328c290fad..0000000000
--- a/branches/sca-android/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.osoa.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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java
deleted file mode 100644
index f41d36194a..0000000000
--- a/branches/sca-android/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.assembly.xml.Constants;
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JaasAuthenticationPolicy implements Policy {
- public static final QName NAME = new QName(Constants.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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java
deleted file mode 100644
index b7736fa817..0000000000
--- a/branches/sca-android/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.assembly.xml.Constants;
-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";
- public static final QName policySetQName = new QName(Constants.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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProcessor.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProcessor.java
deleted file mode 100644
index 48d8731552..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProcessor.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.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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-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";
- public static final QName CALLBACK_HANDLER_QNAME = new QName(Constants.SCA10_TUSCANY_NS,
- callbackHandler);
- public static final QName CONFIGURATION_QNAME = new QName(Constants.SCA10_TUSCANY_NS,
- "configurationName");
- private Monitor monitor;
-
- public QName getArtifactType() {
- return JAAS_AUTHENTICATION_POLICY_QNAME;
- }
-
- public JaasAuthenticationPolicyProcessor(ModelFactoryExtensionPoint 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 = new ProblemImpl(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", Constants.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/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProviderFactory.java b/branches/sca-android/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProviderFactory.java
deleted file mode 100644
index 48a42eb711..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 3a514e6088..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /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 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#securityIdentity,model=org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicy
-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.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/branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory b/branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
deleted file mode 100644
index 95263b8836..0000000000
--- a/branches/sca-android/modules/policy-security/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.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
diff --git a/branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider b/branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider
deleted file mode 100644
index 790424df6b..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider
+++ /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/branches/sca-android/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/definitions.xml b/branches/sca-android/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/definitions.xml
deleted file mode 100644
index e1be4ab03c..0000000000
--- a/branches/sca-android/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">
- <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">
- <description>
- Specifying this intent requires message exchanged to be encrypted
- </description>
- </intent>
-
- <intent name="integrity"
- constrains="sca:binding">
- <description>
- Specifying this intent requires message exchanged to be signed
- </description>
- </intent>
-</definitions> \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/tuscany_definitions.xml b/branches/sca-android/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/tuscany_definitions.xml
deleted file mode 100644
index f5b79af7ee..0000000000
--- a/branches/sca-android/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/tuscany_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.
--->
-<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="jaasAuthentication" constrains="sca:implementation.java">
- <description>All invocations to be authenticated</description>
- </intent>
-</definitions> \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-security/src/main/resources/policy-security-validation-messages.properties b/branches/sca-android/modules/policy-security/src/main/resources/policy-security-validation-messages.properties
deleted file mode 100644
index ebb47f2b60..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/policy-security/src/test/java/org/apache/tuscany/sca/policy/security/PolicyProcessorTestCase.java b/branches/sca-android/modules/policy-security/src/test/java/org/apache/tuscany/sca/policy/security/PolicyProcessorTestCase.java
deleted file mode 100644
index 2414fd777e..0000000000
--- a/branches/sca-android/modules/policy-security/src/test/java/org/apache/tuscany/sca/policy/security/PolicyProcessorTestCase.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.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 junit.framework.Assert;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-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.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PolicyProcessorTestCase {
- 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(Constants.SCA10_NS, "allow"), new AuthorizationPolicyProcessor(null,null));
- processors.put(new QName(Constants.SCA10_NS, "permitAll"), new AuthorizationPolicyProcessor(null,null));
- processors.put(new QName(Constants.SCA10_NS, "denyAll"), new AuthorizationPolicyProcessor(null,null));
- processors.put(new QName(Constants.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/branches/sca-android/modules/policy-security/src/test/resources/org/apache/tuscany/sca/policy/security/mock_policy_definitions.xml b/branches/sca-android/modules/policy-security/src/test/resources/org/apache/tuscany/sca/policy/security/mock_policy_definitions.xml
deleted file mode 100644
index 53d1a581f0..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/policy-transaction/LICENSE b/branches/sca-android/modules/policy-transaction/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/policy-transaction/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/policy-transaction/META-INF/README b/branches/sca-android/modules/policy-transaction/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/policy-transaction/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/policy-transaction/NOTICE b/branches/sca-android/modules/policy-transaction/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/policy-transaction/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/branches/sca-android/modules/policy-transaction/pom.xml b/branches/sca-android/modules/policy-transaction/pom.xml
deleted file mode 100644
index 42f4005306..0000000000
--- a/branches/sca-android/modules/policy-transaction/pom.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-policy-transaction</artifactId>
- <name>Apache Tuscany SCA Transaction Policy Model</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.components</groupId>
- <artifactId>geronimo-transaction</artifactId>
- <version>2.1.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.components</groupId>
- <artifactId>geronimo-connector</artifactId>
- <version>2.1.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <!--
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>4.1.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-ra</artifactId>
- <version>4.1.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.3.1.4</version>
- <scope>test</scope>
- </dependency>
- -->
- <!--
- <dependency>
- <groupId>jotm</groupId>
- <artifactId>jotm</artifactId>
- <version>2.0.10</version>
- <exclusions>
- <exclusion>
- <artifactId>jta</artifactId>
- <groupId>javax.transaction</groupId>
- </exclusion>
- <exclusion>
- <artifactId>connector</artifactId>
- <groupId>javax.resource</groupId>
- </exclusion>
- </exclusions>
- </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.policy.transaction</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.policy.transaction*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/IncompatibleIntentException.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/IncompatibleIntentException.java
deleted file mode 100644
index 8a242924ee..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/IncompatibleIntentException.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.policy.transaction;
-
-/**
- * @version $Rev$ $Date$
- */
-public class IncompatibleIntentException extends Exception {
- private static final long serialVersionUID = -2993825019200280397L;
-
- public IncompatibleIntentException() {
- super();
- }
-
- public IncompatibleIntentException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public IncompatibleIntentException(String message) {
- super(message);
- }
-
- public IncompatibleIntentException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionImplementationPolicyProvider.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionImplementationPolicyProvider.java
deleted file mode 100644
index 3c11fef865..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionImplementationPolicyProvider.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.policy.transaction;
-
-import java.util.List;
-
-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;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TransactionImplementationPolicyProvider implements PolicyProvider {
- private TransactionManagerHelper helper;
- private List<PolicySet> policySets;
-
- public TransactionImplementationPolicyProvider(TransactionManagerHelper helper, PolicySetAttachPoint attachPoint) {
- super();
- this.helper = helper;
- this.policySets = attachPoint.getApplicablePolicySets();
- }
-
- public Interceptor createInterceptor(Operation operation) {
- for (PolicySet policySet : policySets) {
- for (Object p : policySet.getPolicies()) {
- if (p instanceof TransactionPolicy) {
- TransactionInterceptor interceptor =
- new TransactionInterceptor(helper, false, (TransactionPolicy)p, null);
- return interceptor;
- }
- }
- }
- return null;
- }
-
- public String getPhase() {
- return Phase.IMPLEMENTATION_POLICY;
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionIntent.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionIntent.java
deleted file mode 100644
index b3e90c23cd..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionIntent.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.policy.transaction;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public enum TransactionIntent {
- managedTransactionLocal, managedTransactionGlobal, noManagedTransaction, propagatesTransacton, suspendsTransaction, transactedOneWay, immediateOneWay
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionInterceptor.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionInterceptor.java
deleted file mode 100644
index 0de98592cb..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionInterceptor.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.policy.transaction;
-
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TransactionInterceptor implements Interceptor {
- private Invoker next;
- private TransactionManagerHelper helper;
- private boolean outbound;
- private TransactionPolicy interactionPolicy;
- private TransactionPolicy implementationPolicy;
-
- public TransactionInterceptor(TransactionManagerHelper helper,
- boolean outbound,
- TransactionPolicy interactionPolicy,
- TransactionPolicy implementationPolicy) {
- super();
- this.helper = helper;
- this.outbound = outbound;
- this.interactionPolicy = interactionPolicy;
- this.implementationPolicy = implementationPolicy;
- }
-
- /**
- * @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) {
- TransactionalInvocation invocation = new TransactionalInvocation(next, msg);
-
- Message result = null;
- if (msg.getOperation().isNonBlocking()) {
-
- }
- TransactionIntent interactionIntent = TransactionIntent.propagatesTransacton;
- if (interactionPolicy != null) {
- if (interactionPolicy.getAction() == TransactionPolicy.Action.PROPAGATE) {
- interactionIntent = TransactionIntent.propagatesTransacton;
- } else {
- interactionIntent = TransactionIntent.suspendsTransaction;
- }
- }
- TransactionIntent implementationIntent = TransactionIntent.managedTransactionGlobal;
- if (implementationPolicy != null) {
- switch (implementationPolicy.getAction()) {
- case REQUIRE_GLOBAL:
- implementationIntent = TransactionIntent.managedTransactionGlobal;
- break;
- case REQUIRE_LOCAL:
- implementationIntent = TransactionIntent.managedTransactionLocal;
- break;
- default:
- implementationIntent = TransactionIntent.noManagedTransaction;
- break;
- }
- }
- try {
- if (outbound) {
- result = helper.handlesOutbound(interactionIntent, implementationIntent, invocation);
- } else {
- result = helper.handlesInbound(interactionIntent, implementationIntent, invocation);
- }
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return result;
- }
-
- private static class TransactionalInvocation implements TransactionalAction<Message> {
- private final Invoker invoker;
- private final Message message;
-
- public TransactionalInvocation(Invoker invoker, Message message) {
- super();
- this.invoker = invoker;
- this.message = message;
- }
-
- public Message run() throws Exception {
- return invoker.invoke(message);
- }
-
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerHelper.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerHelper.java
deleted file mode 100644
index defe12967e..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerHelper.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.policy.transaction;
-
-import java.lang.reflect.InvocationTargetException;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.InvalidTransactionException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TransactionManagerHelper {
- // private static final Logger logger = Logger.getLogger(TransactionManagerHelper.class.getName());
-
- private TransactionManager tm;
-
- public TransactionManagerHelper(TransactionManager tm) {
- super();
- this.tm = tm;
- }
-
- public Transaction managedGlobalTransactionPreInvoke() throws SystemException, NotSupportedException {
- int status = tm.getStatus();
- if (status == Status.STATUS_COMMITTED || status == Status.STATUS_NO_TRANSACTION
- || status == Status.STATUS_ROLLEDBACK) {
- tm.begin();
- return tm.getTransaction();
- }
- return null;
- }
-
- public void managedGlobalTransactionPostInvoke(Transaction created, boolean rollback)
- throws InvalidTransactionException, IllegalStateException, SystemException, SecurityException,
- HeuristicMixedException, HeuristicRollbackException, RollbackException {
- if (created != null) {
- int status = created.getStatus();
- if (status == Status.STATUS_MARKED_ROLLBACK) {
- created.rollback();
- } else if (status == Status.STATUS_ACTIVE) {
- if (rollback) {
- created.rollback();
- } else {
- created.commit();
- }
- }
- }
- }
-
- public Transaction suspendsTransactionPreInvoke() throws SystemException {
- if (tm.getTransaction() != null) {
- return tm.suspend();
- } else {
- return null;
- }
- }
-
- public void suspendsTransactionPostInvoke(Transaction suspended) throws InvalidTransactionException,
- IllegalStateException, SystemException {
- if (suspended != null) {
- tm.resume(suspended);
- }
- }
-
- public TransactionManager getTransactionManager() {
- return tm;
- }
-
- public void setTransactionManager(TransactionManager tm) {
- this.tm = tm;
- }
-
- public void validateOneway(TransactionIntent onewayIntent, TransactionIntent implIntent)
- throws IncompatibleIntentException {
- if (onewayIntent == TransactionIntent.transactedOneWay) {
- if (implIntent != TransactionIntent.managedTransactionGlobal) {
- throw new IncompatibleIntentException(onewayIntent + "<-X->" + implIntent);
- }
- }
- }
-
- public void validateInbound(TransactionIntent serviceIntent, TransactionIntent implIntent)
- throws IncompatibleIntentException {
- if (serviceIntent == TransactionIntent.propagatesTransacton) {
- if (implIntent != TransactionIntent.managedTransactionGlobal) {
- throw new IncompatibleIntentException(serviceIntent + "<-X->" + implIntent);
- }
- }
- }
-
- public void validateOutbound(TransactionIntent referenceIntent, TransactionIntent implIntent)
- throws IncompatibleIntentException {
- if (referenceIntent == TransactionIntent.propagatesTransacton) {
- if (implIntent != TransactionIntent.managedTransactionGlobal) {
- throw new IncompatibleIntentException(referenceIntent + "<-X->" + implIntent);
- }
- }
- }
-
- public <T> T handlesOutbound(TransactionIntent referenceIntent,
- TransactionIntent implIntent,
- TransactionalAction<T> action) throws Exception {
-
- if (implIntent == null) {
- implIntent = TransactionIntent.noManagedTransaction;
- }
-
- if (referenceIntent == TransactionIntent.propagatesTransacton) {
- if (implIntent != TransactionIntent.managedTransactionGlobal) {
- throw new IncompatibleIntentException(referenceIntent + "<-X->" + implIntent);
- } else {
- // propagates the current TX
- return run(action);
- }
- } else if (referenceIntent == TransactionIntent.suspendsTransaction) {
- Transaction tx = suspendsTransactionPreInvoke();
- try {
- return run(action);
- } finally {
- suspendsTransactionPostInvoke(tx);
- }
- } else {
- return run(action);
- }
- }
-
- private <T> T run(TransactionalAction<T> action) throws Exception {
- // Make sure a global TX is in place
- Transaction tx = managedGlobalTransactionPreInvoke();
- boolean rollback = false;
- try {
- return action.run();
- } catch (InvocationTargetException e) {
- throw e;
- } catch (Throwable e) {
- rollback = true;
- if (e instanceof Error) {
- throw (Error)e;
- } else if (e instanceof RuntimeException) {
- throw (RuntimeException)e;
- } else {
- throw (Exception)e;
- }
- } finally {
- managedGlobalTransactionPostInvoke(tx, rollback);
- }
- }
-
- public <T> T handlesInbound(TransactionIntent serviceIntent,
- TransactionIntent implIntent,
- TransactionalAction<T> action) throws Exception {
- if (serviceIntent == null && implIntent == null) {
- return run(action);
- }
-
- if (implIntent == null) {
- implIntent = TransactionIntent.noManagedTransaction;
- }
-
- if (serviceIntent == TransactionIntent.propagatesTransacton) {
- if (implIntent != TransactionIntent.managedTransactionGlobal) {
- throw new IncompatibleIntentException(serviceIntent + "<-X->" + implIntent);
- } else {
- return run(action);
- }
- } else if (serviceIntent == TransactionIntent.suspendsTransaction) {
- Transaction tx1 = suspendsTransactionPreInvoke();
- try {
- if (implIntent == TransactionIntent.managedTransactionGlobal) {
- return run(action);
- } else {
- return action.run();
- }
- } finally {
- suspendsTransactionPostInvoke(tx1);
- }
- } else {
- if (implIntent == TransactionIntent.managedTransactionGlobal) {
- // Start a new TX
- return run(action);
- } else {
- return action.run();
- }
- }
- }
-
- public <T> void handlesOneWay(TransactionIntent onewayIntent,
- TransactionIntent implIntent,
- TransactionalAction<T> action) throws Exception {
- if (implIntent == null) {
- implIntent = TransactionIntent.noManagedTransaction;
- }
-
- if (onewayIntent == null) {
- // Assume transactedOneWay
- run(action);
- return;
- }
-
- if (onewayIntent == TransactionIntent.transactedOneWay) {
- if (implIntent != TransactionIntent.managedTransactionGlobal) {
- throw new IncompatibleIntentException(onewayIntent + "<-X->" + implIntent);
- } else {
- run(action);
- return;
- }
- } else {
- // TransactionIntent.immediateOneWay
- Transaction tx = suspendsTransactionPreInvoke();
- try {
- run(action);
- return;
- } finally {
- suspendsTransactionPostInvoke(tx);
- }
- }
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerWrapper.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerWrapper.java
deleted file mode 100644
index 31beab4fca..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerWrapper.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.transaction;
-
-import java.io.File;
-
-import javax.transaction.TransactionManager;
-
-import org.apache.geronimo.transaction.log.HOWLLog;
-import org.apache.geronimo.transaction.manager.GeronimoTransactionManager;
-import org.apache.geronimo.transaction.manager.XidFactory;
-import org.apache.geronimo.transaction.manager.XidFactoryImpl;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TransactionManagerWrapper {
- private TransactionManager transactionManager;
- private HOWLLog howlLog;
-
- private String logFileDir = "target/logs";
- private String bufferClassName = "org.objectweb.howl.log.BlockLogBuffer";
- private int bufferSizeKBytes = 32;
- private boolean checksumEnabled = true;
- private boolean adler32Checksum = true;
- private int flushSleepTimeMilliseconds = 50;
- private String logFileExt = "log";
- private String logFileName = "transaction";
- private int maxBlocksPerFile = -1;
- private int maxLogFiles = 2;
- private int maxBuffers = 0;
- private int minBuffers = 4;
- private int threadsWaitingForceThreshold = -1;
- private File serverBaseDir = new File(System.getProperty("basedir", System.getProperty("user.dir")));
-
- public TransactionManagerWrapper() {
- super();
- }
-
- public void start() {
- try {
- XidFactory xidFactory = new XidFactoryImpl();
- howlLog =
- new HOWLLog(bufferClassName, bufferSizeKBytes, checksumEnabled, adler32Checksum,
- flushSleepTimeMilliseconds, logFileDir, logFileExt, logFileName, maxBlocksPerFile,
- maxBuffers, maxLogFiles, minBuffers, threadsWaitingForceThreshold, xidFactory,
- serverBaseDir);
-
- howlLog.doStart();
- transactionManager = new GeronimoTransactionManager(1200, xidFactory, howlLog);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.core.ModuleActivator#stop(org.apache.tuscany.sca.core.ExtensionPointRegistry)
- */
- public void stop() {
- try {
- if (howlLog != null) {
- howlLog.doStop();
- }
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- public TransactionManager getTransactionManager() {
- return transactionManager;
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionModuleActivator.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionModuleActivator.java
deleted file mode 100644
index 3339f2e338..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionModuleActivator.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.policy.transaction;
-
-import javax.transaction.TransactionManager;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TransactionModuleActivator implements ModuleActivator {
- private TransactionManagerWrapper wrapper;
-
- /**
- * @see org.apache.tuscany.sca.core.ModuleActivator#start(org.apache.tuscany.sca.core.ExtensionPointRegistry)
- */
- public void start(ExtensionPointRegistry registry) {
- if (registry != null) {
- UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
- TransactionManager transactionManager = utilities.getUtility(TransactionManager.class);
- if (transactionManager != null) {
- // The transaction manage is provided by the hosting environment
-// RuntimeWireProcessorExtensionPoint wireProcessorExtensionPoint =
-// registry.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class);
-// TransactionManagerHelper helper = new TransactionManagerHelper(transactionManager);
-// wireProcessorExtensionPoint.addWireProcessor(new TransactionRuntimeWireProcessor(helper));
- return;
- }
- }
- try {
- wrapper = new TransactionManagerWrapper();
- wrapper.start();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- if (registry != null) {
- UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
- utilities.addUtility(wrapper.getTransactionManager());
-// RuntimeWireProcessorExtensionPoint wireProcessorExtensionPoint =
-// registry.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class);
-// TransactionManagerHelper helper = new TransactionManagerHelper(wrapper.getTransactionManager());
-// wireProcessorExtensionPoint.addWireProcessor(new TransactionRuntimeWireProcessor(helper));
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.core.ModuleActivator#stop(org.apache.tuscany.sca.core.ExtensionPointRegistry)
- */
- public void stop(ExtensionPointRegistry registry) {
- try {
- if (wrapper != null) {
- wrapper.stop();
- wrapper = null;
- }
- if (registry != null && wrapper != null) {
- UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
- utilities.removeUtility(wrapper.getTransactionManager());
- }
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicy.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicy.java
deleted file mode 100644
index a13748f232..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicy.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.policy.transaction;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * The model for Tuscany transaction policy
- *
- * @version $Rev$ $Date$
- */
-public interface TransactionPolicy extends Policy {
- QName NAME = new QName(Constants.SCA10_TUSCANY_NS, "transactionPolicy");
-
- enum Action {
- PROPAGATE, SUSPEND, REQUIRE_GLOBAL, REQUIRE_LOCAL, REQUIRE_NONE
- };
-
- int getTransactionTimeout();
-
- void setTransactionTimeout(int seconds);
-
- void setAction(Action action);
-
- Action getAction();
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyDefinitionsProvider.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyDefinitionsProvider.java
deleted file mode 100644
index 7b10a7d568..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyDefinitionsProvider.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.transaction;
-
-import java.net.URI;
-import java.net.URL;
-
-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.SCADefinitions;
-import org.apache.tuscany.sca.definitions.util.SCADefinitionsUtil;
-import org.apache.tuscany.sca.provider.SCADefinitionsProvider;
-import org.apache.tuscany.sca.provider.SCADefinitionsProviderException;
-
-/**
- * Provider for Policy Intents and PolicySet definitions related to transaction
- *
- * @version $Rev$ $Date$
- */
-public class TransactionPolicyDefinitionsProvider implements SCADefinitionsProvider {
- private static final String scaDefinitionsFile = "definitions.xml";
- private static final String tuscanyDefinitionsFile = "tuscany_definitions.xml";
- private URLArtifactProcessor urlArtifactProcessor;
-
- public TransactionPolicyDefinitionsProvider(ExtensionPointRegistry registry) {
- URLArtifactProcessorExtensionPoint documentProcessors =
- registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- urlArtifactProcessor = (URLArtifactProcessor)documentProcessors.getProcessor(SCADefinitions.class);
- }
-
- public SCADefinitions getSCADefinition() throws SCADefinitionsProviderException {
-
- try {
- SCADefinitions scaTransactionPolicyDefns = null;
- SCADefinitions tuscanyTransactionPolicyDefns = null;
-
- URI uri = new URI(scaDefinitionsFile);
- URL defintionsFileUrl = getClass().getResource(scaDefinitionsFile);
- scaTransactionPolicyDefns = (SCADefinitions)urlArtifactProcessor.read(null, uri, defintionsFileUrl);
-
- uri = new URI(tuscanyDefinitionsFile);
- defintionsFileUrl = getClass().getResource(tuscanyDefinitionsFile);
- tuscanyTransactionPolicyDefns = (SCADefinitions)urlArtifactProcessor.read(null, uri, defintionsFileUrl);
-
- SCADefinitionsUtil.aggregateSCADefinitions(tuscanyTransactionPolicyDefns, scaTransactionPolicyDefns);
-
- return scaTransactionPolicyDefns;
- } catch (Exception e) {
- throw new SCADefinitionsProviderException(e);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyImpl.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyImpl.java
deleted file mode 100644
index f178876a72..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyImpl.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.policy.transaction;
-
-import javax.xml.namespace.QName;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TransactionPolicyImpl implements TransactionPolicy {
- private boolean unresolved;
- private int transactionTimeout = 1200;
- private Action action = Action.PROPAGATE;
-
- public int getTransactionTimeout() {
- return transactionTimeout;
- }
-
- public void setTransactionTimeout(int transactionTimeout) {
- this.transactionTimeout = transactionTimeout;
- }
-
- public Action getAction() {
- return action;
- }
-
- public void setAction(Action policy) {
- this.action = policy;
- }
-
- public QName getSchemaName() {
- return NAME;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyProcessor.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyProcessor.java
deleted file mode 100644
index 0579890a42..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyProcessor.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.transaction;
-
-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.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TransactionPolicyProcessor implements StAXArtifactProcessor<TransactionPolicy> {
- public static final String TIMEOUT = "transactionTimeout";
- public static final String ACTION = "action";
-
- public QName getArtifactType() {
- return TransactionPolicy.NAME;
- }
-
- public TransactionPolicyProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- }
-
- public TransactionPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- TransactionPolicy txPolicy = new TransactionPolicyImpl();
- int event = reader.getEventType();
- while (reader.hasNext()) {
- event = reader.getEventType();
- switch (event) {
- case START_ELEMENT: {
- String timeout = reader.getAttributeValue(null, TIMEOUT);
- if (timeout != null) {
- txPolicy.setTransactionTimeout(Integer.parseInt(timeout));
- }
- String action = reader.getAttributeValue(null, ACTION);
- if (action != null) {
- txPolicy.setAction(TransactionPolicy.Action.valueOf(action));
- }
- break;
- }
- }
-
- if (event == END_ELEMENT) {
- if (TransactionPolicy.NAME.equals(reader.getName())) {
- break;
- }
- }
-
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
-
- return txPolicy;
- }
-
- public void write(TransactionPolicy policy, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- }
-
- public Class<TransactionPolicy> getModelType() {
- return TransactionPolicy.class;
- }
-
- public void resolve(TransactionPolicy policy, ModelResolver resolver) throws ContributionResolveException {
-
- }
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyProviderFactory.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyProviderFactory.java
deleted file mode 100644
index be97090378..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionPolicyProviderFactory.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.policy.transaction;
-
-import javax.transaction.TransactionManager;
-
-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.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-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 TransactionPolicyProviderFactory implements PolicyProviderFactory<TransactionPolicy> {
- private TransactionManagerHelper helper;
-
- public TransactionPolicyProviderFactory(ExtensionPointRegistry registry) {
- super();
- UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
- TransactionManager tm = utilities.getUtility(TransactionManager.class);
- this.helper = new TransactionManagerHelper(tm);
- }
-
- /**
- * @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) {
- if (component instanceof PolicySetAttachPoint) {
- return new TransactionImplementationPolicyProvider(helper, (PolicySetAttachPoint)component);
- } else {
- 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) {
- if (binding instanceof PolicySetAttachPoint) {
- return new TransactionReferencePolicyProvider(helper, (PolicySetAttachPoint)binding);
- } else {
- 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) {
- if (binding instanceof PolicySetAttachPoint) {
- return new TransactionServicePolicyProvider(helper, (PolicySetAttachPoint)binding);
- } else {
- return null;
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class<TransactionPolicy> getModelType() {
- return TransactionPolicy.class;
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionReferencePolicyProvider.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionReferencePolicyProvider.java
deleted file mode 100644
index 0795a4e5cf..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionReferencePolicyProvider.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.policy.transaction;
-
-import java.util.List;
-
-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;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TransactionReferencePolicyProvider implements PolicyProvider {
- private TransactionManagerHelper helper;
- private List<PolicySet> policySets;
-
- public TransactionReferencePolicyProvider(TransactionManagerHelper helper, PolicySetAttachPoint attachPoint) {
- super();
- this.helper = helper;
- this.policySets = attachPoint.getApplicablePolicySets();
- }
-
- public Interceptor createInterceptor(Operation operation) {
- for (PolicySet policySet : policySets) {
- for (Object p : policySet.getPolicies()) {
- if (p instanceof TransactionPolicy) {
- TransactionInterceptor interceptor =
- new TransactionInterceptor(helper, true, (TransactionPolicy)p, null);
- return interceptor;
- }
- }
- }
- return null;
- }
-
- public String getPhase() {
- return Phase.REFERENCE_POLICY;
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionServicePolicyProvider.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionServicePolicyProvider.java
deleted file mode 100644
index 9f9088a380..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionServicePolicyProvider.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.policy.transaction;
-
-import java.util.List;
-
-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;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TransactionServicePolicyProvider implements PolicyProvider {
- private TransactionManagerHelper helper;
- private List<PolicySet> policySets;
-
- public TransactionServicePolicyProvider(TransactionManagerHelper helper, PolicySetAttachPoint attachPoint) {
- super();
- this.helper = helper;
- this.policySets = attachPoint.getApplicablePolicySets();
- }
-
- public Interceptor createInterceptor(Operation operation) {
- for (PolicySet policySet : policySets) {
- for (Object p : policySet.getPolicies()) {
- if (p instanceof TransactionPolicy) {
- TransactionInterceptor interceptor =
- new TransactionInterceptor(helper, true, (TransactionPolicy)p, null);
- return interceptor;
- }
- }
- }
- return null;
- }
-
- public String getPhase() {
- return Phase.SERVICE_POLICY;
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionalAction.java b/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionalAction.java
deleted file mode 100644
index 5a7ae5c4cc..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/TransactionalAction.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.policy.transaction;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface TransactionalAction<T> {
- /**
- * @return
- * @throws Exception
- */
- T run() throws Exception;
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 1d034e23a2..0000000000
--- a/branches/sca-android/modules/policy-transaction/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.transaction.TransactionPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#transactionPolicy,model=org.apache.tuscany.sca.policy.transaction.TransactionPolicy \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index 9a35d62cad..0000000000
--- a/branches/sca-android/modules/policy-transaction/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.policy.transaction.TransactionModuleActivator
diff --git a/branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory b/branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
deleted file mode 100644
index eeec814f60..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
+++ /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 policy extension
-org.apache.tuscany.sca.policy.transaction.TransactionPolicyProviderFactory;model=org.apache.tuscany.sca.policy.transaction.TransactionPolicy
diff --git a/branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider b/branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider
deleted file mode 100644
index e9d9fab519..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider
+++ /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.transaction.TransactionPolicyDefinitionsProvider \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-transaction/src/main/resources/log4j.properties b/branches/sca-android/modules/policy-transaction/src/main/resources/log4j.properties
deleted file mode 100644
index 698ee41d7e..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/resources/log4j.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.
-#
-# Set root logger level to DEBUG and its only appender to A1.
-log4j.rootLogger=INFO, CONSOLE
-
-# CONSOLE is set to be a ConsoleAppender.
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-
-# A1 uses PatternLayout.
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-
-
-# Print only messages of level WARN or above in the package com.foo.
-log4j.logger.org.apache.tuscany=INFO \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/definitions.xml b/branches/sca-android/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/definitions.xml
deleted file mode 100644
index ff51b131b7..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/definitions.xml
+++ /dev/null
@@ -1,66 +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">
-
- <intent name="managedTransaction" constrains="implementation">
- <description>Used to indicate the transaction environment desired by a component implementation.</description>
- </intent>
- <intent name="managedTransaction.global">
- <description>
- Used to indicate that a component implementation requires a managed global transaction.
- </description>
- </intent>
- <intent name="managedTransaction.local">
- <description>
- Used to indicate that a component implementation requires a managed local transaction.
- </description>
- </intent>
- <intent name="noManagedTransaction" constrains="implementation">
- <description>
- Used to indicate that a component implementation will manage its own transaction resources.
- </description>
- </intent>
- <intent name="propagatesTransaction" constrains="binding">
- <description>
- Used to indicate that a reference will propagate any client transaction or that a service will be dispatched
- under any received transaction.
- </description>
- </intent>
- <intent name="suspendsTransaction" constrains="binding">
- <description>
- Used to indicate that a reference will not propagate any client transaction or that a service will not be
- dispatched under any received transaction.
- </description>
- </intent>
- <intent name="transactedOneWay" constrains="binding">
- <description>
- Used to indicate that the component requires the SCA runtime to transact OneWay send of messages as part of
- any client global transaction or to transact oneWay message receipt as part of any service global
- transaction.
- </description>
- </intent>
- <intent name="immediateOneWay" constrains="binding">
- <description>
- Used to indicate that the component requires the SCA runtime to process the sending or receiving of OneWay
- messages immediately, regardless of any transaction under which the sending/receiving component runs.
- </description>
- </intent>
-</definitions> \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/tuscany_definitions.xml b/branches/sca-android/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/tuscany_definitions.xml
deleted file mode 100644
index 324fa03da6..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/tuscany_definitions.xml
+++ /dev/null
@@ -1,54 +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">
-
- <policySet name="ManagedTransactionPolicySet" provides="managedTransaction" appliesTo="implementation">
- <intentMap provides="managedTransaction" default="global">
- <qualifier name="global">
- <tuscany:transactionPolicy transactionTimeout="1200" action="REQUIRE_GLOBAL" />
- </qualifier>
- <qualifier name="local">
- <tuscany:transactionPolicy transactionTimeout="1200" action="REQUIRE_LOCAL" />
- </qualifier>
- </intentMap>
- </policySet>
-
- <policySet name="NoManagedTransactionPolicySet" provides="noManagedTransaction"
- appliesTo="implementation">
- <tuscany:transactionPolicy action="REQUIRE_NONE" />
- </policySet>
-
- <policySet name="PropagatesTransactionPolicySet" provides="propagatesTransaction" appliesTo="binding">
- <tuscany:transactionPolicy action="PROPAGATE" />
- </policySet>
-
- <policySet name="SuspendsTransactionPolicySet" provides="suspendsTransaction" appliesTo="binding">
- <tuscany:transactionPolicy action="SUSPEND" />
- </policySet>
-
- <policySet name="TransactedOneWayPolicySet" provides="transactedOneWay" appliesTo="binding">
- <tuscany:transactionPolicy action="PROPAGATE" />
- </policySet>
-
- <policySet name="ImmediateOneWayPolicySet" provides="immediateOneWay" appliesTo="binding">
- <tuscany:transactionPolicy action="SUSPEND" />
- </policySet>
-</definitions> \ No newline at end of file
diff --git a/branches/sca-android/modules/policy-transaction/src/test/java/org/apache/tuscany/sca/policy/transaction/PolicyReadTestCase.java b/branches/sca-android/modules/policy-transaction/src/test/java/org/apache/tuscany/sca/policy/transaction/PolicyReadTestCase.java
deleted file mode 100644
index e8560d775d..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/test/java/org/apache/tuscany/sca/policy/transaction/PolicyReadTestCase.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.policy.transaction;
-
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-/**
- * Test the reading of ws config params policy.
- *
- * @version $Rev$ $Date$
- */
-public class PolicyReadTestCase extends TestCase {
-
- @Override
- public void setUp() throws Exception {
- }
-
- public void testPolicyReading() throws Exception {
-
- TransactionPolicyProcessor processor = new TransactionPolicyProcessor(null, null);
-
- URL url = getClass().getResource("/org/apache/tuscany/sca/policy/transaction/tuscany_definitions.xml");
- XMLInputFactory inputFactory = XMLInputFactory.newInstance();
-
- InputStream urlStream = url.openStream();
- XMLStreamReader reader = inputFactory.createXMLStreamReader(urlStream);
-
- TransactionPolicy policy = processor.read(reader);
- assertEquals(1200, policy.getTransactionTimeout());
- }
-
-}
diff --git a/branches/sca-android/modules/policy-transaction/src/test/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerHelperTestCase.java b/branches/sca-android/modules/policy-transaction/src/test/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerHelperTestCase.java
deleted file mode 100644
index 544e0f68c0..0000000000
--- a/branches/sca-android/modules/policy-transaction/src/test/java/org/apache/tuscany/sca/policy/transaction/TransactionManagerHelperTestCase.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.policy.transaction;
-
-import java.util.logging.Logger;
-
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-import junit.framework.TestCase;
-
-import org.apache.geronimo.transaction.manager.NamedXAResource;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TransactionManagerHelperTestCase extends TestCase {
- private static final Logger logger = Logger.getLogger(TransactionManagerHelper.class.getName());
-
- public static class MockXAResource implements NamedXAResource {
-
- private String rm;
- private String id;
- private int timeout = 1000;
-
- public MockXAResource(String rm, String id) {
- super();
- this.rm = rm;
- this.id = id;
- }
-
- public String getName() {
- return rm + ":" + id;
- }
-
- public void commit(Xid xid, boolean onePhase) throws XAException {
- logger.info(id + ": commit(" + xid + "," + onePhase + ")");
- }
-
- public void end(Xid xid, int flags) throws XAException {
- logger.info(id + ": end(" + xid + "," + toString(flags) + ")");
- }
-
- public void forget(Xid xid) throws XAException {
- logger.info(id + ": forget(" + xid + ")");
- }
-
- public int getTransactionTimeout() throws XAException {
- return timeout;
- }
-
- public boolean isSameRM(XAResource xares) throws XAException {
- if (xares instanceof MockXAResource) {
- MockXAResource res = (MockXAResource)xares;
- return res.rm.endsWith(rm);
- } else {
- return false;
- }
- }
-
- public int prepare(Xid xid) throws XAException {
- logger.info(id + ": prepare(" + xid + ")");
- return XA_OK;
- }
-
- public Xid[] recover(int flag) throws XAException {
- return null;
- }
-
- public void rollback(Xid xid) throws XAException {
- logger.info(id + ": rollback(" + xid + ")");
- }
-
- public boolean setTransactionTimeout(int seconds) throws XAException {
- this.timeout = seconds;
- return true;
- }
-
- public void start(Xid xid, int flags) throws XAException {
- logger.info(id + ": start(" + xid + "," + toString(flags) + ")");
- }
-
- private String toString(int flags) {
- StringBuffer sb = new StringBuffer();
- if ((flags & TMENDRSCAN) != 0) {
- sb.append("TMENDRSCAN ");
- }
- if ((flags & TMFAIL) != 0) {
- sb.append("TMFAIL ");
- }
- if ((flags & TMJOIN) != 0) {
- sb.append("TMJOIN ");
- }
- if ((flags & TMONEPHASE) != 0) {
- sb.append("TMONEPHASE ");
- }
- if ((flags & TMRESUME) != 0) {
- sb.append("TMRESUME ");
- }
- if ((flags & TMSTARTRSCAN) != 0) {
- sb.append("TMSTARTRSCAN ");
- }
- if ((flags & TMSUCCESS) != 0) {
- sb.append("TMSUCCESS ");
- }
- if ((flags & TMSUSPEND) != 0) {
- sb.append("TMSUSPEND ");
- }
- if (sb.length() == 0) {
- sb.append("TMNOFLAGS");
- } else {
- sb.deleteCharAt(sb.length() - 1);
- }
- return sb.toString();
- }
-
- }
-
- public void testHelper() throws Exception {
- TransactionManagerWrapper activator = new TransactionManagerWrapper();
- activator.start();
- TransactionManager tm = activator.getTransactionManager();
- // GeronimoUserTransaction tx = new GeronimoUserTransaction(tm);
- TransactionManagerHelper helper = new TransactionManagerHelper(tm);
-
- // No TX yet
- assertNull(tm.getTransaction());
- Transaction t1 = helper.managedGlobalTransactionPreInvoke();
- // Should create T1
- assertNotNull(t1);
- // The current TX should be T1
- assertSame(t1, tm.getTransaction());
-
- XAResource res1 = new MockXAResource("Derby", "001");
- XAResource res2 = new MockXAResource("DB2", "002");
- tm.getTransaction().enlistResource(res1);
- tm.getTransaction().enlistResource(res2);
-
- Transaction suspended = helper.suspendsTransactionPreInvoke();
- suspended.delistResource(res1, XAResource.TMSUSPEND);
- suspended.delistResource(res2, XAResource.TMSUSPEND);
-
- // T1 is suspended
- assertSame(t1, suspended);
- // No more active TX
- assertNull(tm.getTransaction());
-
- Transaction t2 = helper.managedGlobalTransactionPreInvoke();
- assertNotNull(t2);
- // The current TX should be T2
- assertSame(t2, tm.getTransaction());
-
- XAResource res3 = new MockXAResource("Oracle", "003");
- tm.getTransaction().enlistResource(res3);
-
- tm.getTransaction().delistResource(res3, XAResource.TMSUCCESS);
- tm.rollback();
-
- // Skip post
- // helper.managedGlobalTransactionPostInvoke(t2);
-
- helper.suspendsTransactionPostInvoke(suspended);
- suspended.enlistResource(res1);
- suspended.enlistResource(res2);
- // T1 is now resumed
- assertSame(t1, tm.getTransaction());
-
- helper.managedGlobalTransactionPostInvoke(t1, false);
- assertNotNull(tm.getTransaction());
- assertEquals(6, t1.getStatus());
-
- activator.stop();
- }
-}
diff --git a/branches/sca-android/modules/policy-xml-ws/LICENSE b/branches/sca-android/modules/policy-xml-ws/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/policy-xml-ws/META-INF/README b/branches/sca-android/modules/policy-xml-ws/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/policy-xml-ws/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/policy-xml-ws/NOTICE b/branches/sca-android/modules/policy-xml-ws/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/policy-xml-ws/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/branches/sca-android/modules/policy-xml-ws/pom.xml b/branches/sca-android/modules/policy-xml-ws/pom.xml
deleted file mode 100644
index f6d8a884ec..0000000000
--- a/branches/sca-android/modules/policy-xml-ws/pom.xml
+++ /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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.5</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.2</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.5</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.1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </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.policy.xml.ws</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.policy.xml</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/policy-xml-ws/src/main/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessor.java b/branches/sca-android/modules/policy-xml-ws/src/main/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessor.java
deleted file mode 100644
index 263c766948..0000000000
--- a/branches/sca-android/modules/policy-xml-ws/src/main/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessor.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.policy.xml.ws;
-
-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.axiom.om.OMNamespace;
-import org.apache.neethi.PolicyEngine;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.policy.xml.PolicyConstants;
-
-
-/**
- * Processor for handling xml models of PolicySet definitions
- *
- * @version $Rev$ $Date$
- */
-public class WSPolicyProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<org.apache.neethi.Policy>, PolicyConstants {
- 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(ModelFactoryExtensionPoint 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/branches/sca-android/modules/policy-xml-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/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/branches/sca-android/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/branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/TestModelResolver.java b/branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/TestModelResolver.java
deleted file mode 100644
index b887257efe..0000000000
--- a/branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/TestModelResolver.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.xml;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-
-/**
- * A default implementation of an artifact resolver, based on a map.
- *
- * @version $Rev$ $Date$
- */
-public class TestModelResolver implements ModelResolver {
- private static final long serialVersionUID = -7826976465762296634L;
-
- private Map<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/branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java b/branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java
deleted file mode 100644
index 8c138a57dd..0000000000
--- a/branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/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;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.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/branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/WSPolicyProcessorTestCase.java b/branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/WSPolicyProcessorTestCase.java
deleted file mode 100644
index 13b3c44521..0000000000
--- a/branches/sca-android/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/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;
-
-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/branches/sca-android/modules/policy-xml-ws/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml b/branches/sca-android/modules/policy-xml-ws/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
deleted file mode 100644
index 814476b4f9..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/pom.xml b/branches/sca-android/modules/pom.xml
index a5029efaa7..fffe442b51 100644
--- a/branches/sca-android/modules/pom.xml
+++ b/branches/sca-android/modules/pom.xml
@@ -43,123 +43,34 @@
<module>assembly</module>
<module>assembly-xml</module>
<module>assembly-xsd</module>
- <module>binding-corba</module>
- <module>binding-corba-runtime</module>
- <module>binding-ejb</module>
- <module>binding-ejb-runtime</module>
- <module>binding-atom</module>
- <module>binding-atom-abdera</module>
- <module>binding-gdata</module>
- <module>binding-gdata-runtime</module>
- <module>binding-gdata-gsoc</module>
- <module>binding-gdata-runtime-gsoc</module>
- <module>binding-http</module>
- <module>binding-http-runtime</module>
- <module>binding-jms</module>
- <module>binding-jms-runtime</module>
- <module>binding-jsonrpc</module>
- <module>binding-jsonrpc-runtime</module>
- <module>binding-rmi</module>
- <module>binding-rss</module>
- <module>binding-rss-rome</module>
- <module>binding-sca</module>
- <module>binding-sca-axis2</module>
- <module>binding-sca-corba</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-namespace</module>
<module>contribution-java</module>
<module>contribution-impl</module>
- <module>contribution-resource</module>
<module>contribution-xml</module>
<module>core</module>
<module>core-databinding</module>
<module>core-spi</module>
- <module>data-api</module>
<module>databinding</module>
- <module>databinding-axiom</module>
- <module>databinding-jaxb</module>
- <module>databinding-jaxb-axiom</module>
- <module>databinding-sdo</module>
- <module>databinding-sdo-axiom</module>
- <module>databinding-json</module>
- <module>databinding-saxon</module>
- <module>databinding-xmlbeans</module>
- <module>databinding-fastinfoset</module>
- <module>data-engine-helper</module>
<module>definitions</module>
<module>definitions-xml</module>
- <module>domain-manager</module>
<module>endpoint</module>
<module>extensibility</module>
- <module>extensibility-equinox</module>
- <module>extension-helper</module>
- <module>host-corba</module>
- <module>host-corba-jee</module>
- <module>host-corba-jse</module>
- <module>host-corba-jse-tns</module>
- <module>host-ejb</module>
<module>host-embedded</module>
- <module>host-http</module>
- <module>host-openejb</module>
- <module>host-rmi</module>
- <module>host-webapp</module>
- <module>host-webapp-junit</module>
- <module>host-jetty</module>
- <module>host-tomcat</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>implementation-bpel</module>
- <module>implementation-bpel-ode</module>
- <module>implementation-bpel-jbpm</module>
- <module>implementation-das</module>
- <module>implementation-data-xml</module>
- <module>implementation-ejb</module>
<module>implementation-java</module>
<module>implementation-java-xml</module>
<module>implementation-java-runtime</module>
<module>implementation-node</module>
<module>implementation-node-runtime</module>
- <module>implementation-resource</module>
- <module>implementation-resource-runtime</module>
- <module>implementation-script</module>
- <module>implementation-spring</module>
- <module>implementation-widget</module>
- <module>implementation-widget-runtime</module>
- <module>implementation-xquery</module>
<module>monitor</module>
- <module>monitor-logging</module>
<module>node-api</module>
<module>node-impl</module>
<module>node-launcher</module>
- <module>node-launcher-equinox</module>
- <module>thirdparty-library</module>
- <module>node-launcher-webapp</module>
- <module>node-manager</module>
<module>policy</module>
<module>policy-xml</module>
- <module>policy-xml-ws</module>
- <module>policy-logging</module>
- <module>policy-security</module>
- <module>policy-security-jsr250</module>
- <module>policy-security-ws</module>
- <module>policy-transaction</module>
<module>sca-api</module>
- <module>tracing-aspectj</module>
- <module>workspace</module>
- <module>workspace-impl</module>
- <module>workspace-xml</module>
- <module>xsd</module>
- <module>xsd-xml</module>
</modules>
</profile>
diff --git a/branches/sca-android/modules/thirdparty-library/META-INF/README b/branches/sca-android/modules/thirdparty-library/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/thirdparty-library/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/thirdparty-library/pom.xml b/branches/sca-android/modules/thirdparty-library/pom.xml
deleted file mode 100644
index db55bd3093..0000000000
--- a/branches/sca-android/modules/thirdparty-library/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-thirdparty-library</artifactId>
- <name>Apache Tuscany OSGi Bundle for Third Party Jars</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-all</artifactId>
- <type>pom</type>
- <version>1.4-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>${basedir}/lib</directory>
- <includes>
- <include>*</include>
- </includes>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-bundle-plugin</artifactId>
- <configuration>
- <copyJars>true</copyJars>
- </configuration>
- <executions>
- <execution>
- <id>build-manifest</id>
- <goals>
- <goal>build</goal>
- </goals>
- <phase>process-classes</phase>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/branches/sca-android/modules/tracing-aspectj/LICENSE b/branches/sca-android/modules/tracing-aspectj/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/branches/sca-android/modules/tracing-aspectj/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-android/modules/tracing-aspectj/META-INF/README b/branches/sca-android/modules/tracing-aspectj/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/tracing-aspectj/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/tracing-aspectj/NOTICE b/branches/sca-android/modules/tracing-aspectj/NOTICE
deleted file mode 100644
index 1325efd8bf..0000000000
--- a/branches/sca-android/modules/tracing-aspectj/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/branches/sca-android/modules/tracing-aspectj/launcher.bat b/branches/sca-android/modules/tracing-aspectj/launcher.bat
deleted file mode 100644
index a5305f486d..0000000000
--- a/branches/sca-android/modules/tracing-aspectj/launcher.bat
+++ /dev/null
@@ -1,5 +0,0 @@
-@echo off
-set TUSCANY_HOME=C:\Apache\tuscany-sca-1.3
-set ASPECTJ_WEAVER=%HOMEPATH%\.m2\repository\org\aspectj\aspectjweaver\1.6.1\aspectjweaver-1.6.1.jar
-set CP=%ASPECTJ_WEAVER%;%TUSCANY_HOME%\lib\tuscany-sca-manifest.jar;%TUSCANY_HOME%\samples\calculator\target\sample-calculator.jar
-java -javaagent:"%ASPECTJ_WEAVER%" -cp "%CP%;target\classes" calculator.CalculatorClient \ No newline at end of file
diff --git a/branches/sca-android/modules/tracing-aspectj/pom.xml b/branches/sca-android/modules/tracing-aspectj/pom.xml
deleted file mode 100644
index 00790ed621..0000000000
--- a/branches/sca-android/modules/tracing-aspectj/pom.xml
+++ /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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-tracing-aspectj</artifactId>
- <name>Apache Tuscany AOP-based Logging and Tracing</name>
- <dependencies>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>1.6.1</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjlib</artifactId>
- <version>1.6.1</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>1.6.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <!-- Copy the aspectjweaver jar to avoid surefire problems for
- directorites with space -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.0</version>
- <executions>
- <execution>
- <id>copy</id>
- <phase>process-sources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>1.6.1</version>
- <type>jar</type>
- <overWrite>true</overWrite>
- <outputDirectory>${project.build.directory}/dependency
- </outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!-- surefire plugin configuration -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>LATEST</version>
- <configuration>
- <includes>
- <include>**/*TestCase.java</include>
- </includes>
- <reportFormat>brief</reportFormat>
- <useFile>false</useFile>
- <forkMode>once</forkMode>
- <!-- I hit a bug in maven-surefire-plugin
- http://jira.codehaus.org/browse/SUREFIRE-128 -->
- <argLine>-ea -Xmx128m -javaagent:target/dependency/aspectjweaver-1.6.1.jar</argLine>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-Version>1.4</Bundle-Version>
- <Bundle-SymbolicName>org.apache.tuscany.sca.tracing.aspect</Bundle-SymbolicName>
- <Bundle-Description>${pom.description}</Bundle-Description>
- <Export-Package></Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project> \ No newline at end of file
diff --git a/branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/LoggingAspect.java b/branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/LoggingAspect.java
deleted file mode 100644
index 8ad64d498b..0000000000
--- a/branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/LoggingAspect.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.aspectj;
-
-import java.util.Arrays;
-
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.After;
-import org.aspectj.lang.annotation.AfterReturning;
-import org.aspectj.lang.annotation.AfterThrowing;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Before;
-import org.aspectj.lang.annotation.Pointcut;
-
-/**
- * @version $Rev$ $Date$
- */
-@Aspect
-public class LoggingAspect {
- @Pointcut("call(* org.apache.tuscany.sca..*(..)) && (!within(org.apache.tuscany.sca.aspectj.*Aspect))")
- public void anyMethodCall() {
- }
-
- @Pointcut("execution(* org.apache.tuscany.sca..*(..)) && (!within(org.apache.tuscany.sca.aspectj.*Aspect))")
- public void anyMethodExecution() {
- }
-
- @Pointcut("call(* java.util.logging.Logger.info(..))")
- public void anyLogCall() {
- }
-
- @Pointcut("cflow(anyMethodExecution()) && anyLogCall()")
- public void anyLog() {
-
- }
-
- // @Around("anyMethodCall() || anyLog()")
- @Around("anyLog()")
- public Object around(ProceedingJoinPoint jp) throws Throwable {
- System.out.println("Around: " + jp);
- long start = System.currentTimeMillis();
- try {
- return jp.proceed();
- } finally {
- long end = System.currentTimeMillis();
- System.out.println("Roundtrip is " + (end - start) + "ms for " + jp.getSignature());
- }
-
- }
-
- @Before("anyMethodCall()")
- public void before(JoinPoint jp) {
- System.out.println("Before: " + jp);
- System.out.println("Location: " + jp.getSourceLocation());
- System.out.println("This: " + jp.getThis());
- System.out.println("Target: " + jp.getTarget());
- System.out.println("Input: " + Arrays.asList(jp.getArgs()));
- }
-
- @After("anyMethodCall()")
- public void after(JoinPoint jp) {
- System.out.println("After: " + jp);
- }
-
- @AfterReturning(pointcut = "anyMethodCall()", returning = "result")
- public void afterReturning(JoinPoint jp, Object result) {
- System.out.println("After returning: " + jp + " " + result);
- }
-
- @AfterThrowing(pointcut = "anyMethodCall()", throwing = "e")
- public void afterThrowing(Exception e) {
- }
-
-}
diff --git a/branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/SimpleTracingAspect.java b/branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/SimpleTracingAspect.java
deleted file mode 100644
index 67fe54f396..0000000000
--- a/branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/SimpleTracingAspect.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.aspectj;
-
-import java.util.Arrays;
-
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-
-/**
- * @version $Rev$ $Date$
- */
-@Aspect
-public class SimpleTracingAspect extends TracingAspect {
-
- public SimpleTracingAspect() {
- super();
- }
-
- @Override
- protected void completeLog() {
- System.out.println("completeLog()");
- }
-
- @Pointcut("execution(public * org.apache.tuscany.sca..*.*(..)) &&!within(java..*)")
- protected void entry() {
- }
-
- @Pointcut("within(org.apache.tuscany.sca..*) && !within(org.apache.tuscany.sca.aspectj.*Aspect)")
- protected void withinScope() {
- }
-
- @Override
- protected void logEnter(JoinPoint jp) {
- System.out.println("> " + jp.getSignature());
- if (jp.getArgs().length != 0) {
- System.out.println("Input: " + Arrays.asList(jp.getArgs()));
- }
- }
-
- @Override
- protected void logExit(JoinPoint jp) {
- // System.out.println("> " + jp.getSignature());
- }
-
- @Override
- protected void logException(JoinPoint jp, Throwable throwable) {
- System.out.println("! " + jp.getSignature() + " " + throwable.getMessage());
- }
-
- @Override
- protected void logExit(JoinPoint jp, Object result) {
- System.out.println("< " + jp.getSignature());
- if (!jp.getSignature().toString().startsWith("void ")) {
- System.out.println("Output: " + result);
- }
- }
-
- @Override
- protected void startLog() {
- System.out.println("startLog()");
- }
-
-}
diff --git a/branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/TracingAspect.java b/branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/TracingAspect.java
deleted file mode 100644
index 53ef73573b..0000000000
--- a/branches/sca-android/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/TracingAspect.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.aspectj;
-
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.annotation.After;
-import org.aspectj.lang.annotation.AfterReturning;
-import org.aspectj.lang.annotation.AfterThrowing;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Before;
-import org.aspectj.lang.annotation.Pointcut;
-
-/**
- * @version $Rev$ $Date$
- */
-
-@Aspect
-public abstract class TracingAspect {
-
- @Pointcut("")
- protected abstract void entry();
-
- /** ignore join points outside this scope - use within(..) */
- @Pointcut("")
- protected abstract void withinScope();
-
- @Pointcut("withinScope() && call(* java..*.*(..))")
- protected void exit() {
- }
-
- @Pointcut("withinScope() && entry() && !cflowbelow(entry())")
- void start() {
- }
-
- @Pointcut("withinScope() && cflow(entry()) && !cflowbelow(exit()) && !within(org.apache.tuscany.sca.aspectj.*Aspect)")
- void trace() {
- }
-
- @Pointcut("!handler(*) && !preinitialization(new(..))")
- protected void supportsAfterAdvice() {
- }
-
- @Before("start()")
- public void beforeStart() {
- startLog();
- }
-
- @Before("trace() && supportsAfterAdvice()")
- public void beforeTrace(JoinPoint jp) {
- logEnter(jp);
- }
-
- @After("trace() && supportsAfterAdvice()")
- public void afterTrace(JoinPoint jp) {
- logExit(jp);
- }
-
- @AfterReturning(pointcut = "trace() && supportsAfterAdvice()", returning = "result")
- public void afterReturning(JoinPoint jp, Object result) {
- logExit(jp, result);
- }
-
- @AfterThrowing(pointcut = "trace() && supportsAfterAdvice()", throwing = "e")
- public void afterThrowing(JoinPoint jp, Throwable e) {
- logException(jp, e);
- }
-
- @After("start()")
- public void afterStart() {
- completeLog();
- }
-
- protected abstract void logEnter(JoinPoint jp);
-
- protected abstract void logExit(JoinPoint jp);
- protected abstract void logExit(JoinPoint jp, Object result);
- protected abstract void logException(JoinPoint jp, Throwable throwable);
-
- protected abstract void startLog();
-
- protected abstract void completeLog();
-
-}
diff --git a/branches/sca-android/modules/tracing-aspectj/src/main/resources/META-INF/aop.xml b/branches/sca-android/modules/tracing-aspectj/src/main/resources/META-INF/aop.xml
deleted file mode 100644
index 60c0132e9a..0000000000
--- a/branches/sca-android/modules/tracing-aspectj/src/main/resources/META-INF/aop.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<aspectj>
-
- <aspects>
- <!-- declare two existing aspects to the weaver -->
- <aspect name="org.apache.tuscany.sca.aspectj.SimpleTracingAspect" />
- <!--
- <aspect name="org.apache.tuscany.sca.aspectj.LoggingAspect" />
- -->
-
- </aspects>
-
- <!--weaver options="-verbose -debug -showWeaveInfo"-->
- <weaver options="">
- <include within="org.apache.tuscany.sca..*" />
- </weaver>
-
-</aspectj>
diff --git a/branches/sca-android/modules/tracing-aspectj/src/test/java/org/apache/tuscany/sca/aspectj/TracingTestCase.java b/branches/sca-android/modules/tracing-aspectj/src/test/java/org/apache/tuscany/sca/aspectj/TracingTestCase.java
deleted file mode 100644
index 7b76faaf36..0000000000
--- a/branches/sca-android/modules/tracing-aspectj/src/test/java/org/apache/tuscany/sca/aspectj/TracingTestCase.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.aspectj;
-
-import java.util.logging.Logger;
-
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TracingTestCase {
-
- @Test
- public void testAOP() {
- Logger log = Logger.getLogger(getClass().getName());
- System.out.println("doSomething()");
- log.info("Hello, Log");
- }
-
- public static void main(String[] args) {
- new TracingTestCase().testAOP();
- }
-}
diff --git a/branches/sca-android/modules/workspace-impl/LICENSE b/branches/sca-android/modules/workspace-impl/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace-impl/META-INF/README b/branches/sca-android/modules/workspace-impl/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/workspace-impl/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/workspace-impl/NOTICE b/branches/sca-android/modules/workspace-impl/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/workspace-impl/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/branches/sca-android/modules/workspace-impl/pom.xml b/branches/sca-android/modules/workspace-impl/pom.xml
deleted file mode 100644
index da61ef8660..0000000000
--- a/branches/sca-android/modules/workspace-impl/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * 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.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <version>1.4-SNAPSHOT</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.workspace.impl</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.workspace*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java b/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java
deleted file mode 100644
index 016c764d47..0000000000
--- a/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.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.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.assembly.builder.impl.ProblemImpl;
-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.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.ContributionDependencyBuilder;
-
-/**
- * A contribution dependency builder.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionDependencyBuilderImpl implements ContributionDependencyBuilder {
- private static final Logger logger = Logger.getLogger(ContributionDependencyBuilderImpl.class.getName());
-
- private Monitor monitor;
-
- /**
- * Constructs a new ContributionDependencyBuilder.
- */
- public ContributionDependencyBuilderImpl(Monitor monitor) {
-
- this.monitor = monitor;
- }
-
- /**
- * Calculate the set of contributions that a contribution depends on.
- * @param contribution
- * @param workspace
- * @return
- */
- public List<Contribution> buildContributionDependencies(Contribution contribution, Workspace workspace) {
- List<Contribution> dependencies = new ArrayList<Contribution>();
- Set<Contribution> set = new HashSet<Contribution>();
-
- dependencies.add(contribution);
- set.add(contribution);
- addContributionDependencies(contribution, workspace, dependencies, set);
-
- Collections.reverse(dependencies);
- return dependencies;
- }
-
- /**
- * Analyze a contribution and add its dependencies to the given dependency set.
- * @param contribution
- * @param workspace
- * @param dependencies
- * @param set
- */
- private void addContributionDependencies(Contribution contribution, Workspace workspace, List<Contribution> dependencies, Set<Contribution> set) {
-
- // 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);
- }
- }
- }
- }
-
- 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("UnresolvedImport", import_, import_);
- }
- }
- }
- }
-
- /**
- * Report a warning.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void warning(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = new ProblemImpl(getClass().getName(), "workspace-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
-}
diff --git a/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java b/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java
deleted file mode 100644
index 880e95480e..0000000000
--- a/branches/sca-android/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.ModelFactoryExtensionPoint;
-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.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-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 ModelFactoryExtensionPoint 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(ModelFactoryExtensionPoint.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(ModelFactoryExtensionPoint 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/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java b/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java
deleted file mode 100644
index 6ef0fa753d..0000000000
--- a/branches/sca-android/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.ModelFactoryExtensionPoint;
-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.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-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 ModelFactoryExtensionPoint 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(ModelFactoryExtensionPoint.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(ModelFactoryExtensionPoint 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/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/DirectoryContributionScanner.java b/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/DirectoryContributionScanner.java
deleted file mode 100644
index 45ba8c0609..0000000000
--- a/branches/sca-android/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.scanner.ContributionScanner;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-
-/**
- * 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/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/JarContributionScanner.java b/branches/sca-android/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/JarContributionScanner.java
deleted file mode 100644
index 9dd1b3a15b..0000000000
--- a/branches/sca-android/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.scanner.ContributionScanner;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-
-/**
- * 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/branches/sca-android/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/branches/sca-android/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
deleted file mode 100644
index 41d0ebe27d..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace-impl/src/main/resources/workspace-validation-messages.properties b/branches/sca-android/modules/workspace-impl/src/main/resources/workspace-validation-messages.properties
deleted file mode 100644
index 0c07a3a30f..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace-impl/src/main/resources/workspace-validation-messages_it.properties b/branches/sca-android/modules/workspace-impl/src/main/resources/workspace-validation-messages_it.properties
deleted file mode 100644
index 2e8326c062..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java b/branches/sca-android/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java
deleted file mode 100644
index f7b6b35679..0000000000
--- a/branches/sca-android/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 java.util.List;
-
-import junit.framework.TestCase;
-
-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.NamespaceExport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
-import org.apache.tuscany.sca.contribution.namespace.impl.NamespaceImportExportFactoryImpl;
-import org.apache.tuscany.sca.workspace.DefaultWorkspaceFactory;
-import org.apache.tuscany.sca.workspace.Workspace;
-import org.apache.tuscany.sca.workspace.WorkspaceFactory;
-
-/**
- * Test the contribution dependency analyzer.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionDependencyBuilderTestCase extends TestCase {
-
- private ContributionFactory contributionFactory;
- private WorkspaceFactory workspaceFactory;
- private NamespaceImportExportFactory importExportFactory;
-
- @Override
- public void setUp() throws Exception {
- contributionFactory = new DefaultContributionFactory();
- workspaceFactory = new DefaultWorkspaceFactory();
- importExportFactory = new NamespaceImportExportFactoryImpl();
- }
-
- @Override
- public void tearDown() throws Exception {
- }
-
- public void testAnalyze() {
- 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 analyzer = new ContributionDependencyBuilderImpl(null);
- List<Contribution> dependencies = analyzer.buildContributionDependencies(importer, workspace);
- assertTrue(dependencies.size() == 3);
- assertTrue(dependencies.contains(importer));
- assertTrue(dependencies.contains(imported));
- assertTrue(dependencies.contains(imported2));
- }
-
-}
diff --git a/branches/sca-android/modules/workspace-xml/LICENSE b/branches/sca-android/modules/workspace-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace-xml/META-INF/README b/branches/sca-android/modules/workspace-xml/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/workspace-xml/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/workspace-xml/NOTICE b/branches/sca-android/modules/workspace-xml/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/workspace-xml/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/branches/sca-android/modules/workspace-xml/pom.xml b/branches/sca-android/modules/workspace-xml/pom.xml
deleted file mode 100644
index 21024de0d3..0000000000
--- a/branches/sca-android/modules/workspace-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>1.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.1</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </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.workspace.xml</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.workspace.xml*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceDocumentProcessor.java b/branches/sca-android/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceDocumentProcessor.java
deleted file mode 100644
index 49041b3263..0000000000
--- a/branches/sca-android/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceDocumentProcessor.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.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.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-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 = new ProblemImpl(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/branches/sca-android/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceProcessor.java b/branches/sca-android/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceProcessor.java
deleted file mode 100644
index d0665a4ec8..0000000000
--- a/branches/sca-android/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.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.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(ModelFactoryExtensionPoint 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/branches/sca-android/modules/workspace-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/modules/workspace-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 9ea7874b52..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace-xml/src/main/resources/workspace-xml-validation-messages.properties b/branches/sca-android/modules/workspace-xml/src/main/resources/workspace-xml-validation-messages.properties
deleted file mode 100644
index e054591a31..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace-xml/src/test/java/org/apache/tuscany/sca/workspace/xml/ContributionWorkspaceProcessorTestCase.java b/branches/sca-android/modules/workspace-xml/src/test/java/org/apache/tuscany/sca/workspace/xml/ContributionWorkspaceProcessorTestCase.java
deleted file mode 100644
index 8e4d30e7a0..0000000000
--- a/branches/sca-android/modules/workspace-xml/src/test/java/org/apache/tuscany/sca/workspace/xml/ContributionWorkspaceProcessorTestCase.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.workspace.xml;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.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;
-
-/**
- * Test the workspace processor.
- *
- * @version $Rev$ $Date$
- */
-
-public class ContributionWorkspaceProcessorTestCase extends TestCase {
-
- 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 XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
-
- @Override
- protected void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
- }
-
- 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());
- }
-
- 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/branches/sca-android/modules/workspace/LICENSE b/branches/sca-android/modules/workspace/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace/META-INF/README b/branches/sca-android/modules/workspace/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/workspace/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/workspace/NOTICE b/branches/sca-android/modules/workspace/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/branches/sca-android/modules/workspace/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/branches/sca-android/modules/workspace/pom.xml b/branches/sca-android/modules/workspace/pom.xml
deleted file mode 100644
index 751b17b59f..0000000000
--- a/branches/sca-android/modules/workspace/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>1.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.workspace</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.workspace*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/DefaultWorkspaceFactory.java b/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/DefaultWorkspaceFactory.java
deleted file mode 100644
index e895669d23..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/Workspace.java b/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/Workspace.java
deleted file mode 100644
index 66f38afec7..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/WorkspaceFactory.java b/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/WorkspaceFactory.java
deleted file mode 100644
index 2656068bea..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionDependencyBuilder.java b/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionDependencyBuilder.java
deleted file mode 100644
index 6fab700243..0000000000
--- a/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionDependencyBuilder.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.workspace.builder;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.workspace.Workspace;
-
-/**
- * A contribution dependency builder.
- *
- * @version $Rev$ $Date$
- */
-public interface ContributionDependencyBuilder {
-
- /**
- * Build the set of contributions that a contribution depends on.
- * @param workspace
- * @param contribution
- * @return
- */
- List<Contribution> buildContributionDependencies(Contribution contribution, Workspace workspace);
-
-}
diff --git a/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceFactoryImpl.java b/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceFactoryImpl.java
deleted file mode 100644
index e41cc3ea83..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java b/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java
deleted file mode 100644
index e60a5d8108..0000000000
--- a/branches/sca-android/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.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.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;
-
- /**
- * 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 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/branches/sca-android/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.WorkspaceFactory b/branches/sca-android/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.WorkspaceFactory
deleted file mode 100644
index d390d29d90..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/xsd-xml/META-INF/README b/branches/sca-android/modules/xsd-xml/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/xsd-xml/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/xsd-xml/pom.xml b/branches/sca-android/modules/xsd-xml/pom.xml
deleted file mode 100644
index 6361a5254c..0000000000
--- a/branches/sca-android/modules/xsd-xml/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-modules</artifactId>
- <version>1.4-SNAPSHOT</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>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>1.4-SNAPSHOT</version>
- </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.xsd.xml</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.xsd.xml*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelper.java b/branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelper.java
deleted file mode 100644
index 595795a2d9..0000000000
--- a/branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelper.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.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;
- }
-
- private final static XMLInputFactory inputFactory = XMLInputFactory.newInstance();
-
- public static String readTargetNamespace(URL doc, QName element, boolean rootOnly, String attribute)
- 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/branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessor.java b/branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessor.java
deleted file mode 100644
index f54212de9a..0000000000
--- a/branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessor.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.xsd.xml;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-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 Monitor monitor;
-
- public XSDDocumentProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.factory = 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 = new ProblemImpl(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"));
- xsd.setLocation(doc.toURI());
- xsd.setUnresolved(false);
- return xsd;
- }
-}
diff --git a/branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java b/branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
deleted file mode 100644
index 652d9e8d83..0000000000
--- a/branches/sca-android/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.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.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.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionRuntimeException;
-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 XSDFactory factory;
- private Contribution contribution;
- private Map<String, List<XSDefinition>> map = new HashMap<String, List<XSDefinition>>();
- private XmlSchemaCollection schemaCollection;
-
- public XSDModelResolver(Contribution contribution, ModelFactoryExtensionPoint 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());
- 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 = new XmlSchema(ns, schemaCollection);
-
- for (XmlSchema d : schemaCollection.getXmlSchemas()) {
- if (ns.equals(d.getTargetNamespace())) {
- 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/branches/sca-android/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/branches/sca-android/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
deleted file mode 100644
index 1ec3d27200..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/branches/sca-android/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
deleted file mode 100644
index a67ecf063a..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/xsd-xml/src/main/resources/xsd-xml-validation-messages.properties b/branches/sca-android/modules/xsd-xml/src/main/resources/xsd-xml-validation-messages.properties
deleted file mode 100644
index ab50456510..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelperTestCase.java b/branches/sca-android/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelperTestCase.java
deleted file mode 100644
index fbcdf3d861..0000000000
--- a/branches/sca-android/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelperTestCase.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.xsd.xml;
-
-import java.net.URL;
-
-import junit.framework.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);
- Assert.assertEquals("http://greeting", tns);
- }
-
-}
diff --git a/branches/sca-android/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessorTestCase.java b/branches/sca-android/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessorTestCase.java
deleted file mode 100644
index 76e6a57c29..0000000000
--- a/branches/sca-android/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessorTestCase.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.xsd.xml;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-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.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.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);
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.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/branches/sca-android/modules/xsd-xml/src/test/resources/xsd/greeting.xsd b/branches/sca-android/modules/xsd-xml/src/test/resources/xsd/greeting.xsd
deleted file mode 100644
index 635ca25bfc..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/xsd-xml/src/test/resources/xsd/name.xsd b/branches/sca-android/modules/xsd-xml/src/test/resources/xsd/name.xsd
deleted file mode 100644
index 300de931ec..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/xsd/META-INF/README b/branches/sca-android/modules/xsd/META-INF/README
deleted file mode 100644
index 009570154d..0000000000
--- a/branches/sca-android/modules/xsd/META-INF/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains a generated MANIFEST.MF file.
diff --git a/branches/sca-android/modules/xsd/pom.xml b/branches/sca-android/modules/xsd/pom.xml
deleted file mode 100644
index 0ef1e7ed99..0000000000
--- a/branches/sca-android/modules/xsd/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>1.4-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-xsd</artifactId>
- <name>Apache Tuscany SCA XSD Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- <version>1.3.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>
-
-
- <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.xsd</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.xsd*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/DefaultXSDFactory.java b/branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/DefaultXSDFactory.java
deleted file mode 100644
index 92dce98fa1..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDFactory.java b/branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDFactory.java
deleted file mode 100644
index 08a1c8dd63..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java b/branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java
deleted file mode 100644
index 9a973cd095..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDFactoryImpl.java b/branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDFactoryImpl.java
deleted file mode 100644
index 60ff6b6fd9..0000000000
--- a/branches/sca-android/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/branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java b/branches/sca-android/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java
deleted file mode 100644
index e57cbee8b8..0000000000
--- a/branches/sca-android/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;
- }
-
- public 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/branches/sca-android/modules/xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.xsd.XSDFactory b/branches/sca-android/modules/xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.xsd.XSDFactory
deleted file mode 100644
index ca06127c06..0000000000
--- a/branches/sca-android/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