From 2f187c12e2ceceb61ca2745463fcd7fbbb438b72 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 16 Feb 2012 15:39:43 +0000 Subject: Rename beta3 tag to final name git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1245035 13f79535-47bb-0310-9956-ffa450edef68 --- .../tags/2.0-Beta3/modules/core-spi/LICENSE | 205 ------- .../modules/core-spi/META-INF/MANIFEST.MF | 49 -- .../tags/2.0-Beta3/modules/core-spi/NOTICE | 6 - .../tags/2.0-Beta3/modules/core-spi/pom.xml | 106 ---- .../modules/core-spi/src/doc/Context Model.emx | 673 --------------------- .../sca/context/ComponentContextFactory.java | 38 -- .../tuscany/sca/context/CompositeContext.java | 174 ------ .../sca/context/ContextFactoryExtensionPoint.java | 51 -- .../DefaultContextFactoryExtensionPoint.java | 115 ---- .../tuscany/sca/context/PropertyValueFactory.java | 42 -- .../tuscany/sca/context/RequestContextFactory.java | 35 -- .../tuscany/sca/context/ThreadMessageContext.java | 57 -- .../sca/invocation/DataExchangeSemantics.java | 34 -- .../apache/tuscany/sca/invocation/Interceptor.java | 41 -- .../tuscany/sca/invocation/InterceptorAsync.java | 82 --- .../tuscany/sca/invocation/InvocationChain.java | 140 ----- .../org/apache/tuscany/sca/invocation/Invoker.java | 37 -- .../sca/invocation/InvokerAsyncRequest.java | 40 -- .../sca/invocation/InvokerAsyncResponse.java | 39 -- .../org/apache/tuscany/sca/invocation/Message.java | 129 ---- .../tuscany/sca/invocation/MessageFactory.java | 37 -- .../org/apache/tuscany/sca/invocation/Phase.java | 60 -- .../tuscany/sca/invocation/PhasedInterceptor.java | 32 - .../tuscany/sca/management/ConfigAttributes.java | 26 - .../tuscany/sca/management/ManagementService.java | 39 -- .../tuscany/sca/provider/BaseBindingImpl.java | 94 --- .../tuscany/sca/provider/BasePolicyProvider.java | 207 ------- .../sca/provider/BindingPolicyProvider.java | 37 -- .../sca/provider/BindingProviderFactory.java | 51 -- .../DefaultProviderFactoryExtensionPoint.java | 500 --------------- .../sca/provider/EndpointAsyncProvider.java | 56 -- .../tuscany/sca/provider/EndpointProvider.java | 35 -- .../provider/EndpointReferenceAsyncProvider.java | 40 -- .../sca/provider/EndpointReferenceProvider.java | 36 -- .../sca/provider/ImplementationAsyncProvider.java | 68 --- .../sca/provider/ImplementationProvider.java | 57 -- .../provider/ImplementationProviderFactory.java | 43 -- .../sca/provider/OperationSelectorProvider.java | 40 -- .../provider/OperationSelectorProviderFactory.java | 44 -- .../sca/provider/OptimisingBindingProvider.java | 34 -- .../tuscany/sca/provider/PolicyImplementor.java | 38 -- .../tuscany/sca/provider/PolicyProvider.java | 55 -- .../sca/provider/PolicyProviderFactory.java | 52 -- .../tuscany/sca/provider/ProviderFactory.java | 36 -- .../provider/ProviderFactoryExtensionPoint.java | 74 --- .../sca/provider/ReferenceBindingProvider.java | 64 -- .../tuscany/sca/provider/RuntimeProvider.java | 35 -- .../tuscany/sca/provider/SCABindingMapper.java | 44 -- .../sca/provider/ServiceBindingProvider.java | 53 -- .../tuscany/sca/provider/WireFormatProvider.java | 55 -- .../sca/provider/WireFormatProviderFactory.java | 44 -- .../tuscany/sca/runtime/ActivationException.java | 37 -- .../apache/tuscany/sca/runtime/ActiveNodes.java | 32 - .../tuscany/sca/runtime/BaseDomainRegistry.java | 198 ------ .../sca/runtime/BaseDomainRegistryFactory.java | 115 ---- .../tuscany/sca/runtime/CompositeActivator.java | 159 ----- .../sca/runtime/ContributionDescription.java | 157 ----- .../tuscany/sca/runtime/ContributionListener.java | 29 - ...DefaultDomainRegistryFactoryExtensionPoint.java | 103 ---- .../DefaultWireProcessorExtensionPoint.java | 127 ---- .../apache/tuscany/sca/runtime/DomainRegistry.java | 108 ---- .../tuscany/sca/runtime/DomainRegistryFactory.java | 61 -- .../DomainRegistryFactoryExtensionPoint.java | 51 -- .../tuscany/sca/runtime/DomainRegistryURI.java | 168 ----- .../tuscany/sca/runtime/EndpointListener.java | 46 -- .../sca/runtime/EndpointReferenceBinder.java | 53 -- .../tuscany/sca/runtime/EndpointSerializer.java | 36 -- .../runtime/ExtensibleDomainRegistryFactory.java | 156 ----- .../org/apache/tuscany/sca/runtime/Invocable.java | 162 ----- .../tuscany/sca/runtime/ReferenceParameters.java | 59 -- .../tuscany/sca/runtime/RuntimeComponent.java | 96 --- .../sca/runtime/RuntimeComponentContext.java | 65 -- .../sca/runtime/RuntimeComponentReference.java | 44 -- .../sca/runtime/RuntimeComponentService.java | 33 - .../tuscany/sca/runtime/RuntimeEndpoint.java | 102 ---- .../sca/runtime/RuntimeEndpointReference.java | 96 --- .../tuscany/sca/runtime/RuntimeProperties.java | 37 -- .../tuscany/sca/runtime/RuntimeWireProcessor.java | 39 -- .../RuntimeWireProcessorExtensionPoint.java | 53 -- .../sca/runtime/UnknownEndpointHandler.java | 29 - .../org/apache/tuscany/sca/runtime/Version.java | 47 -- .../tuscany/sca/work/NotificationListener.java | 67 -- .../org/apache/tuscany/sca/work/WorkScheduler.java | 62 -- .../tuscany/sca/work/WorkSchedulerException.java | 59 -- ...uscany.sca.context.ContextFactoryExtensionPoint | 19 - ...cany.sca.provider.ProviderFactoryExtensionPoint | 19 - ...sca.runtime.DomainRegistryFactoryExtensionPoint | 17 - ....sca.runtime.RuntimeWireProcessorExtensionPoint | 19 - .../apache/tuscany/sca/runtime/revision.properties | 30 - ...efaultContextFactoryExtensionPointTestCase.java | 207 ------- .../tuscany/sca/runtime/ConfigURITestCase.java | 107 ---- .../tuscany/sca/runtime/VersionTestCase.java | 36 -- 92 files changed, 7319 deletions(-) delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/LICENSE delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/META-INF/MANIFEST.MF delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/NOTICE delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/pom.xml delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/doc/Context Model.emx delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ComponentContextFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ContextFactoryExtensionPoint.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/PropertyValueFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/RequestContextFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ThreadMessageContext.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/DataExchangeSemantics.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncResponse.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/PhasedInterceptor.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ConfigAttributes.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BaseBindingImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingPolicyProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointAsyncProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceAsyncProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationAsyncProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OptimisingBindingProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/RuntimeProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/SCABindingMapper.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActivationException.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActiveNodes.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistry.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistryFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionDescription.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultDomainRegistryFactoryExtensionPoint.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactoryExtensionPoint.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryURI.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistryFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeProperties.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/UnknownEndpointHandler.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Version.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ContextFactoryExtensionPoint delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactoryExtensionPoint delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/ConfigURITestCase.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/VersionTestCase.java (limited to 'sca-java-2.x/tags/2.0-Beta3/modules/core-spi') diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/LICENSE b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/META-INF/MANIFEST.MF b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/META-INF/MANIFEST.MF deleted file mode 100644 index baae06d53a..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/META-INF/MANIFEST.MF +++ /dev/null @@ -1,49 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.apache.tuscany.sca.context;version="2.0.0"; - uses:="org.apache.tuscany.sca.runtime, - org.apache.tuscany.sca.assembly, - org.apache.tuscany.sca.core, - org.oasisopen.sca, - org.apache.tuscany.sca.extensibility", - org.apache.tuscany.sca.invocation;version="2.0.0";uses:="org.apache.tuscany.sca.runtime,org.apache.tuscany.sca.interfacedef", - org.apache.tuscany.sca.management;version="2.0.0";uses:="org.apache.tuscany.sca.runtime", - org.apache.tuscany.sca.provider;version="2.0.0"; - uses:="org.apache.tuscany.sca.invocation, - org.apache.tuscany.sca.runtime, - org.apache.tuscany.sca.assembly, - org.apache.tuscany.sca.definitions, - org.apache.tuscany.sca.core, - org.apache.tuscany.sca.interfacedef, - org.apache.tuscany.sca.extensibility", - org.apache.tuscany.sca.runtime;version="2.0.0"; - uses:="org.apache.tuscany.sca.invocation, - org.apache.tuscany.sca.assembly, - org.apache.tuscany.sca.endpointresolver, - org.apache.tuscany.sca.provider, - org.oasisopen.sca, - org.apache.tuscany.sca.interfacedef", - org.apache.tuscany.sca.work;version="2.0.0" -SCA-Version: 1.1 -Bundle-Name: Apache Tuscany SCA Core SPI -Bundle-Vendor: The Apache Software Foundation -Bundle-Version: 2.0.0 -Bundle-ManifestVersion: 2 -Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt -Bundle-Description: Apache Tuscany SCA Core SPI -Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0", - org.apache.tuscany.sca.assembly.builder;version="2.0.0", - org.apache.tuscany.sca.context;version="2.0.0", - org.apache.tuscany.sca.core;version="2.0.0", - org.apache.tuscany.sca.definitions;version="2.0.0", - org.apache.tuscany.sca.extensibility;version="2.0.0", - org.apache.tuscany.sca.interfacedef;version="2.0.0", - org.apache.tuscany.sca.invocation;version="2.0.0", - org.apache.tuscany.sca.management;version="2.0.0", - org.apache.tuscany.sca.policy;version="2.0.0", - org.apache.tuscany.sca.provider;version="2.0.0", - org.apache.tuscany.sca.runtime;version="2.0.0", - org.apache.tuscany.sca.work;version="2.0.0", - org.oasisopen.sca;version="2.0.0" -Bundle-SymbolicName: org.apache.tuscany.sca.core.spi -Bundle-DocURL: http://www.apache.org/ -Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/NOTICE b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/NOTICE deleted file mode 100644 index d69e595698..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2011 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/pom.xml b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/pom.xml deleted file mode 100644 index 2fa66ee242..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/pom.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 2.0-Beta3 - ../pom.xml - - tuscany-core-spi - Apache Tuscany SCA Core SPI - - - - org.apache.tuscany.sca - tuscany-extensibility - 2.0-Beta3 - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta3 - - - - org.apache.tuscany.sca - tuscany-assembly - 2.0-Beta3 - - - - org.apache.tuscany.sca - tuscany-contribution - 2.0-Beta3 - - - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - 1.0-beta-4 - - - validate - - create - - - - - sources.version - build.timestamp - false - true - 00000 - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.6 - - - process-resources - process-resources - - - - - - - - - - run - - - - - - - - diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/doc/Context Model.emx b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/doc/Context Model.emx deleted file mode 100644 index 0445ea5a6b..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/doc/Context Model.emx +++ /dev/null @@ -1,673 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ComponentContextFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ComponentContextFactory.java deleted file mode 100644 index 2a690dbf0d..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ComponentContextFactory.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.context; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.oasisopen.sca.ComponentContext; - -/** - * Interface implemented by the provider of the ComponentContext. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface ComponentContextFactory { - /** - * Create an instance of ComponentContext - * - * @param component The runtime component - * @return An instance of ComponentContext for the component - */ - ComponentContext createComponentContext(CompositeContext compositeContext, RuntimeComponent component); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java deleted file mode 100644 index 313c4bb64e..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.context; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.assembly.Composite; -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.definitions.Definitions; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.runtime.DomainRegistry; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentContext; - -/** - * The context associated with the Node that provides access to ExtensionPointRegistry and DomainRegistry - * - * @version $Rev$ $Date$ - */ -public class CompositeContext { - protected ExtensionPointRegistry extensionPointRegistry; - protected DomainRegistry domainRegistry; - protected ComponentContextFactory componentContextFactory; - protected Composite domainComposite; - protected String nodeURI; - protected String domainURI; - protected Definitions systemDefinitions; - - protected Map attributes = new HashMap(); - - public CompositeContext(ExtensionPointRegistry registry, - DomainRegistry domainRegistry, - Composite domainComposite, - String domainURI, - String nodeURI, - Definitions systemDefinitions) { - this.extensionPointRegistry = registry; - this.domainRegistry = domainRegistry; - ContextFactoryExtensionPoint contextFactories = registry.getExtensionPoint(ContextFactoryExtensionPoint.class); - this.componentContextFactory = contextFactories.getFactory(ComponentContextFactory.class); - this.domainComposite = domainComposite; - this.domainURI = domainURI; - this.nodeURI = nodeURI; - this.systemDefinitions = systemDefinitions; - } - - public CompositeContext(ExtensionPointRegistry registry, DomainRegistry domainRegistry) { - this(registry, domainRegistry, null, "default", "default", null); - } - - /** - * @return - */ - public static RuntimeComponent getCurrentComponent() { - Message message = ThreadMessageContext.getMessageContext(); - if (message != null) { - Endpoint to = message.getTo(); - if (to == null) { - return null; - } - RuntimeComponent component = (RuntimeComponent)message.getTo().getComponent(); - return component; - } - return null; - } - - /** - * @return - */ - public static CompositeContext getCurrentCompositeContext() { - RuntimeComponent component = getCurrentComponent(); - if (component != null) { - RuntimeComponentContext componentContext = component.getComponentContext(); - return componentContext.getCompositeContext(); - } - return null; - } - - public void bindComponent(RuntimeComponent runtimeComponent) { - RuntimeComponentContext componentContext = - (RuntimeComponentContext)componentContextFactory.createComponentContext(this, runtimeComponent); - runtimeComponent.setComponentContext(componentContext); - } - - /** - * - * @param endpointReference - */ - public void bindEndpointReference(EndpointReference endpointReference) { - - } - - /** - * Get the ExtensionPointRegistry for this node - * @return The ExtensionPointRegistry - */ - public ExtensionPointRegistry getExtensionPointRegistry() { - return extensionPointRegistry; - } - - /** - * Get the DomainRegistry - * @return The DomainRegistry for this node - */ - public DomainRegistry getEndpointRegistry() { - return domainRegistry; - } - - public Composite getDomainComposite() { - return domainComposite; - } - - public String getNodeURI() { - return nodeURI; - } - - public String getDomainURI() { - return domainURI; - } - - /** - * The system definitions that result from starting the runtime. - * TODO - these can be null when the SCAClient starts the runtime - * - * @return systemDefinitions - */ - public Definitions getSystemDefinitions() { - return systemDefinitions; - } - - /** - * Look up an attribute value by name - * @param - * @param name The name of the attribute - * @return The value of the attribute - */ - @SuppressWarnings("unchecked") - public T getAttribute(String name) { - return (T)attributes.get(name); - } - - /** - * Set the value of an attribute - * @param name The name of the attribute - * @param value - */ - public void setAttribute(String name, Object value) { - attributes.put(name, value); - } - - public Map getAttributes() { - return attributes; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ContextFactoryExtensionPoint.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ContextFactoryExtensionPoint.java deleted file mode 100644 index ddcc46a1ac..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ContextFactoryExtensionPoint.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.context; - -/** - * An extension point for context factories. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface ContextFactoryExtensionPoint { - - /** - * Add a context factory extension. - * - * @param factory The factory to add - */ - void addFactory(Object factory); - - /** - * Remove a context factory extension. - * - * @param factory The factory to remove - */ - void removeFactory(Object factory); - - /** - * Get a factory implementing the given interface. - * @param factoryInterface the lookup key (factory interface) - * @return The factory - */ - T getFactory(Class factoryInterface); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java deleted file mode 100644 index 50882c9498..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.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.context; - -import java.lang.reflect.Constructor; -import java.util.HashMap; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.extensibility.ServiceDeclaration; - -/** - * Default implementation of a model factory extension point. - * - * @version $Rev$ $Date$ - */ -public class DefaultContextFactoryExtensionPoint implements ContextFactoryExtensionPoint { - - /** - * The Map of Factories that have been registered. - */ - private HashMap, Object> factories = new HashMap, Object>(); - - private ExtensionPointRegistry registry; - - public DefaultContextFactoryExtensionPoint(ExtensionPointRegistry registry) { - this.registry = registry; - } - - /** - * Add a model factory extension. - * - * @param factory The factory to add. - * @throws IllegalArgumentException if factory is null - */ - public void addFactory(Object factory) throws IllegalArgumentException { - if (factory == null) { - throw new IllegalArgumentException("Cannot add null as a factory"); - } - - Class[] interfaces = factory.getClass().getInterfaces(); - for (int i = 0; i[] interfaces = factory.getClass().getInterfaces(); - for (int i = 0; i T getFactory(Class factoryInterface) throws IllegalArgumentException { - if (factoryInterface == null) { - throw new IllegalArgumentException("Cannot get null as a factory"); - } - - Object factory = factories.get(factoryInterface); - if (factory == null) { - - // Dynamically load a factory class declared under META-INF/services - try { - ServiceDeclaration factoryDeclaration = registry.getServiceDiscovery().getServiceDeclaration(factoryInterface.getName()); - if (factoryDeclaration != null) { - Class factoryClass = factoryDeclaration.loadClass(); - - // Default empty constructor - Constructor constructor = factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - - // Cache the loaded factory - addFactory(factory); - } - } catch (Exception e) { - throw new IllegalArgumentException(e); - } - - } - - return factoryInterface.cast(factory); - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/PropertyValueFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/PropertyValueFactory.java deleted file mode 100644 index 5b91db124c..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/PropertyValueFactory.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.context; - -import org.apache.tuscany.sca.assembly.ComponentProperty; - -/** - * Interface implemented by the provider of the property values - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - * @tuscany.spi.extension.inheritfrom - */ -public interface PropertyValueFactory { - - /** - * This method will create an instance of the value for the specified Property. - * - * @param property The Property from which to retrieve the property value - * @param type The type of the property value being retrieved from the Property - * @param Type type of the property value being looked up - * - * @return the value for the Property - */ - B createPropertyValue(ComponentProperty property, Class type); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/RequestContextFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/RequestContextFactory.java deleted file mode 100644 index 4475427d4b..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/RequestContextFactory.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.context; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.oasisopen.sca.RequestContext; - -/** - * Interface implemented by the provider of the RequestContext. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface RequestContextFactory { - /** - * @return An instance of RequestContext for the current invocation - */ - RequestContext createRequestContext(RuntimeComponent component); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ThreadMessageContext.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ThreadMessageContext.java deleted file mode 100644 index d6237b7ce3..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ThreadMessageContext.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.context; - -import org.apache.tuscany.sca.invocation.Message; - -/** - * Class for tunnelling a WorkContext through the invocation of a user class. - * - * @version $Rev$ $Date$ - */ -public final class ThreadMessageContext { - - private static final ThreadLocal CONTEXT = new ThreadLocal(); - - private ThreadMessageContext() { - } - - public static Message setMessageContext(Message context) { - Message old = CONTEXT.get(); - CONTEXT.set(context); - return old; - } - - /** - * Returns the WorkContext for the current thread. - * - * @return the WorkContext for the current thread - */ - public static Message getMessageContext() { - return CONTEXT.get(); - } - - /** - * Removes and state from the current thread to ensure that - * any associated classloaders can be GCd - */ - public static void removeMessageContext() { - CONTEXT.remove(); - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/DataExchangeSemantics.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/DataExchangeSemantics.java deleted file mode 100644 index 957a15ce8a..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/DataExchangeSemantics.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.invocation; - -/** - * An invoker or interceptor can optionally implement this interface to indicate if they can - * enforce the pass-by-value semantics for an operation on remotable interfaces. - * - * @version $Rev$ $Date$ - */ -public interface DataExchangeSemantics { - /** - * Indicate if the data can be passed in by reference as they won't be mutated. - * @return true if pass-by-reference is allowed - */ - boolean allowsPassByReference(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java deleted file mode 100644 index 42954555b1..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.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.invocation; - -/** - * Synchronous mediation associated with a client- or target- side wire. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface Interceptor extends Invoker { - - /** - * Sets the next invoker - * @param next The next invoker - */ - void setNext(Invoker next); - - /** - * Returns the next invoker or null - * @return The next Invoker - */ - Invoker getNext(); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java deleted file mode 100644 index f29dfddf6a..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.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.invocation; - -/** - * Allows asynchronous wires to be navigated in reverse in order for the - * response to be processed. - * - */ -public interface InterceptorAsync extends Interceptor, InvokerAsyncRequest, InvokerAsyncResponse { - - /** - * Sets the previous invoker - * @param next The previous invoker - */ - void setPrevious(InvokerAsyncResponse previous); - - /** - * Returns the previous invoker or null - * @return The previous Invoker - */ - InvokerAsyncResponse getPrevious(); - - /** - * Process a request message. Provided so that the synchronous - * and asynchronous patterns can re-use the request message - * processing - * - * @param msg The request Message - * @return the processed message - * - */ - Message processRequest(Message msg); - - /** - * Post processing for a request message. Intended to be called after - * the invocation of the request chain returns, to permit cleanup/error handling - * if required - * @param msg The request Message - * @return the processed message - */ - Message postProcessRequest(Message msg); - - /** - * Post processing for a request message where an exception was thrown. - * Intended to be called after the invocation of the request chain returns, - * to permit cleanup/error handling if required - * @param msg The request Message - * @param e a Thowable which is some form of exception thrown during the processing - * of the request message by the invocation chain - * @return the processed message - */ - Message postProcessRequest(Message msg, Throwable e) throws Throwable; - - /** - * Process a response message. Provided so that the synchronous - * and asynchronous patterns can re-use the response message - * processing - * - * @param msg The response Message - * @return the processed message - * - */ - Message processResponse(Message msg); - -} // end interface InterceptorAsync diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java deleted file mode 100644 index b7e26d68eb..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.invocation; - -import org.apache.tuscany.sca.interfacedef.Operation; - -/** - * A wire consists of 1..n invocation chains associated with the operations of its source service contract. - *

