From 05cb79859c35a801922b5eb86f336ab5e1e13d53 Mon Sep 17 00:00:00 2001 From: lresende Date: Mon, 18 Oct 2010 02:28:46 +0000 Subject: Deleting 2.0-M5-RC2 release candidate tag git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1023632 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/assembly/AbstractContract.java | 78 ---- .../tuscany/sca/assembly/AbstractProperty.java | 151 -------- .../tuscany/sca/assembly/AbstractReference.java | 43 --- .../tuscany/sca/assembly/AbstractService.java | 28 -- .../tuscany/sca/assembly/AssemblyFactory.java | 167 --------- .../java/org/apache/tuscany/sca/assembly/Base.java | 45 --- .../org/apache/tuscany/sca/assembly/Binding.java | 114 ------ .../org/apache/tuscany/sca/assembly/Callback.java | 39 -- .../org/apache/tuscany/sca/assembly/Component.java | 142 ------- .../tuscany/sca/assembly/ComponentProperty.java | 89 ----- .../tuscany/sca/assembly/ComponentReference.java | 113 ------ .../tuscany/sca/assembly/ComponentService.java | 59 --- .../apache/tuscany/sca/assembly/ComponentType.java | 90 ----- .../org/apache/tuscany/sca/assembly/Composite.java | 132 ------- .../tuscany/sca/assembly/CompositeReference.java | 44 --- .../tuscany/sca/assembly/CompositeService.java | 57 --- .../tuscany/sca/assembly/ConfiguredOperation.java | 62 ---- .../org/apache/tuscany/sca/assembly/Contract.java | 111 ------ .../sca/assembly/DefaultAssemblyFactory.java | 41 --- .../org/apache/tuscany/sca/assembly/Endpoint.java | 139 ------- .../tuscany/sca/assembly/EndpointReference.java | 165 --------- .../apache/tuscany/sca/assembly/Extensible.java | 45 --- .../org/apache/tuscany/sca/assembly/Extension.java | 66 ---- .../tuscany/sca/assembly/Implementation.java | 36 -- .../apache/tuscany/sca/assembly/Multiplicity.java | 50 --- .../tuscany/sca/assembly/OperationSelector.java | 29 -- .../sca/assembly/OperationsConfigurator.java | 33 -- .../org/apache/tuscany/sca/assembly/Property.java | 40 -- .../org/apache/tuscany/sca/assembly/Reference.java | 71 ---- .../apache/tuscany/sca/assembly/SCABinding.java | 30 -- .../tuscany/sca/assembly/SCABindingFactory.java | 35 -- .../org/apache/tuscany/sca/assembly/Service.java | 42 --- .../java/org/apache/tuscany/sca/assembly/Wire.java | 85 ----- .../apache/tuscany/sca/assembly/WireFormat.java | 31 -- .../sca/assembly/builder/BindingBuilder.java | 51 --- .../sca/assembly/builder/BuilderContext.java | 107 ------ .../assembly/builder/BuilderExtensionPoint.java | 127 ------- .../sca/assembly/builder/CompositeBuilder.java | 51 --- .../builder/CompositeBuilderException.java | 45 --- .../builder/DefaultBuilderExtensionPoint.java | 408 --------------------- .../assembly/builder/ImplementationBuilder.java | 50 --- .../tuscany/sca/assembly/builder/Messages.java | 31 -- .../sca/assembly/builder/PolicyBuilder.java | 84 ----- .../tuscany/sca/assembly/builder/WireBuilder.java | 39 -- .../sca/assembly/impl/AbstractPropertyImpl.java | 112 ------ .../sca/assembly/impl/AbstractReferenceImpl.java | 46 --- .../sca/assembly/impl/AbstractServiceImpl.java | 36 -- .../sca/assembly/impl/AssemblyFactoryImpl.java | 138 ------- .../apache/tuscany/sca/assembly/impl/BaseImpl.java | 45 --- .../tuscany/sca/assembly/impl/BindingImpl.java | 122 ------ .../tuscany/sca/assembly/impl/CallbackImpl.java | 67 ---- .../tuscany/sca/assembly/impl/ComponentImpl.java | 186 ---------- .../sca/assembly/impl/ComponentPropertyImpl.java | 97 ----- .../sca/assembly/impl/ComponentReferenceImpl.java | 119 ------ .../sca/assembly/impl/ComponentServiceImpl.java | 71 ---- .../sca/assembly/impl/ComponentTypeImpl.java | 176 --------- .../tuscany/sca/assembly/impl/CompositeImpl.java | 185 ---------- .../sca/assembly/impl/CompositeReferenceImpl.java | 63 ---- .../sca/assembly/impl/CompositeServiceImpl.java | 62 ---- .../sca/assembly/impl/ConfiguredOperationImpl.java | 95 ----- .../tuscany/sca/assembly/impl/ContractImpl.java | 88 ----- .../tuscany/sca/assembly/impl/EndpointImpl.java | 276 -------------- .../sca/assembly/impl/EndpointReferenceImpl.java | 229 ------------ .../tuscany/sca/assembly/impl/ExtensibleImpl.java | 49 --- .../tuscany/sca/assembly/impl/ExtensionImpl.java | 62 ---- .../sca/assembly/impl/ImplementationImpl.java | 89 ----- .../tuscany/sca/assembly/impl/PropertyImpl.java | 59 --- .../tuscany/sca/assembly/impl/ReferenceImpl.java | 135 ------- .../sca/assembly/impl/SCABindingFactoryImpl.java | 40 -- .../tuscany/sca/assembly/impl/SCABindingImpl.java | 148 -------- .../tuscany/sca/assembly/impl/ServiceImpl.java | 106 ------ .../apache/tuscany/sca/assembly/impl/WireImpl.java | 105 ------ .../sca/definitions/DefaultDefinitionsFactory.java | 32 -- .../tuscany/sca/definitions/Definitions.java | 84 ----- .../sca/definitions/DefinitionsBuilder.java | 34 -- .../definitions/DefinitionsBuilderException.java | 43 --- .../sca/definitions/DefinitionsFactory.java | 31 -- .../definitions/impl/DefinitionsBuilderImpl.java | 307 ---------------- .../sca/definitions/impl/DefinitionsImpl.java | 73 ---- .../sca/definitions/util/DefinitionsUtil.java | 108 ------ .../tuscany/sca/interfacedef/Compatibility.java | 29 -- .../apache/tuscany/sca/interfacedef/DataType.java | 120 ------ .../sca/interfacedef/FaultExceptionMapper.java | 63 ---- .../IncompatibleInterfaceContractException.java | 69 ---- .../apache/tuscany/sca/interfacedef/Interface.java | 116 ------ .../sca/interfacedef/InterfaceContract.java | 82 ----- .../sca/interfacedef/InterfaceContractMapper.java | 207 ----------- .../interfacedef/InvalidAnnotationException.java | 40 -- .../sca/interfacedef/InvalidCallbackException.java | 35 -- .../interfacedef/InvalidInterfaceException.java | 43 --- .../interfacedef/InvalidOperationException.java | 43 --- .../apache/tuscany/sca/interfacedef/Operation.java | 198 ---------- .../interfacedef/OverloadedOperationException.java | 46 --- .../sca/interfacedef/impl/DataTypeImpl.java | 220 ----------- .../interfacedef/impl/InterfaceContractImpl.java | 129 ------- .../impl/InterfaceContractMapperImpl.java | 392 -------------------- .../sca/interfacedef/impl/InterfaceImpl.java | 329 ----------------- .../sca/interfacedef/impl/OperationImpl.java | 274 -------------- .../tuscany/sca/interfacedef/util/ElementInfo.java | 115 ------ .../sca/interfacedef/util/FaultException.java | 83 ----- .../sca/interfacedef/util/JavaXMLMapper.java | 144 -------- .../tuscany/sca/interfacedef/util/TypeInfo.java | 101 ----- .../tuscany/sca/interfacedef/util/WrapperInfo.java | 204 ----------- .../tuscany/sca/interfacedef/util/XMLType.java | 153 -------- .../org/apache/tuscany/sca/policy/BindingType.java | 27 -- .../tuscany/sca/policy/DefaultPolicyFactory.java | 30 -- .../apache/tuscany/sca/policy/ExtensionType.java | 82 ----- .../tuscany/sca/policy/ImplementationType.java | 27 -- .../java/org/apache/tuscany/sca/policy/Intent.java | 161 -------- .../org/apache/tuscany/sca/policy/IntentMap.java | 49 --- .../tuscany/sca/policy/PolicyAttachment.java | 31 -- .../apache/tuscany/sca/policy/PolicyContainer.java | 37 -- .../tuscany/sca/policy/PolicyExpression.java | 66 ---- .../apache/tuscany/sca/policy/PolicyFactory.java | 67 ---- .../org/apache/tuscany/sca/policy/PolicySet.java | 147 -------- .../apache/tuscany/sca/policy/PolicySubject.java | 57 --- .../org/apache/tuscany/sca/policy/Qualifier.java | 44 --- .../tuscany/sca/policy/impl/BindingTypeImpl.java | 38 -- .../tuscany/sca/policy/impl/ExtensionTypeImpl.java | 97 ----- .../sca/policy/impl/ImplementationTypeImpl.java | 39 -- .../apache/tuscany/sca/policy/impl/IntentImpl.java | 168 --------- .../tuscany/sca/policy/impl/IntentMapImpl.java | 78 ---- .../sca/policy/impl/PolicyExpressionImpl.java | 87 ----- .../tuscany/sca/policy/impl/PolicyFactoryImpl.java | 70 ---- .../tuscany/sca/policy/impl/PolicySetImpl.java | 145 -------- .../tuscany/sca/policy/impl/QualifierImpl.java | 48 --- .../tuscany/sca/policy/util/PolicyHelper.java | 130 ------- 127 files changed, 12173 deletions(-) delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConfiguredOperation.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extensible.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extension.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationSelector.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationsConfigurator.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/WireFormat.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilder.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BuilderContext.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BuilderExtensionPoint.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultBuilderExtensionPoint.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/ImplementationBuilder.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/Messages.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/PolicyBuilder.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/WireBuilder.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConfiguredOperationImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensibleImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefaultDefinitionsFactory.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsFactory.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsBuilderImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Compatibility.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/DataType.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/IncompatibleInterfaceContractException.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContract.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidAnnotationException.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidCallbackException.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidInterfaceException.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidOperationException.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/OverloadedOperationException.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/ElementInfo.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/FaultException.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/JavaXMLMapper.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/TypeInfo.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/XMLType.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/BindingType.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultPolicyFactory.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ExtensionType.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ImplementationType.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/Intent.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/IntentMap.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyAttachment.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyContainer.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyExpression.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySubject.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/Qualifier.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ExtensionTypeImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/IntentImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/IntentMapImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyExpressionImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/QualifierImpl.java delete mode 100644 sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java (limited to 'sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org') diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java deleted file mode 100644 index dca1decb76..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Interface contracts define one or more business functions. These business - * functions are provided by services and are used by references. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface AbstractContract extends Base, Extensible, PolicySubject { - - /** - * Returns the name of the contract. - * - * @return the name of the contract - */ - String getName(); - - /** - * Sets the name of the contract. - * - * @param name the name of the contract - */ - void setName(String name); - - /** - * Returns the interface contract defining the interface and callback - * interface for the contract. - * - * @return the interface contract - */ - InterfaceContract getInterfaceContract(); - - /** - * Sets the interface contract defining the interface and callback - * interface for the contract. - * - * @param interfaceContract the interface contract - */ - void setInterfaceContract(InterfaceContract interfaceContract); - - /** - * Returns true if this contract is a reference or service created internally - * to handle a callback interface of another contract, false otherwise. - * - * @return true for a callback contract, false otherwise - */ - boolean isForCallback(); - - /** - * Sets a flag indicating whether this is a callback contract. - * - * @param isCallback true for a callback contract, false otherwise - */ - void setForCallback(boolean isCallback); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java deleted file mode 100644 index 45fa05d66c..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.interfacedef.DataType; - -/** - * A property allows for the configuration of an implementation with externally - * set data values. An implementation can have zero or more properties. Each - * property has a data type, which may be either simple or complex. An - * implementation may also define a default value for a property. - * - * @version $Rev$ $Date$ - */ -public interface AbstractProperty extends Base, Extensible { - - /** - * Returns the property name. - * - * @return the property name - */ - String getName(); - - /** - * Sets the property name. - * - * @param name the property name - */ - void setName(String name); - - /** - * Returns the default value of the property. - * - * @return the default value of this property - */ - Object getValue(); - - /** - * Sets the default value of the property. - * - * @param defaultValue the default value of this property - */ - void setValue(Object defaultValue); - - /** - * Returns true if the property allows multiple values. - * - * @return true if the property allows multiple values - */ - boolean isMany(); - - /** - * Sets whether or not the property allows multiple values. - * - * @param many true if the property should allow multiple values - */ - void setMany(boolean many); - - /** - * Returns true if a value must be supplied for the property. - * - * @return true is a value must be supplied for the property - */ - boolean isMustSupply(); - - /** - * Sets whether a value must be supplied for the property. - * - * @param mustSupply set to true to require that a value be supplied for - * uses of this property - */ - void setMustSupply(boolean mustSupply); - - /** - * Returns the data type of this property. This is the qualified name of an - * XML schema type. - * - * @return the type of this property - */ - QName getXSDType(); - - /** - * Sets the data type of this property. This is the qualified name of an XML - * schema type. - * - * @param type the type of this property - */ - void setXSDType(QName type); - - /** - * Returns the element defining the data type of this property. This is the - * qualified name of an XML schema element. - * - * @return the element defining the type of this property - */ - QName getXSDElement(); - - /** - * Sets the element defining the data type of this property. This is the - * qualified name of an XML schema element. - * - * @param element the element defining the type of this property - */ - void setXSDElement(QName element); - - /** - * Get the data type for this property - * @return The data type - */ - DataType getDataType(); - - /** - * Set the data type - * @param dataType The data type - */ - void setDataType(DataType dataType); - - /** - * Get the XML schema that represents the type if this property. - * Used during property value validation - * - * @return - */ - Object getXSDDefinition(); - - /** - * Set the XML schema that represents the type if this property. - * Used during property value validation - * - * @param xsdDefintion - */ - void setXSDDefinition(Object xsdDefintion); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java deleted file mode 100644 index a9ef26bbb9..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Represents a reference contract. - * - * @version $Rev$ $Date$ - */ -public interface AbstractReference extends AbstractContract { - - /** - * Returns the multiplicity allowed for wires connected to this reference. - * - * @return the multiplicity allowed for wires connected to this reference - */ - Multiplicity getMultiplicity(); - - /** - * Sets the multiplicity allowed for wires connected to this reference. - * - * @param multiplicity the multiplicity allowed for wires connected to this - * reference - */ - void setMultiplicity(Multiplicity multiplicity); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java deleted file mode 100644 index 9ae511c07b..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Represents a service contract. - * - * @version $Rev$ $Date$ - */ -public interface AbstractService extends AbstractContract { - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java deleted file mode 100644 index 5d82b9b727..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * A factory for the assembly model - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface AssemblyFactory { - - /** - * Create a new abstract property. - * - * @return a new abstract property - */ - AbstractProperty createAbstractProperty(); - - /** - * Create a new abstract reference. - * - * @return a new abstract reference - */ - AbstractReference createAbstractReference(); - - /** - * Create a new abstract service. - * - * @return a new abstract service - */ - AbstractService createAbstractService(); - - /** - * Create a new callback. - * - * @return - */ - Callback createCallback(); - - /** - * Create a new component. - * - * @return a new component - */ - Component createComponent(); - - /** - * Create a new component property. - * - * @return a new component property - */ - ComponentProperty createComponentProperty(); - - /** - * Create a new component reference. - * - * @return a new component reference - */ - ComponentReference createComponentReference(); - - /** - * Create a new component service. - * - * @return a new component service - */ - ComponentService createComponentService(); - - /** - * Create a new component type - * - * @return a new component type - */ - ComponentType createComponentType(); - - /** - * Create a new composite. - * - * @return a new composite - */ - Composite createComposite(); - - /** - * Create a new composite reference. - * - * @return a new composite reference - */ - CompositeReference createCompositeReference(); - - /** - * Create a new composite service. - * - * @return a new composite service - */ - CompositeService createCompositeService(); - - /** - * Create a new property. - * - * @return a new property - */ - Property createProperty(); - - /** - * Create a new reference. - * - * @return a new reference - */ - Reference createReference(); - - /** - * Create a new service. - * - * @return a new service - */ - Service createService(); - - /** - * Create a new wire. - * - * @return a new wire - */ - Wire createWire(); - - /** - * Create an Extension - * @return - */ - Extension createExtension(); - - /** - * Create a new endpoint - * - * @return a new endpoint - */ - Endpoint createEndpoint(); - - /** - * Create a new endpoint reference - * - * @return a new endpoint reference - */ - EndpointReference createEndpointReference(); - - /** - * Create a new configured operation. - * - * @return a new ConfiguredOperation - */ - ConfiguredOperation createConfiguredOperation(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java deleted file mode 100644 index b9abb90b03..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Base interface for all assembly model objects. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface Base { - String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200912"; - String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1"; - - /** - * Returns true if the model element is unresolved. - * - * @return true if the model element is unresolved. - */ - boolean isUnresolved(); - - /** - * Sets whether the model element is unresolved. - * - * @param unresolved whether the model element is unresolved - */ - void setUnresolved(boolean unresolved); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java deleted file mode 100644 index 9b96556173..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import javax.xml.namespace.QName; - -/** - * Represents a binding. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface Binding extends Base, Cloneable { - - /** - * Returns the binding URI. - * - * @return the binding URI - */ - String getURI(); - - /** - * Sets the binding URI. - * - * @param uri the binding URI - */ - void setURI(String uri); - - /** - * Returns the binding name. - * - * @return the binding name - */ - String getName(); - - /** - * Sets the binding name. - * - * @param name the binding name - */ - void setName(String name); - - /** - * Clone the binding - * - * @return the clone - */ - Object clone() throws CloneNotSupportedException; - - /** - * Returns the QName type for the binding - * - * @return the binding type QName - */ - QName getType(); - - /** - * Returns the request wire format - * - * @return the request wire format or null is none is specified - */ - WireFormat getRequestWireFormat(); - - /** - * Sets the request wire format - * - * @param wireFormat the request wire format - */ - void setRequestWireFormat(WireFormat wireFormat); - - /** - * Returns the response wire format - * - * @return the response wire format or null is none is specified - */ - WireFormat getResponseWireFormat(); - - /** - * Sets the response wire format - * - * @param wireFormat the response wire format - */ - void setResponseWireFormat(WireFormat wireFormat); - - /** - * Returns the operation selector - * - * @return the operation selector or null is none is specified - */ - OperationSelector getOperationSelector(); - - /** - * Sets the operation selector - * - * @param operationSelector the operation selector - */ - void setOperationSelector(OperationSelector operationSelector); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java deleted file mode 100644 index d34ec7d01f..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Represents a callback object describing the bindings to use for callbacks. - * - * @version $Rev$ $Date$ - */ -public interface Callback extends Base, Extensible, PolicySubject { - - /** - * Returns the bindings supported for callbacks. - * - * @return the bindings supported for callbacks - */ - List getBindings(); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java deleted file mode 100644 index efd8557e07..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.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.assembly; - -import java.util.List; - -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Represents a component. A component is a configured instance of an - * implementation. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface Component extends Base, Extensible, PolicySubject, Cloneable { - - /** - * Returns the URI of the component. - * - * @return the URI of the component - */ - String getURI(); - - /** - * Sets the URI of the component. - * - * @param uri the URI of the component - */ - void setURI(String uri); - - /** - * Returns the name of the component. - * - * @return the name of the component - */ - String getName(); - - /** - * Sets the name of the component. - * - * @param name the name of the component - */ - void setName(String name); - - /** - * Returns the component implementation. - * - * @return the component implementation - */ - Implementation getImplementation(); - - /** - * Sets the component implementation - * - * @param implementation the component implementation - */ - void setImplementation(Implementation implementation); - - /** - * Returns a list of references used by the component. - * - * @return a list of references used by the component - */ - List getReferences(); - - /** - * Return a reference by name - * - * @param name the reference name - * @return reference the reference - */ - ComponentReference getReference(String name); - - /** - * Returns a list of services exposed by the component. - * - * @return a list of services exposed by the component - */ - List getServices(); - - /** - * Return a service by name - * - * @param name the service name - * @return service the service - */ - ComponentService getService(String name); - - /** - * Returns a list of properties for the component. - * - * @return a list of properties - */ - List getProperties(); - - /** - * Return a property by name - * - * @param name the property name - * @return property the property - */ - ComponentProperty getProperty(String name); - - /** - * Return the Boolean value of autowire - * @return null/TRUE/FALSE - */ - Boolean getAutowire(); - - /** - * Sets whether component references should be autowired. - * - * @param autowire whether component references should be autowired - */ - void setAutowire(Boolean autowire); - - /** - * Returns a clone of the component. - * - * @return a clone of the component - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java deleted file mode 100644 index 1202b4d83a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.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.assembly; - -import javax.xml.xpath.XPathExpression; - -/** - * Represents a configured property of a component. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface ComponentProperty extends Property { - - /** - * Returns the property defined by the component implementation. - * - * @return the property defined by the component implementation - */ - Property getProperty(); - - /** - * Sets the property defined by this component implementation. - * - * @param property the property defined by this component implementation - */ - void setProperty(Property property); - - /** - * Returns an XPath expression referencing a property of the enclosing - * composite. - * - * @return an XPath expression referencing a property of the enclosing - * composite - */ - String getSource(); - - /** - * Sets an XPath expression referencing a property of the enclosing - * composite. - * - * @param source an XPath expression referencing a property of the enclosing - * composite - */ - void setSource(String source); - - /** - * Get the XPath expression for the source attribute - * @return the XPath expression for the source attribute - */ - XPathExpression getSourceXPathExpression(); - - /** - * Set the XPath expression for the source attribute - * @param sourceXPathExpression the XPath expression for the source attribute - */ - void setSourceXPathExpression(XPathExpression sourceXPathExpression); - - /** - * Returns a URI to a file containing the property value. - * - * @return a URI to a file containing the property value - */ - String getFile(); - - /** - * Sets a URI to a file containing the property value. - * - * @param file a URI to a file containing the property value - */ - void setFile(String file); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java deleted file mode 100644 index ad72780de8..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * An instance of a reference associated with a particular component. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface ComponentReference extends Reference { - - /** - * Returns the reference defined by the implementation for this reference. - * - * @return the implementation reference - */ - Reference getReference(); - - /** - * Sets the reference defined by the implementation for this reference. - * - * @param reference the implementation reference - */ - void setReference(Reference reference); - - /** - * Return the Boolean value of autowire - * @return null/TRUE/FALSE - */ - Boolean getAutowire(); - - /** - * Sets whether component references should be autowired. - * - * @param autowire whether component references should be autowired - */ - void setAutowire(Boolean autowire); - - /** - * Returns the callback service created internally as a target endpoint - * for callbacks to this reference. - * - * @return the callback service - */ - ComponentService getCallbackService(); - - /** - * Sets the callback service created internally as a target endpoint - * for callbacks to this reference. - * - * @param callbackService the callback service - */ - void setCallbackService(ComponentService callbackService); - - /** - * A boolean value, "false" by default, which indicates whether this component reference - * can have its targets overridden by a composite reference which promotes the - * component reference. - * - * If @nonOverridable==false, the target(s) of the promoting composite reference - * replace all the targets explicitly declared on the component reference for any - * value of @multiplicity on the component reference. - * - * If the component reference has @nonOverridable==false and @multiplicity 1..1 - * and the reference has a target, then any composite reference which promotes - * the component reference has @multiplicity 0..1.by default and MAY have an explicit @multiplicity of either - * 0..1 or 1..1. - * - * If @nonOverridable==true, and the component reference has @multiplicity 0..1 or - * 1..1 and the component reference also declares a target, promotion implies - * that the promoting composite reference has @wiredbyImpl==true and the composite - * reference cannot supply a target, but can influence the policy attached to the - * component reference. - * - * If @nonOverridable==true, and the component reference @multiplicity is 0..n - * or 1..n, promotion targeting is additive - * - * @return - */ - boolean isNonOverridable(); - - /** - * Set the nonOverridable flag - * @param nonOverridable - */ - void setNonOverridable(boolean nonOverridable); - - /** - * Sets whether this Component Reference is promoted - * @param isPromoted - true if the component reference is promoted - */ - void setPromoted(boolean isPromoted); - - boolean isPromoted(); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java deleted file mode 100644 index e1e3eab90c..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * An addressable instance of a service associated with a particular component. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface ComponentService extends Service { - - /** - * Returns the service defined by the implementation for this service. - * - * @return - */ - Service getService(); - - /** - * Sets the service defined by the implementation for this service. - * - * @param service - */ - void setService(Service service); - - /** - * Returns the callback reference created internally as a source endpoint - * for callbacks from this service. - * - * @return the callback reference - */ - ComponentReference getCallbackReference(); - - /** - * Sets the callback reference created internally as a source endpoint - * for callbacks from this service. - * - * @param callbackReference the callback reference - */ - void setCallbackReference(ComponentReference callbackReference); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java deleted file mode 100644 index f748828999..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.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.assembly; - -import java.util.List; - -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Describes an implementation and represents its configurable aspects. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface ComponentType extends Base, PolicySubject { - - /** - * Returns the URI of this component type. - * @return the URI of the component type - */ - String getURI(); - - /** - * Sets the URI of this component type. - * @param uri the URI of the component type - */ - void setURI(String uri); - - /** - * Returns a list of services that are offered. - * - * @return a list of services that are offered - */ - List getServices(); - - /** - * Return a service by name - * - * @param name the service name - * @return service the service - */ - Service getService(String name); - - /** - * Returns the list of reference types that are used. - * - * @return the list of reference types that are used - */ - List getReferences(); - - /** - * Return a reference by name - * - * @param name the reference name - * @return reference the reference - */ - Reference getReference(String name); - - /** - * Returns the list of properties that can be set. - * - * @return the list of properties that can be set - */ - List getProperties(); - - /** - * Return a property by name - * - * @param name the property name - * @return property the property - */ - Property getProperty(String name); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java deleted file mode 100644 index 64a55f1b44..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Represents a composite. - * - * @version $Rev$ $Date$ - */ -public interface Composite extends Implementation, Extensible, Cloneable, PolicySubject { - /** - * Special name for the domain composite - */ - QName DOMAIN_COMPOSITE = new QName(SCA11_NS, ""); - QName TYPE = new QName(SCA11_NS, "implementation.composite"); - - /** - * Returns the spec version of the composite used to build this model - * - * @return the spec version used to build this model - */ - String getSpecVersion(); - - /** - * Sets the spec version of the composite used to build this model - * - * @param specVersion the spec version used to build this model - */ - void setSpecVersion(String specVersion); - - /** - * Returns the name of the composite. - * - * @return the name of the composite - */ - QName getName(); - - /** - * Sets the name of the composite. - * - * @param name the name of the composite - */ - void setName(QName name); - - /** - * Returns a list of composites included in this composite. - * - * @return a list of composites included in this composite. - */ - List getIncludes(); - - /** - * Returns a list of components contained in this composite. - * - * @return a list of components contained in this composite - */ - List getComponents(); - - /** - * Returns a component by name - */ - Component getComponent(String name); - - /** - * Returns a list of wires contained in this composite. - * - * @return a list of wires contained in this composite - */ - List getWires(); - - /** - * Returns true if all the components within the composite must run in the - * same process. - * - * @return true if all the components within the composite must run in the - * same process - */ - boolean isLocal(); - - /** - * Sets whether all the components within the composite must run in the same - * process. - * - * @param local whether all the components within the composite must run in - * the same process - */ - void setLocal(boolean local); - - /** - * Return the Boolean value of autowire - * @return null/TRUE/FALSE - */ - Boolean getAutowire(); - - /** - * Sets whether component references should be autowired. - * - * @param autowire whether component references should be autowired - */ - void setAutowire(Boolean autowire); - - /** - * Returns a clone of the component type. - * - * @return a clone of the component type - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java deleted file mode 100644 index 88cb2f9a2c..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -/** - * Represents composite reference. - * - * @version $Rev$ $Date$ - */ -public interface CompositeReference extends Reference { - /** - * Returns the promoted components. For each promoted component/reference, - * they have the same index in the component and reference list. - * - * @return the promoted components - */ - List getPromotedComponents(); - - /** - * Returns the promoted component references. - * - * @return the promoted component references - */ - List getPromotedReferences(); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java deleted file mode 100644 index 575d0784ce..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.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.assembly; - -/** - * Represents a composite service. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface CompositeService extends Service { - - /** - * Returns the promoted component. - * - * @return the promoted component. - */ - Component getPromotedComponent(); - - /** - * Sets the promoted component - * - * @param promotedComponent the promoted component. - */ - void setPromotedComponent(Component promotedComponent); - - /** - * Returns the promoted component service . - * - * @return the promoted component service. - */ - ComponentService getPromotedService(); - - /** - * Sets the promoted component service - * - * @param promotedService the promoted component service. - */ - void setPromotedService(ComponentService promotedService); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConfiguredOperation.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConfiguredOperation.java deleted file mode 100644 index fcfa689a7d..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConfiguredOperation.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Represents an Operation. Typically Operation elements are used when there is a - * need to apply certain facets such as intents and policysets only to a specific - * operation provided by a service or reference. - * - * @tuscany.spi.extension.asclient - * @version $Rev$ $Date$ - */ -public interface ConfiguredOperation extends Base, PolicySubject { - /** - * Returns the name of the operation. - * - * @return the name of the operation - */ - String getName(); - - /** - * Sets the name of the operation. - * - * @param name the name of the operation - */ - void setName(String name); - - /** - * Returns the name of the service or reference to which this operation belongs. - * This method is particularly useful when operation elements are specified under implementation - * elements and it is necessary to identify which of the various services provided by the - * implementation is referred to by the operation element in question - * - * @return the name of the contract to which this operation belongs - */ - String getContractName(); - - /** - * Sets the name of the service or reference to which this operation belongs. - * - * @param contractName the name of the contract to which this operation belongs - */ - void setContractName(String contractName); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java deleted file mode 100644 index 0c57c74ec0..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.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.assembly; - -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Represents a contract. A contract can be either a service or a reference. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface Contract extends AbstractContract, PolicySubject, Cloneable { - - /** - * Returns the bindings supported by this contract. - * - * @return the bindings supported by this contract - */ - List getBindings(); - - /** - * Returns a binding of the specified type or null if there is no such - * binding configured on this contract. - * - * @param the binding type - * @param bindingClass the binding type class - * @return the binding or null if there is no binding of the specified type - */ - B getBinding(Class bindingClass); - - /** - * Returns a callback binding of the specified type or null if there is no such - * callback binding configured on this contract. - * - * @param the callback binding type - * @param bindingClass the callback binding type class - * @return the callback binding or null if there is no callback binding of the specified type - */ - B getCallbackBinding(Class bindingClass); - - /** - * Returns a callback definition of the bindings to use for callbacks. - * - * @return a definition of the bindings to use for callbacks - */ - Callback getCallback(); - - /** - * Sets a callback definition of the bindings to use for callbacks - * - * @param callback a definition of the bindings to use for callbacks - */ - void setCallback(Callback callback); - - /** - * Returns a clone of the contract. - * - * @return a clone of the reference - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - - /** - * Returns the interface contract given a binding. Important in the case where - * a reference with multiplicity > 1 has been promoted and has it's list of - * resolved bindings extended by a promoting reference. Here the binding - * from the promoting reference may need the interface contract from the - * promoting reference and not the promoted reference. - * TODO - remove this wrinkle with better endpoint support. - * - * @param binding the binding for which the interface contract is required - * @return the interface contract - */ - InterfaceContract getInterfaceContract(Binding binding); - - /** - * A flag to tell if there are any binding elements specified for this service or reference. - * If true, they override the the bindings in the corresponding reference/service in the - * component type or promoted reference/service. - * @return - */ - boolean isOverridingBindings(); - - /** - * Set the flag depending on if there are any binding elements specified for this service or - * reference. - * @param overridingBindings true if there are binding elements specified - */ - void setOverridingBindings(boolean overridingBindings); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java deleted file mode 100644 index 6d8350fc66..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; - -/** - * A factory for the assembly model. - * - * @version $Rev$ $Date$ - */ -public class DefaultAssemblyFactory extends AssemblyFactoryImpl implements AssemblyFactory { - - public DefaultAssemblyFactory(ExtensionPointRegistry registry) { - super(registry); - } - - public DefaultAssemblyFactory() { - super(new DefaultExtensionPointRegistry()); - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java deleted file mode 100644 index 43bf17d66a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.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.assembly; - -import java.io.Serializable; -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Represents a service endpoint which is what results from having a configured - * binding applied to a component service. In a deployed application an endpoint - * will relate directly to a physical endpoint, for example, a HTTP URL or a - * JMS destination. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface Endpoint extends Base, PolicySubject, Cloneable, Serializable { - /** - * Get the structural URI of the service binding - * @return structural URI of the service/binding - */ - String getURI(); - - /** - * Set the structural URI of the service binding - * @param uri <componentURI>#service-binding(serviceName/bindingName) - * or <componentURI>#service(serviceName) - */ - void setURI(String uri); - - /** - * Get the component model object - * - * @return component - */ - Component getComponent(); - - /** - * Set the component model object - * - * @param component - */ - void setComponent(Component component); - - /** - * Get the service model object - * - * @return service - */ - ComponentService getService(); - - /** - * Set the service model object - * - * @param service - */ - void setService(ComponentService service); - - /** - * Get the resolved target binding - * - * @return target binding - */ - Binding getBinding(); - - /** - * Set the binding - * - * @param binding - */ - void setBinding(Binding binding); - - /** - * Returns the interface contract defining the interface - * - * @return the interface contract - */ - InterfaceContract getComponentServiceInterfaceContract(); - - /** - * Get the service's callback endpoint references that - * represent endpoint references from which callbacks - * originate - * - * @return callbackEndpoint the reference callback endpoint - */ - List getCallbackEndpointReferences(); - - /** - * Returns true if this endpoint represents a serivce that is not - * running in this JVM - * - * @return true if the endpoint is remote - */ - boolean isRemote(); - - /** - * Set true if this endpoint represents a serivce that is not - * running in this JVM - * - * @param remote set to true if the endpoint is remote - */ - void setRemote(boolean remote); - - /** - * Supports endpoint cloning - * - * @return endpoint - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - - /** - * Tests if the URI of this endpoint matches the service URI - * @param serviceName the service URI to test - * @return true if the endpoint URI matches the service URI - */ - boolean matches(String serviceURI); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java deleted file mode 100644 index 5c2ad74f54..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.io.Serializable; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Represents an endpoint reference. An SCA reference can reference service endpoints in a - * number of ways. Target names, autowire, configured bindings. The endpoint reference - * captures the result of specifying one of these things. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface EndpointReference extends Base, PolicySubject, Cloneable, Serializable { - - /** - * Status of the endpoint reference resolution - */ - enum Status { - NOT_CONFIGURED, // Not configured - RESOLVED_BINDING, // The endpoint reference is configured with a binding - AUTOWIRE_PLACEHOLDER, // Autowire to be performed - WIRED_TARGET_NOT_FOUND, // Wire target not found - WIRED_TARGET_FOUND_READY_FOR_MATCHING, // Wire target found and to be resolved to an endpoint - WIRED_TARGET_FOUND_AND_MATCHED, // Wire target found and resolved to an endpoint - WIRED_TARGET_IN_BINDING_URI // Target specified by the binding uri - }; - - /** - * Get the structural URI of the reference binding - * @return The structural URI of the reference/binding - */ - String getURI(); - - /** - * Set the structural URI of the reference binding - * @param uri <componentURI>#reference-binding(referenceName/bindingName) - * or <componentURI>#reference(referenceName) if binding is not present - * - */ - void setURI(String uri); - - /** - * Supports endpoint reference cloning - * - * @return endpointReference - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - - /** - * Get the component model object - * - * @return component - */ - Component getComponent(); - - /** - * Set the component model object - * - * @param component the component for the endpoint - */ - void setComponent(Component component); - - /** - * Get the source component reference model object - * - * @return reference the source component reference for the endpoint - */ - ComponentReference getReference(); - - /** - * Set the source component reference model object - * - * @param reference - */ - void setReference(ComponentReference reference); - - /** - * Get the resolved reference binding - * - * @return binding the resolved reference binding - */ - Binding getBinding(); - - /** - * Set the resolved reference binding - * - * @param binding the resolved reference binding - */ - void setBinding(Binding binding); - - /** - * Get the target endpoint - * - * @return endpoint the target endpoint - */ - Endpoint getTargetEndpoint(); - - /** - * Set the target endpoint model object - * - * @param endpoint the target endpoint - */ - void setTargetEndpoint(Endpoint targetEndpoint); - - /** - * Returns the interface contract defining the interface - * - * @return the interface contract - */ - InterfaceContract getComponentReferenceInterfaceContract(); - - /** - * Get the reference callback endpoint that - * represents that target endpoint to which callback - * messages will be directed - * - * @return callbackEndpoint the reference callback endpoint - */ - Endpoint getCallbackEndpoint(); - - /** - * Set the reference callback endpoint - * - * @param callbackEndpoint the reference callback endpoint - */ - void setCallbackEndpoint(Endpoint callbackEndpoint); - - /** - * Rather than relying on combinations of unresolved flags and - * other data we maintain a status enumeration - * - * @return status - */ - Status getStatus(); - - /** - * Rather than relying on combinations of unresolved flags and - * other data we maintain a status enumeration - * - * @param status the new status - */ - void setStatus(Status status); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extensible.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extensible.java deleted file mode 100644 index da8d054140..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extensible.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -/** - * Base interface for extensible assembly model objects. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface Extensible extends Base { - - /** - * Returns a list of extension objects contained in this model object. - * - * @return a list of extension objects container in this model object - */ - List getExtensions(); - - /** - * Returns a list of attribute extensions contained in this model object - * - * @return a list of attribute extensions contained in this model object - */ - List getAttributeExtensions(); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extension.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extension.java deleted file mode 100644 index d179ce7b3b..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extension.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import javax.xml.namespace.QName; - -/** - * Base interface for storing contents of extensible assembly model objects. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface Extension { - - /** - * Return QName for the extension - * @return the extension QName - */ - QName getQName(); - - /** - * Set QName for the extension - * @param qName the extension QName - */ - void setQName(QName qName); - - /** - * Return the original extension value - * @return the extension value - */ - T getValue(); - - /** - * Set the original extension value - * @param value the extension value - */ - void setValue(T value); - - /** - * Return whether or not the extension is an attribute - * @return - */ - boolean isAttribute(); - - /** - * Set whether or not the extension is an attribute - * @param value - */ - void setAttribute(boolean isAttribute); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java deleted file mode 100644 index 3912896f0c..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.interfacedef.Operation; - -/** - * Represents a component implementation. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface Implementation extends ComponentType { - QName getType(); - List getOperations(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java deleted file mode 100644 index 5b719e50bc..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.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.assembly; - -/** - * Enumeration for multiplicity. Defines the number of wires that can connect a - * reference to target services. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension - */ -public enum Multiplicity { - - /** - * Zero or one wire can have the reference as a source. - */ - ZERO_ONE, - - /** - * The default setting, one wire can have the reference as a source. - */ - ONE_ONE, - - /** - * Zero or more wires can have the reference as a source. - */ - ZERO_N, - - /** - * One or more wires can have the reference as a source. - */ - ONE_N - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationSelector.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationSelector.java deleted file mode 100644 index 9df72e358d..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationSelector.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Represents an operationSelector - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface OperationSelector extends Base, Cloneable { - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationsConfigurator.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationsConfigurator.java deleted file mode 100644 index d82d923605..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationsConfigurator.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -/** - * Interface to be implemented by SCA artifacts that support configuration of 'operation' child - * elements for policies etc. - * @tuscany.spi.extension.inheritfrom - * @version $Rev$ $Date$ - */ - -public interface OperationsConfigurator { - List getConfiguredOperations(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java deleted file mode 100644 index c65b6213b0..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * A property allows for the configuration of an implementation with externally - * set data values. An implementation can have zero or more properties. Each - * property has a data type, which may be either simple or complex. An - * implementation may also define a default value for a property. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface Property extends AbstractProperty, Cloneable { - - /** - * Returns a clone of the property. - * - * @return a clone of the property - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java deleted file mode 100644 index 2ee3e774e4..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -/** - * Represents a reference. References within an implementation represent links - * to services that the implementation uses that must be provided by other - * components. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface Reference extends AbstractReference, Contract { - - /** - * Returns a boolean value, "false" by default, which indicates that the - * implementation wires this reference dynamically. - * - * @return true if the implementation wires this reference dynamically - */ - boolean isWiredByImpl(); - - /** - * Sets a boolean value, "false" by default, which indicates that the - * implementation wires this reference dynamically. - * - * @param wiredByImpl whether the implementation wires this reference - * dynamically - */ - void setWiredByImpl(boolean wiredByImpl); - - - /** - * Returns the targets of this reference. - * - * @return the targets of this reference. - */ - List getTargets(); - - /** - * Returns the endpoint references implied by this reference. - * - * Endpoint references are used to represent: - * - * - manually specified reference targets - * - reference targets determined by autowire - * - manually configured remote bindings - * - * @return the endpoint references implied by this reference - */ - List getEndpointReferences(); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java deleted file mode 100644 index aa356e3857..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import javax.xml.namespace.QName; - -/** - * Represents an SCA binding. - * - * @version $Rev$ $Date$ - */ -public interface SCABinding extends Binding { - QName TYPE = new QName(SCA11_NS, "binding.sca"); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java deleted file mode 100644 index feae980326..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * A factory for the SCA binding model - * - * @version $Rev$ $Date$ - */ -public interface SCABindingFactory { - - /** - * Create a new SCA binding. - * - * @return a new SCA binding - */ - SCABinding createSCABinding(); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java deleted file mode 100644 index 1f3d412364..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -/** - * Represents a service. Services are used to publish services provided by - * implementations, so that they are addressable by other components. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface Service extends AbstractService, Contract { - /** - * Returns the endpoints implied by this service. - * - * Endpoints represent configured bindings for a service. Hence a service - * with two bindings will expose two Endpoints. Where a promoted service has - * new binding configuration applied by a promoting component Endpoints are - * introduced to represent these new bindings. - * - * @return the endpoints implied by this service - */ - List getEndpoints(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java deleted file mode 100644 index 075b50eec1..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.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.assembly; - -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Represents a wire. - * - * @version $Rev$ $Date$ - */ -public interface Wire extends Base, Extensible, PolicySubject, Cloneable { - - /** - * Returns the source of the wire. - * - * @return the source of the wire - */ - ComponentReference getSource(); - - /** - * Sets the source of the wire. - * - * @param source the source of the wire - */ - void setSource(ComponentReference source); - - /** - * Returns the target of the wire. - * - * @return the target of the wire - */ - ComponentService getTarget(); - - /** - * Sets the target of the wire. - * - * @param target the target of the wire - */ - void setTarget(ComponentService target); - - /** - * A boolean value, with the default of "false". When a wire element has - * @replace="false", the wire is added to the set of wires which apply to - * the reference identified by the @source attribute. When a wire element - * has @replace="true", the wire is added to the set of wires which apply to - * the reference identified by the @source attribute - but any wires for that - * reference specified by means of the @target attribute of the reference - * are removed from the set of wires which apply to the reference. - * - * @return - */ - boolean isReplace(); - - /** - * Set the replace flag for the wire - * @param replace - */ - void setReplace(boolean replace); - - /** - * Returns a clone of the wire. - * - * @return a clone of the wire - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/WireFormat.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/WireFormat.java deleted file mode 100644 index c622737454..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/WireFormat.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import javax.xml.namespace.QName; - -/** - * Represents a wireFormat. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface WireFormat extends Base, Cloneable { - QName getSchemaName(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilder.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilder.java deleted file mode 100644 index 7be207cdd2..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilder.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.Contract; - -/** - * A builder that handles any build-time configuration needed by bindings. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface BindingBuilder { - - /** - * Configure a binding. - * - * @param component The component for the binding's service or reference - * @param contract The binding's service or reference - * @param context The context for the builder - */ - void build(Component component, Contract contract, B binding, BuilderContext context); - - /** - * Get QName of the binding type - * @return The binding type - */ - QName getBindingType(); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BuilderContext.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BuilderContext.java deleted file mode 100644 index 374c36c1f5..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BuilderContext.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.definitions.Definitions; -import org.apache.tuscany.sca.monitor.DefaultMonitorFactory; -import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.monitor.MonitorFactory; - -/** - * Context for builders - * @tuscany.spi.extension.asclient - */ -public class BuilderContext { - protected Definitions definitions; - protected Map> bindingBaseURIs = Collections.emptyMap(); - protected Monitor monitor; - - /** - * @param definitions - * @param bindingBaseURIs - * @param monitor - */ - public BuilderContext(Definitions definitions, Map> bindingBaseURIs, Monitor monitor) { - super(); - this.definitions = definitions; - if (bindingBaseURIs != null) { - this.bindingBaseURIs = bindingBaseURIs; - } - this.monitor = monitor; - } - - /** - * Create a builder context with the monitor - * @param monitor - */ - public BuilderContext(Monitor monitor) { - super(); - this.monitor = monitor; - } - - /** - * Create a builder context with the extension point registry - * @param registry - */ - public BuilderContext(ExtensionPointRegistry registry) { - super(); - MonitorFactory monitorFactory = - registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(MonitorFactory.class); - this.monitor = monitorFactory.createMonitor(); - } - - /** - * Create a builder context with a default monitor - */ - public BuilderContext() { - super(); - this.monitor = new DefaultMonitorFactory().createMonitor(); - } - - public Monitor getMonitor() { - return monitor; - } - - public Monitor setMonitor(Monitor monitor) { - Monitor old = this.monitor; - this.monitor = monitor; - return old; - } - - public Definitions getDefinitions() { - return definitions; - } - - public Map> getBindingBaseURIs() { - return bindingBaseURIs; - } - - public void setDefinitions(Definitions definitions) { - this.definitions = definitions; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BuilderExtensionPoint.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BuilderExtensionPoint.java deleted file mode 100644 index d432bf3f29..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BuilderExtensionPoint.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - -import java.util.Collection; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Implementation; - -/** - * An extension point for Composite builders. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface BuilderExtensionPoint { - - /** - * Adds a composite builder. - * - * @param compositeBuilder - */ - void addCompositeBuilder(CompositeBuilder compositeBuilder); - - /** - * Removes a composite builder. - * - * @param compositeBuilder - */ - void removeCompositeBuilder(CompositeBuilder compositeBuilder); - - /** - * Returns the composite builder with the given id. - * - * @param id - * @return - */ - CompositeBuilder getCompositeBuilder(String id); - - /** - * Add a binding builder - * @param bindingBuilder - */ - void addBindingBuilder(BindingBuilder bindingBuilder); - - /** - * Look up a binding builder by the binding type - * @param - * @param bindingType - * @return - */ - BindingBuilder getBindingBuilder(QName bindingType); - - /** - * Remove a binding builder - * @param - * @param builder - */ - void removeBindingBuilder(BindingBuilder builder); - - /** - * Add an implementation builder - * @param implementationBuilder - */ - void addImplementationBuilder(ImplementationBuilder implementationBuilder); - - /** - * Look up an implementation builder by implementation type - * @param - * @param implementationType - * @return - */ - ImplementationBuilder getImplementationBuilder(QName implementationType); - - /** - * Remove an implementation builder - * @param - * @param builder - */ - void removeImplementationBuilder(ImplementationBuilder builder); - - /** - * Add a policy builder - * @param policyBuilder - */ - void addPolicyBuilder(PolicyBuilder policyBuilder); - - /** - * Look up a Policy builder by the Policy type - * @param

- * @param policyType - * @return - */ -

PolicyBuilder

getPolicyBuilder(QName policyType); - - /** - * Remove a Policy builder - * @param

- * @param builder - */ -

void removePolicyBuilder(PolicyBuilder

builder); - - /** - * Get a collection of policy builders - * @return - */ - public Collection getPolicyBuilders(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java deleted file mode 100644 index 50bf10f54a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - -import org.apache.tuscany.sca.assembly.Composite; - -/** - * A builder that handles the configuration of the components inside a - * composite and the wiring of component references to component services. - * - * @version $Rev$ $Date$ - */ -public interface CompositeBuilder { - - /** - * Returns the ID of the builder. - * - * @return An ID that identifies the builder - */ - String getID(); - - /** - * Build a composite. - * - * @param composite The composite - * @param context The builder context - * @return The composite built from the original one. In most cases, it is the same as the orginal one as - * most builders only change the content of the composite. - * - * @throws CompositeBuilderException - */ - Composite build(Composite composite, BuilderContext context) throws CompositeBuilderException; - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java deleted file mode 100644 index 5a2015f55e..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - -/** - * Reports a composite builder exception. - * - * @version $Rev$ $Date$ - */ -public class CompositeBuilderException extends Exception { - private static final long serialVersionUID = -8916323176803443856L; - - public CompositeBuilderException() { - } - - public CompositeBuilderException(String message) { - super(message); - } - - public CompositeBuilderException(Throwable cause) { - super(cause); - } - - public CompositeBuilderException(String message, Throwable cause) { - super(message, cause); - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultBuilderExtensionPoint.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultBuilderExtensionPoint.java deleted file mode 100644 index 6dba234f0f..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultBuilderExtensionPoint.java +++ /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. - */ - -package org.apache.tuscany.sca.assembly.builder; - -import java.lang.reflect.Constructor; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.Contract; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.FactoryExtensionPoint; -import org.apache.tuscany.sca.core.LifeCycleListener; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.extensibility.ServiceDeclaration; -import org.apache.tuscany.sca.extensibility.ServiceDeclarationParser; -import org.apache.tuscany.sca.extensibility.ServiceDiscovery; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; - -/** - * Default implementation of a provider factory extension point. - * - * @version $Rev$ $Date$ - */ -public class DefaultBuilderExtensionPoint implements BuilderExtensionPoint, LifeCycleListener { - - private ExtensionPointRegistry registry; - private final Map builders = new HashMap(); - private final Map bindingBuilders = new HashMap(); - private final Map implementationBuilders = - new HashMap(); - private final Map policyBuilders = new HashMap(); - - private boolean loaded; - - public DefaultBuilderExtensionPoint(ExtensionPointRegistry registry) { - this.registry = registry; - } - - public void start() { - } - - public void stop() { - builders.clear(); - bindingBuilders.clear(); - implementationBuilders.clear(); - loaded = false; - } - - public void addCompositeBuilder(CompositeBuilder builder) { - builders.put(builder.getID(), builder); - } - - public void removeCompositeBuilder(CompositeBuilder builder) { - builders.remove(builder.getID()); - } - - public CompositeBuilder getCompositeBuilder(String id) { - loadBuilders(); - return builders.get(id); - } - - /** - * Load builders declared under META-INF/services. - */ - private synchronized void loadBuilders() { - if (loaded) - return; - - FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class); - - UtilityExtensionPoint utils = registry.getExtensionPoint(UtilityExtensionPoint.class); - InterfaceContractMapper mapper = utils.getUtility(InterfaceContractMapper.class); - - // Get the provider factory service declarations - Collection builderDeclarations; - ServiceDiscovery serviceDiscovery = registry.getServiceDiscovery(); - try { - builderDeclarations = serviceDiscovery.getServiceDeclarations(CompositeBuilder.class.getName()); - } catch (Exception e) { - throw new IllegalStateException(e); - } - - for (ServiceDeclaration builderDeclaration : builderDeclarations) { - Map attributes = builderDeclaration.getAttributes(); - String id = attributes.get("id"); - - CompositeBuilder builder = new LazyCompositeBuilder(id, builderDeclaration, this, factories, mapper); - builders.put(id, builder); - } - - try { - builderDeclarations = serviceDiscovery.getServiceDeclarations(BindingBuilder.class); - } catch (Exception e) { - throw new IllegalStateException(e); - } - - for (ServiceDeclaration builderDeclaration : builderDeclarations) { - BindingBuilder builder = new LazyBindingBuilder(builderDeclaration); - bindingBuilders.put(builder.getBindingType(), builder); - } - - try { - builderDeclarations = serviceDiscovery.getServiceDeclarations(ImplementationBuilder.class); - } catch (Exception e) { - throw new IllegalStateException(e); - } - - for (ServiceDeclaration builderDeclaration : builderDeclarations) { - ImplementationBuilder builder = new LazyImplementationBuilder(builderDeclaration); - implementationBuilders.put(builder.getImplementationType(), builder); - } - - try { - builderDeclarations = serviceDiscovery.getServiceDeclarations(PolicyBuilder.class); - } catch (Exception e) { - throw new IllegalStateException(e); - } - - for (ServiceDeclaration builderDeclaration : builderDeclarations) { - PolicyBuilder builder = new LazyPolicyBuilder(builderDeclaration); - policyBuilders.put(builder.getPolicyType(), builder); - } - - - loaded = true; - - } - - public void addBindingBuilder(BindingBuilder bindingBuilder) { - bindingBuilders.put(bindingBuilder.getBindingType(), bindingBuilder); - } - - public BindingBuilder getBindingBuilder(QName bindingType) { - loadBuilders(); - return (BindingBuilder)bindingBuilders.get(bindingType); - } - - public void removeBindingBuilder(BindingBuilder builder) { - bindingBuilders.remove(builder.getBindingType()); - } - - public void addImplementationBuilder(ImplementationBuilder implementationBuilder) { - implementationBuilders.put(implementationBuilder.getImplementationType(), implementationBuilder); - } - - public ImplementationBuilder getImplementationBuilder(QName implementationType) { - loadBuilders(); - return (ImplementationBuilder)implementationBuilders.get(implementationType); - } - - public void removeImplementationBuilder(ImplementationBuilder builder) { - implementationBuilders.remove(builder.getImplementationType()); - } - - public void addPolicyBuilder(PolicyBuilder policyBuilder) { - policyBuilders.put(policyBuilder.getPolicyType(), policyBuilder); - } - - public PolicyBuilder getPolicyBuilder(QName policyType) { - loadBuilders(); - return (PolicyBuilder)policyBuilders.get(policyType); - } - - public Collection getPolicyBuilders() { - loadBuilders(); - return policyBuilders.values(); - } - - public void removePolicyBuilder(PolicyBuilder builder) { - policyBuilders.remove(builder.getPolicyType()); - } - - /** - * A wrapper around a composite builder allowing lazy - * loading and initialization of implementation providers. - */ - private class LazyCompositeBuilder implements CompositeBuilder { - - private FactoryExtensionPoint factories; - private InterfaceContractMapper mapper; - private String id; - private ServiceDeclaration builderDeclaration; - private CompositeBuilder builder; - private BuilderExtensionPoint builders; - - private LazyCompositeBuilder(String id, - ServiceDeclaration factoryDeclaration, - BuilderExtensionPoint builders, - FactoryExtensionPoint factories, - InterfaceContractMapper mapper) { - this.id = id; - this.builderDeclaration = factoryDeclaration; - this.builders = builders; - this.factories = factories; - this.mapper = mapper; - } - - public String getID() { - return id; - } - - public Composite build(Composite composite, BuilderContext context) - throws CompositeBuilderException { - return getBuilder().build(composite, context); - } - - private CompositeBuilder getBuilder() { - if (builder == null) { - try { - Class builderClass = (Class)builderDeclaration.loadClass(); - try { - Constructor constructor = - builderClass.getConstructor(FactoryExtensionPoint.class, InterfaceContractMapper.class); - builder = constructor.newInstance(factories, mapper); - } catch (NoSuchMethodException e) { - try { - Constructor constructor = - builderClass.getConstructor(BuilderExtensionPoint.class, - FactoryExtensionPoint.class, - InterfaceContractMapper.class); - builder = constructor.newInstance(builders, factories, mapper); - } catch (NoSuchMethodException ex) { - Constructor constructor = - builderClass.getConstructor(ExtensionPointRegistry.class); - builder = constructor.newInstance(registry); - } - } - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return builder; - } - - } - - private class LazyBindingBuilder implements BindingBuilder { - private ServiceDeclaration sd; - private BindingBuilder builder; - private QName qname;; - - /** - * @param sd - */ - public LazyBindingBuilder(ServiceDeclaration sd) { - super(); - this.sd = sd; - this.qname = ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); - } - - public void build(Component component, Contract contract, Binding binding, BuilderContext context) { - getBuilder().build(component, contract, binding, context); - } - - public QName getBindingType() { - return qname; - } - - - private synchronized BindingBuilder getBuilder() { - if (builder == null) { - try { - Class builderClass = sd.loadClass(); - try { - Constructor constructor = builderClass.getConstructor(ExtensionPointRegistry.class); - builder = (BindingBuilder)constructor.newInstance(registry); - } catch (NoSuchMethodException e) { - Constructor constructor = builderClass.getConstructor(); - builder = (BindingBuilder)constructor.newInstance(); - - } - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return builder; - } - - } - - private class LazyImplementationBuilder implements ImplementationBuilder { - private ServiceDeclaration sd; - private ImplementationBuilder builder; - private QName qname;; - - /** - * @param sd - */ - public LazyImplementationBuilder(ServiceDeclaration sd) { - super(); - this.sd = sd; - this.qname = ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); - } - - public void build(Component component, Implementation implementation, BuilderContext context) { - getBuilder().build(component, implementation, context); - } - - public QName getImplementationType() { - return qname; - } - - private synchronized ImplementationBuilder getBuilder() { - if (builder == null) { - try { - Class builderClass = sd.loadClass(); - try { - Constructor constructor = builderClass.getConstructor(ExtensionPointRegistry.class); - builder = (ImplementationBuilder)constructor.newInstance(registry); - } catch (NoSuchMethodException e) { - Constructor constructor = builderClass.getConstructor(); - builder = (ImplementationBuilder)constructor.newInstance(); - - } - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return builder; - } - - } - - private class LazyPolicyBuilder implements PolicyBuilder { - private ServiceDeclaration sd; - private PolicyBuilder builder; - private QName qname;; - - /** - * @param sd - */ - public LazyPolicyBuilder(ServiceDeclaration sd) { - super(); - this.sd = sd; - this.qname = ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); - } - - public boolean build(Component component, Implementation implementation, BuilderContext context) { - return getBuilder().build(component, implementation, context); - } - - public QName getPolicyType() { - return qname; - } - - public List getSupportedBindings() { - return getBuilder().getSupportedBindings(); - } - - private synchronized PolicyBuilder getBuilder() { - if (builder == null) { - try { - Class builderClass = sd.loadClass(); - try { - Constructor constructor = builderClass.getConstructor(ExtensionPointRegistry.class); - builder = (PolicyBuilder)constructor.newInstance(registry); - } catch (NoSuchMethodException e) { - Constructor constructor = builderClass.getConstructor(); - builder = (PolicyBuilder)constructor.newInstance(); - - } - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return builder; - } - - public boolean build(Endpoint endpoint, BuilderContext context) { - return getBuilder().build(endpoint, context); - } - - public boolean build(org.apache.tuscany.sca.assembly.EndpointReference endpointReference, BuilderContext context) { - return getBuilder().build(endpointReference, context); - } - - public boolean build(EndpointReference endpointReference, Endpoint endpoint, BuilderContext context) { - return getBuilder().build(endpointReference, endpoint, context); - } - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/ImplementationBuilder.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/ImplementationBuilder.java deleted file mode 100644 index d47c3d9032..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/ImplementationBuilder.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.assembly.builder; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.Implementation; - -/** - * A builder that handles any build-time configuration needed by implementations. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface ImplementationBuilder { - - /** - * Configure a component implementation. - * - * @param component The component - * @param context TODO - * @param contract The implementation - */ - void build(Component component, I implmentation, BuilderContext context); - - /** - * Get the QName of the implementation type - * @return - */ - QName getImplementationType(); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/Messages.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/Messages.java deleted file mode 100644 index 4f2842c61a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/Messages.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - -/** - * Constants for resource bundle names - */ -public interface Messages { - String RESOURCE_PACKAGE = "org.apache.tuscany.sca.assembly.builder."; - String ASSEMBLY_VALIDATION = RESOURCE_PACKAGE + "assembly-validation-messages"; - String ASSEMBLY_CONFORMANCE = RESOURCE_PACKAGE + "assembly-conformance-messages"; - String DEFINITIONS_VALIDATION = RESOURCE_PACKAGE + "definitions-validation-messages"; - String BUILDER_VALIDATION_BUNDLE = "org.apache.tuscany.sca.builder.builder-validation-messages"; -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/PolicyBuilder.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/PolicyBuilder.java deleted file mode 100644 index 423c856973..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/PolicyBuilder.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.assembly.builder; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.assembly.Implementation; - -/** - * A builder that is contributed by a specific policy language to validate the configurations - * for SCA endpoints, endpoint references and component implementations - * @tuscany.spi.extension.inheritfrom - */ -public interface PolicyBuilder { - /** - * Get the policy type - * @return - */ - QName getPolicyType(); - - /** - * Return the list of binding type QNames at which this policy implementation - * is targeted. Or null if the policy is not binding specific - * @return list of binding type QNames at which this policy implementation or null if it's not binding specific - */ - List getSupportedBindings(); - - /** - * Build (and validate) the policy settings on the endpoint - * @param endpoint - * @param monitor - * @return true if the policy setting is compatible - */ - boolean build(Endpoint endpoint, BuilderContext context); - - /** - * Build (and validate) the policy settings on the endpoint reference - * @param endpointReference - * @param monitor - * @return true if the policy setting is compatible - */ - boolean build(EndpointReference endpointReference, BuilderContext context); - - /** - * Build (and validate) the policy settings on the component implementation - * @param component - * @param implementation - * @param monitor - * @return true if the policy setting is compatible - */ - boolean build(Component component, Implementation implementation, BuilderContext context); - - /** - * Build (and validate) the policy settings on the endpoint reference is compatible with the endpoint - * @param endpointReference - * @param endpoint - * @param context - * @return if the policy setting is compatible - */ - boolean build(EndpointReference endpointReference, Endpoint endpoint, BuilderContext context); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/WireBuilder.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/WireBuilder.java deleted file mode 100644 index 2bfbe85664..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/WireBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; - -/** - * A builder that connects an endpoint reference to an endpoint - */ -public interface WireBuilder { - /** - * Build the endpoint reference against the endpoint. If the endpoint is a valid target for the - * endpoint reference, the wire buidler can populate some information from the endpoint into the - * endpoint reference (such as targetEndpoint, policySets or requiredIntents) - * @param endpointReference - * @param endpoint - * @param context - * @return true if the endpoint is a valid target for the endpoint reference - */ - boolean build(EndpointReference endpointReference, Endpoint endpoint, BuilderContext context); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java deleted file mode 100644 index 24dc20f815..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.AbstractProperty; -import org.apache.tuscany.sca.interfacedef.DataType; - -/** - * Represents an abstract property. - * - * @version $Rev$ $Date$ - */ -public class AbstractPropertyImpl extends ExtensibleImpl implements AbstractProperty { - protected Object value; - protected String name; - protected QName xsdType; - protected QName xsdElement; - protected boolean many; - protected boolean mustSupply; - protected DataType dataType; - protected Object xsdDefinition; - - /** - * Constructs a new abstract property. - */ - protected AbstractPropertyImpl() { - } - - public Object getValue() { - return value; - } - - public String getName() { - return name; - } - - public QName getXSDElement() { - return xsdElement; - } - - public QName getXSDType() { - return xsdType; - } - - public boolean isMany() { - return many; - } - - public boolean isMustSupply() { - return mustSupply; - } - - public void setValue(Object defaultValue) { - this.value = defaultValue; - } - - public void setMany(boolean many) { - this.many = many; - } - - public void setMustSupply(boolean mustSupply) { - this.mustSupply = mustSupply; - } - - public void setName(String name) { - this.name = name; - } - - public void setXSDElement(QName element) { - this.xsdElement = element; - } - - public void setXSDType(QName type) { - this.xsdType = type; - } - - public DataType getDataType() { - return dataType; - } - - public void setDataType(DataType dataType) { - this.dataType = dataType; - } - - public Object getXSDDefinition() { - return xsdDefinition; - } - - public void setXSDDefinition(Object xsdDefinition) { - this.xsdDefinition = xsdDefinition; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java deleted file mode 100644 index 3e44f5f7ae..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.AbstractReference; -import org.apache.tuscany.sca.assembly.Multiplicity; - -/** - * Represents an abstract reference - * - * @version $Rev$ $Date$ - */ -public class AbstractReferenceImpl extends ContractImpl implements AbstractReference { - private Multiplicity multiplicity = Multiplicity.ONE_ONE; - - /** - * Constructs a new abstract reference. - */ - protected AbstractReferenceImpl() { - } - - public Multiplicity getMultiplicity() { - return multiplicity; - } - - public void setMultiplicity(Multiplicity multiplicity) { - this.multiplicity = multiplicity; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java deleted file mode 100644 index 24b1a0e03e..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.AbstractService; - -/** - * Represents an abstract service - * - * @version $Rev$ $Date$ - */ -public class AbstractServiceImpl extends ContractImpl implements AbstractService { - - /** - * Constructs a new abstract service. - */ - protected AbstractServiceImpl() { - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java deleted file mode 100644 index 0759ff1361..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.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.assembly.impl; - -import org.apache.tuscany.sca.assembly.AbstractProperty; -import org.apache.tuscany.sca.assembly.AbstractReference; -import org.apache.tuscany.sca.assembly.AbstractService; -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.ConfiguredOperation; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.assembly.Extension; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.Wire; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; - -/** - * A factory for the assembly model. - * - * @version $Rev$ $Date$ - */ -public abstract class AssemblyFactoryImpl implements AssemblyFactory { - - protected ExtensionPointRegistry registry; - - protected AssemblyFactoryImpl(ExtensionPointRegistry registry) { - super(); - this.registry = registry; - } - - public AbstractProperty createAbstractProperty() { - return new AbstractPropertyImpl(); - } - - public AbstractReference createAbstractReference() { - return new AbstractReferenceImpl(); - } - - public AbstractService createAbstractService() { - return new AbstractServiceImpl(); - } - - public Callback createCallback() { - return new CallbackImpl(); - } - - public Component createComponent() { - return new ComponentImpl(); - } - - public ComponentProperty createComponentProperty() { - return new ComponentPropertyImpl(); - } - - public ComponentReference createComponentReference() { - return new ComponentReferenceImpl(); - } - - public ComponentService createComponentService() { - return new ComponentServiceImpl(); - } - - public ComponentType createComponentType() { - return new ComponentTypeImpl(); - } - - public Composite createComposite() { - return new CompositeImpl(); - } - - public CompositeReference createCompositeReference() { - return new CompositeReferenceImpl(); - } - - public CompositeService createCompositeService() { - return new CompositeServiceImpl(); - } - - public Property createProperty() { - return new PropertyImpl(); - } - - public Reference createReference() { - return new ReferenceImpl(); - } - - public Service createService() { - return new ServiceImpl(); - } - - public Wire createWire() { - return new WireImpl(); - } - - public Extension createExtension() { - return new ExtensionImpl(); - } - - public Endpoint createEndpoint() { - return new EndpointImpl(registry); - } - - public EndpointReference createEndpointReference() { - return new EndpointReferenceImpl(registry); - } - - public ConfiguredOperation createConfiguredOperation() { - return new ConfiguredOperationImpl(); - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java deleted file mode 100644 index 516b11724f..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.Base; - -/** - * Convenience base class for assembly model objects. - * - * @version $Rev$ $Date$ - */ -public abstract class BaseImpl implements Base { - private boolean unresolved; - - /** - * Constructs a new base model object. - */ - protected BaseImpl() { - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean undefined) { - this.unresolved = undefined; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java deleted file mode 100644 index d912606f1d..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.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.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.OperationSelector; -import org.apache.tuscany.sca.assembly.WireFormat; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Base Binding implementation class - */ -public abstract class BindingImpl extends ExtensibleImpl implements Binding { - private String name; - private ExtensionType extensionType; - private String uri; - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - - protected QName type; - - protected BindingImpl(QName type) { - super(); - this.type = type; - } - - public QName getType() { - return type; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ExtensionType getExtensionType() { - return extensionType; - } - - public void setExtensionType(ExtensionType type) { - this.extensionType = type; - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public OperationSelector getOperationSelector() { - return null; - } - - public WireFormat getRequestWireFormat() { - return null; - } - - public WireFormat getResponseWireFormat() { - return null; - } - - public void setOperationSelector(OperationSelector operationSelector) { - } - - public void setRequestWireFormat(WireFormat wireFormat) { - } - - public void setResponseWireFormat(WireFormat wireFormat) { - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append(getType()).append(" ("); - buf.append("uri=").append(getURI()); - buf.append(",name=").append(getName()); - buf.append(")"); - return buf.toString(); - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java deleted file mode 100644 index dcd6c7b08a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a reference. - * - * @version $Rev$ $Date$ - */ -public class CallbackImpl extends ExtensibleImpl implements Callback { - private List bindings = new ArrayList(); - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - - public List getPolicySets() { - return policySets; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - protected CallbackImpl() { - } - - public List getBindings() { - return bindings; - } - - public ExtensionType getExtensionType() { - return null; - } - - public void setExtensionType(ExtensionType type) { - } - - public void setRequiredIntents(List intents) { - this.requiredIntents = intents; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java deleted file mode 100644 index 8a03df339c..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.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.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a component. - * - * @version $Rev$ $Date$ - */ -public class ComponentImpl extends ExtensibleImpl implements Component, Cloneable { - private Implementation implementation; - private String name; - private String uri; - private List properties = new ArrayList(); - private List references = new ArrayList(); - private List services = new ArrayList(); - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - private Boolean autowire; - private ExtensionType type; - - /** - * Constructs a new component. - */ - protected ComponentImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - ComponentImpl clone = (ComponentImpl)super.clone(); - - clone.properties = new ArrayList(); - for (ComponentProperty property : getProperties()) { - clone.properties.add((ComponentProperty)property.clone()); - } - clone.references = new ArrayList(); - for (ComponentReference reference : getReferences()) { - clone.references.add((ComponentReference)reference.clone()); - } - clone.services = new ArrayList(); - for (ComponentService service : getServices()) { - clone.services.add((ComponentService)service.clone()); - } - - // Clone the implementation.composite - if(implementation instanceof Composite) { - clone.implementation = (Composite) ((Composite) implementation).clone(); - } - - // Clone the Lists for intents and policySets - clone.requiredIntents = new ArrayList(getRequiredIntents()); - clone.policySets = new ArrayList(getPolicySets()); - - return clone; - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public Implementation getImplementation() { - return implementation; - } - - public String getName() { - return name; - } - - public List getProperties() { - return properties; - } - - public ComponentProperty getProperty(String name) { - for (ComponentProperty property : getProperties()) { - if (property.getName().equals(name)) { - return property; - } - } - return null; - } - - public List getReferences() { - return references; - } - - public ComponentReference getReference(String name){ - for (ComponentReference ref : getReferences()){ - if (ref.getName().equals(name)){ - return ref; - } - } - return null; - } - - public List getServices() { - return services; - } - - public ComponentService getService(String name) { - for (ComponentService service : getServices()) { - if (service.getName().equals(name)) { - return service; - } - } - return null; - } - - public void setImplementation(Implementation implementation) { - this.implementation = implementation; - } - - public void setName(String name) { - this.name = name; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - - public boolean isAutowire() { - return (autowire == null) ? false : autowire.booleanValue(); - } - - public void setAutowire(Boolean autowire) { - this.autowire = autowire; - } - - public Boolean getAutowire() { - return autowire; - } - - public ExtensionType getExtensionType() { - return type; - } - - public void setExtensionType(ExtensionType type) { - this.type = type; - } - - public String toString() { - StringBuffer buf = new StringBuffer("Component ("); - buf.append("uri=").append(uri); - buf.append(",name=").append(name); - buf.append(",implementation=").append(implementation); - buf.append(")"); - return buf.toString(); - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java deleted file mode 100644 index 9db522930f..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import javax.xml.xpath.XPathExpression; - -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.Property; - -/** - * Represents a component property. - * - * @version $Rev$ $Date$ - */ -public class ComponentPropertyImpl extends PropertyImpl implements ComponentProperty, Cloneable { - private String file; - private Property property; - private String source; - private XPathExpression sourceXPathExpression; - - /** - * Constructs a new component property. - */ - protected ComponentPropertyImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - // FIXME getValue should not delegate to property.getValue() - // Doing this violates the setValue/getValue semantics, as you - // can call setValue() then get a different value from getValue() - @Override - public Object getValue() { - if (super.getValue() == null && property != null) { - return property.getValue(); - } else { - return super.getValue(); - } - } - - public String getFile() { - return file; - } - - public Property getProperty() { - return property; - } - - public String getSource() { - return source; - } - - public void setFile(String file) { - this.file = file; - } - - public void setProperty(Property property) { - this.property = property; - } - - public void setSource(String source) { - this.source = source; - } - - public XPathExpression getSourceXPathExpression() { - return sourceXPathExpression; - } - - public void setSourceXPathExpression(XPathExpression sourceXPathExpression) { - this.sourceXPathExpression = sourceXPathExpression; - } - - public String toString() { - return "Property: " + getName() + " Value: " + getValue(); - } // end method toString - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java deleted file mode 100644 index 78b54668b3..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; - -/** - * Represents a component reference - * - * @version $Rev$ $Date$ - */ -public class ComponentReferenceImpl extends ReferenceImpl implements ComponentReference, Cloneable { - private Reference reference; - private Boolean autowire; - private boolean nonOverridable; - private List promotedAs = new ArrayList(); - private ComponentService callbackService; - private boolean isPromoted = false; - - /** - * Constructs a new component reference. - */ - protected ComponentReferenceImpl() { - // Set multiplicity to null so that by default it'll inherit from the Reference - setMultiplicity(null); - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public Reference getReference() { - return reference; - } - - public void setReference(Reference reference) { - this.reference = reference; - } - - public boolean isAutowire() { - return (autowire == null) ? false : autowire.booleanValue(); - } - - public void setAutowire(Boolean autowire) { - this.autowire = autowire; - } - - public Boolean getAutowire() { - return autowire; - } - - public List promotedAs() { - return promotedAs; - } - - public ComponentService getCallbackService() { - return callbackService; - } - - public void setCallbackService(ComponentService callbackService) { - this.callbackService = callbackService; - } - - /** - * Use endpoint information to work out what the interface contract for the - * binding is. - */ - @Override - public InterfaceContract getInterfaceContract(Binding binding) { - InterfaceContract interfaceContract = null; - - if (interfaceContract == null) { - interfaceContract = getInterfaceContract(); - } - return interfaceContract; - } - - public boolean isNonOverridable() { - return nonOverridable; - } - - public void setNonOverridable(boolean nonOverridable) { - this.nonOverridable = nonOverridable; - } - - public void setPromoted(boolean isPromoted) { - this.isPromoted = isPromoted; - } // end method setPromoted - - public boolean isPromoted() { - return isPromoted; - } -} // end class ComponentReferenceImpl diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java deleted file mode 100644 index f8c9f53413..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.Service; - -/** - * Represents a component service - * - * @version $Rev$ $Date$ - */ -public class ComponentServiceImpl extends ServiceImpl implements ComponentService, Cloneable { - private Service service; - private List promotedAs = new ArrayList(); - private ComponentReference callbackReference; - - /** - * Constructs a new component service. - */ - protected ComponentServiceImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public Service getService() { - return service; - } - - public void setService(Service service) { - this.service = service; - } - - public List promotedAs() { - return promotedAs; - } - - public ComponentReference getCallbackReference() { - return callbackReference; - } - - public void setCallbackReference(ComponentReference callbackReference) { - this.callbackReference = callbackReference; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java deleted file mode 100644 index b52c65ef8b..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.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.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -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.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a component type. - * - * @version $Rev$ $Date$ - */ -public class ComponentTypeImpl extends ExtensibleImpl implements ComponentType, Cloneable { - private String uri; - private List properties = new ArrayList(); - private List references = new ArrayList(); - private List services = new ArrayList(); - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - - /** - * Constructs a new component type. - */ - protected ComponentTypeImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - ComponentTypeImpl clone = (ComponentTypeImpl)super.clone(); - - clone.services = new ArrayList(); - for (Service service : getServices()) { - clone.services.add((Service)service.clone()); - } - clone.references = new ArrayList(); - for (Reference reference : getReferences()) { - clone.references.add((Reference)reference.clone()); - } - clone.properties = new ArrayList(); - for (Property property : getProperties()) { - clone.properties.add((Property)property.clone()); - } - clone.requiredIntents = new ArrayList(requiredIntents); - clone.policySets = new ArrayList(policySets); - return clone; - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public List getProperties() { - return properties; - } - - public Property getProperty(String name){ - Property property = null; - - for (Property tmp : getProperties()){ - if (tmp.getName().equals(name)){ - property = tmp; - break; - } - } - - return property; - } - - public List getReferences() { - return references; - } - - public Reference getReference(String name){ - Reference reference = null; - - for (Reference tmp : getReferences()){ - if (tmp.getName().equals(name)){ - reference = tmp; - break; - } - } - - return reference; - } - - public List getServices() { - return services; - } - - public Service getService(String name){ - Service service = null; - - for (Service tmp : getServices()){ - if (tmp.getName().equals(name)){ - service = tmp; - break; - } - } - - return service; - } - - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - - public ExtensionType getExtensionType() { - return null; - } - - public void setExtensionType(ExtensionType type) { - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((uri == null) ? 0 : uri.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ComponentTypeImpl other = (ComponentTypeImpl)obj; - if (uri == null) { - if (other.uri != null) { - return false; - } - } else if (!uri.equals(other.uri)) { - return false; - } - return true; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java deleted file mode 100644 index fba6af7e7f..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.Wire; - -/** - * Implementation of a Composite. - * - * @version $Rev$ $Date$ - */ -public class CompositeImpl extends ImplementationImpl implements Composite, Cloneable { - private String specVersion = "undefined"; - private List components = new ArrayList(); - private List includes = new ArrayList(); - private QName name; - private List wires = new ArrayList(); - private Boolean autowire; - private boolean local = true; - - /** - * Constructs a new composite. - */ - protected CompositeImpl() { - super(TYPE); - } - - @Override - public Object clone() throws CloneNotSupportedException { - CompositeImpl clone = (CompositeImpl)super.clone(); - - // clone the child components - clone.components = new ArrayList(); - for (Component component : getComponents()) { - Component clonedComponent = (Component)component.clone(); - clone.components.add(clonedComponent); - } - - // reset the references and services so the get re-resolved - for (Service service : clone.getServices()) { - CompositeService compositeService = (CompositeService)service; - // Force the promoted component/service to be rebuilt against the clone - if (compositeService.getPromotedComponent() != null) { - compositeService.getPromotedComponent().setUnresolved(true); - } - if (compositeService.getPromotedService() != null) { - compositeService.getPromotedService().setUnresolved(true); - } - } - for (Reference reference : clone.getReferences()) { - CompositeReference compositeReference = (CompositeReference)reference; - for (ComponentReference ref : compositeReference.getPromotedReferences()) { - // Force the promoted reference to be rebuilt against the clone - ref.setUnresolved(true); - } - } - - // clone the wires - clone.wires = new ArrayList(); - for (Wire wire : getWires()) { - clone.wires.add((Wire)wire.clone()); - } - - // Clone the includes - clone.includes = new ArrayList(); - for (Composite included : getIncludes()) { - clone.includes.add((Composite)included.clone()); - } - return clone; - } - - public String getSpecVersion() { - return specVersion; - } - - public void setSpecVersion(String specVersion) { - this.specVersion = specVersion; - } - - public List getComponents() { - return components; - } - - public Component getComponent(String name) { - Component component = null; - - for (Component tmp : getComponents()){ - if (tmp.getName().equals(name)){ - component = tmp; - break; - } - } - return component; - } - - public List getIncludes() { - return includes; - } - - public QName getName() { - return name; - } - - public List getWires() { - return wires; - } - - public boolean isLocal() { - return local; - } - - public void setLocal(boolean local) { - this.local = local; - } - - public boolean isAutowire() { - return (autowire == null) ? false : autowire.booleanValue(); - } - - public void setAutowire(Boolean autowire) { - this.autowire = autowire; - } - - public Boolean getAutowire() { - return autowire; - } - - public void setName(QName name) { - this.name = name; - } - - @Override - public int hashCode() { - return String.valueOf(getName()).hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } else if (obj instanceof Composite) { - if (getName() != null) { - return getName().equals(((Composite)obj).getName()); - } else { - return ((Composite)obj).getName() == null; - } - } else { - return false; - } - } - - @Override - public String toString() { - return "Composite (name=" + getName() + ")"; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java deleted file mode 100644 index ae5fad461b..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.CompositeReference; - -/** - * Represents a composite reference. - * - * @version $Rev$ $Date$ - */ -public class CompositeReferenceImpl extends ReferenceImpl implements CompositeReference, Cloneable { - private List promotedComponents = new ArrayList(); - private List promotedReferences = new ArrayList(); - - /** - * Constructs a new composite reference. - */ - protected CompositeReferenceImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - CompositeReferenceImpl copy = (CompositeReferenceImpl)super.clone(); - copy.promotedComponents = new ArrayList(promotedComponents); - copy.promotedReferences = new ArrayList(promotedReferences); - return copy; - } - - public List getPromotedReferences() { - return promotedReferences; - } - - public List getPromotedComponents() { - return promotedComponents; - } - - public String toString() { - return getName(); - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java deleted file mode 100644 index 55b48ec578..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.CompositeService; - -/** - * Represents a composite service - * - * @version $Rev$ $Date$ - */ -public class CompositeServiceImpl extends ServiceImpl implements CompositeService, Cloneable { - private ComponentService promotedService; - private Component promotedComponent; - - /** - * Constructs a new composite service. - */ - protected CompositeServiceImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public ComponentService getPromotedService() { - return promotedService; - } - - public void setPromotedService(ComponentService promotedService) { - this.promotedService = promotedService; - } - - public Component getPromotedComponent() { - return promotedComponent; - } - - public void setPromotedComponent(Component promotedComponent) { - this.promotedComponent = promotedComponent; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConfiguredOperationImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConfiguredOperationImpl.java deleted file mode 100644 index 32377faf54..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConfiguredOperationImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.ConfiguredOperation; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents an Operation. - * - * @version $Rev$ $Date$ - */ -public class ConfiguredOperationImpl extends BaseImpl implements ConfiguredOperation { - private List policySets = new ArrayList(); - private List requiredIntents = new ArrayList(); - private List applicablePolicySets = new ArrayList(); - - private String name; - private String contractName; - private ExtensionType type; - - /** - * Constructs a new Operation. - */ - protected ConfiguredOperationImpl() { - } - - public List getPolicySets() { - return policySets; - } - - public void setPolicySets(List policySets) { - this.policySets = policySets; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public void setRequiredIntents(List intents) { - this.requiredIntents = intents; - } - - public String getContractName() { - return contractName; - } - - public void setContractName(String contractName) { - this.contractName = contractName; - } - - public List getApplicablePolicySets() { - return applicablePolicySets; - } - - public ExtensionType getExtensionType() { - return type; - } - - public void setExtensionType(ExtensionType type) { - this.type = type; - } - - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java deleted file mode 100644 index 2b72f1f047..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.AbstractContract; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Implementation of a Contract. - * - * @version $Rev$ $Date$ - */ -public class ContractImpl extends ExtensibleImpl implements AbstractContract { - private InterfaceContract interfaceContract; - private String name; - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - - private boolean isCallback = false; - - /** - * Constructs a new contract. - */ - protected ContractImpl() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public InterfaceContract getInterfaceContract() { - return interfaceContract; - } - - public void setInterfaceContract(InterfaceContract interfaceContract) { - this.interfaceContract = interfaceContract; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public boolean isForCallback() { - return isCallback; - } - - public void setForCallback(boolean isCallback) { - this.isCallback = isCallback; - } - - public ExtensionType getExtensionType() { - return null; - } - - public void setExtensionType(ExtensionType type) { - } - - public List getPolicySets() { - return policySets; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java deleted file mode 100644 index 34ece5a24b..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.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.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * The assembly model object for an endpoint. - * - * @version $Rev$ $Date$ - */ -public class EndpointImpl implements Endpoint { - private static final long serialVersionUID = 7344399683703812593L; - - protected transient ExtensionPointRegistry registry; - protected boolean unresolved; - protected String uri; - protected Component component; - protected ComponentService service; - protected Binding binding; - protected InterfaceContract interfaceContract; - protected List callbackEndpointReferences = new ArrayList(); - protected List policySets = new ArrayList(); - protected List requiredIntents = new ArrayList(); - protected boolean remote = false; - - protected EndpointImpl(ExtensionPointRegistry registry) { - this.registry = registry; - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean unresolved) { - this.unresolved = unresolved; - } - - public Component getComponent() { - resolve(); - return component; - } - - public void setComponent(Component component) { - this.component = component; - reset(); - } - - public ComponentService getService() { - resolve(); - return service; - } - - public void setService(ComponentService service) { - this.service = service; - reset(); - } - - public Binding getBinding() { - resolve(); - return binding; - } - - public void setBinding(Binding binding) { - this.binding = binding; - reset(); - } - - public InterfaceContract getComponentServiceInterfaceContract() { - resolve(); - if (interfaceContract == null && service != null) { - interfaceContract = service.getInterfaceContract(); - } - return interfaceContract; - } - - public void setInterfaceContract(InterfaceContract interfaceContract) { - this.interfaceContract = interfaceContract; - } - - /** - * Get the services callbacl enpoint references that - * represent endpoint references from which callbacks - * originate - * - * @return callbackEndpoint the reference callback endpoint - */ - public List getCallbackEndpointReferences() { - resolve(); - return callbackEndpointReferences; - } - - public List getPolicySets() { - resolve(); - return policySets; - } - - public List getRequiredIntents() { - resolve(); - return requiredIntents; - } - - public ExtensionType getExtensionType() { - getBinding(); - if (binding instanceof PolicySubject) { - return ((PolicySubject)binding).getExtensionType(); - } - return null; - } - - public void setExtensionType(ExtensionType type) { - throw new UnsupportedOperationException(); - } - - public String toStringWithoutHash() { - String output = "Endpoint: "; - - if (getURI() != null) { - output += " URI = " + getURI(); - } - - if (unresolved) { - output += " [Unresolved]"; - } - - return output; - } - - public String toString() { - return "(@" + this.hashCode() + ")" + toStringWithoutHash(); - } - - public String getURI() { - if (uri == null) { - if (component != null && service != null && binding != null) { - String bindingName = binding.getName(); - if (bindingName == null) { - bindingName = service.getName(); - } - uri = component.getURI() + "#service-binding(" + service.getName() + "/" + bindingName + ")"; - } else if (component != null && service != null) { - uri = component.getURI() + "#service(" + service.getName() + ")"; - } else if (component != null) { - uri = component.getURI(); - } - } - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - protected void resolve() { - } - - protected void reset() { - this.uri = null; - } - - protected void setExtensionPointRegistry(ExtensionPointRegistry registry) { - this.registry = registry; - } - - public boolean isRemote() { - return remote; - } - - public void setRemote(boolean remote) { - this.remote = remote; - } - - public boolean matches(String serviceURI) { - String[] parts1 = parseServiceURI(serviceURI); - String[] parts2 = parseStructuralURI(getURI()); - for (int i = 0; i < parts1.length; i++) { - if (parts1[i] == null || parts1[i].equals(parts2[i])) { - continue; - } else { - return false; - } - } - return true; - } - - /** - * Parse the service URI into an array of names. The service URI is in one of the following formats: - *

    - *
  • componentName - *
  • componentName/serviceName - *
  • componentName/serviceName/bindingName - *
- * @param serviceURI - * @return - */ - private static String[] parseServiceURI(String serviceURI) { - if (serviceURI.startsWith("/")) { - serviceURI = serviceURI.substring(1); - } - if (serviceURI.contains("#")) { - return parseStructuralURI(serviceURI); - } - String[] names = new String[3]; - String[] segments = serviceURI.split("/"); - for (int i = 0; i < names.length && i < segments.length; i++) { - names[i] = segments[i]; - } - return names; - } - - /** - * Parse the structural URI into an array of parts (componentURI, serviceName, bindingName) - * @param structuralURI - * @return [0]: componentURI [1]: serviceName [2]: bindingName - */ - private static String[] parseStructuralURI(String structuralURI) { - String[] names = new String[3]; - int index = structuralURI.lastIndexOf('#'); - if (index == -1) { - names[0] = structuralURI; - } else { - names[0] = structuralURI.substring(0, index); - String str = structuralURI.substring(index + 1); - if (str.startsWith("service-binding(") && str.endsWith(")")) { - str = str.substring("service-binding(".length(), str.length() - 1); - String[] parts = str.split("/"); - if (parts.length != 2) { - throw new IllegalArgumentException("Invalid service-binding URI: " + structuralURI); - } - names[1] = parts[0]; - names[2] = parts[1]; - } else if (str.startsWith("service(") && str.endsWith(")")) { - str = str.substring("service(".length(), str.length() - 1); - names[1] = str; - } else { - throw new IllegalArgumentException("Invalid structural URI: " + structuralURI); - } - } - return names; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java deleted file mode 100644 index d13740b287..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * The assembly model object for an endpoint. - * - * @version $Rev$ $Date$ - */ -public class EndpointReferenceImpl implements EndpointReference { - private static final long serialVersionUID = 8838066441709300972L; - - protected ExtensionPointRegistry registry; - protected boolean unresolved = true; - protected String uri; - protected Component component; - protected ComponentReference reference; - protected Binding binding; - protected List policySets = new ArrayList(); - protected List requiredIntents = new ArrayList(); - protected InterfaceContract interfaceContract; - protected Status status = Status.NOT_CONFIGURED; - - // the target of the endpoint reference - protected Endpoint targetEndpoint; - - // callback endpoint that messages across this reference - // will be directed toward - protected Endpoint callbackEndpoint; - - protected EndpointReferenceImpl(ExtensionPointRegistry registry) { - this.registry = registry; - } - - @Override - public Object clone() throws CloneNotSupportedException { - EndpointReference cloned = (EndpointReference)super.clone(); - - if (targetEndpoint != null) { - cloned.setTargetEndpoint((Endpoint)targetEndpoint.clone()); - } - - return cloned; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean unresolved) { - this.unresolved = unresolved; - } - - public Component getComponent() { - resolve(); - return component; - } - - public void setComponent(Component component) { - this.component = component; - reset(); - } - - public ComponentReference getReference() { - resolve(); - return reference; - } - - public void setReference(ComponentReference reference) { - this.reference = reference; - reset(); - } - - public Binding getBinding() { - resolve(); - return binding; - } - - public void setBinding(Binding binding) { - this.binding = binding; - reset(); - } - - public Endpoint getTargetEndpoint() { - resolve(); - return targetEndpoint; - } - - public void setTargetEndpoint(Endpoint targetEndpoint) { - this.targetEndpoint = targetEndpoint; - reset(); - } - - public InterfaceContract getComponentReferenceInterfaceContract() { - resolve(); - if (interfaceContract == null && reference != null) { - interfaceContract = reference.getInterfaceContract(); - } - return interfaceContract; - } - - public void setInterfaceContract(InterfaceContract interfaceContract) { - this.interfaceContract = interfaceContract; - reset(); - } - - public List getPolicySets() { - resolve(); - return policySets; - } - - public List getRequiredIntents() { - resolve(); - return requiredIntents; - } - - public ExtensionType getExtensionType() { - getBinding(); - if (binding instanceof PolicySubject) { - return ((PolicySubject)binding).getExtensionType(); - } - return null; - } - - public void setExtensionType(ExtensionType type) { - throw new UnsupportedOperationException(); - } - - public Endpoint getCallbackEndpoint() { - resolve(); - return callbackEndpoint; - } - - public void setCallbackEndpoint(Endpoint callbackEndpoint) { - this.callbackEndpoint = callbackEndpoint; - reset(); - } - - public String toStringWithoutHash() { - StringBuffer output = new StringBuffer("EndpointReference: "); - - if (getURI() != null) { - output.append(" URI = ").append(getURI()); - } - - output.append(" ").append(status); - - if (targetEndpoint != null) { - output.append(" Target = ").append(targetEndpoint); - } - - return output.toString(); - } - - public String toString() { - return "(@" + this.hashCode() + ")" + toStringWithoutHash(); - } - - public String getURI() { - if (uri == null) { - if (component != null && reference != null && binding != null) { - String bindingName = binding.getName(); - if (bindingName == null) { - bindingName = reference.getName(); - } - uri = component.getURI() + "#reference-binding(" + reference.getName() + "/" + bindingName + ")"; - } else if (component != null && reference != null) { - uri = component.getURI() + "#reference(" + reference.getName() + ")"; - } else if (component != null) { - uri = component.getURI(); - } - } - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - protected void resolve() { - } - - protected void reset() { - this.uri = null; - } - - public void setExtensionPointRegistry(ExtensionPointRegistry registry) { - this.registry = registry; - } - - public Status getStatus() { - return status; - } - - public void setStatus(Status status) { - this.status = status; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensibleImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensibleImpl.java deleted file mode 100644 index 340fa2854c..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensibleImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Extensible; -import org.apache.tuscany.sca.assembly.Extension; - -/** - * Convenience base class for extensible assembly model objects. - * - * @version $Rev$ $Date$ - */ -public abstract class ExtensibleImpl extends BaseImpl implements Extensible { - private List extensions = new ArrayList(); - private List attributeExtensions = new ArrayList(); - - /** - * Constructs a new base model object. - */ - protected ExtensibleImpl() { - } - - public List getExtensions() { - return extensions; - } - - public List getAttributeExtensions() { - return attributeExtensions; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java deleted file mode 100644 index e69eb4a771..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Extension; - -public class ExtensionImpl implements Extension { - private QName qName; - private Object value; - private boolean isAttribute = false; - - public ExtensionImpl() { - } - - public ExtensionImpl(QName qName, Object value, boolean isAttribute) { - this.qName = qName; - this.value = value; - this.isAttribute = isAttribute; - } - - public QName getQName() { - return qName; - } - - public void setQName(QName qName) { - this.qName = qName; - } - - public T getValue() { - return (T)value; - } - - public void setValue(T value) { - this.value = value; - } - - public boolean isAttribute() { - return isAttribute; - } - - public void setAttribute(boolean isAttribute) { - this.isAttribute = isAttribute; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java deleted file mode 100644 index 677e86c759..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.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.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Base implementation class of Implementation model interface - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public abstract class ImplementationImpl extends ComponentTypeImpl implements Implementation, PolicySubject { - private QName type; - private ExtensionType extensionType; - private List operations = new ArrayList(); - - protected ImplementationImpl(QName type) { - super(); - this.type = type; - } - - public ExtensionType getExtensionType() { - return extensionType; - } - - public void setExtensionType(ExtensionType extensionType) { - this.extensionType = extensionType; - } - - public QName getType() { - return type; - } - - public String toString() { - return String.valueOf(getType()); - } - - public List getOperations() { - return operations; - } - - @Override - public Object clone() throws CloneNotSupportedException { - ImplementationImpl impl = (ImplementationImpl)super.clone(); - impl.operations = new ArrayList(); - for (Operation operation : operations) { - impl.operations.add((Operation)operation.clone()); - } - return impl; - } - - // Override the ComponentTypeImpl.hashCode() - @Override - public int hashCode() { - return System.identityHashCode(this); - } - - // Override the ComponentTypeImpl.equals() - @Override - public boolean equals(Object obj) { - return this == obj; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java deleted file mode 100644 index 263af296b1..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a property. - * - * @version $Rev$ $Date$ - */ -public class PropertyImpl extends AbstractPropertyImpl implements Property, Cloneable { - private List policySets = new ArrayList(); - private List applicablePolicySets = new ArrayList(); - - /** - * Constructs a new property. - */ - protected PropertyImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public List getPolicySets() { - return policySets; - } - - public void setPolicySets(List policySets) { - this.policySets = policySets; - } - - public List getApplicablePolicySets() { - return applicablePolicySets; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java deleted file mode 100644 index 69d76f238d..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; - -/** - * Represents a reference. - * - * @version $Rev$ $Date$ - */ -public class ReferenceImpl extends AbstractReferenceImpl implements Reference, Cloneable { - private List bindings = new ArrayList(); - private boolean wiredByImpl; - private List targets = new ArrayList(); - private Callback callback; - private boolean overridingBindings; - private List endpointReferences = new ArrayList(); - - /** - * Constructs a new reference. - */ - protected ReferenceImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - ReferenceImpl clone = (ReferenceImpl)super.clone(); - clone.bindings = new ArrayList(bindings); - clone.targets = new ArrayList(targets); - // clone the endpoint references themselves and set the reference pointer back to - // this new refrence - clone.endpointReferences = new ArrayList(); - - for (EndpointReference epr : endpointReferences) { - EndpointReference eprClone = (EndpointReference)epr.clone(); - eprClone.setReference((ComponentReference)clone); - clone.endpointReferences.add(eprClone); - } - return clone; - } - - public List getBindings() { - return bindings; - } - - public B getBinding(Class bindingClass) { - for (Binding binding : bindings) { - if (bindingClass.isInstance(binding)) { - return bindingClass.cast(binding); - } - } - return null; - } - - public B getCallbackBinding(Class bindingClass) { - if (callback != null) { - for (Binding binding : callback.getBindings()) { - if (bindingClass.isInstance(binding)) { - return bindingClass.cast(binding); - } - } - } - return null; - } - - public boolean isWiredByImpl() { - return wiredByImpl; - } - - public void setWiredByImpl(boolean wiredByImpl) { - this.wiredByImpl = wiredByImpl; - } - - public List getTargets() { - return targets; - } - - public Callback getCallback() { - return callback; - } - - public void setCallback(Callback callback) { - this.callback = callback; - } - - /** - * By default return the interface contract for the reference - */ - public InterfaceContract getInterfaceContract(Binding binding) { - return getInterfaceContract(); - } - - public List getEndpointReferences() { - return endpointReferences; - } - - public String toString() { - return getName(); - } - - public boolean isOverridingBindings() { - return overridingBindings; - } - - public void setOverridingBindings(boolean overridingBindings) { - this.overridingBindings = overridingBindings; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java deleted file mode 100644 index 84e5825b50..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.SCABinding; -import org.apache.tuscany.sca.assembly.SCABindingFactory; - -/** - * A factory for the SCA binding model. - * - * @version $Rev$ $Date$ - */ -public class SCABindingFactoryImpl implements SCABindingFactory { - - public SCABindingFactoryImpl() { - - } - - public SCABinding createSCABinding() { - return new SCABindingImpl(); - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java deleted file mode 100644 index b42f3f929f..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Extensible; -import org.apache.tuscany.sca.assembly.Extension; -import org.apache.tuscany.sca.assembly.OperationSelector; -import org.apache.tuscany.sca.assembly.SCABinding; -import org.apache.tuscany.sca.assembly.WireFormat; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * The assembly mode object for an SCA binding. - * - * @version $Rev$ $Date$ - */ -public class SCABindingImpl implements SCABinding, Extensible, PolicySubject { - private String name; - private String uri; - private List extensions = new ArrayList(); - private List attributeExtensions = new ArrayList(); - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - private ExtensionType extensionType; - - /** - * Constructs a new SCA binding. - */ - protected SCABindingImpl() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * Getters for the binding URI. The computed URI for the - * service that the reference is targeting or which the service represents - * depending on whether the biding is associated with a reference or - * service - * - * @return the binding URI - */ - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public List getExtensions() { - return extensions; - } - - public List getAttributeExtensions() { - return attributeExtensions; - } - - public boolean isUnresolved() { - return false; - } - - public void setUnresolved(boolean unresolved) { - } - - public List getPolicySets() { - return policySets; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public ExtensionType getExtensionType() { - return extensionType; - } - - public void setExtensionType(ExtensionType intentAttachPointType) { - this.extensionType = intentAttachPointType; - } - - public void setPolicySets(List policySets) { - this.policySets = policySets; - } - - public void setRequiredIntents(List intents) { - this.requiredIntents = intents; - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public QName getType() { - return TYPE; - } - - public WireFormat getRequestWireFormat() { - return null; - } - - public void setRequestWireFormat(WireFormat wireFormat) { - } - - public WireFormat getResponseWireFormat() { - return null; - } - - public void setResponseWireFormat(WireFormat wireFormat) { - } - - public OperationSelector getOperationSelector() { - return null; - } - - public void setOperationSelector(OperationSelector operationSelector) { - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java deleted file mode 100644 index 62523e5c17..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.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.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; - -/** - * Represents a reference. - * - * @version $Rev$ $Date$ - */ -public class ServiceImpl extends AbstractServiceImpl implements Service, Cloneable { - private List bindings = new ArrayList(); - private boolean overridingBindings; - private Callback callback; - private List endpoints = new ArrayList(); - - /** - * Constructs a new service. - */ - protected ServiceImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - ServiceImpl clone = (ServiceImpl)super.clone(); - clone.bindings = new ArrayList(); - clone.bindings.addAll(getBindings()); - return clone; - } - - public List getBindings() { - return bindings; - } - - public B getBinding(Class bindingClass) { - for (Binding binding : bindings) { - if (bindingClass.isInstance(binding)) { - return bindingClass.cast(binding); - } - } - return null; - } - - public B getCallbackBinding(Class bindingClass) { - if (callback != null) { - for (Binding binding : callback.getBindings()) { - if (bindingClass.isInstance(binding)) { - return bindingClass.cast(binding); - } - } - } - return null; - } - - public Callback getCallback() { - return callback; - } - - public void setCallback(Callback callback) { - this.callback = callback; - } - - /** - * By default return the interface contract for the service - */ - public InterfaceContract getInterfaceContract(Binding binding) { - return getInterfaceContract(); - } - - public List getEndpoints() { - return endpoints; - } - - public boolean isOverridingBindings() { - return overridingBindings; - } - - public void setOverridingBindings(boolean overridingBindings) { - this.overridingBindings = overridingBindings; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java deleted file mode 100644 index a4990f6a98..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Wire; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a wire - * - * @version $Rev$ $Date$ - */ -public class WireImpl extends ExtensibleImpl implements Wire, Cloneable { - private ComponentReference source; - private ComponentService target; - private boolean replace; - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - private List applicablePolicySets = new ArrayList(); - - public List getApplicablePolicySets() { - return applicablePolicySets; - } - - /** - * Constructs a new wire. - */ - protected WireImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public ComponentReference getSource() { - return source; - } - - public ComponentService getTarget() { - return target; - } - - public void setSource(ComponentReference source) { - this.source = source; - } - - public void setTarget(ComponentService target) { - this.target = target; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - - public ExtensionType getExtensionType() { - return null; - } - - public void setExtensionType(ExtensionType type) { - } - - public void setPolicySets(List policySets) { - this.policySets = policySets; - } - - public void setRequiredIntents(List intents) { - this.requiredIntents = intents; - } - - public boolean isReplace() { - return replace; - } - - public void setReplace(boolean replace) { - this.replace = replace; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefaultDefinitionsFactory.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefaultDefinitionsFactory.java deleted file mode 100644 index 156fd0af75..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefaultDefinitionsFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.definitions; - -import org.apache.tuscany.sca.definitions.impl.DefinitionsImpl; - -/** - * Default Implementation of DefinitionsFactory - */ -public class DefaultDefinitionsFactory implements DefinitionsFactory { - - public Definitions createDefinitions() { - return new DefinitionsImpl(); - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java deleted file mode 100644 index 7a63bbedc5..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.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.definitions; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.policy.BindingType; -import org.apache.tuscany.sca.policy.ImplementationType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - - -/** - * Represents SCA Definitions. - * - * @version $Rev$ $Date$ - */ -public interface Definitions { - /** - * Returns the target namespace for this SCA Definition - * @return the target namespace - */ - String getTargetNamespace(); - - /** - * Sets the target names for this SCA Definition. - * - * @param ns the target namespace for this SCA Definition - */ - void setTargetNamespace(String ns); - - /** - * Returns a list of domain wide Policy Intents - * - * @return a list of domain wide Policy Intents - */ - List getIntents(); - - /** - * Returns a list of domain wide PolicySets - * - * @return a list of domain wide PolicySets - */ - List getPolicySets(); - - /** - * Returns a list of domain wide Binding Types - * - * @return a list of domain wide Binding Types - */ - List getBindingTypes(); - - - /** - * Returns a list of domain wide Implementation Types - * - * @return a list of domain wide Implementation Types - */ - List getImplementationTypes(); - - /** - * Returns a list of domain wide binding definition objects - * - * @return a list of domain wide binding definition objects - */ - List getBindings(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java deleted file mode 100644 index 5c68c6cbff..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.definitions; - - -/** - * Interface to abstract building of SCA Definitions for a Domain - * - * @version $Rev$ $Date$ - */ -public interface DefinitionsBuilder { - /** - * Builds the SCA definitions - * - * @param scaDefns - */ - void build(Definitions scaDefns) throws DefinitionsBuilderException; -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java deleted file mode 100644 index f45be80888..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.definitions; - -/** - * Builder Exception - * - * @version $Rev$ $Date$ - */ -public class DefinitionsBuilderException extends Exception { - private static final long serialVersionUID = 2513219325230252783L; - - public DefinitionsBuilderException() { - } - - public DefinitionsBuilderException(String message) { - super(message); - } - - public DefinitionsBuilderException(Throwable cause) { - super(cause); - } - - public DefinitionsBuilderException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsFactory.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsFactory.java deleted file mode 100644 index 616616ae7a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.definitions; - -/** - * Factory interface to create SCA definitions model - * - */ -public interface DefinitionsFactory { - /** - * Create an instance of SCA definitions - * @return a new instance of SCA definitions - */ - Definitions createDefinitions(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsBuilderImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsBuilderImpl.java deleted file mode 100644 index d87d45b27a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsBuilderImpl.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.definitions.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.definitions.Definitions; -import org.apache.tuscany.sca.definitions.DefinitionsBuilder; -import org.apache.tuscany.sca.definitions.DefinitionsBuilderException; -import org.apache.tuscany.sca.policy.BindingType; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.ImplementationType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.IntentMap; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.Qualifier; - -/** - * Provides a concrete implementation for a SCADefinitionsBuilder - * - * @version $Rev$ $Date$ - */ -public class DefinitionsBuilderImpl implements DefinitionsBuilder { - - public void build(Definitions scaDefns) throws DefinitionsBuilderException { - Map definedIntents = new HashMap(); - for (Intent intent : scaDefns.getIntents()) { - definedIntents.put(intent.getName(), intent); - } - - Map definedPolicySets = new HashMap(); - for (PolicySet policySet : scaDefns.getPolicySets()) { - definedPolicySets.put(policySet.getName(), policySet); - } - - Map definedBindingTypes = new HashMap(); - for (BindingType bindingType : scaDefns.getBindingTypes()) { - definedBindingTypes.put(bindingType.getType(), bindingType); - } - - Map definedImplTypes = new HashMap(); - for (ImplementationType implType : scaDefns.getImplementationTypes()) { - definedImplTypes.put(implType.getType(), implType); - } - - //filling up the maps removes all duplicate entries... so fill this unique lists - //into the scaDefns. - scaDefns.getIntents().clear(); - scaDefns.getPolicySets().clear(); - scaDefns.getBindingTypes().clear(); - scaDefns.getImplementationTypes().clear(); - - scaDefns.getIntents().addAll(definedIntents.values()); - scaDefns.getPolicySets().addAll(definedPolicySets.values()); - scaDefns.getBindingTypes().addAll(definedBindingTypes.values()); - scaDefns.getImplementationTypes().addAll(definedImplTypes.values()); - - buildPolicyIntents(scaDefns, definedIntents); - buildPolicySets(scaDefns, definedPolicySets, definedIntents); - buildBindingTypes(scaDefns, definedBindingTypes, definedIntents); - buildImplementationTypes(scaDefns, definedImplTypes, definedIntents); - } - - private void buildBindingTypes(Definitions scaDefns, - Map definedBindingTypes, - Map definedIntents) throws DefinitionsBuilderException { - for (BindingType bindingType : scaDefns.getBindingTypes()) { - buildAlwaysProvidedIntents(bindingType, definedIntents); - buildMayProvideIntents(bindingType, definedIntents); - } - - } - - private void buildImplementationTypes(Definitions scaDefns, - Map definedImplTypes, - Map definedIntents) throws DefinitionsBuilderException { - for (ImplementationType implType : scaDefns.getImplementationTypes()) { - buildAlwaysProvidedIntents(implType, definedIntents); - buildMayProvideIntents(implType, definedIntents); - } - } - - private void buildPolicyIntents(Definitions scaDefns, Map definedIntents) - throws DefinitionsBuilderException { - for (Intent policyIntent : scaDefns.getIntents()) { - if (!policyIntent.getRequiredIntents().isEmpty()) { - buildProfileIntent(policyIntent, definedIntents); - } - - if (!policyIntent.getQualifiedIntents().isEmpty()) { - buildQualifiedIntent(policyIntent, definedIntents); - } - } - } - - private void buildPolicySets(Definitions scaDefns, - Map definedPolicySets, - Map definedIntents) throws DefinitionsBuilderException { - - for (PolicySet policySet : scaDefns.getPolicySets()) { - buildProvidedIntents(policySet, definedIntents); - buildIntentsInMappedPolicies(policySet, definedIntents); - buildReferredPolicySets(policySet, definedPolicySets); - } - - for (PolicySet policySet : scaDefns.getPolicySets()) { - for (PolicySet referredPolicySet : policySet.getReferencedPolicySets()) { - includeReferredPolicySets(policySet, referredPolicySet); - } - } - } - - private void buildProfileIntent(Intent policyIntent, Map definedIntents) - throws DefinitionsBuilderException { - //FIXME: Need to check for cyclic references first i.e an A requiring B and then B requiring A... - if (policyIntent != null) { - //resolve all required intents - List requiredIntents = new ArrayList(); - for (Intent requiredIntent : policyIntent.getRequiredIntents()) { - if (requiredIntent.isUnresolved()) { - Intent resolvedRequiredIntent = definedIntents.get(requiredIntent.getName()); - if (resolvedRequiredIntent != null) { - requiredIntents.add(resolvedRequiredIntent); - } else { - throw new DefinitionsBuilderException("Required Intent - " + requiredIntent - + " not found for ProfileIntent " - + policyIntent); - - } - } else { - requiredIntents.add(requiredIntent); - } - } - policyIntent.getRequiredIntents().clear(); - policyIntent.getRequiredIntents().addAll(requiredIntents); - } - } - - private void buildQualifiedIntent(Intent policyIntent, Map definedIntents) - throws DefinitionsBuilderException { - /* - if (policyIntent != null) { - //resolve the qualifiable intent - Intent qualifiableIntent = policyIntent.getQualifiableIntent(); - if (qualifiableIntent.isUnresolved()) { - Intent resolvedQualifiableIntent = definedIntents.get(qualifiableIntent.getName()); - - if (resolvedQualifiableIntent != null) { - policyIntent.setQualifiableIntent(resolvedQualifiableIntent); - } else { - throw new DefinitionsBuilderException("Qualifiable Intent - " + qualifiableIntent - + " not found for QualifiedIntent " - + policyIntent); - } - - } - } - */ - } - - private void buildAlwaysProvidedIntents(ExtensionType extensionType, Map definedIntents) - throws DefinitionsBuilderException { - if (extensionType != null) { - // resolve all provided intents - List alwaysProvided = new ArrayList(); - for (Intent providedIntent : extensionType.getAlwaysProvidedIntents()) { - if (providedIntent.isUnresolved()) { - Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName()); - if (resolvedProvidedIntent != null) { - alwaysProvided.add(resolvedProvidedIntent); - } else { - throw new DefinitionsBuilderException("Always Provided Intent - " + providedIntent - + " not found for ExtensionType " - + extensionType); - - } - } else { - alwaysProvided.add(providedIntent); - } - } - extensionType.getAlwaysProvidedIntents().clear(); - extensionType.getAlwaysProvidedIntents().addAll(alwaysProvided); - } - } - - private void buildMayProvideIntents(ExtensionType extensionType, Map definedIntents) - throws DefinitionsBuilderException { - if (extensionType != null) { - // resolve all provided intents - List mayProvide = new ArrayList(); - for (Intent providedIntent : extensionType.getMayProvidedIntents()) { - if (providedIntent.isUnresolved()) { - Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName()); - if (resolvedProvidedIntent != null) { - mayProvide.add(resolvedProvidedIntent); - } else { - throw new DefinitionsBuilderException("May Provide Intent - " + providedIntent - + " not found for ExtensionType " - + extensionType); - - } - } else { - mayProvide.add(providedIntent); - } - } - extensionType.getMayProvidedIntents().clear(); - extensionType.getMayProvidedIntents().addAll(mayProvide); - } - } - - private void buildProvidedIntents(PolicySet policySet, Map definedIntents) - throws DefinitionsBuilderException { - if (policySet != null) { - //resolve all provided intents - List providedIntents = new ArrayList(); - for (Intent providedIntent : policySet.getProvidedIntents()) { - if (providedIntent.isUnresolved()) { - Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName()); - if (resolvedProvidedIntent != null) { - providedIntents.add(resolvedProvidedIntent); - } else { - throw new DefinitionsBuilderException("Provided Intent - " + providedIntent - + " not found for PolicySet " - + policySet); - - } - } else { - providedIntents.add(providedIntent); - } - } - policySet.getProvidedIntents().clear(); - policySet.getProvidedIntents().addAll(providedIntents); - } - } - - private void buildIntentsInMappedPolicies(PolicySet policySet, Map definedIntents) - throws DefinitionsBuilderException { - for (IntentMap intentMap : policySet.getIntentMaps()) { - for (Qualifier qualifier : intentMap.getQualifiers()) { - Intent mappedIntent = qualifier.getIntent(); - if (mappedIntent.isUnresolved()) { - Intent resolvedMappedIntent = definedIntents.get(mappedIntent.getName()); - - if (resolvedMappedIntent != null) { - qualifier.setIntent(resolvedMappedIntent); - } else { - throw new DefinitionsBuilderException("Mapped Intent - " + mappedIntent - + " not found for PolicySet " - + policySet); - - } - } - } - } - } - - private void buildReferredPolicySets(PolicySet policySet, Map definedPolicySets) - throws DefinitionsBuilderException { - - List referredPolicySets = new ArrayList(); - for (PolicySet referredPolicySet : policySet.getReferencedPolicySets()) { - if (referredPolicySet.isUnresolved()) { - PolicySet resolvedReferredPolicySet = definedPolicySets.get(referredPolicySet.getName()); - if (resolvedReferredPolicySet != null) { - referredPolicySets.add(resolvedReferredPolicySet); - } else { - throw new DefinitionsBuilderException("Referred PolicySet - " + referredPolicySet - + "not found for PolicySet - " - + policySet); - } - } else { - referredPolicySets.add(referredPolicySet); - } - } - policySet.getReferencedPolicySets().clear(); - policySet.getReferencedPolicySets().addAll(referredPolicySets); - } - - private void includeReferredPolicySets(PolicySet policySet, PolicySet referredPolicySet) { - for (PolicySet furtherReferredPolicySet : referredPolicySet.getReferencedPolicySets()) { - includeReferredPolicySets(referredPolicySet, furtherReferredPolicySet); - } - policySet.getPolicies().addAll(referredPolicySet.getPolicies()); - policySet.getIntentMaps().addAll(referredPolicySet.getIntentMaps()); - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java deleted file mode 100644 index 224bc0a69a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.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.definitions.impl; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.definitions.Definitions; -import org.apache.tuscany.sca.policy.BindingType; -import org.apache.tuscany.sca.policy.ImplementationType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Provides a concrete implementation for SCADefinitions - * - * @version $Rev$ $Date$ - */ -public class DefinitionsImpl implements Definitions { - private String targetNamespace = null; - private List intents = new CopyOnWriteArrayList(); - private List policySets = new CopyOnWriteArrayList(); - private List bindingTypes = new CopyOnWriteArrayList(); - private List implementationTypes = new CopyOnWriteArrayList(); - private List bindings = new CopyOnWriteArrayList(); - - - public List getBindingTypes() { - return bindingTypes; - } - - public List getImplementationTypes() { - return implementationTypes; - } - - public List getIntents() { - return intents; - } - - public List getPolicySets() { - return policySets; - } - - public String getTargetNamespace() { - return targetNamespace; - } - - public void setTargetNamespace(String ns) { - this.targetNamespace = ns; - } - - public List getBindings() { - return bindings; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java deleted file mode 100644 index eb74677236..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.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.definitions.util; - -import static org.apache.tuscany.sca.assembly.builder.Messages.DEFINITIONS_VALIDATION; - -import java.util.HashSet; - -import org.apache.tuscany.sca.definitions.Definitions; -import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.policy.BindingType; -import org.apache.tuscany.sca.policy.ImplementationType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Some utility functions to deal with SCADefinitions - * - * @version $Rev$ $Date$ - */ -public class DefinitionsUtil { - - /** - * Add the source set of definitions into the target set of definitions checking that - * definitions artifacts are unique in the process - * - * @param source the input definitions collection - * @param target the definition collection into which source will aggregated - */ - public static void aggregate(Definitions source, Definitions target, Monitor monitor) { - - HashSet intents = new HashSet(target.getIntents()); - for(Intent intent : source.getIntents()){ - if (intents.contains(intent)){ - Monitor.error(monitor, - target, - DEFINITIONS_VALIDATION, - "DuplicateIntent", - intent.getName().toString()); - } else { - target.getIntents().add(intent); - intents.add(intent); - } - } - - HashSet policySets = new HashSet(target.getPolicySets()); - for(PolicySet policySet : source.getPolicySets()){ - if (policySets.contains(policySet)){ - Monitor.error(monitor, - target, - DEFINITIONS_VALIDATION, - "DuplicatePolicySet", - policySet.getName().toString()); - } else { - target.getPolicySets().add(policySet); - policySets.add(policySet); - } - } - - HashSet bindingTypes = new HashSet(target.getBindingTypes()); - for(BindingType bindingType : source.getBindingTypes()){ - if (bindingTypes.contains(bindingType)){ - Monitor.error(monitor, - target, - DEFINITIONS_VALIDATION, - "DuplicateBindingType", - bindingType.getType().toString()); - } else { - target.getBindingTypes().add(bindingType); - bindingTypes.add(bindingType); - } - } - - HashSet implementationTypes = new HashSet(target.getImplementationTypes()); - for(ImplementationType implementationType : source.getImplementationTypes()){ - if (implementationTypes.contains(implementationType)){ - Monitor.error(monitor, - target, - DEFINITIONS_VALIDATION, - "DuplicateImplementationType", - implementationType.getType().toString()); - } else { - target.getImplementationTypes().add(implementationType); - implementationTypes.add(implementationType); - } - } - - target.getBindings().addAll(source.getBindings()); - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Compatibility.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Compatibility.java deleted file mode 100644 index e05a05476a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Compatibility.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.interfacedef; - -/** - * Types of compatibility - */ -public enum Compatibility { - SUPERSET, // The source is a superset of the target - SUBSET, // The source is a subset of the target - MUTUAL, // The source is the same set as the target - INCOMPATIBLE // The source is not compatible with the target -} \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/DataType.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/DataType.java deleted file mode 100644 index 386275b41b..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/DataType.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.interfacedef; - -import java.lang.reflect.Type; - -/** - * Representation of the type of data associated with an operation. Data is - * represented in two forms: the physical form used by the runtime and a logical - * form used by the assembly. The physical form is a Java Type because the - * runtime is written in Java. This may be the same form used by the application - * but it may not; for example, an application that is performing stream - * processing may want a physical form such as an - * {@link java.io.InputStream InputStream} to semantically operate on application - * data such as a purchase order. The logical description is that used by the - * assembly model and is an identifier into some well-known type space; examples - * may be a Java type represented by its Class or an XML type represented by its - * QName. Every data type may also contain metadata describing the expected - * data; for example, it could specify a preferred data binding technology or - * the size of a typical instance. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface DataType extends Cloneable { - /** - * Set the java type for the data - * @param cls - */ - void setPhysical(Class cls); - - /** - * Returns the physical type used by the runtime. - * - * @return the physical type used by the runtime - */ - Class getPhysical(); - - /** - * Get the java generic type - * @return The java generic type - */ - Type getGenericType(); - - /** - * Set the java generic type - * @param genericType - */ - void setGenericType(Type genericType); - - /** - * Returns the logical identifier used by the assembly. The type of this - * value identifies the logical type system in use. Known values are: - *
    - *
  • a Class identifies a Java type by name and - * ClassLoader; this includes Java Classes as they are specializations of - * Type
  • - *
  • a XMLType identifies an XML type by local name and - * namespace
  • - *
- * - * @return the logical type name - */ - L getLogical(); - - /** - * Get the databinding for the given data type - * @return the databinding - */ - String getDataBinding(); - - /** - * Set the databinding for the given data type - * @param dataBinding the dataBinding to set - */ - void setDataBinding(String dataBinding); - - /** - * Clone a data type - * @return The cloned data type - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - - /** - * Set the logical type of the data type - * @param logical the logical to set - */ - void setLogical(L logical); - - /** - * Get the databinding-specific metadata - * @param type The java type of the metadata - * @return the databinding-specific metadata - */ - T getMetaData(Class type); - /** - * Set the databinding-specific metadata - * @param type The java type of the metadata - * @param metaData the databinding-specific metadata, such as SDO's commonj.sdo.Type or - * JAXB's javax.xml.bind.JAXBContext - */ - void setMetaData(Class type, T metaData); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java deleted file mode 100644 index 4aa5f2780a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.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.interfacedef; - -/** - * This interface represents the mapping between WSDL faults and Java exceptions - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -@SuppressWarnings("unchecked") -public interface FaultExceptionMapper { - /** - * Introspect an exception class to find out the fault data type following the WSDL2Java - * mapping rules. The result will be populated into the logical type of the exception data - * type - * - * @param exceptionDataType The data type representing a java exception class - * @param operation TODO - * @param generatingFaultBean If JAXWS Section 3.7 Fault Bean will be generated - * @return true if the introspection can recognize the exception data type - */ - boolean introspectFaultDataType(DataType exceptionDataType, Operation operation, boolean generatingFaultBean); - - /** - * Create a java exception to wrap the fault data - * - * @param exceptionType The DataType for the exception - * @param message message for the exception - * @param faultInfo The fault data - * @param cause of the exception - * @param operation TODO - * @return An instance of java exception to represent the fault - */ - Throwable wrapFaultInfo(DataType exceptionType, String message, Object faultInfo, Throwable cause, Operation operation); - - /** - * Retrieve the fault info from a java exception - * - * @param exception The java exception that represents the fault data - * @param faultBeanClass - * @param operation TODO - * @return The fault data - */ - Object getFaultInfo(Throwable exception, Class faultBeanClass, Operation operation); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/IncompatibleInterfaceContractException.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/IncompatibleInterfaceContractException.java deleted file mode 100644 index 179dc1755e..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/IncompatibleInterfaceContractException.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef; - -/** - * Denotes incompatible service contracts for a wire - * - * @version $Rev$ $Date$ - */ -public class IncompatibleInterfaceContractException extends Exception { - private static final long serialVersionUID = 5127478601823295587L; - private final InterfaceContract source; - private final InterfaceContract target; - private final Operation sourceOperation; - private final Operation targetOperation; - - public IncompatibleInterfaceContractException(String message, InterfaceContract source, InterfaceContract target) { - super(message); - this.source = source; - this.target = target; - this.sourceOperation = null; - this.targetOperation = null; - } - - public IncompatibleInterfaceContractException(String message, - InterfaceContract source, - InterfaceContract target, - Operation sourceOperation, - Operation targetOperation) { - super(message); - this.source = source; - this.target = target; - this.sourceOperation = sourceOperation; - this.targetOperation = targetOperation; - } - - public InterfaceContract getTarget() { - return target; - } - - public InterfaceContract getSource() { - return source; - } - - public Operation getSourceOperation() { - return sourceOperation; - } - - public Operation getTargetOperation() { - return targetOperation; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java deleted file mode 100644 index e3103b768a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.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.interfacedef; - -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Represents a service interface. This interface will typically be extended to - * support concrete interface type systems, such as Java interfaces, WSDL 1.1 - * portTypes and WSDL 2.0 interfaces. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface Interface extends Cloneable, PolicySubject { - - /** - * Returns true if the interface is a remotable interface.. - * - * @return true if the interface is a remotable interface - */ - boolean isRemotable(); - - /** - * Sets whether the interface is a remotable or local interface. - * - * @param remotable indicates whether the interface is remotable or local - */ - void setRemotable(boolean remotable); - - /** - * Returns true if the interface remotable property is set.. - * - * This is used to verify if a @remotable attribute is used in the - * SCDL element. If true, use isRemotable to verify the - * current value - * - * @return - */ - boolean isRemotableSet(); - - /** - * Returns the operations defined on this interface. - * - * @return the operations defined on this interface - */ - List getOperations(); - - /** - * Set the databinding for the interface - * @param dataBinding - * @deprecated Please use resetDataBinding - */ - @Deprecated - void setDefaultDataBinding(String dataBinding); - - /** - * Reset the databinding for the interface - * @param dataBinding - */ - void resetDataBinding(String dataBinding); - - /** - * Set the interface input types by copying those from the - * interface provided - * - * @param newInterface - */ - public void resetInterfaceInputTypes(Interface newInterface); - - /** - * Set the interface output types by copying those from the - * interface provided - * - * @param newInterface - */ - public void resetInterfaceOutputTypes(Interface newInterface); - - /** - * Returns true if the Interface is dynamic. - * - * @return true if the Interface is dynamic. - */ - boolean isDynamic(); - - /** - * Get a map of attributes associated with the interface - * @return A map of attributes - */ - Map getAttributes(); - - /** - * Implementations must support cloning. - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContract.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContract.java deleted file mode 100644 index 054b18c349..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContract.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.interfacedef; - - -/** - * Interface contracts define one or more business functions. These business - * functions are provided by services and are used by references. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface InterfaceContract extends Cloneable { - - /** - * Returns the interface definition representing the interface for - * invocations from the requestor to the provider. - * - * @return the interface definition representing the interface for - * invocations from the requestor to the provider - */ - Interface getInterface(); - - /** - * Sets the interface definition representing the interface for invocations - * from the requestor to the provider. - * - * @param callInterface the interface definition representing the interface - * for invocations from the requestor to the provider - */ - void setInterface(Interface callInterface); - - /** - * Returns the interface definition representing the interface for - * invocations from the provider to the requestor. - * - * @return the interface definition representing the interface for - * invocations from the provider to the requestor. - */ - Interface getCallbackInterface(); - - /** - * Sets the interface definition representing the interface for invocations - * from the provider to the requestor. - * - * @param callbackInterface the interface definition representing the - * interface for invocations from the provider to the requestor. - */ - void setCallbackInterface(Interface callbackInterface); - - // FIXME: We need a better way to do this - /** - * Convert an interface contract to a unidirectional interface contract - * - * @param isCallback true for a callback interface contract, false for - * a forward interface contract - * @return A unidirectional interface contract, cloned if necessary - */ - InterfaceContract makeUnidirectional(boolean isCallback); - - /** - * Implementations must support cloning. - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java deleted file mode 100644 index d1958eb00b..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.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.interfacedef; - -/** - * The InterfaceContractMapper is responsible to match interfaces - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface InterfaceContractMapper { - /** - * @param source The source interface contract - * @param target The target interface contract - * @param compatibility The compatibility style - * @param ignoreCallback - * @param silent - * @return - * @throws IncompatibleInterfaceContractException - */ - boolean checkCompatibility(InterfaceContract source, - InterfaceContract target, - Compatibility compatibility, - boolean ignoreCallback, - boolean silent) throws IncompatibleInterfaceContractException; - - /** - * Test if the source data type is compatible with the target data type. The - * compatibility is defined as follows. - *
    - *
  • source's logical type is either the same or subtype of the target's - * logical type - *
- * For example, if the source type is a SDO Customer and the target type is - * a JAXB Customer and both Customer are generated from the same XSD type. - * - * @param source The source data type - * @param target The target data type - * @param passByValue A flag to indicate how the compatibility is checked - *
    - *
  • true: Check the two types as compatible "by-value" (can be copied) - *
  • false: Check the two types as compatible "by-reference" (can be assigned) - *
- * @return true if the source data type is the same or subtype of the target data type - */ - boolean isCompatible(DataType source, DataType target, boolean passByValue); - - /** - * Check if source operation is compatible with the target operation. A source operation is - * compatible with the target operation means the following: - * - *
    - *
  1. compatibility for the two operations is defined as compatibility - * of the signature, i.e., the operation name, the input types, and the output types are the same - * - *
  2. the order of the input and output types of the source operation is the same as the order of - * the input and output types for the corresponding target operation - *
  3. the set of Faults and Exceptions expected by the source operation is the same as or is - * a SUPERSET of the set of Faults and Exceptions specified by the corresponding target operation - *
- * - * Simply speaking, any request from the source operation can be processed by the target operation and - * the normal response or fault/exception from the target operation can be handled by the source operation. - * - * Please note this compatibility check is NOT symmetric. But the following should be guaranteed: - *
    - *
  • (source, target, SUB) == (target, source, SUPER) - *
  • (source, target, MUTUAL) == (source, target, SUB) && (target, source, SUB) == (source, target, SUPER) && (source, target, SUPER) - * - * @param source The source operation - * @param target The target operation - * @param compatibilityType The type of compatibility - * @return true if the source operation is compatible with the target - * operation - */ - boolean isCompatible(Operation source, Operation target, Compatibility compatibilityType); - - boolean isCompatibleByReference(Operation source, Operation target, Compatibility compatibilityType); - boolean isCompatibleByValue(Operation source, Operation target, Compatibility compatibilityType); - - /** - * An interface A is a Compatible Subset of a second interface B if and only if all of points 1 through 6 - * in the following list apply: - *
      - *
    1. interfaces A and B are either both remotable or else both local - *
    2. the set of operations in interface A is the same as or is a subset of the set of operations in - * interface B - *
    3. compatibility for individual operations of the interfaces A and B is defined as compatibility - * of the signature, i.e., the operation name, the input types, and the output types are the same - *
    4. the order of the input and output types for each operation in interface A is the same as the - * order of the input and output types for the corresponding operation in interface B - *
    5. the set of Faults and Exceptions expected by each operation in interface A is the same as or is - * a superset of the set of Faults and Exceptions specified by the corresponding operation in interface B - *
    6. for checking the compatibility of 2 remotable interfaces which are in different interface - * languages, both are mapped to WSDL 1.1 (if not already WSDL 1.1) and compatibility checking is done - * between the WSDL 1.1 mapped interfaces.
      - * For checking the compatibility of 2 local interfaces which are in different interface languages, the - * method of checking compatibility is defined by the specifications which define those interface types, - * which must define mapping rules for the 2 interface types concerned. - * - *
    - * - * The callback interfaces are not considered her. - * - * @param source The source interface - * @param target The target interface - * @return true if the source interface is a compatible subset of the target interface - */ - boolean isCompatibleSubset(Interface source, Interface target); - - /** - * An interface A is a Compatible Subset of a second interface B if and only if all of points 1 through 7 - * in the following list apply: - *
      - *
    1. interfaces A and B are either both remotable or else both local - *
    2. the set of operations in interface A is the same as or is a subset of the set of operations in - * interface B - *
    3. compatibility for individual operations of the interfaces A and B is defined as compatibility - * of the signature, i.e., the operation name, the input types, and the output types are the same - *
    4. the order of the input and output types for each operation in interface A is the same as the - * order of the input and output types for the corresponding operation in interface B - *
    5. the set of Faults and Exceptions expected by each operation in interface A is the same as or is - * a superset of the set of Faults and Exceptions specified by the corresponding operation in interface B - *
    6. for checking the compatibility of 2 remotable interfaces which are in different interface - * languages, both are mapped to WSDL 1.1 (if not already WSDL 1.1) and compatibility checking is done - * between the WSDL 1.1 mapped interfaces.
      - * For checking the compatibility of 2 local interfaces which are in different interface languages, the - * method of checking compatibility is defined by the specifications which define those interface types, - * which must define mapping rules for the 2 interface types concerned. - *
    7. if either interface A or interface B declares a callback interface then both interface - * A and interface B declare callback interfaces and the callback interface declared on interface B is a - * compatible subset of the callback interface declared on interface A, according to points 1 through 6 - * above - *
    - * - * @param source The source interface contract - * @param target The target interface contract - * @return true if the source interface contract is a compatible subset of the target interface contract - */ - boolean isCompatibleSubset(InterfaceContract source, InterfaceContract target); - - /** - * Check that two interfaces are mutually compatible. The interfaces are mutually compatible if the two - * interfaces have the same set of operations, with each operation having the same signature (name, input - * types, output types and fault/exception types). - * - * @param source an interface - * @param target a second interface - * @return true if the two interfaces are mutually compatible, otherwise return false - */ - public boolean isMutuallyCompatible(Interface source, Interface target); - - /** - * An interface A is Compatible with a second interface B if and only if all of points 1 through 7 in the - * following list apply:

    - *

      - *
    1. interfaces A and B are either both remotable or else both local - *
    2. the set of operations in interface A is the same as the set of operations in interface B - *
    3. compatibility for individual operations of the interfaces A and B is defined as compatibility - * of the signature, i.e., the operation name, the input types, and the output types are the same - *
    4. the order of the input and output types for each operation in interface A is the same as the - * order of the input and output types for the corresponding operation in interface B - *
    5. the set of Faults and Exceptions expected by each operation in interface A is the - * same as the set of Faults and Exceptions specified by the corresponding operation in interface B - *
    6. for checking the compatibility of 2 remotable interfaces which are in different interface - * languages, both are mapped to WSDL 1.1 (if not already WSDL 1.1) and compatibility checking is done - * between the WSDL 1.1 mapped interfaces. - *
      For checking the compatibility of 2 local interfaces which are in different interface languages, - * the method of checking compatibility is defined by the specifications which define those interface types, - * which must define mapping rules for the 2 interface types concerned. - *
    7. if either interface A or interface B declares a callback interface then both interface - * A and interface B declare callback interfaces and the callback interface declared on interface A is - * compatible with the callback interface declared on interface B, according to points 1 through 6 above - * - * @param source - the source interface contract - * @param target - the target interface contract - * @return true if the source and target interface contracts are mutually compatible - */ - boolean isMutuallyCompatible(InterfaceContract source, InterfaceContract target); - - /** - * Map the source operation to a compatible operation in the target interface - * - * @param target The target interface - * @param source The source operation - * @return A compatible operation if the target interface is compatible superset of the source interface - */ - Operation map(Interface target, Operation source); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidAnnotationException.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidAnnotationException.java deleted file mode 100644 index db1d5f7fd7..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidAnnotationException.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; - -/** - * - * @tuscany.spi.extension.asclient - * - */ -public class InvalidAnnotationException extends InvalidInterfaceException { - - private static final long serialVersionUID = 4923028138353415223L; - private final Class clazz; - - public InvalidAnnotationException(String message, Class clazz) { - super(message); - this.clazz = clazz; - } - - public Class getAnnotation() { - return clazz; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidCallbackException.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidCallbackException.java deleted file mode 100644 index 392e81a8fa..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidCallbackException.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; - - -/** - * Denotes an illegal callback interface - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ - -public class InvalidCallbackException extends InvalidInterfaceException { - private static final long serialVersionUID = 2727755895702116397L; - - public InvalidCallbackException(String message) { - super(message); - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidInterfaceException.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidInterfaceException.java deleted file mode 100644 index 0cac606e1a..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidInterfaceException.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; - -/** - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public abstract class InvalidInterfaceException extends Exception { - private static final long serialVersionUID = -3850574026273544538L; - - public InvalidInterfaceException() { - super(); - } - - public InvalidInterfaceException(String message) { - super(message); - } - - public InvalidInterfaceException(String message, Throwable cause) { - super(message, cause); - } - - public InvalidInterfaceException(Throwable cause) { - super(cause); - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidOperationException.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidOperationException.java deleted file mode 100644 index 2e82c201d9..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidOperationException.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; - -import java.lang.reflect.Method; - -/** - * Denotes an invalid conversational interface definition - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public class InvalidOperationException extends InvalidInterfaceException { - - private static final long serialVersionUID = -1797615361821517091L; - private final Method operation; - - public InvalidOperationException(String message, Method operation) { - super(message); - this.operation = operation; - } - - public Method getOperation() { - return operation; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java deleted file mode 100644 index 1757ab3c92..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.interfacedef; - -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.interfacedef.util.WrapperInfo; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * Represents an operation on a service interface. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface Operation extends Cloneable, PolicySubject { - /** - * Returns the name of the operation. - * - * @return the name of the operation - */ - String getName(); - - /** - * Sets the name of the operation. - * - * @param name the name of the operation - */ - void setName(String name); - - /** - * Returns true if the model element is unresolved. - * - * @return true if the model element is unresolved. - */ - boolean isUnresolved(); - - /** - * Sets whether the model element is unresolved. - * - * @param unresolved whether the model element is unresolved - */ - void setUnresolved(boolean unresolved); - - /** - * Get the data type that represents the input of this operation. The logic - * type is a list of data types and each element represents a parameter - * - * @return the inputType - */ - DataType> getInputType(); - - /** - * @param inputType - */ - void setInputType(DataType> inputType); - - /** - * Get the data type for the output - * - * @return the outputType - */ - DataType getOutputType(); - - /** - * @param outputType - */ - void setOutputType(DataType outputType); - - /** - * Get a list of data types to represent the faults/exceptions - * - * @return the faultTypes - */ - List getFaultTypes(); - - /** - * @param faultTypes - */ - void setFaultTypes(List faultTypes); - - /** - * Get the owning interface - * @return - */ - Interface getInterface(); - - /** - * Set the owning interface - * @param interfaze - */ - void setInterface(Interface interfaze); - - /** - * Indicate if the operation is non-blocking - * @return - */ - boolean isNonBlocking(); - - /** - * Set the operation to be non-blocking - */ - void setNonBlocking(boolean nonBlocking); - - /** - * @return the wrapperInfo - */ - WrapperInfo getWrapper(); - - /** - * @param wrapperInfo the wrapperInfo to set - */ - void setWrapper(WrapperInfo wrapperInfo); - - /** - * @return the wrapperStyle - */ - boolean isWrapperStyle(); - - /** - * @param wrapperStyle the wrapperStyle to set - */ - void setWrapperStyle(boolean wrapperStyle); - - /** - * @deprecated This should be the WrapperInfo.getDataBinding() - * Get the databinding for the operation - * @return - */ - @Deprecated - String getDataBinding(); - - /** - * @deprecated This should be the WrapperInfo.setDataBinding() - * Set the databinding for the operation - * @param dataBinding - */ - @Deprecated - void setDataBinding(String dataBinding); - - /** - * Returns true if the operation is dynamic. - * - * @return true if the operation is dynamic otherwise false - */ - boolean isDynamic(); - - /** - * Set if the operation is dynamic - * @param b - */ - void setDynamic(boolean b); - - /** - * Get the synthesized fault beans for this operation - * - * @return the fault beans - */ - Map>> getFaultBeans(); - - /** - * Set the synthesized fault beans for this operation - * @param faultBeans - */ - void setFaultBeans(Map>> faultBeans); - - /** - * Get a map of attributes assoicated with the operation - * @return A map of attributes - */ - Map getAttributes(); - - /** - * Implementations must support cloning. - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/OverloadedOperationException.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/OverloadedOperationException.java deleted file mode 100644 index 92ac0850e7..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/OverloadedOperationException.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.interfacedef; - -import java.lang.reflect.Method; - -/** - * Exception thrown to indicate that a service contract specification contains - * an overloaded method. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public class OverloadedOperationException extends InvalidInterfaceException { - private static final long serialVersionUID = -4658711318608885638L; - private final Method operation; - - public OverloadedOperationException(Method operation) { - super(operation == null ? - null : "[JCA20001] Cannot overload operation " + operation.getName() - + " on " + operation.getDeclaringClass().getName() - + " as it is a @Remotable interface"); - this.operation = operation; - } - - public Method getOperation() { - return operation; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java deleted file mode 100644 index 12ea22938c..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.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.interfacedef.impl; - -import java.lang.reflect.Type; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.sca.interfacedef.DataType; - -/** - * Representation of the type of data associated with an operation. Data is - * represented in two forms: the physical form used by the runtime and a logical - * form used by the assembly. The physical form is a Java Type because the - * runtime is written in Java. This may be the same form used by the application - * but it may not; for example, an application that is performing stream - * processing may want a physical form such as an - * {@link java.io.InputStream InputStream} to semantically operate on application - * data such as a purchase order. The logical description is that used by the - * assembly model and is an identifier into some well-known type space; examples - * may be a Java type represented by its Class or an XML type represented by its - * QName. Every data type may also contain metadata describing the expected - * data; for example, it could specify a preferred data binding technology or - * the size of a typical instance. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public class DataTypeImpl implements DataType { - private String dataBinding; - private Class physical; - private Type genericType; - private L logical; - private Map, Object> metaDataMap; - - /** - * Construct a data type specifying the physical and logical types. - * - * @param physical the physical class used by the runtime - * @param logical the logical type - * @see #getLogical() - */ - public DataTypeImpl(Class physical, L logical) { - this(null, physical, physical, logical); - } - - /** - * @param dataBinding - * @param physical - * @param logical - */ - public DataTypeImpl(String dataBinding, Class physical, L logical) { - this(dataBinding, physical, physical, logical); - } - - /** - * @param dataBinding - * @param physical - * @param genericType - * @param logical - */ - public DataTypeImpl(String dataBinding, Class physical, Type genericType, L logical) { - super(); - this.dataBinding = dataBinding; - this.physical = physical; - this.genericType = genericType; - this.logical = logical; - } - - /** - * Returns the physical type used by the runtime. - * - * @return the physical type used by the runtime - */ - public Class getPhysical() { - return physical; - } - - /** - * @param physical the physical to set - */ - public void setPhysical(Class physical) { - this.physical = physical; - } - - /** - * Get the java generic type - * @return The java generic type - */ - public Type getGenericType() { - return genericType; - } - - /** - * Set the java generic type - * @param genericType - */ - public void setGenericType(Type genericType) { - this.genericType = genericType; - } - - /** - * Returns the logical identifier used by the assembly. The type of this - * value identifies the logical type system in use. Known values are: - *
        - *
      • a java.lang.reflect.Type identifies a Java type by name and - * ClassLoader; this includes Java Classes as they are specializations of - * Type
      • - *
      • a javax.xml.namespace.QName identifies an XML type by local name and - * namespace
      • - *
      - * - * @return the logical type name - */ - public L getLogical() { - return logical; - } - - /** - * @param logical the logical to set - */ - public void setLogical(L logical) { - this.logical = logical; - } - - public String getDataBinding() { - return dataBinding; - } - - /** - * @param dataBinding the dataBinding to set - */ - public void setDataBinding(String dataBinding) { - this.dataBinding = dataBinding; - } - - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append(physical).append(" ").append(dataBinding).append(" ").append(logical); - return sb.toString(); - } - - @SuppressWarnings("unchecked") - @Override - public Object clone() throws CloneNotSupportedException { - DataTypeImpl copy = (DataTypeImpl)super.clone(); - return copy; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((dataBinding == null) ? 0 : dataBinding.hashCode()); - result = prime * result + ((genericType == null) ? 0 : genericType.hashCode()); - result = prime * result + ((logical == null) ? 0 : logical.hashCode()); - result = prime * result + ((physical == null) ? 0 : physical.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final DataTypeImpl other = (DataTypeImpl)obj; - if (dataBinding == null) { - if (other.dataBinding != null) - return false; - } else if (!dataBinding.equals(other.dataBinding)) - return false; - if (genericType == null) { - if (other.genericType != null) - return false; - } else if (!genericType.equals(other.genericType)) - return false; - if (logical == null) { - if (other.logical != null) - return false; - } else if (!logical.equals(other.logical)) - return false; - if (physical == null) { - if (other.physical != null) - return false; - } else if (!physical.equals(other.physical)) - return false; - return true; - } - - public T getMetaData(Class type) { - return metaDataMap == null ? null : type.cast(metaDataMap.get(type)); - } - - public void setMetaData(Class type, T metaData) { - if (metaDataMap == null) { - metaDataMap = new ConcurrentHashMap, Object>(); - } - metaDataMap.put(type, metaData); - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractImpl.java deleted file mode 100644 index a62813edd4..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractImpl.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.interfacedef.impl; - -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; - -/** - * Represents an interface contract. InterfaceContractImpl - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public abstract class InterfaceContractImpl implements InterfaceContract { - private Interface callInterface; - private Interface callbackInterface; - - public Interface getCallbackInterface() { - return callbackInterface; - } - - public Interface getInterface() { - return callInterface; - } - - public void setCallbackInterface(Interface callbackInterface) { - this.callbackInterface = callbackInterface; - } - - public void setInterface(Interface callInterface) { - this.callInterface = callInterface; - } - - public InterfaceContract makeUnidirectional(boolean isCallback) { - if (!isCallback && callbackInterface == null) - return this; // already a unidirectional forward interface contract - - if (isCallback && callInterface == null) - return this; // already a unidirectional callback interface contract - - // contract is bidirectional, so create a new unidirectional contract - try { - InterfaceContract newContract = clone(); - if (!isCallback) { - newContract.setCallbackInterface(null); // create unidirectional forward interface contract - } else { - newContract.setInterface(null); // create unidirectional callback interface contract - } - return newContract; - } catch (CloneNotSupportedException e) { - // will not happen - return null; - } - } - - @Override - public InterfaceContractImpl clone() throws CloneNotSupportedException { - InterfaceContractImpl copy = (InterfaceContractImpl)super.clone(); - if (this.callbackInterface != null) { - copy.callbackInterface = (Interface)this.callbackInterface.clone(); - } - if (this.callInterface != null) { - copy.callInterface = (Interface)this.callInterface.clone(); - } - return copy; - } - - /** - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((callInterface == null) ? 0 : callInterface.hashCode()); - result = prime * result + ((callbackInterface == null) ? 0 : callbackInterface.hashCode()); - return result; - } - - /** - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final InterfaceContractImpl other = (InterfaceContractImpl)obj; - if (callInterface == null) { - if (other.callInterface != null) { - return false; - } - } else if (!callInterface.equals(other.callInterface)) { - return false; - } - if (callbackInterface == null) { - if (other.callbackInterface != null) { - return false; - } - } else if (!callbackInterface.equals(other.callbackInterface)) { - return false; - } - return true; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java deleted file mode 100644 index 468083c839..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java +++ /dev/null @@ -1,392 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.impl; - -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.Compatibility; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.IncompatibleInterfaceContractException; -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.Operation; - -/** - * @version $Rev$ $Date$ - */ -public class InterfaceContractMapperImpl implements InterfaceContractMapper { - - public boolean isCompatible(DataType source, DataType target, boolean passByValue) { - if (source == target) { - return true; - } - if (!passByValue) { - if (source == null || target == null) { - return false; - } - // For local case - return target.getPhysical().isAssignableFrom(source.getPhysical()); - } else { - // FIXME: [rfeng] How to test if two remotable data type is compatible? - // We will need to understand the different typing system used by the databindings - // We should probably delegate to some extensions here - return true; - } - - } - - /** - * Check that two interface contracts are equal. The contracts are equal if the two contracts have the - * same set of operations, with each operation having the same signature, both for forward and callback - * interfaces - * @param source - * @param target - * @return - */ - public boolean isMutuallyCompatible(InterfaceContract source, InterfaceContract target) { - // Are the forward interfaces equal? - if (isMutuallyCompatible(source.getInterface(), target.getInterface())) { - // Is there a Callback interface? - if (source.getCallbackInterface() == null && target.getCallbackInterface() == null) { - return true; - } else { - if (isMutuallyCompatible(source.getCallbackInterface(), target.getCallbackInterface())) { - return true; - } // end if - } // end if - } // end if - return false; - } // end method isEqual - - /** - * Check that two interfaces are equal. The interfaces are equal if the two interfaces have the - * same set of operations, with each operation having the same signature. - * @param source - * @param target - * @return - */ - public boolean isMutuallyCompatible(Interface source, Interface target) { - if (source == target) { - // Shortcut for performance - return true; - } // end if - if (source == null || target == null) { - return false; - } // end if - - if (source.isDynamic() || target.isDynamic()) { - return true; - } - - if (source.isRemotable() != target.isRemotable()) { - return false; - } - if (source.getOperations().size() != target.getOperations().size()) { - return false; - } - - for (Operation operation : source.getOperations()) { - Operation targetOperation = getOperation(target.getOperations(), operation.getName()); - if (targetOperation == null) { - return false; - } - if (!isCompatible(operation, targetOperation, Compatibility.SUBSET)) { - return false; - } - } - return true; - } // end method isEqual - - public boolean isCompatible(Operation source, Operation target, Compatibility compatibilityType) { - return isCompatible(source, target, compatibilityType, true); - } - - public boolean isCompatible(Operation source, Operation target, Compatibility compatibilityType, boolean byValue) { - if (source == target) { - return true; - } - - if (source.isDynamic() || target.isDynamic()) { - return true; - } - - // Check name - if (!source.getName().equals(target.getName())) { - return false; - } - - if (source.getInterface().isRemotable() != target.getInterface().isRemotable()) { - return false; - } - - boolean passByValue = (source.getInterface().isRemotable()) && byValue; - - // if (source.getInterface().isRemotable()) { - // return true; - // } - - // FIXME: We need to deal with wrapped<-->unwrapped conversion - - // Check output type - DataType sourceOutputType = source.getOutputType(); - DataType targetOutputType = target.getOutputType(); - - boolean checkSourceWrapper = true; - List sourceInputType = source.getInputType().getLogical(); - if (source.isWrapperStyle() && source.getWrapper() != null) { - sourceInputType = source.getWrapper().getUnwrappedInputType().getLogical(); - sourceOutputType = source.getWrapper().getUnwrappedOutputType(); - checkSourceWrapper = false; - } - boolean checkTargetWrapper = true; - List targetInputType = target.getInputType().getLogical(); - if (target.isWrapperStyle() && target.getWrapper() != null) { - targetInputType = target.getWrapper().getUnwrappedInputType().getLogical(); - targetOutputType = target.getWrapper().getUnwrappedOutputType(); - checkTargetWrapper = false; - } - - if (checkSourceWrapper != checkTargetWrapper) { - return true; - } - - if (!isCompatible(targetOutputType, sourceOutputType, passByValue)) { - return false; - } - - if (sourceInputType.size() != targetInputType.size()) { - return false; - } - - int size = sourceInputType.size(); - for (int i = 0; i < size; i++) { - if (!isCompatible(sourceInputType.get(i), targetInputType.get(i), passByValue)) { - return false; - } - } - - // Check fault types - for (DataType targetFaultType : target.getFaultTypes()) { - // Source fault types must be the same or superset of target fault - // types - boolean found = true; - for (DataType sourceFaultType : source.getFaultTypes()) { - found = false; - if (isCompatible(targetFaultType, sourceFaultType, passByValue)) { - // Target fault type can be covered by the source fault type - found = true; - break; - } - } - if (!found) { - return false; - } - } - - return true; - } - public boolean isCompatibleByReference(Operation source, Operation target, Compatibility compatibilityType) { - return isCompatible(source, target, compatibilityType, false); - } - - public boolean isCompatibleByValue(Operation source, Operation target, Compatibility compatibilityType) { - return isCompatible(source, target, compatibilityType, true); - } - - // FIXME: How to improve the performance for the lookup - private Operation getOperation(List operations, String name) { - for (Operation op : operations) { - if (op.getName().equals(name)) { - return op; - } - } - return null; - } - - public boolean checkCompatibility(InterfaceContract source, - InterfaceContract target, - Compatibility compatibility, - boolean ignoreCallback, - boolean silent) throws IncompatibleInterfaceContractException { - if (source == target) { - // Shortcut for performance - return true; - } - - if (source == null || target == null) { - return false; - } - - if (source.getInterface() == target.getInterface()) { - return ignoreCallback || isCallbackCompatible(source, target, silent); - } - - if (source.getInterface() == null || target.getInterface() == null) { - return false; - } - - if (source.getInterface().isDynamic() || target.getInterface().isDynamic()) { - return ignoreCallback || isCallbackCompatible(source, target, silent); - } - - if (source.getInterface().isRemotable() != target.getInterface().isRemotable()) { - if (!silent) { - throw new IncompatibleInterfaceContractException("Remotable settings do not match", source, target); - } else { - return false; - } - } - - for (Operation operation : source.getInterface().getOperations()) { - Operation targetOperation = map(target.getInterface(), operation); - if (targetOperation == null) { - if (!silent) { - throw new IncompatibleInterfaceContractException("Operation " + - operation.getName() + - " not found on target", - source, - target); - } else { - return false; - } - } - if (!source.getInterface().isRemotable()) { - // FIXME: for remotable operation, only compare name for now - if (!isCompatible(operation, targetOperation, Compatibility.SUBSET)) { - if (!silent) { - throw new IncompatibleInterfaceContractException("Target operations called " + - operation.getName() + - " are not compatible", - source, - target); - } else { - return false; - } - } - } - } - - return ignoreCallback || isCallbackCompatible(source, target, silent); - } - - protected boolean isCallbackCompatible(InterfaceContract source, InterfaceContract target, boolean silent) - throws IncompatibleInterfaceContractException { - if (source.getCallbackInterface() == null && target.getCallbackInterface() == null) { - return true; - } - if (source.getCallbackInterface() == null || target.getCallbackInterface() == null) { - if (!silent) { - throw new IncompatibleInterfaceContractException("Callback interface doesn't match", source, target); - } else { - return false; - } - } - - for (Operation operation : source.getCallbackInterface().getOperations()) { - Operation targetOperation = - getOperation(target.getCallbackInterface().getOperations(), operation.getName()); - if (targetOperation == null) { - if (!silent) { - throw new IncompatibleInterfaceContractException("Callback operation not found on target", source, - target, null, targetOperation); - } else { - return false; - } - } - if (!source.getCallbackInterface().isRemotable()) { - // FIXME: for remotable operation, only compare name for now - if (!operation.equals(targetOperation)) { - if (!silent) { - throw new IncompatibleInterfaceContractException("Target callback operation is not compatible", - source, target, operation, targetOperation); - } else { - return false; - } - } - } - } - return true; - } - - public boolean isCompatibleSubset(Interface source, Interface target) { - if (source == target) { - // Shortcut for performance - return true; - } - if (source == null || target == null) { - return false; - } - - if (source.isDynamic() || target.isDynamic()) { - return true; - } - - if (source.isRemotable() != target.isRemotable()) { - return false; - } - - for (Operation operation : source.getOperations()) { - Operation targetOperation = getOperation(target.getOperations(), operation.getName()); - if (targetOperation == null) { - return false; - } - if (!isCompatible(operation, targetOperation, Compatibility.SUBSET)) { - return false; - } - } - return true; - } - - public boolean isCompatibleSubset(InterfaceContract source, InterfaceContract target) { - try { - return checkCompatibility(source, target, Compatibility.SUBSET, false, false); - } catch (IncompatibleInterfaceContractException e) { - return false; - } - } - - /** - * @see org.apache.tuscany.sca.interfacedef.InterfaceContractMapper#map(org.apache.tuscany.sca.interfacedef.Interface, - * org.apache.tuscany.sca.interfacedef.Operation) - */ - public Operation map(Interface target, Operation source) { - // TODO: How to handle the case that source operation is dynamic? - if (target == null || target.isDynamic()) { - return source; - } else if (target.isRemotable()) { - for (Operation op : target.getOperations()) { - if (op.getName().equals(source.getName())) { - return op; - } - } - return null; - } else { - for (Operation op : target.getOperations()) { - if (isCompatible(source, op, Compatibility.SUBSET)) { - return op; - } - } - return null; - } - - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java deleted file mode 100644 index c56b5545ce..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.interfacedef.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.util.WrapperInfo; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a service interface. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public class InterfaceImpl implements Interface { - - private Boolean remotable; - private boolean conversational; - private OperationList operations = new OperationList(); - private boolean unresolved; - - private ExtensionType type; - private List policySets = new ArrayList(); - private List requiredIntents = new ArrayList(); - private Map attributes = new ConcurrentHashMap(); - - public boolean isRemotable() { - boolean value = false; - if (remotable != null && remotable.booleanValue()) { - value = true; - } - return value; - } - - public void setRemotable(boolean remotable) { - this.remotable = Boolean.valueOf(remotable); - } - - public boolean isRemotableSet() { - return remotable == null ? false : true; - } - - public List getOperations() { - return operations; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean undefined) { - this.unresolved = undefined; - } - - /** - * @return the conversational - */ - public boolean isConversational() { - return conversational; - } - - /** - * @param conversational the conversational to set - */ - public void setConversational(boolean conversational) { - this.conversational = conversational; - } - - private class OperationList extends ArrayList { - private static final long serialVersionUID = -903469106307606099L; - - @Override - public Operation set(int index, Operation element) { - element.setInterface(InterfaceImpl.this); - return super.set(index, element); - } - - @Override - public void add(int index, Operation element) { - element.setInterface(InterfaceImpl.this); - super.add(index, element); - } - - @Override - public boolean add(Operation o) { - o.setInterface(InterfaceImpl.this); - return super.add(o); - } - - @Override - public boolean addAll(Collection c) { - for (Operation op : c) { - op.setInterface(InterfaceImpl.this); - } - return super.addAll(c); - } - - @Override - public boolean addAll(int index, Collection c) { - for (Operation op : c) { - op.setInterface(InterfaceImpl.this); - } - return super.addAll(index, c); - } - - } - - @Deprecated - public void setDefaultDataBinding(String dataBinding) { - for (Operation op : getOperations()) { - if (op.getDataBinding() == null) { - op.setDataBinding(dataBinding); - DataType> inputType = op.getInputType(); - if (inputType != null) { - for (DataType d : inputType.getLogical()) { - if (d.getDataBinding() == null) { - d.setDataBinding(dataBinding); - } - } - } - DataType outputType = op.getOutputType(); - if (outputType != null && outputType.getDataBinding() == null) { - outputType.setDataBinding(dataBinding); - } - List faultTypes = op.getFaultTypes(); - if (faultTypes != null) { - for (DataType d : faultTypes) { - if (d.getDataBinding() == null) { - d.setDataBinding(dataBinding); - } - DataType ft = (DataType) d.getLogical(); - if (ft.getDataBinding() == null) { - ft.setDataBinding(dataBinding); - } - - } - } - if (op.isWrapperStyle()) { - WrapperInfo wrapper = op.getWrapper(); - if (wrapper != null) { - DataType> unwrappedInputType = wrapper.getUnwrappedInputType(); - if (unwrappedInputType != null) { - for (DataType d : unwrappedInputType.getLogical()) { - if (d.getDataBinding() == null) { - d.setDataBinding(dataBinding); - } - } - } - DataType unwrappedOutputType = wrapper.getUnwrappedOutputType(); - if (unwrappedOutputType != null && unwrappedOutputType.getDataBinding() == null) { - unwrappedOutputType.setDataBinding(dataBinding); - } - } - } - } - } - } - - private void setDataBinding(DataType dataType, String dataBinding) { - if ("java:array".equals(dataType.getDataBinding())) { - setDataBinding((DataType)dataType.getLogical(), dataBinding); - } else { - dataType.setDataBinding(dataBinding); - } - } - - public void resetDataBinding(String dataBinding) { - for (Operation op : getOperations()) { - op.setDataBinding(dataBinding); - DataType> inputType = op.getInputType(); - if (inputType != null) { - for (DataType d : inputType.getLogical()) { - setDataBinding(d, dataBinding); - } - } - DataType outputType = op.getOutputType(); - if (outputType != null) { - setDataBinding(outputType, dataBinding); - } - List faultTypes = op.getFaultTypes(); - if (faultTypes != null) { - for (DataType d : faultTypes) { - setDataBinding(d, dataBinding); - setDataBinding((DataType) d.getLogical(), dataBinding); - } - } - if (op.isWrapperStyle()) { - WrapperInfo wrapper = op.getWrapper(); - if (wrapper != null) { - DataType> unwrappedInputType = wrapper.getUnwrappedInputType(); - if (unwrappedInputType != null) { - for (DataType d : unwrappedInputType.getLogical()) { - setDataBinding(d, dataBinding); - } - } - DataType unwrappedOutputType = wrapper.getUnwrappedOutputType(); - if (unwrappedOutputType != null) { - setDataBinding(unwrappedOutputType, dataBinding); - } - } - } - } - } - - public void resetInterfaceInputTypes(Interface newInterface){ - for (int i = 0; i < getOperations().size(); i++) { - // only remote interfaces only have a data type model defined - // and in this case operations cannot be overloaded so match - // operations by name - Operation oldOperation = getOperations().get(i); - Operation newOperation = null; - - for (Operation tmpOperation : newInterface.getOperations()){ - if (tmpOperation.getName().equals(oldOperation.getName())){ - newOperation = tmpOperation; - } - } - - if (newOperation == null){ - break; - } - - // set input types - oldOperation.setInputType(newOperation.getInputType()); - - // set wrapper - if (newOperation.isWrapperStyle()) { - oldOperation.setWrapperStyle(true); - oldOperation.setWrapper(newOperation.getWrapper()); - } - } - } - - public void resetInterfaceOutputTypes(Interface newInterface){ - for (int i = 0; i < getOperations().size(); i++) { - // only remote interfaces only have a data type model defined - // and in this case operations cannot be overloaded so match - // operations by name - Operation oldOperation = getOperations().get(i); - Operation newOperation = null; - - for (Operation tmpOperation : newInterface.getOperations()){ - if (tmpOperation.getName().equals(oldOperation.getName())){ - newOperation = tmpOperation; - } - } - - if (newOperation == null){ - break; - } - - // set output types - oldOperation.setOutputType(newOperation.getOutputType()); - - // set fault types - oldOperation.setFaultTypes(newOperation.getFaultTypes()); - - // set wrapper - if (newOperation.isWrapperStyle()) { - oldOperation.setWrapperStyle(true); - oldOperation.setWrapper(newOperation.getWrapper()); - } - } - } - - public boolean isDynamic() { - return false; - } - - public List getPolicySets() { - return policySets; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public ExtensionType getExtensionType() { - return type; - } - - public void setExtensionType(ExtensionType type) { - this.type = type; - } - - @Override - public Object clone() throws CloneNotSupportedException { - InterfaceImpl copy = (InterfaceImpl)super.clone(); - copy.operations = new OperationList(); - for (Operation operation : this.operations) { - Operation clonedOperation = (Operation)operation.clone(); - copy.operations.add(clonedOperation); - } - copy.attributes = new ConcurrentHashMap(); - copy.attributes.putAll(attributes); - return copy; - } - - public Map getAttributes() { - return attributes; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java deleted file mode 100644 index 0acb326a47..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.interfacedef.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import javax.xml.namespace.QName; - -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.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents an operation on a service interface. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public class OperationImpl implements Operation { - - private String name; - private boolean unresolved; - private DataType outputType; - private DataType> inputType; - private List faultTypes; - private Interface interfaze; - private boolean nonBlocking; - private boolean wrapperStyle; - private WrapperInfo wrapper; - private boolean dynamic; - - private Map attributes = new ConcurrentHashMap(); - - private Map>> faultBeans; - - private List applicablePolicySets = new ArrayList(); - private List policySets = new ArrayList(); - private List requiredIntents = new ArrayList(); - private ExtensionType type; - - /** - * @param name - */ - public OperationImpl() { - inputType = new DataTypeImpl>("idl:input", Object[].class, new ArrayList()); - faultTypes = new ArrayList(); - faultBeans = new HashMap>>(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean undefined) { - this.unresolved = undefined; - } - - /** - * @return the faultTypes - */ - public List getFaultTypes() { - return faultTypes; - } - - /** - * @param faultTypes the faultTypes to set - */ - public void setFaultTypes(List faultTypes) { - this.faultTypes = faultTypes; - } - - /** - * @return the inputType - */ - public DataType> getInputType() { - return inputType; - } - - /** - * @param inputType the inputType to set - */ - public void setInputType(DataType> inputType) { - this.inputType = inputType; - } - - /** - * @return the outputType - */ - public DataType getOutputType() { - return outputType; - } - - /** - * @param outputType the outputType to set - */ - public void setOutputType(DataType outputType) { - this.outputType = outputType; - } - - /** - * @return the interface - */ - public Interface getInterface() { - return interfaze; - } - - /** - * @param interfaze the interface to set - */ - public void setInterface(Interface interfaze) { - this.interfaze = interfaze; - } - - /** - * @return the nonBlocking - */ - public boolean isNonBlocking() { - return nonBlocking; - } - - /** - * @param nonBlocking the nonBlocking to set - */ - public void setNonBlocking(boolean nonBlocking) { - this.nonBlocking = nonBlocking; - } - - /** - * @return the wrapperInfo - */ - public WrapperInfo getWrapper() { - return wrapper; - } - - /** - * @param wrapperInfo the wrapperInfo to set - */ - public void setWrapper(WrapperInfo wrapperInfo) { - this.wrapper = wrapperInfo; - } - - /** - * @return the wrapperStyle - */ - public boolean isWrapperStyle() { - return wrapperStyle; - } - - /** - * @param wrapperStyle the wrapperStyle to set - */ - public void setWrapperStyle(boolean wrapperStyle) { - this.wrapperStyle = wrapperStyle; - } - - public String getDataBinding() { - return wrapper != null ? wrapper.getDataBinding() : null; - } - - public void setDataBinding(String dataBinding) { - if (wrapper != null) { - wrapper.setDataBinding(dataBinding); - } - } - - public boolean isDynamic() { - return dynamic; - } - - public void setDynamic(boolean b) { - this.dynamic = b; - } - - public Map>> getFaultBeans() { - return faultBeans; - } - - public void setFaultBeans(Map>> faultBeans) { - this.faultBeans = faultBeans; - } - - @Override - public OperationImpl clone() throws CloneNotSupportedException { - OperationImpl copy = (OperationImpl) super.clone(); - - final List clonedFaultTypes = new ArrayList(this.faultTypes.size()); - for (DataType t : this.faultTypes) { - clonedFaultTypes.add((DataType) t.clone()); - } - copy.faultTypes = clonedFaultTypes; - - List clonedLogicalTypes = new ArrayList(); - for (DataType t : inputType.getLogical()) { - DataType type = (DataType) t.clone(); - clonedLogicalTypes.add(type); - } - DataType> clonedInputType = - new DataTypeImpl>(inputType.getPhysical(), clonedLogicalTypes); - clonedInputType.setDataBinding(inputType.getDataBinding()); - copy.inputType = clonedInputType; - - if (this.outputType != null) { - copy.outputType = (DataType) this.outputType.clone(); - } - - copy.attributes = new ConcurrentHashMap(); - copy.attributes.putAll(attributes); - - // [rfeng] We need to clone the wrapper as it holds the databinding information - if (wrapper != null) { - copy.wrapper = (WrapperInfo)wrapper.clone(); - } - - return copy; - } - - public List getApplicablePolicySets() { - return applicablePolicySets; - } - - public List getPolicySets() { - return policySets; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public ExtensionType getExtensionType() { - return type; - } - - public void setExtensionType(ExtensionType type) { - this.type = type; - } - - public Map getAttributes() { - return attributes; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/ElementInfo.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/ElementInfo.java deleted file mode 100644 index 38e33e33d9..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/ElementInfo.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.util; - -import javax.xml.namespace.QName; - -/** - * An abstraction of XML schema elements. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public class ElementInfo { - private final QName name; - private final TypeInfo type; - private boolean many = false; - private boolean nillable = false; - - /** - * @param name - * @param type - */ - public ElementInfo(QName name, TypeInfo type) { - super(); - this.name = name; - this.type = type; - } - - /** - * @return the name - */ - public QName getQName() { - return name; - } - - /** - * @return the type - */ - public TypeInfo getType() { - return type; - } - - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("Element: ").append(name).append(" ").append(type); - return sb.toString(); - } - - public boolean isMany() { - return many; - } - - public void setMany(boolean many) { - this.many = many; - } - - public boolean isNillable() { - return nillable; - } - - public void setNillable(boolean nillable) { - this.nillable = nillable; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((name == null) ? 0 : name.hashCode()); - result = prime * result + ((type == null) ? 0 : type.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final ElementInfo other = (ElementInfo)obj; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - /* - if (type == null) { - if (other.type != null) - return false; - } else if (!type.equals(other.type)) - return false; - */ - return true; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/FaultException.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/FaultException.java deleted file mode 100644 index 334c826f86..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/FaultException.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.util; - -import javax.xml.namespace.QName; - -/** - * The generic java exception to wrap service faults - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public class FaultException extends Exception { - private static final long serialVersionUID = -8002583655240625792L; - private transient Object faultInfo; // FIXME: How to serialize it? - private QName faultName; - - /** - * @param message - * @param faultInfo - */ - public FaultException(String message, Object faultInfo) { - super(message); - this.faultInfo = faultInfo; - } - - /** - * @param message - * @param faultInfo - * @param cause - */ - public FaultException(String message, Object faultInfo, Throwable cause) { - super(message, cause); - this.faultInfo = faultInfo; - } - - /** - * @return the faultInfo - */ - public Object getFaultInfo() { - return faultInfo; - } - - public QName getFaultName() { - return faultName; - } - - public void setFaultName(QName logical) { - this.faultName = logical; - } - - public boolean isMatchingType(Object type) { - if (faultName == null) { - return false; - } - - if ((type instanceof QName) && faultName.equals(type)) { - return true; - } - if (type instanceof XMLType && faultName.equals(((XMLType)type).getElementName())) { - return true; - } - return false; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/JavaXMLMapper.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/JavaXMLMapper.java deleted file mode 100644 index 849b922285..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/JavaXMLMapper.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.util; - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - -/** - * Utility class that can be used to map XSD types to Java classes and Java classes to XSD types. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public final class JavaXMLMapper { - public static final String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema"; - private static final Map JAVA2XML = new HashMap(); - private static final Map XML2JAVA = new HashMap(); - - private JavaXMLMapper() { - } - - static { - JAVA2XML.put(boolean.class, getTypeName("boolean")); - JAVA2XML.put(byte.class, getTypeName("byte")); - JAVA2XML.put(short.class, getTypeName("short")); - JAVA2XML.put(int.class, getTypeName("int")); - JAVA2XML.put(long.class, getTypeName("long")); - JAVA2XML.put(float.class, getTypeName("float")); - JAVA2XML.put(double.class, getTypeName("double")); - JAVA2XML.put(Boolean.class, getTypeName("boolean")); - JAVA2XML.put(Byte.class, getTypeName("byte")); - JAVA2XML.put(Short.class, getTypeName("short")); - JAVA2XML.put(Integer.class, getTypeName("int")); - JAVA2XML.put(Long.class, getTypeName("long")); - JAVA2XML.put(Float.class, getTypeName("float")); - JAVA2XML.put(Double.class, getTypeName("double")); - JAVA2XML.put(java.lang.String.class, getTypeName("string")); - JAVA2XML.put(java.math.BigInteger.class, getTypeName("integer")); - JAVA2XML.put(java.math.BigDecimal.class, getTypeName("decimal")); - JAVA2XML.put(java.util.Calendar.class, getTypeName("dateTime")); - JAVA2XML.put(java.util.Date.class, getTypeName("dateTime")); - JAVA2XML.put(javax.xml.namespace.QName.class, getTypeName("QName")); - JAVA2XML.put(java.net.URI.class, getTypeName("string")); - JAVA2XML.put(javax.xml.datatype.XMLGregorianCalendar.class, getTypeName("anySimpleType")); - JAVA2XML.put(javax.xml.datatype.Duration.class, getTypeName("duration")); - JAVA2XML.put(java.lang.Object.class, getTypeName("anyType")); - JAVA2XML.put(java.awt.Image.class, getTypeName("base64Binary")); - JAVA2XML.put(byte[].class, getTypeName("base64Binary")); - // java2XSD.put(javax.activation.DataHandler.class, getTypeName("base64Binary")); - JAVA2XML.put(javax.xml.transform.Source.class, getTypeName("base64Binary")); - JAVA2XML.put(java.util.UUID.class, getTypeName("string")); - } - - static { - XML2JAVA.put("string", java.lang.String.class); - XML2JAVA.put("integer", java.math.BigInteger.class); - XML2JAVA.put("int", int.class); - XML2JAVA.put("long", long.class); - XML2JAVA.put("short", short.class); - XML2JAVA.put("decimal", java.math.BigDecimal.class); - XML2JAVA.put("float", float.class); - XML2JAVA.put("double", double.class); - XML2JAVA.put("boolean", boolean.class); - XML2JAVA.put("byte", byte.class); - XML2JAVA.put("QName", javax.xml.namespace.QName.class); - XML2JAVA.put("dateTime", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("base64Binary", byte[].class); - XML2JAVA.put("hexBinary", byte[].class); - XML2JAVA.put("unsignedInt", long.class); - XML2JAVA.put("unsignedShort", int.class); - XML2JAVA.put("unsignedByte", short.class); - XML2JAVA.put("time", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("date", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("gDay", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("gMonth", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("gYear", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("gYearMonth", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("gMonthDay", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("anySimpleType", java.lang.Object.class); // For elements - // XML2JAVA.put("anySimpleType", java.lang.String.class); // For - // attributes - XML2JAVA.put("duration", javax.xml.datatype.Duration.class); - XML2JAVA.put("NOTATION", javax.xml.namespace.QName.class); - } - - public static Class getJavaType(QName xmlType) { - if (URI_2001_SCHEMA_XSD.equals(xmlType.getNamespaceURI())) { - return XML2JAVA.get(xmlType.getLocalPart()); - } else { - return null; - } - } - - private static QName getTypeName(String name) { - return new QName(URI_2001_SCHEMA_XSD, name); - } - - public static QName getXMLType(Class javaType) { - return JAVA2XML.get(javaType); - } - - private static String getPackageName(Class cls) { - String name = cls.getName(); - int index = name.lastIndexOf('.'); - return index == -1 ? "" : name.substring(0, index); - } - - public static String getNamespace(Class cls) { - String packageName = getPackageName(cls); - if ("".equals(packageName)) { - return ""; - } - StringBuffer ns = new StringBuffer("http://"); - String[] names = packageName.split("\\."); - for (int i = names.length - 1; i >= 0; i--) { - ns.append(names[i]); - if (i != 0) { - ns.append('.'); - } - } - ns.append('/'); - return ns.toString(); - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/TypeInfo.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/TypeInfo.java deleted file mode 100644 index abae4e7e38..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/TypeInfo.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.util; - -import javax.xml.namespace.QName; - -/** - * An abstraction of XML schema types - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public class TypeInfo { - private QName name; - - private boolean isSimpleType; - - private TypeInfo baseType; - - /** - * @param name - * @param isSimpleType - */ - public TypeInfo(QName name, boolean isSimpleType, TypeInfo baseType) { - super(); - this.name = name; - this.isSimpleType = isSimpleType; - this.baseType = baseType; - } - - /** - * @return the isSimpleType - */ - public boolean isSimpleType() { - return isSimpleType; - } - - /** - * @return the name - */ - public QName getQName() { - return name; - } - - /** - * @return the baseType - */ - public TypeInfo getBaseType() { - return baseType; - } - - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("Type: ").append(name); - return sb.toString(); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((name == null) ? 0 : name.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final TypeInfo other = (TypeInfo)obj; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - return true; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java deleted file mode 100644 index 2252434c39..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.util; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; - -/** - * The "Wrapper Style" WSDL operation is defined by The Java API for XML-Based - * Web Services (JAX-WS) 2.0 specification, section 2.3.1.2 Wrapper Style.

      - * A WSDL operation qualifies for wrapper style mapping only if the following - * criteria are met: - *

        - *
      • (i) The operation�s input and output messages (if present) each contain - * only a single part - *
      • (ii) The input message part refers to a global element declaration whose - * localname is equal to the operation name - *
      • (iii) The output message part refers to a global element declaration - *
      • (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 - *
      • (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. - *
      - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public class WrapperInfo implements Cloneable { - private ElementInfo inputWrapperElement; - - private ElementInfo outputWrapperElement; - - private List inputChildElements; - - private List outputChildElements; - - // The data type of the unwrapped input child elements - private DataType> unwrappedInputType; - - // The data type of the unwrapped output child element (we only supports one child) - private DataType unwrappedOutputType; - - // The data for the input/output wrappers - private String dataBinding; - - // The data type for the input (request) wrapper bean - private DataType inputWrapperType; - // The data type for the output (response) wrapper bean - private DataType outputWrapperType; - - public WrapperInfo(String dataBinding, - ElementInfo inputWrapperElement, - ElementInfo outputWrapperElement, - List inputElements, - List outputElements) { - super(); - this.dataBinding = dataBinding; - this.inputWrapperElement = inputWrapperElement; - this.outputWrapperElement = outputWrapperElement; - this.inputChildElements = inputElements; - this.outputChildElements = outputElements; - } - - /** - * @return the inputElements - */ - public List getInputChildElements() { - return inputChildElements; - } - - /** - * @return the inputWrapperElement - */ - public ElementInfo getInputWrapperElement() { - return inputWrapperElement; - } - - /** - * @return the outputElements - */ - public List getOutputChildElements() { - return outputChildElements; - } - - /** - * @return the outputWrapperElement - */ - public ElementInfo getOutputWrapperElement() { - return outputWrapperElement; - } - - /** - * @return the unwrappedInputType - */ - public DataType> getUnwrappedInputType() { - if (unwrappedInputType == null) { - List childTypes = new ArrayList(); - for (ElementInfo element : getInputChildElements()) { - DataType type = getDataType(element); - childTypes.add(type); - } - unwrappedInputType = new DataTypeImpl>("idl:unwrapped.input", Object[].class, childTypes); - } - return unwrappedInputType; - } - - private DataType getDataType(ElementInfo element) { - DataType type = null; - if (element.isMany()) { - DataType logical = new DataTypeImpl(dataBinding, Object.class, new XMLType(element)); - type = new DataTypeImpl("java:array", Object[].class, logical); - } else { - type = new DataTypeImpl(dataBinding, Object.class, new XMLType(element)); - } - return type; - } - - /** - * @return the unwrappedOutputType - */ - public DataType getUnwrappedOutputType() { - if (unwrappedOutputType == null) { - List elements = getOutputChildElements(); - if (elements != null && elements.size() > 0) { - if (elements.size() > 1) { - // We don't support output with multiple parts - // throw new IllegalArgumentException("Multi-part output is not supported"); - } - ElementInfo element = elements.get(0); - - unwrappedOutputType = getDataType(element); - } - } - return unwrappedOutputType; - } - - public Class getInputWrapperClass() { - return inputWrapperType == null ? null : inputWrapperType.getPhysical(); - } - - public Class getOutputWrapperClass() { - return outputWrapperType == null ? null : outputWrapperType.getPhysical(); - } - - public String getDataBinding() { - return dataBinding; - } - - public void setDataBinding(String dataBinding) { - this.dataBinding = dataBinding; - } - - public DataType getInputWrapperType() { - return inputWrapperType; - } - - public void setInputWrapperType(DataType inputWrapperType) { - this.inputWrapperType = inputWrapperType; - } - - public DataType getOutputWrapperType() { - return outputWrapperType; - } - - public void setOutputWrapperType(DataType outputWrapperType) { - this.outputWrapperType = outputWrapperType; - } - - @Override - public Object clone() throws CloneNotSupportedException { - WrapperInfo copy = (WrapperInfo) super.clone(); - if (inputWrapperType != null) { - copy.inputWrapperType = (DataType)inputWrapperType.clone(); - } - if (outputWrapperType != null) { - copy.outputWrapperType = (DataType)outputWrapperType.clone(); - } - return copy; - - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/XMLType.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/XMLType.java deleted file mode 100644 index fd1b840b17..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/XMLType.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.interfacedef.util; - -import javax.xml.namespace.QName; - -/** - * The metadata for an XML element or type. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public class XMLType { - public static final XMLType UNKNOWN = new XMLType(null, null); - protected QName element; - protected QName type; - protected boolean nillable = true; - protected boolean many = false; - - /** - * @param element - */ - public XMLType(ElementInfo element) { - super(); - this.element = element.getQName(); - if (element.getType() != null) { - this.type = element.getType().getQName(); - } - } - - /** - * @param element - */ - public XMLType(TypeInfo type) { - this.element = null; - this.type = type.getQName(); - } - - public XMLType(QName element, QName type) { - this.element = element; - this.type = type; - } - - /** - * @return the type - */ - public QName getTypeName() { - return type; - } - - public boolean isElement() { - return element != null; - } - - public QName getElementName() { - return element; - } - - public void setElementName(QName element) { - this.element = element; - } - - public void setTypeName(QName type) { - this.type = type; - } - - public static XMLType getType(QName type) { - return new XMLType(null, type); - } - - /** - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int PRIME = 31; - int result = 1; - result = PRIME * result + ((element == null) ? 0 : element.hashCode()); - result = PRIME * result + ((type == null) ? 0 : type.hashCode()); - return result; - } - - /** - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final XMLType other = (XMLType)obj; - if (element == null) { - if (other.element != null) { - return false; - } - } else if (!element.equals(other.element)) { - return false; - } - if (type == null) { - if (other.type != null) { - return false; - } - } else if (!type.equals(other.type)) { - return false; - } - return true; - } - - @Override - public String toString() { - return "Element: " + element + " Type: " + type; - } - - public boolean isNillable() { - return nillable; - } - - public void setNillable(boolean niable) { - this.nillable = niable; - } - - public boolean isMany() { - return many; - } - - public void setMany(boolean many) { - this.many = many; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/BindingType.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/BindingType.java deleted file mode 100644 index f43c428563..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/BindingType.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.policy; - - -/** - * Definition of binding type which extends from sca:binding - */ -public interface BindingType extends ExtensionType { -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultPolicyFactory.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultPolicyFactory.java deleted file mode 100644 index 2da41675a1..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultPolicyFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.policy; - -import org.apache.tuscany.sca.policy.impl.PolicyFactoryImpl; - -/** - * A factory for the policy model. - * - * @version $Rev$ $Date$ - */ -public class DefaultPolicyFactory extends PolicyFactoryImpl implements PolicyFactory { - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ExtensionType.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ExtensionType.java deleted file mode 100644 index f8f8a48b06..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ExtensionType.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.policy; - -import java.util.List; - -import javax.xml.namespace.QName; - -/** - * Definition of extension type: binding or implementation - * @tuscany.spi.extension.asclient - */ -public interface ExtensionType { - QName BINDING_BASE = new QName("http://docs.oasis-open.org/ns/opencsa/sca/200912", "binding"); - QName IMPLEMENTATION_BASE = new QName("http://docs.oasis-open.org/ns/opencsa/sca/200912", "implementation"); - - /** - * The name of the extension type (binding or implementation). The extension type name - * attribute MUST be the QName of an XSD global element definition used for - * binding/implementation elements of that type - * - * @return The QName of this type - */ - QName getType(); - - /** - * Set the QName for this type - * @param type The QName of this type - */ - void setType(QName type); - - QName getBaseType(); - - /** - * A set of intents. The intents in the alwaysProvides set are always - * provided by this extension type, whether the intents are attached - * to the using component or not. - * - * @return A list of intents that are always provided by this type - */ - List getAlwaysProvidedIntents(); - - /** - * a set of intents. The intents in the mayProvide set are provided by this - * extension type if the intent in question is attached to the using - * component. - * - * @return A list of intents that may be provided by this type - */ - List getMayProvidedIntents(); - /** - * Returns true if the model element is unresolved. - * - * @return true if the model element is unresolved. - */ - boolean isUnresolved(); - - /** - * Sets whether the model element is unresolved. - * - * @param unresolved whether the model element is unresolved - */ - void setUnresolved(boolean unresolved); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ImplementationType.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ImplementationType.java deleted file mode 100644 index d142015f57..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ImplementationType.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.policy; - - -/** - * Definition of an implementation type which extends from sca:implementation - */ -public interface ImplementationType extends ExtensionType { -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/Intent.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/Intent.java deleted file mode 100644 index b2578fab49..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/Intent.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.policy; - -import java.util.List; - -import javax.xml.namespace.QName; - -/** - * Represents a policy intent. See the Policy Framework specification for a - * description of this element. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface Intent { - enum Type { - interaction, implementation - }; - - /** - * Returns the intent name. - * - * @return the intent name - */ - QName getName(); - - /** - * Sets the intent name - * - * @param name the intent name - */ - void setName(QName name); - - /** - * Returns the list of SCA constructs that this intent is meant to - * configure. - * - * @return the list of SCA constructs that this intent is meant to configure - */ - List getConstrainedTypes(); - - /** - * Return a list of required intents - * @return The list of required intents - */ - List getRequiredIntents(); - - /** - * Returns the list of intents which are mutually exclusive with this intent. - * - * @return the list of mutually exclusive intents. - */ - List getExcludedIntents(); - - /** - * Returns the list of qualified intents. - * - * @return the list of qualified intents. - */ - List getQualifiedIntents(); - - /** - * Get the default qualified intent - * - * @return - */ - Intent getDefaultQualifiedIntent(); - - /** - * Set the default qualified intent - * - * @param qualifiedIntent - */ - void setDefaultQualifiedIntent(Intent qualifiedIntent); - - /** - * Get the intent type: Interaction or Implementation - * @return - */ - Type getType(); - - /** - * Set the intent type - * @param type: Interaction or Implementation - */ - void setType(Type type); - - /** - * If this attribute is present and has a value of true it indicates that - * the qualified intents defined for this intent are mutually exclusive - * - * @return - */ - boolean isMutuallyExclusive(); - - /** - * Set the value of mutuallyExclusive - * @param mutuallyExclusive - */ - void setMutuallyExclusive(boolean mutuallyExclusive); - - /** - * Returns the intent description. - * - * @return the intent description - */ - String getDescription(); - - /** - * Sets the intent description. - * - * @param description the intent description - */ - void setDescription(String description); - - /** - * Returns true if the model element is unresolved. - * - * @return true if the model element is unresolved. - */ - - /** - * Get the parent intent for a qualified intent. If an intent is not qualified, - * return null. - * @return The parent intent or null if this intent is not qualified - */ - Intent getQualifiableIntent(); - - /** - * Set the parent intent for a qualified intent - * @param intent - */ - void setQualifiableIntent(Intent intent); - - boolean isUnresolved(); - - /** - * Sets whether the model element is unresolved. - * - * @param unresolved whether the model element is unresolved - */ - void setUnresolved(boolean unresolved); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/IntentMap.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/IntentMap.java deleted file mode 100644 index 5b401baeb3..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/IntentMap.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.policy; - -import java.util.List; - - -/** - * Map policies to the qualified intents - */ -public interface IntentMap { - /** - * Returns the intent realized by this intent map. - * - * @return the intent realized by this intent map - */ - Intent getProvidedIntent(); - - /** - * Sets the intent realized by this intent map. - * - * @param providedIntent the intent realized by this intent map - */ - void setProvidedIntent(Intent providedIntent); - - /** - * Get a list of qualifiers - * - * @return A list of qualifiers - */ - List getQualifiers(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyAttachment.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyAttachment.java deleted file mode 100644 index ee4f5b5236..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyAttachment.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; - -import java.util.List; - -/** - * Attach a policySet to a collection of policy subjects - */ -public interface PolicyAttachment { - PolicySet getPolicySet(); - void setPolicySet(PolicySet policySet); - List getPolicySubjects(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyContainer.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyContainer.java deleted file mode 100644 index 6bb7244e05..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyContainer.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.policy; - -/** - * Base interface for policy models. Mainly allows policies to hold - * other policies - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface PolicyContainer { - /** - * For complex policy models, such as ws-policy, - * a policy provider may only match against one of a - * number of child policy models - * - * @return the matching child policy object or null - */ - Object getChildPolicy(Class policyType); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyExpression.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyExpression.java deleted file mode 100644 index b7de263789..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyExpression.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; - -import javax.xml.namespace.QName; - -/** - * Interface that will abstract various types of policy specifications - * and attachments for example WS-Policy - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface PolicyExpression { - /** - * Get the QName of the policy expression - * @return the QName of the policy expression - */ - QName getName(); - - /** - * Set the QName of the policy expression - * @param name - */ - void setName(QName name); - - /** - * Get the policy definition in the type of the specific domain - * @return - */ - T getPolicy(); - - /** - * Set the policy definition - * @param expression - */ - void setPolicy(T policy); - - /** - * - * @param unresolved - */ - void setUnresolved(boolean unresolved); - - /** - * - * @return - */ - boolean isUnresolved(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java deleted file mode 100644 index b2ac5ca409..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.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; - -/** - * A factory for the policy model. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface PolicyFactory { - - /** - * Create a new intent. - * - * @return a new intent - */ - Intent createIntent(); - - /** - * Create a new policy set. - * - * @return a new policy set - */ - PolicySet createPolicySet(); - - /** - * Create a new intent map. - * - * @return a new intent map - */ - IntentMap createIntentMap(); - - /** - * create a new Qualifier - * - * @return a Qualifier - */ - Qualifier createQualifier(); - - /** - * Create a new PolicyExpression - * @return - */ - PolicyExpression createPolicyExpression(); - - ExtensionType createExtensionType(); - BindingType createBindingType(); - ImplementationType createImplementationType(); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java deleted file mode 100644 index a1ae3892e4..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySet.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.policy; - -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.xpath.XPathExpression; - -/** - * Represents a policy set. See the Policy Framework specification for a - * description of this element. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface PolicySet { - - /** - * Returns the intent name. - * - * @return the intent name - */ - QName getName(); - - /** - * Sets the intent name - * - * @param name the intent name - */ - void setName(QName name); - - /** - * Returns the list of - * - * @return - */ - List getReferencedPolicySets(); - - /** - * Returns the list of provided intents - * - * @return - */ - List getProvidedIntents(); - - /** - * Returns the list of concrete policies, either WS-Policy policy - * attachments, policy references, or policies expressed in another policy - * language. - * - * @return the list of concrete policies - */ - List getPolicies(); - - /** - * Returns true if the model element is unresolved. - * - * @return true if the model element is unresolved. - */ - boolean isUnresolved(); - - /** - * Sets whether the model element is unresolved. - * - * @param unresolved whether the model element is unresolved - */ - void setUnresolved(boolean unresolved); - - /** - * Returns the XPath expression that is to be used to evaluate - * if this PolicySet applies to specific policy subject - * - * @return the XPath expression - */ - String getAppliesTo(); - - /** - * Sets the XPath expression that is to be used to evaluate - * if this PolicySet applies to specific policy subject - * - */ - void setAppliesTo(String xpath); - - /** - * A string which is an XPath 1.0 expression identifying one or more - * elements (policy subject) in the Domain. It is used to declare which - * set of elements the policySet is actually attached to. - * - * @return The attachTo XPath - */ - String getAttachTo(); - - /** - * Set the attachTo XPath - * @param xpath - */ - void setAttachTo(String xpath); - - /** - * Get the resolved XPathExpression for attachTo - * @return - */ - XPathExpression getAttachToXPathExpression(); - - /** - * Set the resolved XPathExpression for attachTo - * @param expression - */ - void setAttachToXPathExpression(XPathExpression expression); - - /** - * Returns the policies / policy attachments provided thro intent maps - * - * @return - */ - List getIntentMaps(); - - /** - * Get the XPath expression for the appliesTo attribute - * @return the XPath expression for the appliesTo attribute - */ - XPathExpression getAppliesToXPathExpression(); - - /** - * Set the XPath expression for the appliesTo attribute - * @param xpathExpression the XPath expression for the appliesTo attribute - */ - void setAppliesToXPathExpression(XPathExpression xpathExpression); - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySubject.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySubject.java deleted file mode 100644 index e585fcf384..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySubject.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.policy; - -import java.util.List; - -/** - * A policy subject is an entity in the assembly with which a policy can be - * associated. - * - * For example, a policy subject can be one of the following: - *
        - *
      • composite - *
      • component - *
      • implementation - *
      • service - *
      • reference - *
      • binding - *
      • interface - *
      - * @tuscany.spi.extension.inheritfrom - */ -public interface PolicySubject { - /** - * Get a list of required intents - * - * @return - */ - List getRequiredIntents(); - - /** - * Get a list of attached policySets - * - * @return A list of policySets - */ - List getPolicySets(); - - ExtensionType getExtensionType(); - void setExtensionType(ExtensionType type); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/Qualifier.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/Qualifier.java deleted file mode 100644 index c1862283c7..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/Qualifier.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; - -import java.util.List; - -/** - * A qualifier provides a list of policies for a qualified intent within the IntentMap - */ -public interface Qualifier { - /** - * Get the qualified intent for this qualifier - * @return The intent - */ - Intent getIntent(); - - /** - * Set the qualified intent for this qualifier - */ - void setIntent(Intent intent); - - /** - * Get the list of policies provided by this qualifier - * @return A list of policies - */ - List getPolicies(); -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java deleted file mode 100644 index 1a2a9c5bad..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.policy.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.policy.BindingType; - -/** - * Concrete implementation for a BindingType - * - * @version $Rev$ $Date$ - */ -public class BindingTypeImpl extends ExtensionTypeImpl implements BindingType { - protected BindingTypeImpl() { - super(); - } - - public QName getBaseType() { - return BINDING_BASE; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ExtensionTypeImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ExtensionTypeImpl.java deleted file mode 100644 index 97fbc19ced..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ExtensionTypeImpl.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.policy.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; - -/** - * Concrete implementation for a BindingType - * - * @version $Rev$ $Date$ - */ -public class ExtensionTypeImpl implements ExtensionType { - - private List alwaysProvides = new ArrayList(); - private List mayProvide = new ArrayList(); - private QName typeName; - private boolean unResolved = true; - - protected ExtensionTypeImpl() { - - } - - public List getAlwaysProvidedIntents() { - return alwaysProvides; - } - - public List getMayProvidedIntents() { - return mayProvide; - } - - public QName getType() { - return typeName; - } - - public void setType(QName type) { - this.typeName = type; - } - - public boolean isUnresolved() { - return unResolved; - } - - public void setUnresolved(boolean unresolved) { - this.unResolved = unresolved; - } - - @Override - public int hashCode() { - return String.valueOf(getType()).hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } else if (obj instanceof ExtensionTypeImpl) { - if (getType() != null) { - return getType().equals(((ExtensionTypeImpl)obj).getType()); - } else { - return ((ExtensionTypeImpl)obj).getType() == null; - } - } else { - return false; - } - } - - @Override - public String toString() { - return (this.typeName != null) ? getType().toString() : "null"; - } - - public QName getBaseType() { - return null; - } -}; diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java deleted file mode 100644 index 5c285e4d95..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.policy.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.policy.ImplementationType; - -/** - * Concrete implementation for a Implementation Type - * - * @version $Rev$ $Date$ - */ -public class ImplementationTypeImpl extends ExtensionTypeImpl implements ImplementationType { - protected ImplementationTypeImpl() { - super(); - } - - public QName getBaseType() { - return IMPLEMENTATION_BASE; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/IntentImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/IntentImpl.java deleted file mode 100644 index 27a77f3ba8..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/IntentImpl.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.policy.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.Intent; - -/** - * Represents a policy intent. - * - * @version $Rev$ $Date$ - */ -public class IntentImpl implements Intent { - - private QName name; - private Type type; - private List constrainedTypes = new ArrayList(); - private String description; - private List qualifiedIntents = new ArrayList(); - private Intent defaultQualifiedIntent; - private Intent parent; - private List requiredIntents = new ArrayList(); - private List excludedIntents = new ArrayList(); - private boolean mutuallyExclusive; - private boolean unresolved = true; - - protected IntentImpl() { - } - - public QName getName() { - return name; - } - - public void setName(QName name) { - this.name = name; - } - - public List getConstrainedTypes() { - return constrainedTypes; - } - - public void setConstrainedTypes(List constrainedTypes) { - this.constrainedTypes = constrainedTypes; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Intent getQualifiableIntent() { - return parent; - } - - public void setQualifiableIntent(Intent parent) { - this.parent = parent; - } - - public List getQualifiedIntents() { - return qualifiedIntents; - } - - public void setQualifiedIntents(List qualifiedIntents) { - this.qualifiedIntents = qualifiedIntents; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public void setRequiredIntents(List requiredIntents) { - this.requiredIntents = requiredIntents; - } - - public List getExcludedIntents() { - return excludedIntents; - } - - public void setExcludedIntents(List excludedIntents) { - this.excludedIntents = excludedIntents; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean unresolved) { - this.unresolved = unresolved; - } - - public Type getType() { - return type; - } - - public void setType(Type type) { - this.type = type; - } - - public boolean isMutuallyExclusive() { - return mutuallyExclusive; - } - - public void setMutuallyExclusive(boolean mutuallyExclusive) { - this.mutuallyExclusive = mutuallyExclusive; - } - - public Intent getDefaultQualifiedIntent() { - return defaultQualifiedIntent; - } - - public void setDefaultQualifiedIntent(Intent defaultQualifiedIntent) { - this.defaultQualifiedIntent = defaultQualifiedIntent; - } - - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((name == null) ? 0 : name.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - IntentImpl other = (IntentImpl)obj; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - return true; - } - - public String toString() { - return String.valueOf(name); - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/IntentMapImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/IntentMapImpl.java deleted file mode 100644 index 357b7afab4..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/IntentMapImpl.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.policy.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.IntentMap; -import org.apache.tuscany.sca.policy.Qualifier; - -/** - * Represents an intent map. - * - * @version $Rev$ $Date$ - */ -public class IntentMapImpl implements IntentMap { - - private boolean unresolved; - private Intent providedIntent; - private List qualifiers = new ArrayList(); - - protected IntentMapImpl() { - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean unresolved) { - this.unresolved = unresolved; - } - - public Intent getProvidedIntent() { - return providedIntent; - } - - public void setProvidedIntent(Intent providedIntent) { - this.providedIntent = providedIntent; - } - - public List getQualifiers() { - return qualifiers; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - IntentMapImpl other = (IntentMapImpl)obj; - if (providedIntent == null) { - if (other.providedIntent != null) - return false; - } else if (!providedIntent.equals(other.providedIntent)) - return false; - return true; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyExpressionImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyExpressionImpl.java deleted file mode 100644 index b9f9fa5eb4..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyExpressionImpl.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.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.policy.PolicyExpression; - -public class PolicyExpressionImpl implements PolicyExpression { - private QName name; - private Object policy; - private boolean unresolved = true; - - protected PolicyExpressionImpl() { - } - - public QName getName() { - return name; - } - - @SuppressWarnings("unchecked") - public T getPolicy() { - return (T)policy; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setName(QName name) { - this.name = name; - } - - public void setPolicy(T policy) { - this.policy = policy; - } - - public void setUnresolved(boolean unresolved) { - this.unresolved = unresolved; - } - - public String toString() { - return String.valueOf(name); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((name == null) ? 0 : name.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - PolicyExpressionImpl other = (PolicyExpressionImpl)obj; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - return true; - } -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java deleted file mode 100644 index c67ff1eab8..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.policy.impl; - -import org.apache.tuscany.sca.policy.BindingType; -import org.apache.tuscany.sca.policy.ExtensionType; -import org.apache.tuscany.sca.policy.ImplementationType; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.IntentMap; -import org.apache.tuscany.sca.policy.PolicyExpression; -import org.apache.tuscany.sca.policy.PolicyFactory; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.Qualifier; - -/** - * A factory for the policy model. - * - * @version $Rev$ $Date$ - */ -public abstract class PolicyFactoryImpl implements PolicyFactory { - - public Intent createIntent() { - return new IntentImpl(); - } - - public PolicySet createPolicySet() { - return new PolicySetImpl(); - } - - public IntentMap createIntentMap() { - return new IntentMapImpl(); - } - - public Qualifier createQualifier() { - return new QualifierImpl(); - } - - public PolicyExpression createPolicyExpression() { - return new PolicyExpressionImpl(); - } - - public BindingType createBindingType() { - return new BindingTypeImpl(); - } - - public ImplementationType createImplementationType() { - return new ImplementationTypeImpl(); - } - - public ExtensionType createExtensionType() { - return new ExtensionTypeImpl(); - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java deleted file mode 100644 index 75d1229cd8..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.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.policy.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.xpath.XPathExpression; - -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.IntentMap; -import org.apache.tuscany.sca.policy.PolicyExpression; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a policy set. - * - * @version $Rev$ $Date$ - */ -public class PolicySetImpl implements PolicySet { - - private QName name; - private String appliesTo; - private String attachTo; - private List providedIntents = new ArrayList(); - private List referencedPolicySets = new ArrayList(); - private boolean unresolved = true; - - private XPathExpression appliesToXPathExpression; - private XPathExpression attachToXPathExpression; - - private List intentMaps = new ArrayList(); - private List policies = new ArrayList(); - - public QName getName() { - return name; - } - - public void setName(QName name) { - this.name = name; - } - - public String getAppliesTo() { - return appliesTo; - } - - public void setAppliesTo(String appliesTo) { - this.appliesTo = appliesTo; - } - - public String getAttachTo() { - return attachTo; - } - - public void setAttachTo(String attachTo) { - this.attachTo = attachTo; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean unresolved) { - this.unresolved = unresolved; - } - - public XPathExpression getAppliesToXPathExpression() { - return appliesToXPathExpression; - } - - public void setAppliesToXPathExpression(XPathExpression appliesToXPathExpression) { - this.appliesToXPathExpression = appliesToXPathExpression; - } - - public XPathExpression getAttachToXPathExpression() { - return attachToXPathExpression; - } - - public void setAttachToXPathExpression(XPathExpression attachToXPathExpression) { - this.attachToXPathExpression = attachToXPathExpression; - } - - public List getIntentMaps() { - return intentMaps; - } - - public List getProvidedIntents() { - return providedIntents; - } - - public List getReferencedPolicySets() { - return referencedPolicySets; - } - - public List getPolicies() { - return policies; - } - - public String toString() { - return String.valueOf(name); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((name == null) ? 0 : name.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - PolicySetImpl other = (PolicySetImpl)obj; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - return true; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/QualifierImpl.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/QualifierImpl.java deleted file mode 100644 index 102bea8d41..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/QualifierImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.policy.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicyExpression; -import org.apache.tuscany.sca.policy.Qualifier; - -public class QualifierImpl implements Qualifier { - private Intent intent; - private List policies = new ArrayList(); - - protected QualifierImpl() { - } - - public Intent getIntent() { - return intent; - } - - public List getPolicies() { - return policies; - } - - public void setIntent(Intent intent) { - this.intent = intent; - } - -} diff --git a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java b/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java deleted file mode 100644 index 8a4adb3d7f..0000000000 --- a/sca-java-2.x/tags/2.0-M5-RC2/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.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.util; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.definitions.Definitions; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicyExpression; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.PolicySubject; - -/** - * A utility that helps to navigate the policy model - * @tuscany.spi.extension.asclient - */ -public class PolicyHelper { - public PolicySet getPolicySet(PolicySubject subject, QName policySetName) { - for (PolicySet ps : subject.getPolicySets()) { - if (ps.getName().equals(policySetName)) { - return ps; - } - } - return null; - } - - public Intent getIntent(Definitions subject, QName intentName) { - for (Intent i : subject.getIntents()) { - if (i.getName().equals(intentName)) { - return i; - } - } - return null; - } - - public PolicySet getPolicySet(Definitions subject, QName policySetName) { - for (PolicySet ps : subject.getPolicySets()) { - if (ps.getName().equals(policySetName)) { - return ps; - } - } - return null; - } - - public Intent getIntent(PolicySubject subject, QName intentName) { - for (Intent i : subject.getRequiredIntents()) { - if (i.getName().equals(intentName)) { - return i; - } - } - return null; - } - - public Collection getPolicyExpressions(PolicySubject subject, QName policyName) { - Collection policies = new ArrayList(); - for (PolicySet ps : subject.getPolicySets()) { - for (PolicyExpression exp : ps.getPolicies()) { - if (exp.getName().equals(policyName)) { - policies.add(exp); - } - } - } - return policies; - } - - public Collection getPolicies(PolicySubject subject, QName policyName) { - Collection policies = new ArrayList(); - for (PolicySet ps : subject.getPolicySets()) { - for (PolicyExpression exp : ps.getPolicies()) { - if (exp.getName().equals(policyName)) { - policies.add(exp.getPolicy()); - } - } - } - return policies; - } - - public static PolicySet getPolicySet(Binding wsBinding, QName intentName) { - PolicySet returnPolicySet = null; - - if (wsBinding instanceof PolicySubject) { - PolicySubject policiedBinding = (PolicySubject)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 PolicySubject) { - List intents = ((PolicySubject)wsBinding).getRequiredIntents(); - for (Intent i : intents) { - if (intent.equals(i.getName())) { - return true; - } - } - } - return getPolicySet(wsBinding, intent) != null; - } - -} -- cgit v1.2.3