- * Invocation chains may contain Interceptors that process invocations. - *

- * A Message is used to pass data associated with an invocation through the chain. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface InvocationChain { - /** - * Returns the target operation for this invocation chain. - * - * @return The target operation for this invocation chain - */ - Operation getTargetOperation(); - - /** - * Updates the target operation for this invocation chain. - * - * @param operation The new target operation for this invocation chain - */ - void setTargetOperation(Operation operation); - - /** - * Returns the source operation for this invocation chain. - * - * @return The source operation for this invocation chain - */ - Operation getSourceOperation(); - - /** - * Updates the source operation for this invocation chain. - * - * @param operation The new source operation for this invocation chain - */ - void setSourceOperation(Operation operation); - - /** - * Adds an interceptor to the end of the chain. For reference side, it will be added to - * Phase.REFERENCE. For service side, it will be added to Phase.SERVICE - * - * @param interceptor The interceptor to add - */ - void addInterceptor(Interceptor interceptor); - - /** - * Add an interceptor to the end of the given phase - * @param phase - the phase - * @param interceptor - the interceptor - */ - void addInterceptor(String phase, Interceptor interceptor); - - /** - * Adds an interceptor to the head of the chain - * @param interceptor - the interceptor - */ - void addHeadInterceptor(Interceptor interceptor); - - /** - * Adds an interceptor to the head of the given phase - * @param phase - the phase - * @param interceptor - the interceptor - */ - void addHeadInterceptor(String phase, Interceptor interceptor); - - /** - * Adds an invoker to the end of the chain - * - * @param invoker The invoker to add - */ - void addInvoker(Invoker invoker); - - /** - * Returns the first invoker in the chain. - * - * @return The first invoker in the chain - */ - Invoker getHeadInvoker(); - - /** - * Returns the last invoker in the chain. - * - * @return The last invoker in the chain - */ - Invoker getTailInvoker(); - - /** - * Get the first invoker that is on the same or later phase - * @param phase - * @return The first invoker that is on the same or later phase - */ - Invoker getHeadInvoker(String phase); - - /** - * Indicate if the data can be passed in by reference as they won't be mutated. - * @return true if pass-by-reference is allowed - */ - boolean allowsPassByReference(); - /** - * Force the invocation to allow pass-by-reference - * @param allowsPBR - */ - void setAllowsPassByReference(boolean allowsPBR); - - /** - * Returns true if this chain must be able to support async - * invocation. This will be as a consequence of the EPR/EP - * detecting the asyncInvocation intent. The flag is set on - * construction and used as an internal guard against non - * async interceptors being added to a chain that expect to - * be able to handle async calls - * - * @return true is the chain supports async invocation. - */ - boolean isAsyncInvocation(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java deleted file mode 100644 index 69309f6dd0..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.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.invocation; - -/** - * Synchronous mediation associated with a client- or target- side wire. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface Invoker { - - /** - * Process a synchronous wire - * - * @param msg The request Message for the wire - * @return The response Message from the wire - */ - Message invoke(Message msg); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java deleted file mode 100644 index 025010a076..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.invocation; - -/** - * TUSCANY-3786 - * - * The request side of an Interface to describe an invocation where - * the request processing can be performed independently of the - * response processing. - */ -public interface InvokerAsyncRequest { - - /** - * Process the request message and pass it down the chain - * - * @param msg The request Message - * @return the processed message - * @throws Throwable - * - */ - void invokeAsyncRequest(Message msg) throws Throwable; - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncResponse.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncResponse.java deleted file mode 100644 index 7eeabb760e..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncResponse.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.invocation; - -/** - * TUSCANY-3786 - * - * The response side of an Interface to describe an invocation where - * the request processing can be performed independently of the - * response processing. - */ -public interface InvokerAsyncResponse { - - /** - * Process the response message and pass it down the chain - * - * @param msg The request Message - * @return the processed message - * - */ - void invokeAsyncResponse(Message msg); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java deleted file mode 100644 index 2bafdb64b8..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.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.invocation; - -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.interfacedef.Operation; - -/** - * Represents a request, response, or exception flowing through a wire - * - * @version $Rev $Date$ - * @tuscany.spi.extension.asclient - */ -public interface Message { - - /** - * Returns the body of the message, which will be the payload or parameters associated with the wire - * @return The body of the message - */ - T getBody(); - - /** - * Sets the body of the message. - * @param body The body of the message - */ - void setBody(T body); - - /** - * Get the end point reference of the source reference - * @return The end point reference of the reference originating the message - */ - EndpointReference getFrom(); - - /** - * Set the end point reference of the reference originating the message - * @param from The end point reference of the reference originating the message - */ - void setFrom(EndpointReference from); - - /** - * Get the end point reference of target service - * @return The end point reference of the service that the message targets - */ - Endpoint getTo(); - - /** - * Set the end point reference of target service - * @param to The end point reference of the service that the message targets - */ - void setTo(Endpoint to); - - /** - * Returns the id of the message - * @return The message Id - */ - Object getMessageID(); - - /** - * Sets the id of the message - * @param messageId The message ID - */ - void setMessageID(Object messageId); - - /** - * Determines if the message represents a fault/exception - * - * @return true If the message body is a fault object, false if the body is a normal payload - */ - boolean isFault(); - - /** - * Set the message body with a fault object. After this method is called, isFault() returns true. - * - * @param fault The fault object represents an exception - */ - void setFaultBody(T fault); - - /** - * Returns the operation that created the message. - * - * @return The operation that created the message - */ - Operation getOperation(); - - /** - * Sets the operation that created the message. - * - * @param op The operation that created the message - */ - void setOperation(Operation op); - - /** - * Returns a list of objects that are contained in the message header - * - * @return - */ - Map getHeaders(); - - /** - * Returns the binding context in force for this message - */ - T getBindingContext(); - - /** - * Set the binding context that is in force for this message - * @param bindingContext - */ - void setBindingContext(T bindingContext); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java deleted file mode 100644 index 711c09728b..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.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.invocation; - - -/** - * A factory for messages - * - * @version $Rev $Date$ - * @tuscany.spi.extension.asclient - */ -public interface MessageFactory { - - /** - * Creates a new message. - * - * @return The new message - */ - Message createMessage(); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java deleted file mode 100644 index 4f81b763c7..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.invocation; - -/** - * Tuscany built-in phases for the invocation chain. The phases are organized - * here such that a message passing from reference component implementation to - * service component implementation passes through the phases from top to bottom - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface Phase { - - // Reference operation chains - - String REFERENCE = "component.reference"; // The first phase for outgoing invocations via a reference - String REFERENCE_INTERFACE = "reference.interface"; // data transformation and validation - String REFERENCE_POLICY = "reference.policy"; // reference policy handling - String REFERENCE_BINDING = "reference.binding"; // reference binding invoker - - // Reference binding chain - - String REFERENCE_BINDING_WIREFORMAT = "reference.binding.wireformat"; - String REFERENCE_BINDING_POLICY = "reference.binding.policy"; - String REFERENCE_BINDING_TRANSPORT = "reference.binding.transport"; - - // Service binding chain - - String SERVICE_BINDING_TRANSPORT = "service.binding.transport"; - String SERVICE_BINDING_OPERATION_SELECTOR = "service.binding.operationselector"; - String SERVICE_BINDING_WIREFORMAT = "service.binding.wireformat"; - String SERVICE_BINDING_POLICY = "service.binding.policy"; - - // Service operation chains - - String SERVICE_BINDING = "service.binding"; // The first phase for incoming invocations via a service - String SERVICE_INTERFACE = "service.interface"; // data validation and transformation - String SERVICE_POLICY = "service.policy"; // service policy handling - String SERVICE = "component.service"; // TODO: not sure if we need to have this phase - String IMPLEMENTATION_POLICY = "implementation.policy"; // implementation policy handling - String IMPLEMENTATION = "component.implementation"; // implementation invoker -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/PhasedInterceptor.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/PhasedInterceptor.java deleted file mode 100644 index f77a662779..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/PhasedInterceptor.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.invocation; - -/** - * An interceptor that is designated to be a given phase - * @tuscany.spi.extension.inheritfrom - */ -public interface PhasedInterceptor extends Interceptor { - /** - * Get the name of the phase that this interceptor is positioned - * @return - */ - String getPhase(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ConfigAttributes.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ConfigAttributes.java deleted file mode 100644 index 7d20ec7fc0..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ConfigAttributes.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.management; - -import java.util.Map; - -public interface ConfigAttributes { - Map getAttributes(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java deleted file mode 100644 index 3887db4873..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.management; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * Interface for the management service abstraction. The implementation - * could be based on a variety of technologies including JMX, WSDM, - * SNMP etc. - * - * @version $Revision$ $Date$ - */ -public interface ManagementService { - - /** - * Registers a component for management. - * - * @param name Name of the component. - * @param component Component to be registered. - */ - void registerComponent(String name, RuntimeComponent component); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BaseBindingImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BaseBindingImpl.java deleted file mode 100644 index 3d47bd22f0..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BaseBindingImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.provider; - -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; - -/** - * Base abstract impl for a binding model. - */ -public abstract class BaseBindingImpl implements Binding { - - private String name; - private String uri; - private boolean unresolved; - private OperationSelector operationSelector; - private WireFormat requestWireFormat; - private WireFormat responseWireFormat; - - public String getName() { - return name; - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean unresolved) { - this.unresolved = unresolved; - } - - public abstract QName getType(); - - public WireFormat getRequestWireFormat() { - return requestWireFormat; - } - - public void setRequestWireFormat(WireFormat wireFormat) { - this.requestWireFormat = wireFormat; - } - - public WireFormat getResponseWireFormat() { - return responseWireFormat; - } - - public void setResponseWireFormat(WireFormat wireFormat) { - this.responseWireFormat = wireFormat; - } - - public OperationSelector getOperationSelector() { - return operationSelector; - } - - public void setOperationSelector(OperationSelector operationSelector) { - this.operationSelector = operationSelector; - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java deleted file mode 100644 index ab1b33ac3c..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.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.provider; - -import java.security.Policy; -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.PhasedInterceptor; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicyContainer; -import org.apache.tuscany.sca.policy.PolicyExpression; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.PolicySubject; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; -import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; - -/** - * Abstract base class for policy providers - * @tuscany.spi.extension.inheritfrom - */ -public abstract class BasePolicyProvider implements PolicyProvider { - protected Class policyType; - protected PolicySubject subject; - - protected BasePolicyProvider(Class policyType, PolicySubject subject) { - this.policyType = policyType; - this.subject = subject; - } - - protected List findPoliciesWithProvidedIntents(List intents) { - List applicablePolicySets = new ArrayList(); - List policySets = subject.getPolicySets(); - for ( PolicySet ps : policySets ) { - List provided = ps.getProvidedIntents(); - for ( Intent intent : intents ) { - if ( provided.contains(intent) ) { - applicablePolicySets.add(ps); - continue; - } - - } - } - return findPolicies(applicablePolicySets); - } - - protected List findPolicies() { - return findPolicies(subject.getPolicySets()); - } - - private List findPolicies(List policySets) { - List policies = new ArrayList(); - - for (PolicySet ps : policySets) { - for (Object p : ps.getPolicies()) { - if (policyType.isInstance(p)) { - policies.add(policyType.cast(p)); - } - - if (p instanceof PolicyExpression) { - PolicyExpression exp = (PolicyExpression)p; - if (policyType.isInstance(exp.getPolicy())) { - policies.add(policyType.cast(exp.getPolicy())); - } - - // TODO - some code to handle the case where the - // policy expression is a WS-Policy - // Experimental at the moment. - if (PolicyContainer.class.isInstance(exp.getPolicy())){ - Object policy = ((PolicyContainer)exp.getPolicy()).getChildPolicy(policyType); - if(policy != null){ - policies.add(policyType.cast(policy)); - } - } - } - } - } - return policies; - } - - protected List findPolicySets() { - List policies = new ArrayList(); - List policySets = subject.getPolicySets(); - for (PolicySet ps : policySets) { - for (Object p : ps.getPolicies()) { - if (policyType.isInstance(p)) { - policies.add(ps); - } - if (p instanceof PolicyExpression) { - PolicyExpression exp = (PolicyExpression)p; - if (policyType.isInstance(exp.getPolicy())) { - policies.add(ps); - } - } - } - } - return policies; - } - - protected PolicySet findPolicySet() { - List policySets = subject.getPolicySets(); - for (PolicySet ps : policySets) { - for (Object p : ps.getPolicies()) { - if (policyType.isInstance(p)) { - return ps; - } - if (p instanceof PolicyExpression) { - PolicyExpression exp = (PolicyExpression)p; - if (policyType.isInstance(exp.getPolicy())) { - return ps; - } - } - } - } - return null; - } - - protected String getContext() { - if (subject instanceof Endpoint) { - Endpoint endpoint = (Endpoint)subject; - return endpoint.getURI(); - } else if (subject instanceof EndpointReference) { - EndpointReference endpointReference = (EndpointReference)subject; - return endpointReference.getURI(); - } else if (subject instanceof Component) { - Component component = (Component)subject; - return component.getURI(); - } - return null; - } - - public void start() { - } - - public void stop() { - } - - public PhasedInterceptor createInterceptor(Operation operation) { - return null; - } - - public PhasedInterceptor createBindingInterceptor() { - return null; - } - - public void configureBinding(Object configuration){ - } - - protected InvocationChain getInvocationChain() { - if (subject instanceof RuntimeEndpoint) { - RuntimeEndpoint endpoint = (RuntimeEndpoint)subject; - List chains = endpoint.getInvocationChains(); - for (InvocationChain chain : chains) { - configure(chain, chain.getTargetOperation()); - } - - } else if (subject instanceof RuntimeEndpointReference) { - RuntimeEndpointReference endpointReference = (RuntimeEndpointReference)subject; - List chains = endpointReference.getInvocationChains(); - for (InvocationChain chain : chains) { - configure(chain, chain.getSourceOperation()); - } - } else if (subject instanceof RuntimeComponent) { - RuntimeComponent component = (RuntimeComponent)subject; - for (ComponentService s : component.getServices()) { - RuntimeComponentService service = (RuntimeComponentService)s; - for (Endpoint ep : service.getEndpoints()) { - List chains = ((RuntimeEndpoint)ep).getInvocationChains(); - for (InvocationChain chain : chains) { - configure(chain, chain.getTargetOperation()); - } - } - - } - } - return null; - } - - protected void configure(InvocationChain invocationChain, Operation operation) { - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingPolicyProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingPolicyProvider.java deleted file mode 100644 index 5f2e6bd315..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingPolicyProvider.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.invocation.PhasedInterceptor; - -/** - * TODO RRB experiment - * This is an experiment extension to try out the request response - * binding function - * @version $Rev$ $Date$ - */ -public interface BindingPolicyProvider extends PolicyProvider { - /** - * Create a binding interceptor - * @return An interceptor that realize the policySet - */ - PhasedInterceptor createBindingInterceptor(); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java deleted file mode 100644 index 36e34c11b7..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; -import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; - -/** - * A factory for creating the runtime artifacts that represent bindings. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface BindingProviderFactory extends ProviderFactory { - - /** - * Creates a new reference binding provider for the given endpoint reference - * - * @param endpointReference defines the component/reference/binding against which to create the provider - * @return The binding provider - */ - ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpointReference); - - /** - * Creates a new service binding provider for the given component and - * service. - * - * @param endpoint defines the component/service/binding against which to create the provider - * @return The binding provider - */ - ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java deleted file mode 100644 index 40b6275667..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import java.lang.reflect.Constructor; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.assembly.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.extensibility.ServiceDeclaration; -import org.apache.tuscany.sca.extensibility.ServiceDiscovery; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; -import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; - -/** - * Default implementation of a provider factory extension point. - * - * @version $Rev$ $Date$ - */ -public class DefaultProviderFactoryExtensionPoint implements ProviderFactoryExtensionPoint { - - private ExtensionPointRegistry registry; - private final Map, ProviderFactory> providerFactories = new HashMap, ProviderFactory>(); - private final List policyProviderFactories = new ArrayList(); - private boolean loaded; - - /** - * The default constructor. Does nothing. - * - */ - public DefaultProviderFactoryExtensionPoint(ExtensionPointRegistry registry) { - this.registry = registry; - } - - /** - * Add a provider factory. - * - * @param providerFactory The provider factory - */ - public void addProviderFactory(ProviderFactory providerFactory) { - if(providerFactory instanceof PolicyProviderFactory) { - policyProviderFactories.add((PolicyProviderFactory)providerFactory); - } - // Only add the 1st instance so that the ones with higher ranking with prevail - if (!providerFactories.containsKey(providerFactory.getModelType())) { - providerFactories.put(providerFactory.getModelType(), providerFactory); - } - } - - /** - * Remove a provider factory. - * - * @param providerFactory The provider factory - */ - public void removeProviderFactory(ProviderFactory providerFactory) { - if(providerFactory instanceof PolicyProviderFactory) { - policyProviderFactories.remove((PolicyProviderFactory)providerFactory); - } - providerFactories.remove(providerFactory.getModelType()); - } - - /** - * Returns the provider factory associated with the given model type. - * @param modelType A model type - * @return The provider factory associated with the given model type - */ - public ProviderFactory getProviderFactory(Class modelType) { - loadProviderFactories(); - - Class[] classes = modelType.getInterfaces(); - for (Class c : classes) { - ProviderFactory factory = providerFactories.get(c); - if (factory != null) { - return factory; - } - } - return providerFactories.get(modelType); - } - - public List getPolicyProviderFactories() { - loadProviderFactories(); - return policyProviderFactories; - } - - public

Collection

getProviderFactories(Class

factoryType) { - loadProviderFactories(); - List

factories = new ArrayList

(); - for (ProviderFactory pf : providerFactories.values()) { - if (factoryType.isInstance(pf)) { - factories.add(factoryType.cast(pf)); - } - } - return factories; - } - - /** - * Load provider factories declared under META-INF/services. - * @param registry - */ - private synchronized void loadProviderFactories() { - if (loaded) - return; - - loadProviderFactories(BindingProviderFactory.class); - loadProviderFactories(ImplementationProviderFactory.class); - loadProviderFactories(PolicyProviderFactory.class); - loadProviderFactories(WireFormatProviderFactory.class); - loadProviderFactories(OperationSelectorProviderFactory.class); - - loaded = true; - } - - /** - * Load provider factories declared under META-INF/services. - * @param registry - * @param factoryClass - * @return - */ - private List loadProviderFactories(Class factoryClass) { - - // Get the provider factory service declarations - Collection factoryDeclarations; - ServiceDiscovery serviceDiscovery = registry.getServiceDiscovery(); - try { - factoryDeclarations = serviceDiscovery.getServiceDeclarations(factoryClass.getName(), true); - } catch (Exception e) { - throw new IllegalStateException(e); - } - - List factories = new ArrayList(); - - for (ServiceDeclaration factoryDeclaration : factoryDeclarations) { - Map attributes = factoryDeclaration.getAttributes(); - - // Load an implementation provider factory - if (factoryClass == ImplementationProviderFactory.class) { - String modelTypeName = attributes.get("model"); - - // Create a provider factory wrapper and register it - ImplementationProviderFactory factory = - new LazyImplementationProviderFactory(registry, modelTypeName, factoryDeclaration); - addProviderFactory(factory); - factories.add(factory); - - } else if (factoryClass == BindingProviderFactory.class) { - - // Load a binding provider factory - String modelTypeName = attributes.get("model"); - - // Create a provider factory wrapper and register it - BindingProviderFactory factory = - new LazyBindingProviderFactory(registry, modelTypeName, factoryDeclaration); - addProviderFactory(factory); - factories.add(factory); - } else if (factoryClass == PolicyProviderFactory.class) { - // Load a policy provider factory - String modelTypeName = attributes.get("model"); - - // Create a provider factory wrapper and register it - PolicyProviderFactory factory = - new LazyPolicyProviderFactory(registry, modelTypeName, factoryDeclaration); - addProviderFactory(factory); - factories.add(factory); - } else if (factoryClass == WireFormatProviderFactory.class) { - - // Load a wire format provider factory - String modelTypeName = attributes.get("model"); - - // Create a provider factory wrapper and register it - WireFormatProviderFactory factory = - new LazyWireFormatProviderFactory(registry, modelTypeName, factoryDeclaration); - addProviderFactory(factory); - factories.add(factory); - } else if (factoryClass == OperationSelectorProviderFactory.class) { - - // Load a wire format provider factory - String modelTypeName = attributes.get("model"); - - // Create a provider factory wrapper and register it - OperationSelectorProviderFactory factory = - new LazyOperationSelectorProviderFactory(registry, modelTypeName, factoryDeclaration); - addProviderFactory(factory); - factories.add(factory); - } - } - return factories; - } - - /** - * A wrapper around an implementation provider factory allowing lazy - * loading and initialization of implementation providers. - */ - private static class LazyBindingProviderFactory implements BindingProviderFactory { - - private ExtensionPointRegistry registry; - private String modelTypeName; - private ServiceDeclaration factoryDeclaration; - private BindingProviderFactory factory; - private Class modelType; - - private LazyBindingProviderFactory(ExtensionPointRegistry registry, - String modelTypeName, - ServiceDeclaration factoryDeclaration) { - this.registry = registry; - this.modelTypeName = modelTypeName; - this.factoryDeclaration = factoryDeclaration; - } - - @SuppressWarnings("unchecked") - private BindingProviderFactory getFactory() { - if (factory == null) { - try { - Class factoryClass = - (Class)factoryDeclaration.loadClass(); - Constructor constructor = - factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return factory; - } - - @SuppressWarnings("unchecked") - public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpointReference) { - return getFactory().createReferenceBindingProvider(endpointReference); - } - - @SuppressWarnings("unchecked") - public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) { - return getFactory().createServiceBindingProvider(endpoint); - } - - public Class getModelType() { - if (modelType == null) { - try { - modelType = factoryDeclaration.loadClass(modelTypeName); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return modelType; - } - - } - - /** - * A wrapper around an implementation provider factory allowing lazy - * loading and initialization of implementation providers. - */ - private class LazyImplementationProviderFactory implements ImplementationProviderFactory { - - private ExtensionPointRegistry registry; - private String modelTypeName; - private ServiceDeclaration providerClass; - private ImplementationProviderFactory factory; - private Class modelType; - - private LazyImplementationProviderFactory(ExtensionPointRegistry registry, - String modelTypeName, - ServiceDeclaration providerClass) { - this.registry = registry; - this.modelTypeName = modelTypeName; - this.providerClass = providerClass; - } - - @SuppressWarnings("unchecked") - private ImplementationProviderFactory getFactory() { - if (factory == null) { - try { - Class factoryClass = - (Class)providerClass.loadClass(); - Constructor constructor = - factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return factory; - } - - @SuppressWarnings("unchecked") - public ImplementationProvider createImplementationProvider(RuntimeComponent component, - Implementation Implementation) { - return getFactory().createImplementationProvider(component, Implementation); - } - - public Class getModelType() { - if (modelType == null) { - try { - - modelType = providerClass.loadClass(modelTypeName); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return modelType; - } - - } - - /** - * A wrapper around an policy provider factory allowing lazy - * loading and initialization of policy providers. - */ - private class LazyPolicyProviderFactory implements PolicyProviderFactory { - private ExtensionPointRegistry registry; - private String modelTypeName; - private ServiceDeclaration providerClass; - private PolicyProviderFactory factory; - private Class modelType; - - private LazyPolicyProviderFactory(ExtensionPointRegistry registry, - String modelTypeName, - ServiceDeclaration providerClass) { - this.registry = registry; - this.modelTypeName = modelTypeName; - this.providerClass = providerClass; - } - - @SuppressWarnings("unchecked") - private PolicyProviderFactory getFactory() { - if (factory == null) { - try { - Class factoryClass = (Class)providerClass.loadClass(); - Constructor constructor = - factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return factory; - } - - public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component) { - return getFactory().createImplementationPolicyProvider(component); - } - - public PolicyProvider createReferencePolicyProvider(EndpointReference endpointReference) { - return getFactory().createReferencePolicyProvider(endpointReference); - } - - public PolicyProvider createServicePolicyProvider(Endpoint endpoint) { - return getFactory().createServicePolicyProvider(endpoint); - } - - public Class getModelType() { - if (modelType == null) { - try { - modelType = providerClass.loadClass(modelTypeName); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return modelType; - } - } - - /** - * A wrapper around a wire format provider factory allowing lazy - * loading and initialization of wire format providers. - */ - private class LazyWireFormatProviderFactory implements WireFormatProviderFactory { - - private ExtensionPointRegistry registry; - private String modelTypeName; - private ServiceDeclaration providerClass; - private WireFormatProviderFactory factory; - private Class modelType; - - private LazyWireFormatProviderFactory(ExtensionPointRegistry registry, - String modelTypeName, - ServiceDeclaration providerClass) { - this.registry = registry; - this.modelTypeName = modelTypeName; - this.providerClass = providerClass; - } - - @SuppressWarnings("unchecked") - private WireFormatProviderFactory getFactory() { - if (factory == null) { - try { - Class factoryClass = - (Class)providerClass.loadClass(); - Constructor constructor = - factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return factory; - } - - public WireFormatProvider createReferenceWireFormatProvider(RuntimeEndpointReference endpointReference){ - return getFactory().createReferenceWireFormatProvider(endpointReference); - } - - public WireFormatProvider createServiceWireFormatProvider(RuntimeEndpoint endpoint){ - return getFactory().createServiceWireFormatProvider(endpoint); - } - - public Class getModelType() { - if (modelType == null) { - try { - - modelType = providerClass.loadClass(modelTypeName); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return modelType; - } - } - - /** - * A wrapper around a operation selector provider factory allowing lazy - * loading and initialization of operation selector providers. - */ - private class LazyOperationSelectorProviderFactory implements OperationSelectorProviderFactory { - - private ExtensionPointRegistry registry; - private String modelTypeName; - private ServiceDeclaration providerClass; - private OperationSelectorProviderFactory factory; - private Class modelType; - - private LazyOperationSelectorProviderFactory(ExtensionPointRegistry registry, - String modelTypeName, - ServiceDeclaration providerClass) { - this.registry = registry; - this.modelTypeName = modelTypeName; - this.providerClass = providerClass; - } - - @SuppressWarnings("unchecked") - private OperationSelectorProviderFactory getFactory() { - if (factory == null) { - try { - Class factoryClass = - (Class)providerClass.loadClass(); - Constructor constructor = - factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return factory; - } - - public OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeEndpointReference endpointReference){ - return getFactory().createReferenceOperationSelectorProvider(endpointReference); - } - - public OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeEndpoint endpoint){ - return getFactory().createServiceOperationSelectorProvider(endpoint); - } - - public Class getModelType() { - if (modelType == null) { - try { - - modelType = providerClass.loadClass(modelTypeName); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return modelType; - } - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointAsyncProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointAsyncProvider.java deleted file mode 100644 index b74b1dd9a7..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointAsyncProvider.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.InvokerAsyncResponse; - - -/** - * TUSCANY-3783 - * - * Async related operations that are here rather than higher up - * while we develop them. - * - */ -public interface EndpointAsyncProvider extends EndpointProvider { - - /** - * TUSCANY-3801 - * Returns true if the service binding provider is natively able - * to dispatch async responses. - * - * @return true if the service provide support async operation natively - */ - boolean supportsNativeAsync(); - - /** - * TUSCANY-3801 - * Create an async response invoker. This is used when - * supportsNativeAsync = true so that the endpoint - * has somewhere to send the async response when it - * eventually returns from the implementation. - * - * @para operation - * @return the invoker that will dispatch the async response - */ - InvokerAsyncResponse createAsyncResponseInvoker(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointProvider.java deleted file mode 100644 index a25814234a..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - - -/** - * Defines the extra operation that service binding providers implement - * to configure the binding chain. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface EndpointProvider extends ServiceBindingProvider { - /** - * Configure the binding invocation chain - */ - void configure(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceAsyncProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceAsyncProvider.java deleted file mode 100644 index 044ba523b9..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceAsyncProvider.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.provider; - - -/** - * TUSCANY-3783 - * - * Async related operations that are here rather than higher up - * while we develop them. - * - */ -public interface EndpointReferenceAsyncProvider extends EndpointReferenceProvider { - - /** - * TUSCANY-3801 - * Returns true if the reference binding provider is natively able - * to receive async responses. - * - * @return true if the service provide support async operation natively - */ - boolean supportsNativeAsync(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceProvider.java deleted file mode 100644 index 209b057859..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceProvider.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - - -/** - * Defines the extra operation that reference binding providers implement - * to configure the binding chain. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface EndpointReferenceProvider extends ReferenceBindingProvider { - /** - * Configure the binding invocation chain - */ - void configure(); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationAsyncProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationAsyncProvider.java deleted file mode 100644 index 2941483ede..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationAsyncProvider.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.InvokerAsyncRequest; -import org.apache.tuscany.sca.invocation.InvokerAsyncResponse; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * TUSCANY-3786 - Possibly temporary interface to describe an - * async invocation. Need to make it work end to - * end before committing to this. - * - * A component implementation can implement this interface in order to tie - * into the Tuscany runtime to process asynchronous responses. - * - */ -public interface ImplementationAsyncProvider extends ImplementationProvider { - - /** - * TUSCANY-3801 - * Create an async invoker for the component implementation in the invocation - * chain. The invoker will be responsible for calling the implementation - * logic for the given component. The only real difference between this and - * createInvoker is that the Endpoint is passed in so that the invoker can - * engineer the async response - * - * @param service The component service - * @param operation The operation that the interceptor will handle - * @return An invoker that handles the invocation logic, null should be - * returned if no invoker is required - */ - InvokerAsyncRequest createAsyncInvoker(RuntimeComponentService service, Operation operation); - - /** - * TUSCANY-3801 - * Create an invoker for the asynchronous responses in the invocation - * chain. The invoker will be responsible for processing the async - * response including correlating it with the forward call using - * the MESAGE_ID that appears in the message header. - * - * @param service The component service - * @param operation The operation that the interceptor will handle - * @return An AsyncResponseHandler instance - */ - InvokerAsyncResponse createAsyncResponseInvoker(Operation operation); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java deleted file mode 100644 index 4e9fddb135..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.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.provider; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * A component implementation can implement this interface in order to tie - * into the Tuscany runtime - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface ImplementationProvider extends RuntimeProvider { - - /** - * Create an invoker for the component implementation in the invocation - * chain. The invoker will be responsible for calling the implementation - * logic for the given component. - * - * @param service The component service - * @param operation The operation that the interceptor will handle - * @return An invoker that handles the invocation logic, null should be - * returned if no invoker is required - */ - Invoker createInvoker(RuntimeComponentService service, Operation operation); - - /** - * For bindings that invoke one-way callback operations asynchronously, - * there is no need to perform a thread switch before calling the invoker. - * This method indicates whether the binding has this capability. - * - * @return true if the callback invoker is able to invoke one-way operations - * asynchronously, false if all invocations are synchronous - */ - boolean supportsOneWayInvocation(); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java deleted file mode 100644 index cfb06d9c70..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.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.provider; - -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * An interface for factories that create implementation providers. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface ImplementationProviderFactory extends ProviderFactory { - - /** - * Creates a new implementation provider for the given - * component. - * - * @param component The runtime component - * @param Implementation The implementation type - * @return The implementation provider - */ - ImplementationProvider createImplementationProvider(RuntimeComponent component, M Implementation); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java deleted file mode 100644 index c0346780d8..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.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.provider; - -import org.apache.tuscany.sca.invocation.Interceptor; - -/** - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface OperationSelectorProvider { - /** - * Create an interceptor for the operation selector - * @return An interceptor that realize the policySet - */ - Interceptor createInterceptor(); - - /** - * Get the phase that the interceptor should be added - * @return The phase that this interceptor belongs to - */ - String getPhase(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java deleted file mode 100644 index 43ea8d171b..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.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.provider; - -import org.apache.tuscany.sca.assembly.OperationSelector; -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; -import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; - -/** - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface OperationSelectorProviderFactory extends ProviderFactory { - /** - * Create wire format provider for a given reference binding - * @param endpointReference TODO - * @return - */ - OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeEndpointReference endpointReference); - - /** - * Create policy provider for a given service binding - * @param endpoint TODO - * @return - */ - OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeEndpoint endpoint); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OptimisingBindingProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OptimisingBindingProvider.java deleted file mode 100644 index 57c9b48349..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OptimisingBindingProvider.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.provider; - -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; - -/** - * Defines the extra operation that binding providers implement - * when they provide local optimisation of reference to service invocations - */ -public interface OptimisingBindingProvider { - /** - * Optimise the binding chain for a service endpoint - */ - void optimiseBinding( RuntimeEndpoint ep ); - -} // end interface OptimisingBindingProvider diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java deleted file mode 100644 index f2b59a7c54..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import java.util.List; - -import javax.xml.namespace.QName; - -/** - * This interface can be optionally implemented by the Binding or Implementation providers to - * indicate if they implement the policies in the binding/implementation provider. - * - * @version $Rev$ $Date$ - */ -public interface PolicyImplementor { - /** - * Get a list of policy names that are implemented by this policy implementor - * @return A list of policy names - */ - List getImplementedPolicies(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java deleted file mode 100644 index de0b62eecd..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.PhasedInterceptor; - -/** - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface PolicyProvider extends RuntimeProvider { - /** - * Create an interceptor for a given operation - * - * @param operation - * @return An interceptor that realizes the policySet - */ - PhasedInterceptor createInterceptor(Operation operation); - - /** - * Create a binding interceptor. The binding wire is - * not operation specific so an operation parameter - * isn't required - * - * @return An interceptor that realizes the policySet - */ - PhasedInterceptor createBindingInterceptor(); - - /** - * Give the provider an opportunity to affect the - * binding configuration if required - * - * @param configurationContext the configuration context of the - * binding that will be modified - */ - void configureBinding(Object configuration); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java deleted file mode 100644 index 134df1c37e..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface PolicyProviderFactory extends ProviderFactory { - /** - * Create policy provider for a given reference binding - * @param endpointReference The endpoint reference - * @return A policy provider for the endpoint reference - */ - PolicyProvider createReferencePolicyProvider(EndpointReference endpointReference); - - /** - * Create policy provider for a given service binding - * @param endpoint The endpoint - * @return A policy provider for the endpoint - */ - PolicyProvider createServicePolicyProvider(Endpoint endpoint); - - /** - * Create policy provider for a given component implementation - * @param component - * @return A policy provider for the implementation - */ - PolicyProvider createImplementationPolicyProvider(RuntimeComponent component); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java deleted file mode 100644 index 2102806881..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -/** - * A factory for runtime providers. - * - * @version $Rev$ $Date$ - */ -public interface ProviderFactory { - - /** - * The model type that this factory creates providers for. - * - * @return the model type - */ - Class getModelType(); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java deleted file mode 100644 index 75c5544aa3..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import java.util.Collection; -import java.util.List; - - -/** - * An extension point for provider factories. Holds all of the provider - * factories from loaded extension points. Allows a provider factory - * to be located based on a given model type. Hence the runtime can - * generate runtime artifacts from the in memory assembly model. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface ProviderFactoryExtensionPoint { - - - /** - * Add a provider factory. - * - * @param providerFactory The provider factory - */ - void addProviderFactory(ProviderFactory providerFactory); - - /** - * Remove a provider factory. - * - * @param providerFactory The provider factory - */ - void removeProviderFactory(ProviderFactory providerFactory); - - /** - * Returns the provider factory associated with the given model type. - * @param modelType A model type - * @return The provider factory associated with the given model type - */ - ProviderFactory getProviderFactory(Class modelType); - - /** - * Get a list of registered PolicyProviderFactory - * @return a list of registered PolicyProviderFactory - */ - List getPolicyProviderFactories(); - - /** - * Get a collection of provider factories by the factory type - * @param

- * @param factoryType The factory type such as BindingProviderFactory - * @return a collection of provider factories of the factory type - */ -

Collection

getProviderFactories(Class

factoryType); - - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java deleted file mode 100644 index ab864dba3f..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; - -/** - * A reference binding implementation can options implement this - * interface to tie into the Tuscany SCA runtime - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface ReferenceBindingProvider extends RuntimeProvider { - /** - * Create an invoker for the reference binding in the invocation chain. The - * invoker is responsible for making the outbound invocation over the - * binding protocol. - * - * @param operation The operation that the interceptor will handle - * @return An invoker that handles the invocation logic, null should be - * returned if no invoker is required - */ - Invoker createInvoker(Operation operation); - - /** - * Get the effective interface contract imposed by the binding. For example, - * it will be interface contract introspected from the WSDL portType used by - * the endpoint for a WebService binding. - * - * @return The effective interface contract, if null is returned, the - * interface contract for the component reference will be used - */ - InterfaceContract getBindingInterfaceContract(); - - /** - * For bindings that invoke one-way operations asynchronously, there is no - * need to perform a thread switch before calling the invoker. This method - * indicates whether the binding has this capability. - * - * @return true if the binding invoker is able to invoke one-way operations - * asynchronously, false if all invocations are synchronous - */ - boolean supportsOneWayInvocation(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/RuntimeProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/RuntimeProvider.java deleted file mode 100644 index 2afd44af31..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/RuntimeProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -/** - * The base interface for runtime providers that can be started or stoppped - */ -public interface RuntimeProvider { - /** - * This method will be invoked when the corresponding SCA component is started. - */ - void start(); - - /** - * This method will be invoked when the corresponding SCA component is stopped - */ - void stop(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/SCABindingMapper.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/SCABindingMapper.java deleted file mode 100644 index 706bf7d319..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/SCABindingMapper.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.provider; - -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; -import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; - -/** - * SCABindingMapper allows us to map binding.sca to any of the bindings available to the runtime - */ -public interface SCABindingMapper { - - /** - * Map an endpoint with binding.sca to an endpoint - * @param endpoint The endpoint for binding.sca - * @return The endpoint for the mapped binding - */ - public RuntimeEndpoint map(RuntimeEndpoint endpoint); - - /** - * Map an endpoint reference with binding.sca to an endpoint reference with the mapped binding - * @param endpointReference - * @return The endpoint reference for the mapped binding - */ - public RuntimeEndpointReference map(RuntimeEndpointReference endpointReference); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java deleted file mode 100644 index e7df45bfa8..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; - -/** - * A service binding can optionally implement this interface to tie - * into the Tuscany SCA runtime - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface ServiceBindingProvider extends RuntimeProvider { - - /** - * Get the effective interface contract imposed by the binding. For example, - * it will be interface contract introspected from the WSDL portType used by - * the endpoint for a WebService binding. - * - * @return The effective interface contract, if null is returned, the - * interface contract for the component service will be used - */ - InterfaceContract getBindingInterfaceContract(); - - /** - * For bindings that invoke one-way callback operations asynchronously, - * there is no need to perform a thread switch before calling the invoker. - * This method indicates whether the binding has this capability. - * - * @return true if the callback invoker is able to invoke one-way operations - * asynchronously, false if all invocations are synchronous - */ - boolean supportsOneWayInvocation(); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java deleted file mode 100644 index 674b708ef8..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.invocation.Interceptor; - -/** - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface WireFormatProvider { - - /** - * Set up the contract that describes the interface that - * is providing data to or accepting data from the - * wire format interceptor. The wire format's job - * is to translate between this interface contract and the - * format on the wire. The interface contract may be - * configured separately for request and response - * wire formats - * - * @return the wire format interface contract - */ - public InterfaceContract configureWireFormatInterfaceContract(InterfaceContract interfaceContract); - - /** - * Create an interceptor for the wire format - * @return An interceptor that realize the policySet - */ - Interceptor createInterceptor(); - - /** - * Get the phase that the interceptor should be added - * @return The phase that this interceptor belongs to - */ - String getPhase(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java deleted file mode 100644 index 3f629ddeef..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.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.provider; - -import org.apache.tuscany.sca.assembly.WireFormat; -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; -import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; - -/** - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface WireFormatProviderFactory extends ProviderFactory { - /** - * Create wire format provider for a given reference binding - * @param endpointReference The endpoint reference - * @return - */ - WireFormatProvider createReferenceWireFormatProvider(RuntimeEndpointReference endpointReference); - - /** - * Create policy provider for a given service binding - * @param endpoint TODO - * @return - */ - WireFormatProvider createServiceWireFormatProvider(RuntimeEndpoint endpoint); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActivationException.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActivationException.java deleted file mode 100644 index b015891e93..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActivationException.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.runtime; - - -/** - * Denotes an error starting the runtime - * - * @version $Rev$ $Date$ - */ -public class ActivationException extends Exception { - private static final long serialVersionUID = 8612661660934426123L; - - public ActivationException(String message) { - super(message); - } - - public ActivationException(Throwable cause) { - super(cause); - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActiveNodes.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActiveNodes.java deleted file mode 100644 index c3b6527181..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActiveNodes.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.runtime; - -import java.util.ArrayList; -import java.util.List; - -public class ActiveNodes { - - List activeNodes = new ArrayList(); - - public List getActiveNodes() { - return activeNodes; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistry.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistry.java deleted file mode 100644 index 3d9d2cb14c..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistry.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.runtime; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.logging.Logger; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Base; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.FactoryExtensionPoint; -import org.apache.tuscany.sca.core.LifeCycleListener; - -/** - * A replicated DomainRegistry based on Apache Tomcat Tribes - * @tuscany.spi.extension.inheritfrom - */ -public abstract class BaseDomainRegistry implements DomainRegistry, LifeCycleListener { - protected final static Logger logger = Logger.getLogger(BaseDomainRegistry.class.getName()); - - protected String domainRegistryURI; - protected String domainURI; - - protected List endpointreferences = new CopyOnWriteArrayList(); - protected List listeners = new CopyOnWriteArrayList(); - protected List contributionlisteners = new CopyOnWriteArrayList(); - protected ExtensionPointRegistry registry; - protected Map attributes; - - public BaseDomainRegistry(ExtensionPointRegistry registry, - Map attributes, - String domainRegistryURI, - String domainURI) { - this.registry = registry; - this.domainURI = domainURI; - this.domainRegistryURI = domainRegistryURI; - this.attributes = attributes; - } - - public abstract void addEndpoint(Endpoint endpoint); - - public void addEndpointReference(EndpointReference endpointReference) { - endpointreferences.add(endpointReference); - ((RuntimeEndpointReference)endpointReference).bind(registry, this); - logger.fine("Add endpoint reference - " + endpointReference); - } - - public void addEndpointListener(EndpointListener listener) { - listeners.add(listener); - } - - protected void endpointAdded(Endpoint endpoint) { - ((RuntimeEndpoint)endpoint).bind(registry, this); - for (EndpointListener listener : listeners) { - listener.endpointAdded(endpoint); - } - } - - protected void endpointRemoved(Endpoint endpoint) { - ((RuntimeEndpoint)endpoint).bind(registry, this); - for (EndpointListener listener : listeners) { - listener.endpointRemoved(endpoint); - } - } - - protected void endpointUpdated(Endpoint oldEp, Endpoint newEp) { - ((RuntimeEndpoint)newEp).bind(registry, this); - for (EndpointListener listener : listeners) { - listener.endpointUpdated(oldEp, newEp); - } - } - - public boolean isOutOfDate(EndpointReference endpointReference) { - return ! findEndpoint(endpointReference).contains(endpointReference.getTargetEndpoint()); - } - - public List findEndpoint(EndpointReference endpointReference) { - logger.fine("Find endpoint for reference - " + endpointReference); - - if (endpointReference.getReference() != null) { - Endpoint targetEndpoint = endpointReference.getTargetEndpoint(); - String uri = targetEndpoint.getURI(); - // [rfeng] This is a workaround to deal with the case that the endpoint URI doesn't have the - // service name to avoid confusion between structural URIs and service URIs - if (uri.indexOf('#') == -1) { - uri = uri + "#service()"; - } - return findEndpoint(uri); - } - - return new ArrayList(); - } - - public abstract List findEndpoint(String uri); - - public List findEndpointReference(Endpoint endpoint) { - return endpointreferences; - } - - /** - * Returns a list of EndpointReferences that have a URI that matches a given URI - * @param uri - the URI to match - * @return a List of EndpointReferences that match the supplied URI - if there are none - * an *empty* list is returned (not null) - */ - public List findEndpointReferences( String uri ) { - List theRefs = new ArrayList(); - if( uri == null ) return theRefs; - - for( EndpointReference ref : endpointreferences ) { - if( uri.equals(ref.getURI()) ) theRefs.add(ref); - } // end for - - return theRefs; - } // end method findEndpointReference - - public abstract Endpoint getEndpoint(String uri); - - public List getEndpointReferences() { - return endpointreferences; - } - - public abstract Collection getEndpoints(); - - public List getListeners() { - return listeners; - } - - public abstract void removeEndpoint(Endpoint endpoint); - - public void removeEndpointReference(EndpointReference endpointReference) { - endpointreferences.remove(endpointReference); - logger.fine("Remove endpoint reference - " + endpointReference); - } - - public void removeEndpointListener(EndpointListener listener) { - listeners.remove(listener); - } - - public String getDomainURI() { - return domainRegistryURI; - } - - public String getDomainName() { - return domainURI; - } - - public void addContributionListener(ContributionListener listener) { - contributionlisteners.add(listener); - } - - public void removeContributionListener(ContributionListener listener) { - contributionlisteners.remove(listener); - } - - public Composite getDomainComposite() { - FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class); - AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class); - Composite domainComposite = assemblyFactory.createComposite(); - domainComposite.setName(new QName(Base.SCA11_TUSCANY_NS, getDomainName())); - domainComposite.setAutowire(false); - domainComposite.setLocal(false); - List domainIncludes = domainComposite.getIncludes(); - Map> runningCompositeURIs = getRunningCompositeURIs(); - for (String curi : runningCompositeURIs.keySet()) { - for (String compositeURI : runningCompositeURIs.get(curi)) { - domainIncludes.add(getRunningComposite(curi, compositeURI)); - } - } - return domainComposite; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistryFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistryFactory.java deleted file mode 100644 index ce38eb4eee..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistryFactory.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.runtime; - -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.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.LifeCycleListener; - -/** - * The utility responsible for finding the endpoint regstry by the scheme and creating instances for the - * given domain - * @tuscany.spi.extension.inheritfrom - */ -public abstract class BaseDomainRegistryFactory implements DomainRegistryFactory, LifeCycleListener { - protected ExtensionPointRegistry registry; - protected Map domainRegistries = new ConcurrentHashMap(); - protected List listeners = new ArrayList(); - - /** - * @param extensionRegistry - */ - public BaseDomainRegistryFactory(ExtensionPointRegistry registry) { - super(); - this.registry = registry; - } - - public void start() { - } - - public synchronized DomainRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI) { - if (endpointRegistryURI == null) { - endpointRegistryURI = domainURI; - } - - Object key = getKey(endpointRegistryURI, domainURI); - - DomainRegistry domainRegistry = domainRegistries.get(key); - if (domainRegistry != null) { - return domainRegistry; - } - - domainRegistry = createEndpointRegistry(endpointRegistryURI, domainURI); - - if (domainRegistry instanceof LifeCycleListener) { - ((LifeCycleListener)domainRegistry).start(); - } - - for (EndpointListener listener : listeners) { - domainRegistry.addEndpointListener(listener); - } - domainRegistries.put(key, domainRegistry); - return domainRegistry; - } - - protected Object getKey(String endpointRegistryURI, String domainURI) { - return endpointRegistryURI + "," + domainURI; - } - - protected abstract DomainRegistry createEndpointRegistry(String endpointRegistryURI, String domainURI); - - public void stop() { - for (DomainRegistry domainRegistry : domainRegistries.values()) { - if (domainRegistry instanceof LifeCycleListener) { - ((LifeCycleListener)domainRegistry).stop(); - } - } - domainRegistries.clear(); - listeners.clear(); - } - - public synchronized Collection getEndpointRegistries() { - return new ArrayList(domainRegistries.values()); - } - - public synchronized void addListener(EndpointListener listener) { - listeners.add(listener); - for (DomainRegistry registry : domainRegistries.values()) { - registry.addEndpointListener(listener); - } - } - - public synchronized List getListeners() { - return listeners; - } - - public synchronized void removeListener(EndpointListener listener) { - listeners.remove(listener); - for (DomainRegistry registry : domainRegistries.values()) { - registry.removeEndpointListener(listener); - } - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java deleted file mode 100644 index d9bdc2b6f6..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.context.CompositeContext; - -/** - * Start/stop a composite - * - * @version $Rev$ $Date$ - */ -public interface CompositeActivator { - /** - * Activate a composite - * @param compositeContext The context of the Node - * @param composite - */ - void activate(CompositeContext compositeContext, Composite composite) throws ActivationException; - - /** - * Activate a component reference - * @param compositeContext The context of the Node - * @param component - * @param ref - */ - void activate(CompositeContext compositeContext, RuntimeComponent component, RuntimeComponentReference ref); - - /** - * Activate a component reference - * @param compositeContext The context of the Node - * @param component - * @param ref - */ - void activate(CompositeContext compositeContext, RuntimeComponent component, RuntimeComponentService service); - - /** - * De-activate a component reference - * @param component - * @param ref - */ - void deactivate(RuntimeComponent component, RuntimeComponentReference ref); - - /** - * De-activate a component reference - * @param component - * @param ref - */ - void deactivate(RuntimeComponent component, RuntimeComponentService service); - - /** - * Stop a composite - * @param composite - */ - void deactivate(Composite composite) throws ActivationException; - - /** - * Start a component reference - * @param compositeContext The context of the Node - * @param component - * @param ref - */ - void start(CompositeContext compositeContext, RuntimeComponent component, RuntimeComponentReference ref); - - - /** - * Start a component - * @param component - */ - void start(CompositeContext compositeContext, Component component) throws ActivationException; - - /** - * Stop a component - * @param component - */ - void stop(CompositeContext compositeContext, Component component) throws ActivationException; - - /** - * Start components in a composite - * @param composite - */ - void start(CompositeContext compositeContext, Composite composite) throws ActivationException; - - /** - * Stop components in a composite - * @param composite - */ - void stop(CompositeContext compositeContext, Composite composite) throws ActivationException; - - /** - * Activate an endpoint - * @param compositeContext - * @param endpoint - */ - void activate(CompositeContext compositeContext, RuntimeEndpoint endpoint); - - /** - * Activate an endpoint reference - * @param compositeContext - * @param endpointReference - */ - void activate(CompositeContext compositeContext, RuntimeEndpointReference endpointReference); - - /** - * Deactivate an endpoint - * @param endpoint - */ - void deactivate(RuntimeEndpoint endpoint); - - /** - * Deactivate an endpoint reference - * @param endpointReference - */ - void deactivate(RuntimeEndpointReference endpointReference); - - /** - * Start an endpoint - * @param compositeContext - * @param endpoint - */ - void start(CompositeContext compositeContext, RuntimeEndpoint endpoint); - - /** - * Start an endpoint reference - * @param compositeContext - * @param endpointReference - */ - void start(CompositeContext compositeContext, RuntimeEndpointReference endpointReference); - - /** - * Stop an endpoint - * @param endpoint - */ - void stop(RuntimeEndpoint endpoint); - - /** - * Stop an endpoint reference - * @param endpointReference - */ - void stop(RuntimeEndpointReference endpointReference); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionDescription.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionDescription.java deleted file mode 100644 index 6ddffb06da..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionDescription.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.io.File; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.Export; -import org.apache.tuscany.sca.contribution.Import; -import org.apache.tuscany.sca.contribution.java.JavaExport; -import org.apache.tuscany.sca.contribution.java.JavaImport; -import org.apache.tuscany.sca.contribution.namespace.NamespaceExport; -import org.apache.tuscany.sca.contribution.namespace.NamespaceImport; - -public class ContributionDescription implements Serializable { - private static final long serialVersionUID = 1L; - - private String uri; - private String url; - private List dependentContributionURIs = new ArrayList(); - - // the URIs of the deployable composites within the contribution - private List deployables = new ArrayList(); - - // TODO: Handle Imports and Exports in a more extensible way - private List javaExports = new ArrayList(); - private List namespaceExports = new ArrayList(); - private List javaImports = new ArrayList(); - private List namespaceImports = new ArrayList(); - - // the URI and XML content of composites to include in the contribution - private Map additionalDeployables = new HashMap(); - - public ContributionDescription(String url) { - this(null, url); - } - public ContributionDescription(String uri, String url) { - this.url = url; - this.uri = uri; - if (uri == null || uri.length() < 1) { - this.uri = deriveContributionURI(url); - } - } - - public String getURI() { - return uri; - } - public String getURL() { - return url; - } - public List getDeployables() { - return deployables; - } - public void setDeployables(List deployables) { - this.deployables = deployables; - } - public List getDependentContributionURIs() { - return dependentContributionURIs; - } - public Map getAdditionalDeployables() { - return additionalDeployables; - } - public List getJavaExports() { - return javaExports; - } - public List getNamespaceExports() { - return namespaceExports; - } - public List getJavaImports() { - return javaImports; - } - public List getNamespaceImports() { - return namespaceImports; - } - - public void configureMetaData(Contribution contribution) { - - if (contribution.getDeployables() != null) { - for (Composite composite : contribution.getDeployables()) { - getDeployables().add(composite.getURI()); - } - } - - if (contribution.getExports() != null) { - for (Export export : contribution.getExports()) { - // TODO: Handle these and others in a more extensible way - if (export instanceof JavaExport) { - getJavaExports().add(((JavaExport)export).getPackage()); - } else if (export instanceof NamespaceExport) { - getNamespaceExports().add(((NamespaceExport)export).getNamespace()); - } - } - } - - if (contribution.getImports() != null) { - for (Import imprt : contribution.getImports()) { - // TODO: Handle these and others in a more extensible way - if (imprt instanceof JavaImport) { - getJavaImports().add(((JavaImport)imprt).getPackage()); - } else if (imprt instanceof NamespaceImport) { - getNamespaceImports().add(((NamespaceImport)imprt).getNamespace()); - } - } - } - } - - /** - * Derives a URI for the contribution based on its URL - */ - protected String deriveContributionURI(String contributionURL) { - String uri = null; - try { - File f = new File(contributionURL); - if ("classes".equals(f.getName()) && "target".equals(f.getParentFile().getName())) { - uri = f.getParentFile().getParentFile().getName(); - } else { - uri = f.getName(); - } - } catch (Exception e) { - // ignore - } - if (uri == null) { - uri = contributionURL; - } - if (uri.endsWith(".zip") || uri.endsWith(".jar")) { - uri = uri.substring(0, uri.length() - 4); - } - if (uri.endsWith("SNAPSHOT")) { - uri = uri.substring(0, uri.lastIndexOf('-')); - uri = uri.substring(0, uri.lastIndexOf('-')); - } - return uri; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java deleted file mode 100644 index d1eba27a79..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.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.runtime; - -import java.util.EventListener; - -public interface ContributionListener extends EventListener { - - void contributionRemoved(String uri); - - void contributionUpdated(String uri); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultDomainRegistryFactoryExtensionPoint.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultDomainRegistryFactoryExtensionPoint.java deleted file mode 100644 index f74d80b882..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultDomainRegistryFactoryExtensionPoint.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.LifeCycleListener; -import org.apache.tuscany.sca.extensibility.ServiceDeclaration; -import org.apache.tuscany.sca.extensibility.ServiceHelper; -import org.oasisopen.sca.ServiceRuntimeException; - -/** - * Default implementation of DomainRegistryFactoryExtensionPoint - */ -public class DefaultDomainRegistryFactoryExtensionPoint implements DomainRegistryFactoryExtensionPoint, - LifeCycleListener { - private ExtensionPointRegistry registry; - private boolean loaded; - private List factories = new ArrayList(); - private Map domainRegistryMapping = new HashMap(); - - /** - * @param registry - */ - public DefaultDomainRegistryFactoryExtensionPoint(ExtensionPointRegistry registry, Map attributes) { - super(); - this.registry = registry; - // Populate the domainRegistryMapping - domainRegistryMapping.putAll(attributes); - domainRegistryMapping.remove("class"); - domainRegistryMapping.remove("ranking"); - } - - public void addDomainRegistryFactory(DomainRegistryFactory factory) { - ServiceHelper.start(factory); - factories.add(factory); - } - - public List getDomainRegistryFactories() { - load(); - return factories; - } - - private synchronized void load() { - if (loaded) { - return; - } - try { - Collection declarations = - registry.getServiceDiscovery().getServiceDeclarations(DomainRegistryFactory.class, true); - for (ServiceDeclaration declaration : declarations) { - DomainRegistryFactory factory = ServiceHelper.newInstance(registry, declaration); - addDomainRegistryFactory(factory); - } - } catch (Exception e) { - throw new ServiceRuntimeException(e); - } finally { - loaded = true; - } - } - - public void removeDomainRegistryFactory(DomainRegistryFactory factory) { - if (factories.remove(factory)) { - ServiceHelper.stop(factory); - } - - } - - public void start() { - // Empty - } - - public void stop() { - ServiceHelper.stop(factories); - } - - public Map getDomainRegistryMapping() { - return domainRegistryMapping; - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java deleted file mode 100644 index 283d1d1a8b..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.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.runtime; - -import java.lang.reflect.Constructor; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.LifeCycleListener; -import org.apache.tuscany.sca.extensibility.ServiceDeclaration; -import org.apache.tuscany.sca.extensibility.ServiceDiscovery; - -/** - * The default implementation of a WireProcessorExtensionPoint - * - * @version $Rev$ $Date$ - */ -public class DefaultWireProcessorExtensionPoint implements RuntimeWireProcessorExtensionPoint, LifeCycleListener { - private ExtensionPointRegistry registry; - private boolean loaded; - - /** - * @param registry - */ - public DefaultWireProcessorExtensionPoint(ExtensionPointRegistry registry) { - super(); - this.registry = registry; - } - - /** - * The list of WireProcessors available to the runtime - */ - private final List processors = new ArrayList(); - - /** - * Registers a wire-processor in the runtime - * - * @param processor The processor to register - */ - public void addWireProcessor(RuntimeWireProcessor processor) { - processors.add(processor); - if (processor instanceof LifeCycleListener) { - ((LifeCycleListener)processor).start(); - } - } - - /** - * De-registers a wire-processor in the runtime - * - * @param processor The processor to de-register - */ - public void removeWireProcessor(RuntimeWireProcessor processor) { - boolean found = processors.remove(processor); - if (found && (processor instanceof LifeCycleListener)) { - ((LifeCycleListener)processor).stop(); - } - } - - /** - * Returns a list of registered wire-processors. - * - * @return The list of wire processors - */ - public List getWireProcessors() { - loadWireProcessors(); - return processors; - } - - private synchronized void loadWireProcessors() { - if (loaded) { - return; - } - try { - Collection sds = - registry.getServiceDiscovery().getServiceDeclarations(RuntimeWireProcessor.class, true); - for (ServiceDeclaration sd : sds) { - Class type = sd.loadClass(); - Constructor constructor = null; - RuntimeWireProcessor processor = null; - try { - constructor = type.getConstructor(ExtensionPointRegistry.class); - processor = (RuntimeWireProcessor)constructor.newInstance(registry); - - } catch (NoSuchMethodException e) { - constructor = type.getConstructor(); - processor = (RuntimeWireProcessor)constructor.newInstance(); - } - if (processor != null) { - addWireProcessor(processor); - } - } - loaded = true; - } catch (Throwable e) { - throw new IllegalStateException(e); - } - } - - public void start() { - } - - public void stop() { - for (RuntimeWireProcessor processor : processors) { - if ((processor instanceof LifeCycleListener)) { - ((LifeCycleListener)processor).stop(); - } - } - processors.clear(); - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java deleted file mode 100644 index c33d3c1a4b..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.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.runtime; - -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; - -/** - * The DomainRegistry holds the active service endpoints for the SCA domain - * @tuscany.spi.extension.inheritfrom - */ -public interface DomainRegistry { - /** - * Add an enpoint to the registry. If the endpoint URI is the same as an existing endpoint in the registry, - * the existing one will be updated - * @param endpoint - */ - void addEndpoint(Endpoint endpoint); - - /** - * Remove an enpoint from the registry - * @param endpoint - */ - void removeEndpoint(Endpoint endpoint); - - /** - * Look up an enpoint from the registry - * @param uri The endpoint URI - * @return - */ - Endpoint getEndpoint(String uri); - - /** - * Get all endpoints in the registry - * @return - */ - Collection getEndpoints(); - - List findEndpoint(String uri); - List findEndpoint(EndpointReference endpointReference); - - void addEndpointReference(EndpointReference endpointReference); - void removeEndpointReference(EndpointReference endpointReference); - // List findEndpointReference(Endpoint endpoint); - List getEndpointReferences(); - - boolean isOutOfDate(EndpointReference endpointReference); - - /** - * Returns a list of EndpointReferences that have a URI that matches a given URI - * @param uri - the URI to match - * @return a List of EndpointReferences that match the supplied URI - if there are none - * an *empty* list is returned (not null) - */ - public List findEndpointReferences( String uri ); - - void addEndpointListener(EndpointListener listener); - void removeEndpointListener(EndpointListener listener); - - String getDomainURI(); - String getDomainName(); - - void installContribution(ContributionDescription cd); - void uninstallContribution(String uri); - List getInstalledContributionURIs(); - ContributionDescription getInstalledContribution(String uri); - void updateInstalledContribution(ContributionDescription cd); - - void addContributionListener(ContributionListener listener); - void removeContributionListener(ContributionListener listener); - - void addRunningComposite(String contributionURI, Composite composite); - void removeRunningComposite(String contributionURI, String compositeURI); - Map> getRunningCompositeURIs(); - Composite getRunningComposite(String contributionURI, String compositeURI); - - String getContainingCompositesContributionURI(String componentName); - - List getNodeNames(); - String getLocalNodeName(); - String getRunningNodeName(String contributionURI, String compositeURI); - - String remoteCommand(String memberName, Callable command); - public Composite getDomainComposite(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java deleted file mode 100644 index 69ed07763e..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.util.Collection; - -/** - * A DomainRegistryFactory is responsible for creating an instance of the DomainRegistry for a given - * registry URI and domain URI - */ -public interface DomainRegistryFactory { - /** - * Get the DomainRegistry for the given registry URI and domain URI - * @param endpointRegistryURI A URI can be used to connect to the registry, such as vm://localhost - * or multicast://200.0.100.200:50000/... - * @param domainURI The domain URI - * @return - */ - DomainRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI); - - /** - * Return all active endpoint registries - * @return - */ - Collection getEndpointRegistries(); - - /** - * Add an EndpointListener - * @param listener - */ - void addListener(EndpointListener listener); - - /** - * Remove an EndpointListener - * @param listener - */ - void removeListener(EndpointListener listener); - - /** - * Return an array of schemes that this factory supports - * @return - */ - String[] getSupportedSchemes(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactoryExtensionPoint.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactoryExtensionPoint.java deleted file mode 100644 index f1582c3d70..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactoryExtensionPoint.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.runtime; - -import java.util.List; -import java.util.Map; - -/** - * Extension point for DomainRegistryFactory - */ -public interface DomainRegistryFactoryExtensionPoint { - /** - * Return a mapping between domain URI and domain registry URI - * @return A mutable map - */ - Map getDomainRegistryMapping(); - - /** - * Add a DomainRegistryFactory - * @param factory - */ - void addDomainRegistryFactory(DomainRegistryFactory factory); - - /** - * Remove a DomainRegistryFactory - * @param factory - */ - void removeDomainRegistryFactory(DomainRegistryFactory factory); - - /** - * @return A list of DomainRegistryFactory - */ - List getDomainRegistryFactories(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryURI.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryURI.java deleted file mode 100644 index 6de0878383..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryURI.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.runtime; - -import java.net.URI; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -/** - * Utility to parse the config uri string. - * - * tuscany:[domainName]?listen=[port|ip:port]]&password=abc&multicast=[off|port|ip:port]&remotes=ip:port,ip:port,... - - * listen - defines the local bind address and port, it defaults to all network interfaces on port 14820 and if that port in use it will try incrementing by one till a free port is found. - * password - is the password other nodes must use to connect to this domain. The default is 'tuscany'. - * multicast - defines if multicast discovery is used and if so what multicast ip group and port is used. - * The default is multicast is off if remotes= is specified (only for now due to a Hazelcast limitation that is planned to be fixed), - * otherwise if remotes= is not specified then multicast defaults to 224.5.12.10:51482 - * remotes - a list of ipAddress:port for remote nodes - * - * @tuscany.spi.extension.asclient - * - */ -public class DomainRegistryURI { - - private String domainName = "default"; - private String bindAddress = null; // null means all network adapters - private int listenPort = 14820; - private String password = "tuscany"; - private boolean multicastDisabled = false; - private String multicastAddress = "224.5.12.10"; - private int multicastPort = 51482; - private List remotes = new ArrayList(); - private String uri; - - public DomainRegistryURI(String uri) { - this.uri = uri; - parseURI(uri); - } - - private void parseURI(String uri) { - if (uri.startsWith("tuscanyclient:")) { - uri = uri.replace("tuscanyclient:", "tuscany:"); - } - - if (!uri.startsWith("tuscany:")) { - throw new IllegalArgumentException("Config URI must start with 'tuscany:'"); - } - - // make it a URI so java.net.URI can be used to parse it - int i = uri.indexOf(":"); - if (uri.charAt("tuscany:".length()) != '/') { - uri = uri.replaceFirst(":", ":/"); - } - if (uri.charAt("tuscany:".length()+1) != '/') { - uri = uri.replaceFirst(":/", "://"); - } - URI configURI = URI.create(uri); - - this.domainName = configURI.getHost(); - - String query = configURI.getQuery(); - if (query != null && query.length() > 0) { - String[] params = query.split("&"); - Map paramMap = new HashMap(); - for (String param : params) { - paramMap.put(param.split("=")[0], param.split("=")[1]); - } - for (String name : paramMap.keySet()) { - String value = paramMap.get(name); - if ("listen".equals(name)) { - if (value.indexOf(":") == -1) { - this.listenPort = Integer.parseInt(value); - } else { - String[] addr = value.split(":"); - this.bindAddress = addr[0]; - this.listenPort = Integer.parseInt(addr[1]); - } - } else if ("multicast".equals(name)) { - if ("off".equalsIgnoreCase(value)) { - this.multicastDisabled = true; - } else { - if (value.indexOf(":") == -1) { - this.multicastAddress = value; - } else { - String[] addr = value.split(":"); - this.multicastAddress = addr[0]; - this.multicastPort = Integer.parseInt(addr[1]); - } - } - } else if ("password".equals(name)) { - this.password = value; - } else if ("remotes".equals(name)) { - String[] ips = value.split(","); - for (String ip : ips) { - if (ip.indexOf(":") == -1) { - remotes.add(ip + ":14820"); - } else { - remotes.add(ip); - } - } - if (paramMap.containsKey("multicast")) { -// throw new IllegalArgumentException("Cannot have multicast and remotes (for now)"); - } else { - this.multicastDisabled = true; - } - } - } - } - } - - public String getDomainName() { - return domainName; - } - - public String getBindAddress() { - return bindAddress; - } - - public int getListenPort() { - return listenPort; - } - - public String getPassword() { - return password; - } - - public boolean isMulticastDisabled() { - return multicastDisabled; - } - - public String getMulticastAddress() { - return multicastAddress; - } - - public int getMulticastPort() { - return multicastPort; - } - - public List getRemotes() { - return remotes; - } - - public String toString() { - return uri; - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java deleted file mode 100644 index 13d193c464..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.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.runtime; - -import java.util.EventListener; - -import org.apache.tuscany.sca.assembly.Endpoint; - -/** - * A listener for endpoint events - */ -public interface EndpointListener extends EventListener { - /** - * The method is invoked when a new endpoint is added to the registry - * @param endpoint - */ - void endpointAdded(Endpoint endpoint); - /** - * The method is invoked when an endpoint is removed the registry - * @param endpoint - */ - void endpointRemoved(Endpoint endpoint); - /** - * The method is invoked when an endpoint is updated in the registry - * @param oldEndpoint - * @param newEndpoint - */ - void endpointUpdated(Endpoint oldEndpoint, Endpoint newEndpoint); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java deleted file mode 100644 index 79e8dfc475..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.assembly.builder.BuilderContext; - -/** - * A utility responsible for resolving the endpoint reference against a matching endpoint published - * to the DomainRegistry - */ -public interface EndpointReferenceBinder { - - /** - * @param domainRegistry - * @param endpointReference - * @return - */ - void bindBuildTime(DomainRegistry domainRegistry, EndpointReference endpointReference, BuilderContext builderContext); - - - /** - * @param domainRegistry - * @param endpointReference - * @return - */ - void bindRunTime(DomainRegistry domainRegistry, EndpointReference endpointReference); - - /** - * - * @param domainRegistry - * @param endpointReference - * @return - */ - boolean isOutOfDate(DomainRegistry domainRegistry, EndpointReference endpointReference); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java deleted file mode 100644 index 981872fdfa..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.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.runtime; - -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; - -/** - * A utility to seralize/deserialize Endpoint/EndpointReference objects - */ -public interface EndpointSerializer { - EndpointReference readEndpointReference(String xml); - - String write(EndpointReference endpointReference); - - Endpoint readEndpoint(String xml); - - String write(Endpoint endpoint); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistryFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistryFactory.java deleted file mode 100644 index ddb4279a4e..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistryFactory.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.oasisopen.sca.ServiceRuntimeException; - -/** - * A delegating DomainRegistryFactory - */ -public class ExtensibleDomainRegistryFactory implements DomainRegistryFactory { - private final DomainRegistryFactoryExtensionPoint factories; - private String[] allSchemes; - private String defaultScheme = "vm"; - - public ExtensibleDomainRegistryFactory(ExtensionPointRegistry registry) { - this.factories = registry.getExtensionPoint(DomainRegistryFactoryExtensionPoint.class); - RuntimeProperties ps = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class); - if (ps.getProperties().containsKey("defaultScheme")) { - defaultScheme = ps.getProperties().getProperty("defaultScheme"); - } - - } - - public ExtensibleDomainRegistryFactory(DomainRegistryFactoryExtensionPoint factories) { - this.factories = factories; - } - - public static ExtensibleDomainRegistryFactory getInstance(ExtensionPointRegistry registry) { - UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); - return utilities.getUtility(ExtensibleDomainRegistryFactory.class); - } - - public void addListener(EndpointListener listener) { - for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) { - factory.addListener(listener); - } - } - - public Collection getEndpointRegistries() { - List registries = new ArrayList(); - for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) { - registries.addAll(factory.getEndpointRegistries()); - } - return registries; - } - - public DomainRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI) { - if (domainURI == null) { - domainURI = getDomainName(endpointRegistryURI); - } - if (endpointRegistryURI == null) { - endpointRegistryURI = factories.getDomainRegistryMapping().get(domainURI); - if (endpointRegistryURI == null) { - endpointRegistryURI = domainURI; - } - } - - String scheme = endpointRegistryURI == null ? null : URI.create(endpointRegistryURI).getScheme(); - if (scheme == null) { - - // See if there is a previously created registry for that domain - for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) { - for (DomainRegistry domainRegistry : factory.getEndpointRegistries()) { - if (domainRegistry.getDomainURI().equals(domainURI)) { - return domainRegistry; - } - } - } - - scheme = defaultScheme; - endpointRegistryURI = scheme + ":" + endpointRegistryURI; - } else { - scheme = scheme.toLowerCase(); - } - for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) { - String[] schemes = factory.getSupportedSchemes(); - if (schemes != null && Arrays.asList(schemes).contains(scheme)) { - DomainRegistry domainRegistry = factory.getEndpointRegistry(endpointRegistryURI, domainURI); - if (domainRegistry == null) { - continue; - } else { - return domainRegistry; - } - } - } - throw new ServiceRuntimeException("No DomainRegistry can support " + endpointRegistryURI); - } - - public void removeListener(EndpointListener listener) { - for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) { - factory.removeListener(listener); - } - } - - public synchronized String[] getSupportedSchemes() { - if (allSchemes == null) { - Set supportedSchemes = new HashSet(); - for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) { - String[] schemes = factory.getSupportedSchemes(); - if (schemes != null) { - supportedSchemes.addAll(Arrays.asList(schemes)); - } - } - allSchemes = supportedSchemes.toArray(new String[supportedSchemes.size()]); - } - return allSchemes; - } - - /** - * Derive a domain name from a domain URI - * Examples: - * Domain URI - Domain Name - * default default - * foo foo - * uri:foo foo - * uri://foo?key=x&key2=y foo - * uri://foo/bar foo/bar - */ - private static String getDomainName(String domainURI) { - int scheme = domainURI.indexOf(':'); - int qm = domainURI.indexOf('?'); - if (qm == -1) { - return domainURI.substring(scheme+1); - } else { - return domainURI.substring(scheme+1, qm); - } - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java deleted file mode 100644 index 78a87191de..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.lang.reflect.InvocationTargetException; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.Contract; -import org.apache.tuscany.sca.context.CompositeContext; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.provider.PolicyProvider; - -/** - * The abstraction of an invocable model that contains invocation chains - * @tuscany.spi.extension.asclient - */ -public interface Invocable { - /** - * Bind the invocable to the composite context - * @param context - */ - void bind(CompositeContext context); - - /** - * Bind the invocable to the extension point registry and endpoint registry. This is typically - * called after the endpoint or endpoint reference is deserialized - * @param registry - * @param domainRegistry - */ - void bind(ExtensionPointRegistry registry, DomainRegistry domainRegistry); - - /** - * Get the associated composite context - * @return - */ - CompositeContext getCompositeContext(); - - /** - * Unbind the invocable from the composite context - */ - void unbind(); - - /** - * Get the component - * @return - */ - Component getComponent(); - - /** - * Get the service or reference (contract) - * @return - */ - Contract getContract(); - - /** - * Get the binding - * @return - */ - Binding getBinding(); - - /** - * Returns the invocation chains for service operations associated with the - * wire - * - * @return the invocation chains for service operations associated with the - * wire - */ - List getInvocationChains(); - - /** - * Lookup the invocation chain by operation - * @param operation The operation - * @return The invocation chain for the given operation - */ - InvocationChain getInvocationChain(Operation operation); - - /** - * Get the invocation chain for the binding-specific handling - * @return The binding invocation chain - */ - InvocationChain getBindingInvocationChain(); - - /** - * This invoke method assumes that the binding invocation chain is in force - * and that there will be an operation selector element there to - * determine which operation to call - * @param msg The request message - * @return The response message - */ - Message invoke(Message msg); - - /** - * Invoke an operation with given arguments - * @param operation The operation - * @param args The arguments - * @return The result - * @throws InvocationTargetException - */ - Object invoke(Operation operation, Object[] args) throws InvocationTargetException; - - /** - * Invoke an operation with a context message - * @param operation The operation - * @param msg The request message - * @return The response message - * @throws InvocationTargetException - */ - Message invoke(Operation operation, Message msg); - - /** - * Asynchronously invoke an operation with a context message - * @param operation The operation - * @param msg The request message - * @return The ticket that can be used to identify this invocation - * @throws InvocationTargetException - */ - void invokeAsync(Operation operation, Message msg); - - /** - * Asynchronously invoke an operation with a context message - * This invoke method assumes that the binding invocation chain is in force - * and that there will be an operation selector element there to - * determine which operation to call - * @param msg The request message - */ - void invokeAsync(Message msg); - - /** - * Asynchronously invoke an operation with a context message - * @param tailInvoker the invoker at the end of the chain - * @param msg The request message - */ - void invokeAsyncResponse(Message msg); - - /** - * Get a list of policy providers - * @return - */ - List getPolicyProviders(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java deleted file mode 100644 index 928c77fd04..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.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.runtime; - -import org.apache.tuscany.sca.assembly.EndpointReference; - -/** - * Parameters for the EndPointReference - * - * @version $Rev$ $Date$ - */ -public interface ReferenceParameters extends Cloneable { - /** - * Get the callback ID - * @return the callbackID - */ - Object getCallbackID(); - - /** - * Set the callback ID - * @param callbackID the callbackID to set - */ - void setCallbackID(Object callbackID); - - /** - * Get the ID for the non-ServiceReference callback object - * @return - */ - Object getCallbackObjectID(); - - /** - * Set the ID for the non-ServiceReference callback object - * @param callbackObjectID - */ - void setCallbackObjectID(Object callbackObjectID); - - EndpointReference getCallbackReference(); - - void setCallbackReference(EndpointReference callback); - - Object clone() throws CloneNotSupportedException; -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java deleted file mode 100644 index 01b0111e59..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.provider.PolicyProvider; -import org.oasisopen.sca.ServiceReference; - -/** - * The runtime component interface. Provides the bridge between the - * assembly model representation of a component and its runtime - * realization. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface RuntimeComponent extends Component { - /** - * Set the implementation-specific configuration for this component - * @param implementationProvider The object that manages the component implementation - */ - void setImplementationProvider(ImplementationProvider implementationProvider); - - /** - * Get the implementation-specific configuration for this component - * @return The implementation provider for this component - */ - ImplementationProvider getImplementationProvider(); - - /** - * Get the associated component context - * @return - */ - RuntimeComponentContext getComponentContext(); - - /** - * Set the associated component context - * @param context - */ - void setComponentContext(RuntimeComponentContext context); - - /** - * Tests if the RuntimeComponent is started - * @return true if the RuntimeComponent is started otherwise false - */ - boolean isStarted(); - - /** - * Sets the RuntimeComponent started state - * @param started the state to set - */ - void setStarted(boolean started); - - /** - * Add a policy provider to the component - * @param policyProvider - */ - void addPolicyProvider(PolicyProvider policyProvider); - - /** - * Get a list of policy providers configured for this component - * @return - */ - List getPolicyProviders(); - - - /** - * Returns a ServiceReference for a service provided by the component - * - * @param businessInterface the interface that will be used to invoke the service - * @param serviceName the name of the service - * @param the Java type of the business interface for the service - * @return an object that implements the business interface - */ - ServiceReference getServiceReference(Class businessInterface, String name); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java deleted file mode 100644 index cf2042a0ae..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.context.CompositeContext; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.ServiceReference; - -/** - * @version $Rev$ $Date$ - */ -public interface RuntimeComponentContext extends ComponentContext { - - /** - * Get the CallableReference for a given component reference - * @param - * @param businessInterface The business interface - * @param endpointReference The endpointReference to be used - * @return A service reference representing the wire - */ - ServiceReference getServiceReference(Class businessInterface, - RuntimeEndpointReference endpointReference); - - - /** - * Create a CallableReference for the given component service - * @param - * @param businessInterface - * @param component - * @param service - * @return - */ - ServiceReference getServiceReference(Class businessInterface, RuntimeEndpoint endpoint); - - /** - * @param - * @param businessInterface - * @param service - * @return - */ - ServiceReference createSelfReference(Class businessInterface, ComponentService service); - - ExtensionPointRegistry getExtensionPointRegistry(); - - CompositeContext getCompositeContext(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java deleted file mode 100644 index 5dc114ade0..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.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.runtime; - -import org.apache.tuscany.sca.assembly.ComponentReference; - -/** - * The runtime component reference. Provides the bridge between the - * assembly model representation of a component reference and its runtime - * realization - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface RuntimeComponentReference extends ComponentReference { - /** - * Set the owning component - * @param component - */ - void setComponent(RuntimeComponent component); - - /** - * Get the owning component - * @return the owning component - */ - RuntimeComponent getComponent(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java deleted file mode 100644 index 1eefdc978e..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.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.runtime; - -import org.apache.tuscany.sca.assembly.ComponentService; - -/** - * The runtime component service. Provides the bridge between the - * assembly model representation of a component service and its runtime - * realization - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface RuntimeComponentService extends ComponentService { -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java deleted file mode 100644 index b45def3e95..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.io.Serializable; - -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.context.CompositeContext; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; - -/** - * The runtime representation of a service endpoint - * @tuscany.spi.extension.asclient - */ -public interface RuntimeEndpoint extends Endpoint, Invocable, Serializable { - /** - * Attach the service binding provider - * @param provider - */ - void setBindingProvider(ServiceBindingProvider provider); - - /** - * Get the service binding provider - * @return - */ - ServiceBindingProvider getBindingProvider(); - - /** - * Get the interface contract for the binding. This represents the data types that the binding - * protocol stack can process. - * @return The binding interface contract - */ - InterfaceContract getBindingInterfaceContract(); - - /** - * Get the interface contract of the service of the target component type, i.e., the - * componentType.service.interfaceContract. This represents the data types that the implementation - * code can process. - * @return The target component type service interface contract - */ - InterfaceContract getComponentTypeServiceInterfaceContract(); - - - /** - * Check that endpoint has compatible interface at the component and binding ends. - * The user can specify the interfaces at both ends so there is a danger that they won't be compatible. - */ - void validateServiceInterfaceCompatibility(); - - /** - * Get the composite context for the composite that contains this endpoint. This - * is useful for accessing various composite level objects from within the - * runtime code - */ - CompositeContext getCompositeContext(); - - /** - * Retrieve the normalized WSDL contract relating to the input WSDL contract - * - * @param interfaceContract - * @return - */ - public InterfaceContract getGeneratedWSDLContract(InterfaceContract interfaceContract); - - /** - * Creates the async callback for this Endpoint, if it does not already exist - * and stores it into the Endpoint - */ - public void createAsyncServerCallback( ); - - /** - * Gets the async callback reference for this Endpoint, if it exists - * @return - */ - public RuntimeEndpointReference getAsyncServerCallback(); - - /** - * Get/Set the endpoint that this endpoint delegates to. This only - * comes into play when this endpoint is configured with an SCA bindng - */ - RuntimeEndpoint getDelegateEndpoint(); - void setDelegateEndpoint(RuntimeEndpoint delegateEndpoint); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java deleted file mode 100644 index dbdd458543..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.io.Serializable; - -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; - -/** - * The runtime representation of an endpoint reference - * @tuscany.spi.extension.asclient - */ -public interface RuntimeEndpointReference extends EndpointReference, Invocable, Serializable { - /** - * Set the reference binding provider for the endpoint reference - * @param provider The binding provider - */ - void setBindingProvider(ReferenceBindingProvider provider); - - /** - * Get the reference binding provider for the endpoint reference - * @return The binding provider - */ - ReferenceBindingProvider getBindingProvider(); - - /** - * Get the interface contract for the binding. This represents the data types that the binding - * protocol stack can process. - * @return The binding interface contract - */ - InterfaceContract getBindingInterfaceContract(); - - - /** - * Get the interface contract of the reference of the source component type, i.e., the - * componentType.reference.interfaceContract. This represents the data types that the - * implementation code uses to make the outbound call. - * @return The source component type reference interface contract - */ - InterfaceContract getComponentTypeReferenceInterfaceContract(); - - /** - * Check that endpoint reference has compatible interface at the component and binding ends. - * The user can specify the interfaces at both ends so there is a danger that they won't be compatible. - * There is checking in the activator but of course endpoint references may not have a binding assigned - * until final resolution. - */ - public void validateReferenceInterfaceCompatibility(); - - boolean isOutOfDate(); - void rebuild(); - boolean isStarted(); - - /** - * Retrieve the normalized WSDL contract relating to the input WSDL contract - * - * @param interfaceContract - * @return - */ - public InterfaceContract getGeneratedWSDLContract(InterfaceContract interfaceContract); - - /** - * Create the endpoint which will be the target of and asynchronous response to a - * message sent through this reference. We have the code here as this can't be done - * in the builders in the same was as callbacks are because we don't know the details - * of the endpoint until the endpoint reference has been resolved. - */ - public void createAsyncCallbackEndpoint(); - - /** - * Get/Set the endpoint reference that this endpoint reference delegates to. This only - * comes into play when this endpoint reference is configured with an SCA bindng - */ - RuntimeEndpointReference getDelegateEndpointReference(); - void setDelegateEndpointReference(RuntimeEndpointReference delegateEndpointReference); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeProperties.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeProperties.java deleted file mode 100644 index 0e02d2cd94..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeProperties.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.runtime; - -import java.util.Properties; -/** - * - * @tuscany.spi.extension.asclient - * - */ -public interface RuntimeProperties { - - /** - * When true log with Level.FINE instead of Level.INFO - */ - public static final String QUIET_LOGGING = "org.apache.tuscany.sca.quietLogging"; - - Properties getProperties(); - void setProperties(Properties properties); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java deleted file mode 100644 index 997e170b22..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.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.runtime; - -/** - * Implementations are called after wires are decorated with policy and before they are connected. - * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.inheritfrom - */ -public interface RuntimeWireProcessor { - /** - * Configure the runtime endpoint - * @param endpoint - */ - void process(RuntimeEndpoint endpoint); - - /** - * Configure the runtime endpoint reference - * @param endpointReference - */ - void process(RuntimeEndpointReference endpointReference); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java deleted file mode 100644 index 4b2c71b397..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.runtime; - -import java.util.List; - -/** - * Acts as a delegating WireProcessorExtensionPoint, delegating - * processing of wires after policies have been applied and source and targets - * have been connected. - * - * @version $Rev$ $Date$ - */ -public interface RuntimeWireProcessorExtensionPoint { - - /** - * Registers a wire-processor in the runtime - * - * @param processor The processor to register - */ - void addWireProcessor(RuntimeWireProcessor processor); - - /** - * De-registers a wire-processor in the runtime - * - * @param processor The processor to de-register - */ - void removeWireProcessor(RuntimeWireProcessor processor); - - /** - * Returns a list of registered wire-processors. - * - * @return The list of wire processors - */ - List getWireProcessors(); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/UnknownEndpointHandler.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/UnknownEndpointHandler.java deleted file mode 100644 index cfb205f489..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/UnknownEndpointHandler.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.runtime; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.EndpointReference; - -public interface UnknownEndpointHandler { - - Binding handleUnknownEndpoint(EndpointReference endpointReference); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Version.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Version.java deleted file mode 100644 index 5d3ed1ce41..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Version.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.util.ResourceBundle; - -public class Version { - - public static final String VERSION; - public static final String REVISION; - public static final String BUILDTIME; - static { - ResourceBundle rb = ResourceBundle.getBundle("org/apache/tuscany/sca/runtime/revision"); - VERSION = rb.getString("version"); - REVISION = rb.getString("revision"); - BUILDTIME = rb.getString("buildtime"); - } - - public static String getVersion() { - return VERSION; - } - - public static String getRevsion() { - return REVISION; - } - - public static String getBuildTime() { - return BUILDTIME; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java deleted file mode 100644 index d32af450ff..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.work; - -/** - * A callback interface that can be optionally used for registering - * interest in status of asynchronously scheduled unit of work. - * - * @version $Rev$ $Date$ - */ -public interface NotificationListener { - - /** - * Callback method when the unit of work is accepted. - * - * @param work Work that was accepted. - */ - void workAccepted(T work); - - /** - * Callback method when the unit of work is successfully completed. - * - * @param work Work that was successfully completed. - */ - void workCompleted(T work); - - /** - * Callback when the unit of work is started. - * - * @param work Unit of work that was started. - */ - void workStarted(T work); - - /** - * Callback when the unit of work is rejected. - * - * @param work Unit of work that was rejected. - */ - void workRejected(T work); - - /** - * Callback when the unit of work fails to complete. - * - * @param work Unit of work that failed to complete. - * @param error Error that caused the unit of work to fail. - */ - void workFailed(T work, Throwable error); - - - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java deleted file mode 100644 index f8a1ef4d23..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.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.work; - -import java.util.concurrent.ExecutorService; - -/** - * Defines the contract for scheduling asynchronous units of work. - * - *

- * Units of work can be scheduled with an optional NotificationListener. - * If a notification listener is specified, the caller will be notified regarding the - * status of the work. The unit of work can either be completed, rejected or completed - * with an error. If the work completed with an error, the caller is notified with the - * error details. - *

- * - * @version $Rev$ $Date$ - * @tuscany.spi.extension.asclient - */ -public interface WorkScheduler { - - /** - * Schedules a unit of work for future execution. The notification listener - * is used to register interest in callbacks regarding the status of the work. - * - * @param work The unit of work that needs to be asynchronously executed. - * @param listener Notification listener for callbacks. - */ - void scheduleWork(T work, NotificationListener listener); - - /** - * Schedules a unit of work for future execution. The notification listener - * is used to register interest in callbacks regarding the status of the work. - * - * @param work The unit of work that needs to be asynchronously executed. - */ - void scheduleWork(T work); - - /** - * Get the underlying getExecutorService - * @return - */ - ExecutorService getExecutorService(); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java deleted file mode 100644 index 18ec2dfeaa..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.work; - - -/** - * Exception thrown by the work scheduler in case of unexpected exceptions. - * - * @version $Rev$ $Date$ - * - * @version $Rev$ $Date$ - */ -public class WorkSchedulerException extends RuntimeException { - private static final long serialVersionUID = 1L; - - /** - * {@inheritDoc} - */ - public WorkSchedulerException() { - super(); - } - - /** - * {@inheritDoc} - */ - public WorkSchedulerException(String message, Throwable cause) { - super(message, cause); - } - - /** - * {@inheritDoc} - */ - public WorkSchedulerException(String message) { - super(message); - } - - /** - * {@inheritDoc} - */ - public WorkSchedulerException(Throwable cause) { - super(cause); - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ContextFactoryExtensionPoint b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ContextFactoryExtensionPoint deleted file mode 100644 index 454d1796cc..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ContextFactoryExtensionPoint +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -org.apache.tuscany.sca.context.DefaultContextFactoryExtensionPoint - diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint deleted file mode 100644 index 19cf2a444f..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -org.apache.tuscany.sca.provider.DefaultProviderFactoryExtensionPoint - diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactoryExtensionPoint b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactoryExtensionPoint deleted file mode 100644 index be585a1e03..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactoryExtensionPoint +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -org.apache.tuscany.sca.runtime.DefaultDomainRegistryFactoryExtensionPoint \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint deleted file mode 100644 index 1ab308cc71..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -org.apache.tuscany.sca.runtime.DefaultWireProcessorExtensionPoint - diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties deleted file mode 100644 index 9018bd1a1b..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties +++ /dev/null @@ -1,30 +0,0 @@ -# -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# - -#-- Don't edit these. They're updated from the build, see the -# buildnumber-maven-plugin in this modules pom.xml -version=@version@ -revision=@svnRevision@ -buildtime=@buildtime@ -#---------------------- - - - diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java deleted file mode 100644 index 6486a5ed4f..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.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.context; - -import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.junit.Assert; -import org.junit.Test; - -/** - * This test case will test the class - * org.apache.tuscany.sca.context.DefaultContextFactoryExtensionPoint - * - * $Date$ $Rev$ - */ -public class DefaultContextFactoryExtensionPointTestCase { - - /** - * Tests adding/getting/removing a factory with no interfaces - */ - @Test - public void testFactoryWithNoInterfaces() { - Object factory = new FactoryWithNoInterfaces(); - Class[] ifaces = {}; - addGetRemoveFactory(factory, ifaces); - } - - /** - * Tests adding/getting/removing a factory with one interface - */ - @Test - public void testFactoryWithOneInterface() { - Object factory = new FactoryWithOneInterface(); - Class[] ifaces = { FactoryOneInterface.class }; - addGetRemoveFactory(factory, ifaces); - } - - /** - * Tests adding/getting/removing a factory with two interfaces - */ - @Test - public void testFactoryWithTwoInterfaces() { - Object factory = new FactoryWithTwoInterfaces(); - Class[] ifaces = { FactoryTwoInterfacesA.class, FactoryTwoInterfacesB.class }; - addGetRemoveFactory(factory, ifaces); - } - - /** - * Tests having multiple factories registered - */ - @Test - public void testMultipleFactories() { - // Create new factories - FactoryWithOneInterface factory1 = new FactoryWithOneInterface(); - FactoryWithTwoInterfaces factory2 = new FactoryWithTwoInterfaces(); - - ExtensionPointRegistry registry = new DefaultExtensionPointRegistry(); - - // Register the factories - DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry); - ctxFactory.addFactory(factory1); - ctxFactory.addFactory(factory2); - - // Re-get each of the factories - FactoryOneInterface regotFactory1 = ctxFactory.getFactory(FactoryOneInterface.class); - Assert.assertNotNull(regotFactory1); - Assert.assertSame(factory1, regotFactory1); - FactoryTwoInterfacesA regotFactory2A = ctxFactory.getFactory(FactoryTwoInterfacesA.class); - Assert.assertNotNull(regotFactory2A); - Assert.assertSame(factory2, regotFactory2A); - FactoryTwoInterfacesB regotFactory2B = ctxFactory.getFactory(FactoryTwoInterfacesB.class); - Assert.assertNotNull(regotFactory1); - Assert.assertSame(factory2, regotFactory2B); - } - - /** - * Tests passing in null to addFactory() - */ - @Test - public void testAddingNullFactory() { - - ExtensionPointRegistry registry = new DefaultExtensionPointRegistry(); - DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry); - try { - ctxFactory.addFactory(null); - Assert.fail("Should have thrown IllegalArgumentException"); - } catch (IllegalArgumentException ex) { - // As expected - } - } - - /** - * Test passing in null to removeFactory() - */ - @Test - public void testRemovingNullFactory() { - ExtensionPointRegistry registry = new DefaultExtensionPointRegistry(); - DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry); - try { - ctxFactory.removeFactory(null); - Assert.fail("Should have thrown IllegalArgumentException"); - } catch (IllegalArgumentException ex) { - // As expected - } - } - - /** - * Test passing in null to getFactory() - */ - @Test - public void testGetNullFactory() { - ExtensionPointRegistry registry = new DefaultExtensionPointRegistry(); - DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry); - try { - ctxFactory.getFactory(null); - Assert.fail("Should have thrown IllegalArgumentException"); - } catch (IllegalArgumentException ex) { - // As expected - } - } - - /** - * Utility method for testing adding and removing a factory - * - * @param factory The factory class to test - * @param factoryInterfaces The list of interfaces implemented by the factory - */ - private void addGetRemoveFactory(Object factory, Class[] factoryInterfaces) { - ExtensionPointRegistry registry = new DefaultExtensionPointRegistry(); - DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry); - - // Make sure factory not already present - for (Class iface : factoryInterfaces) { - Assert.assertNull(ctxFactory.getFactory(iface)); - } - - // Add the factory - ctxFactory.addFactory(factory); - - // Make sure we can get the factory recently registered factory - for (Class iface : factoryInterfaces) { - Object regot = ctxFactory.getFactory(iface); - Assert.assertNotNull(regot); - Assert.assertSame(factory, regot); - } - - // Remove the factory - ctxFactory.removeFactory(factory); - - // Make sure factory is no longer registered - for (Class iface : factoryInterfaces) { - Assert.assertNull(ctxFactory.getFactory(iface)); - } - } - - /** - * Simple factory with no interfaces - */ - private class FactoryWithNoInterfaces { - } - - /** - * Simple interface for the factory with one interface - */ - private interface FactoryOneInterface { - } - - /** - * Simple factory with one interface - */ - private class FactoryWithOneInterface implements FactoryOneInterface { - } - - /** - * Simple interface for the factory with two interfaces - */ - private interface FactoryTwoInterfacesA { - } - - /** - * Simple interface for the factory with two interfaces - */ - private interface FactoryTwoInterfacesB { - } - - /** - * Simple factory with two interfaces - */ - private class FactoryWithTwoInterfaces implements FactoryTwoInterfacesA, FactoryTwoInterfacesB { - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/ConfigURITestCase.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/ConfigURITestCase.java deleted file mode 100644 index b7e96a8b28..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/ConfigURITestCase.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.net.UnknownHostException; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.runtime.DomainRegistryURI; -import org.junit.Test; - -public class ConfigURITestCase { - - @Test - public void testInvalidPrefix() throws UnknownHostException { - try { - new DomainRegistryURI("foo"); - Assert.fail(); - } catch (IllegalArgumentException e) { - // expected - } - } - - @Test - public void testDomainName() throws UnknownHostException { - DomainRegistryURI configURI = new DomainRegistryURI("tuscany:myDomain"); - Assert.assertEquals("myDomain", configURI.getDomainName()); - Assert.assertFalse(configURI.isMulticastDisabled()); - } - - @Test - public void testListenAddr() throws UnknownHostException { - DomainRegistryURI configURI = new DomainRegistryURI("tuscany:myDomain?listen=4321"); - Assert.assertEquals("myDomain", configURI.getDomainName()); - Assert.assertFalse(configURI.isMulticastDisabled()); - Assert.assertEquals(4321, configURI.getListenPort()); - Assert.assertNull(configURI.getBindAddress()); - } - @Test - public void testListenAddr2() throws UnknownHostException { - DomainRegistryURI configURI = new DomainRegistryURI("tuscany:myDomain?listen=1.1.1.1:4321"); - Assert.assertEquals("myDomain", configURI.getDomainName()); - Assert.assertFalse(configURI.isMulticastDisabled()); - Assert.assertEquals(4321, configURI.getListenPort()); - Assert.assertEquals("1.1.1.1", configURI.getBindAddress()); - } - - @Test - public void testMulticase1() throws UnknownHostException { - DomainRegistryURI configURI = new DomainRegistryURI("tuscany:myDomain?multicast=off"); - Assert.assertEquals("myDomain", configURI.getDomainName()); - Assert.assertTrue(configURI.isMulticastDisabled()); - } - - @Test - public void testMulticase2() throws UnknownHostException { - DomainRegistryURI configURI = new DomainRegistryURI("tuscany:myDomain?multicast=1.2.3.4:67"); - Assert.assertEquals("myDomain", configURI.getDomainName()); - Assert.assertFalse(configURI.isMulticastDisabled()); - Assert.assertEquals("1.2.3.4", configURI.getMulticastAddress()); - Assert.assertEquals(67, configURI.getMulticastPort()); - } - - @Test - public void testMulticase3() throws UnknownHostException { - DomainRegistryURI configURI = new DomainRegistryURI("tuscany:myDomain?multicast=1.2.3.4"); - Assert.assertEquals("myDomain", configURI.getDomainName()); - Assert.assertFalse(configURI.isMulticastDisabled()); - Assert.assertEquals("1.2.3.4", configURI.getMulticastAddress()); - Assert.assertEquals(51482, configURI.getMulticastPort()); - } - - @Test - public void testPassword() { - DomainRegistryURI configURI = new DomainRegistryURI("tuscany:myDomain?password=bla"); - Assert.assertEquals("myDomain", configURI.getDomainName()); - Assert.assertEquals("bla", configURI.getPassword()); - } - - @Test - public void testRemotes() throws UnknownHostException { - DomainRegistryURI configURI = new DomainRegistryURI("tuscany:myDomain?remotes=1.1.1.1:23,2.2.2.2"); - Assert.assertEquals("myDomain", configURI.getDomainName()); - Assert.assertTrue(configURI.isMulticastDisabled()); - Assert.assertEquals(2, configURI.getRemotes().size()); - Assert.assertEquals("1.1.1.1:23", configURI.getRemotes().get(0)); - Assert.assertEquals("2.2.2.2:14820", configURI.getRemotes().get(1)); - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/VersionTestCase.java b/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/VersionTestCase.java deleted file mode 100644 index 89ca99484c..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/VersionTestCase.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.runtime; - -import org.junit.Test; -import org.junit.Ignore; - -/** - */ -@Ignore -public class VersionTestCase { - - @Test - public void testRevision() { - // Doesn't test much, just that it has been initilized to a number - System.out.println(Version.getVersion() + " " + Version.getRevsion() + " " + Version.getBuildTime()); - Integer.parseInt(Version.getRevsion()); - } - -} -- cgit v1.2.3