diff options
Diffstat (limited to 'sandbox/slaws/backward-compatibility')
18 files changed, 0 insertions, 1768 deletions
diff --git a/sandbox/slaws/backward-compatibility/contribution-processor/LICENSE b/sandbox/slaws/backward-compatibility/contribution-processor/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/sandbox/slaws/backward-compatibility/contribution-processor/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/sandbox/slaws/backward-compatibility/contribution-processor/NOTICE b/sandbox/slaws/backward-compatibility/contribution-processor/NOTICE deleted file mode 100644 index 25bb89c9b2..0000000000 --- a/sandbox/slaws/backward-compatibility/contribution-processor/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2009 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sandbox/slaws/backward-compatibility/contribution-processor/pom.xml b/sandbox/slaws/backward-compatibility/contribution-processor/pom.xml deleted file mode 100644 index edc344fd12..0000000000 --- a/sandbox/slaws/backward-compatibility/contribution-processor/pom.xml +++ /dev/null @@ -1,180 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>bc-contribution-processor</artifactId> - <name>Apache Tuscany SCA Contribution Processor</name> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-api</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-node</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-workspace</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-workspace-impl</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-definitions-xml</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-client-impl</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-policy-xml</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core-databinding</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xsd</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-endpoint</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>test</scope> - </dependency> - - <!-- backward compaibility --> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xsd-osoa</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml-osoa</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-sca-xml-osoa</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-xml-osoa</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api-osoa</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - </dependencies> - -</project> diff --git a/sandbox/slaws/backward-compatibility/contribution-processor/src/main/java/org/apache/tuscany/sca/bc/ContributionProcessorImpl.java b/sandbox/slaws/backward-compatibility/contribution-processor/src/main/java/org/apache/tuscany/sca/bc/ContributionProcessorImpl.java deleted file mode 100644 index a82378268a..0000000000 --- a/sandbox/slaws/backward-compatibility/contribution-processor/src/main/java/org/apache/tuscany/sca/bc/ContributionProcessorImpl.java +++ /dev/null @@ -1,617 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -package org.apache.tuscany.sca.bc; - -import static java.lang.System.currentTimeMillis; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.InputStream; -import java.net.URI; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilder; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint; -import org.apache.tuscany.sca.client.impl.SCAClientImpl; -import org.apache.tuscany.sca.contribution.Artifact; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.ContributionFactory; -import org.apache.tuscany.sca.contribution.DefaultImport; -import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; -import org.apache.tuscany.sca.contribution.processor.ExtendedURLArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint; -import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint; -import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.FactoryExtensionPoint; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.core.assembly.ActivationException; -import org.apache.tuscany.sca.core.assembly.CompositeActivator; -import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory; -import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory; -import org.apache.tuscany.sca.core.invocation.ProxyFactory; -import org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint; -import org.apache.tuscany.sca.definitions.Definitions; -import org.apache.tuscany.sca.definitions.DefinitionsFactory; -import org.apache.tuscany.sca.definitions.util.DefinitionsUtil; -import org.apache.tuscany.sca.definitions.xml.DefinitionsExtensionPoint; -import org.apache.tuscany.sca.implementation.node.ConfiguredNodeImplementation; -import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory; -import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.monitor.MonitorFactory; -import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.monitor.Problem.Severity; -import org.apache.tuscany.sca.node.Client; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.provider.DefinitionsProvider; -import org.apache.tuscany.sca.provider.DefinitionsProviderException; -import org.apache.tuscany.sca.provider.DefinitionsProviderExtensionPoint; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentContext; -import org.apache.tuscany.sca.work.WorkScheduler; -import org.apache.tuscany.sca.workspace.Workspace; -import org.apache.tuscany.sca.workspace.WorkspaceFactory; -import org.apache.tuscany.sca.workspace.builder.ContributionBuilder; -import org.apache.tuscany.sca.workspace.builder.ContributionBuilderExtensionPoint; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.NoSuchDomainException; -import org.oasisopen.sca.NoSuchServiceException; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.ServiceRuntimeException; -import org.oasisopen.sca.client.SCAClient; - -/** - * Represents an SCA runtime node. - * - * @version $Rev$ $Date$ - */ -public class ContributionProcessorImpl { - - private static final String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1"; - - private static final Logger logger = Logger.getLogger(ContributionProcessorImpl.class.getName()); - - // The node configuration name, used for logging - private String configurationName; - - // The composite loaded into this node - private Composite composite; - private boolean useDeploymentComposite; - - private ExtensionPointRegistry extensionPoints; - private Monitor monitor; - private ExtendedURLArtifactProcessor<Contribution> contributionProcessor; - private ModelResolverExtensionPoint modelResolvers; - private FactoryExtensionPoint modelFactories; - private WorkspaceFactory workspaceFactory; - private ContributionFactory contributionFactory; - private AssemblyFactory assemblyFactory; - private XMLInputFactory inputFactory; - private ContributionBuilder contributionDependencyBuilder; - private CompositeBuilder compositeBuilder; - private CompositeBuilder endpointReferenceBuilder; - private StAXArtifactProcessorExtensionPoint xmlProcessors; - private StAXArtifactProcessor<Composite> compositeProcessor; - private ProxyFactory proxyFactory; - private List<ModuleActivator> moduleActivators = new ArrayList<ModuleActivator>(); - private CompositeActivator compositeActivator; - private WorkScheduler workScheduler; - private Contribution systemContribution; - private Definitions systemDefinitions; - // Added MJE 28/04/2009 - private URLArtifactProcessor<Composite> compositeDocumentProcessor; - - - /** - * Constructs a new SCA node. - * - * @param compositeURI - * @param contributions - */ - ContributionProcessorImpl(org.apache.tuscany.sca.node.Contribution[] contributions) { - configurationName = "temp"; - logger.log(Level.INFO, "Creating contribution processor: " + configurationName); - - try { - // Initialize the runtime - init(); - - // Create a node configuration - NodeImplementationFactory nodeImplementationFactory = - modelFactories.getFactory(NodeImplementationFactory.class); - ConfiguredNodeImplementation configuration = nodeImplementationFactory.createConfiguredNodeImplementation(); - - // Create contribution models - for (org.apache.tuscany.sca.node.Contribution c : contributions) { - Contribution contribution = contribution(contributionFactory, c); - configuration.getContributions().add(contribution); - } - - // Configure the node - configureNode(configuration); - - } catch (Exception e) { - throw new ServiceRuntimeException(e); - } - } - - static Contribution contribution(ContributionFactory contributionFactory, org.apache.tuscany.sca.node.Contribution c) { - Contribution contribution = contributionFactory.createContribution(); - contribution.setURI(c.getURI()); - contribution.setLocation(c.getLocation()); - contribution.setUnresolved(true); - return contribution; - } - - - - private static String getSystemProperty(final String name) { - return AccessController.doPrivileged(new PrivilegedAction<String>() { - public String run() { - return System.getProperty(name); - } - }); - } - - static URI createURI(String uri) { - if (uri.indexOf(' ') != -1) { - uri = uri.replace(" ", "%20"); - } - return URI.create(uri); - } - - private void init() { - long start = currentTimeMillis(); - - // Create extension point registry - extensionPoints = new DefaultExtensionPointRegistry(); - - // Enable schema validation only of the logger level is FINE or higher - ValidationSchemaExtensionPoint schemas = - extensionPoints.getExtensionPoint(ValidationSchemaExtensionPoint.class); - if (schemas != null) { - String enabled = getSystemProperty(ValidationSchemaExtensionPoint.class.getName() + ".enabled"); - if (enabled == null) { - enabled = "true"; - } - boolean debug = logger.isLoggable(Level.FINE); - schemas.setEnabled("true".equals(enabled) || debug); - } - - // Use the runtime-enabled assembly factory - modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); - assemblyFactory = new RuntimeAssemblyFactory(); - modelFactories.addFactory(assemblyFactory); - - // Create a monitor - UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); - MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); - monitor = monitorFactory.createMonitor(); - - // Initialize the Tuscany module activators - ModuleActivatorExtensionPoint activators = - extensionPoints.getExtensionPoint(ModuleActivatorExtensionPoint.class); - for (ModuleActivator moduleActivator : activators.getModuleActivators()) { - try { - moduleActivator.start(extensionPoints); - moduleActivators.add(moduleActivator); - } catch (Throwable e) { - // Ignore the failing module for now - logger.log(Level.SEVERE, e.getMessage(), e); - } - } - - // Get XML input/output factories - inputFactory = modelFactories.getFactory(XMLInputFactory.class); - - // Get contribution workspace and assembly model factories - contributionFactory = modelFactories.getFactory(ContributionFactory.class); - workspaceFactory = modelFactories.getFactory(WorkspaceFactory.class); - - // Create XML artifact processors - xmlProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); - compositeProcessor = xmlProcessors.getProcessor(Composite.class); - - // Create contribution content processor - URLArtifactProcessorExtensionPoint docProcessorExtensions = - extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class); - contributionProcessor = (ExtendedURLArtifactProcessor<Contribution>) docProcessorExtensions.getProcessor(Contribution.class); - - // Added MJE 28/04/2009 - // Create Composite Document processor - compositeDocumentProcessor = docProcessorExtensions.getProcessor(Composite.class); - - // Get the model resolvers - modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class); - - // Get a contribution dependency builder - ContributionBuilderExtensionPoint contributionBuilders = - extensionPoints.getExtensionPoint(ContributionBuilderExtensionPoint.class); - contributionDependencyBuilder = - contributionBuilders - .getContributionBuilder("org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder"); - - // Get composite builders - CompositeBuilderExtensionPoint compositeBuilders = - extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class); - compositeBuilder = - compositeBuilders.getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder"); - - // Get endpoint builders - // TODO - new extension point? - endpointReferenceBuilder = - compositeBuilders.getCompositeBuilder("org.apache.tuscany.sca.endpoint.impl.EndpointReferenceBuilderImpl"); - - // Initialize runtime - - // Get proxy factory - ProxyFactoryExtensionPoint proxyFactories = extensionPoints.getExtensionPoint(ProxyFactoryExtensionPoint.class); - proxyFactory = new ExtensibleProxyFactory(proxyFactories); - - // Get the composite activator - compositeActivator = utilities.getUtility(CompositeActivator.class); - - workScheduler = utilities.getUtility(WorkScheduler.class); - - DefinitionsFactory definitionsFactory = modelFactories.getFactory(DefinitionsFactory.class); - systemDefinitions = definitionsFactory.createDefinitions(); - - DefinitionsExtensionPoint definitionsExtensionPoint = - extensionPoints.getExtensionPoint(DefinitionsExtensionPoint.class); - for (Definitions defs : definitionsExtensionPoint.getDefinitions()) { - DefinitionsUtil.aggregate(systemDefinitions, defs); - } - - // Load the system definitions.xml from all of the loaded extension points - DefinitionsProviderExtensionPoint definitionsProviders = - extensionPoints.getExtensionPoint(DefinitionsProviderExtensionPoint.class); - - // aggregate all the definitions into a single definitions model - try { - for (DefinitionsProvider definitionsProvider : definitionsProviders.getDefinitionsProviders()) { - DefinitionsUtil.aggregate(definitionsProvider.getDefinitions(), systemDefinitions); - } - } catch (DefinitionsProviderException e) { - throw new IllegalStateException(e); - } - - // create a system contribution to hold the definitions. The contribution - // will be extended later with definitions from application contributions - systemContribution = contributionFactory.createContribution(); - systemContribution.setURI("http://tuscany.apache.org/SystemContribution"); - systemContribution.setLocation("http://tuscany.apache.org/SystemContribution"); - ModelResolver modelResolver = new ExtensibleModelResolver(systemContribution, modelResolvers, modelFactories); - systemContribution.setModelResolver(modelResolver); - systemContribution.setUnresolved(true); - - // create an artifact to represent the system defintions and - // add it to the contribution - List<Artifact> artifacts = systemContribution.getArtifacts(); - Artifact artifact = contributionFactory.createArtifact(); - artifact.setURI("http://tuscany.apache.org/SystemContribution/Definitions"); - artifact.setLocation("Derived"); - artifact.setModel(systemDefinitions); - artifacts.add(artifact); - - // don't resolve the system contribution until all the application - // level definitions have been added - - // - // // Configure a resolver for the system definitions - // ModelResolver definitionsResolver = new DefaultModelResolver(); - // for (Intent intent : systemDefinitions.getPolicyIntents()) { - // definitionsResolver.addModel(intent); - // } - // for (PolicySet policySet : systemDefinitions.getPolicySets()) { - // definitionsResolver.addModel(policySet); - // } - // for (ExtensionType bindingType : systemDefinitions.getBindingTypes()) { - // definitionsResolver.addModel(bindingType); - // } - // for (ExtensionType implementationType : systemDefinitions.getImplementationTypes()) { - // definitionsResolver.addModel(implementationType); - // } - // - // // Now that all system sca definitions have been read, let's resolve them - // URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class); - // URLArtifactProcessor<Definitions> definitionsProcessor = documentProcessors.getProcessor(Definitions.class); - // try { - // definitionsProcessor.resolve(systemDefinitions, definitionsResolver); - // } catch (ContributionResolveException e) { - // throw new IllegalStateException(e); - // } - - if (logger.isLoggable(Level.FINE)) { - long end = currentTimeMillis(); - logger.fine("The tuscany runtime started in " + (end - start) + " ms."); - } - } - - private void configureNode(ConfiguredNodeImplementation configuration) throws Exception { - - // Create workspace model - Workspace workspace = workspaceFactory.createWorkspace(); - workspace.setModelResolver(new ExtensibleModelResolver(workspace, modelResolvers, modelFactories)); - - // Load the specified contributions - for (Contribution c : configuration.getContributions()) { - URI contributionURI = URI.create(c.getURI()); - - URI uri = createURI(c.getLocation()); - if (uri.getScheme() == null) { - uri = new File(c.getLocation()).toURI(); - } - URL contributionURL = uri.toURL(); - - // Load the contribution - logger.log(Level.INFO, "Loading contribution: " + contributionURL); - Contribution contribution = contributionProcessor.read(null, contributionURI, contributionURL); - workspace.getContributions().add(contribution); - analyzeProblems(); - } - - // Build an aggregated SCA definitions model. Must be done before we try and - // resolve any contributions or composites as they may depend on the full - // definitions.xml picture - - // get all definitions.xml artifacts from contributions and aggregate - // into the system contribution. In turn add a default import into - // each contribution so that for unresolved items the resolution - // processing will look in the system contribution - for (Contribution contribution : workspace.getContributions()) { - // aggregate definitions - for (Artifact artifact : contribution.getArtifacts()) { - Object model = artifact.getModel(); - if (model instanceof Definitions) { - DefinitionsUtil.aggregate((Definitions)model, systemDefinitions); - } - } - - // create a default import and wire it up to the system contribution - // model resolver. This is the trick that makes the resolution processing - // skip over to the system contribution if resolution is unsuccessful - // in the current contribution - DefaultImport defaultImport = contributionFactory.createDefaultImport(); - defaultImport.setModelResolver(systemContribution.getModelResolver()); - contribution.getImports().add(defaultImport); - } - - // now resolve the system contribution and add the contribution - // to the workspace - contributionProcessor.resolve(systemContribution, workspace.getModelResolver()); - workspace.getContributions().add(systemContribution); - - // TODO - Now we can calculate applicable policy sets for each composite - - // pre-resolve the contributions - contributionsPreresolve( workspace.getContributions(), workspace.getModelResolver() ); - - // Build the contribution dependencies - Set<Contribution> resolved = new HashSet<Contribution>(); - for (Contribution contribution : workspace.getContributions()) { - contributionDependencyBuilder.build(contribution, workspace, monitor); - - // Resolve contributions - for (Contribution dependency : contribution.getDependencies()) { - if (!resolved.contains(dependency)) { - resolved.add(dependency); - contributionProcessor.resolve(dependency, workspace.getModelResolver()); - } - } - } - - // Create a top level composite to host our composites - // This is temporary to make the activator happy - composite = assemblyFactory.createComposite(); - composite.setName(new QName(SCA11_TUSCANY_NS, "_tempComposite")); - composite.setURI(SCA11_TUSCANY_NS); - - for (Contribution contribution : workspace.getContributions()) { - // find all the (deployable) composites - for (Composite deployable: contribution.getDeployables()) { - composite.getIncludes().add(deployable); - } - } - - // Build the composite and wire the components included in it - compositeBuilder.build(composite, systemDefinitions, monitor); - analyzeProblems(); - - // build the endpoint references - endpointReferenceBuilder.build(composite, systemDefinitions, monitor); - analyzeProblems(); - - - - -/* - composite = configuration.getComposite(); - - // If a composite was not originally supplied when the Node was created, pick one of the deployable - // composites from the supplied contributions. Note: throws an exception if none can be found. - if (composite == null) { - setDefaultComposite(configuration, workspace); - } - - // Find the composite in the given contributions - boolean found = false; - if (!useDeploymentComposite) { - Artifact compositeFile = contributionFactory.createArtifact(); - compositeFile.setUnresolved(true); - compositeFile.setURI(composite.getURI()); - for (Contribution contribution : workspace.getContributions()) { - ModelResolver resolver = contribution.getModelResolver(); - - Artifact resolvedArtifact = resolver.resolveModel(Artifact.class, compositeFile); - if (!resolvedArtifact.isUnresolved() && resolvedArtifact.getModel() instanceof Composite) { - - if (!composite.isUnresolved()) { - - // The composite content was passed into the node and read into a composite model, - // don't use the composite found in the contribution, use that composite, but just resolve - // it within the context of the contribution - compositeProcessor.resolve(composite, resolver); - - } else { - - // Use the resolved composite we've found in the contribution - composite = (Composite)resolvedArtifact.getModel(); - } - found = true; - break; - } // end if - } // end for - } - - if (!found) { - if (!useDeploymentComposite) { - // If the composite was not found, then it must be a separate composite file outside any of the contributions - // - a "composite by value" - this requires its URI to be absolute and pointing at the composite file itself. - // First read in the composite file to create a composite model object... - URI compositeURI = new URI(composite.getURI()); - URL compositeURL = compositeURI.toURL(); - composite = compositeDocumentProcessor.read(compositeURL, compositeURI, compositeURL); - if (composite == null) { - throw new IllegalArgumentException("Composite not found: " + compositeURI); - } - } - - // Resolve the "composite by value" against the FIRST contribution - Contribution contribution = workspace.getContributions().get(0); - ModelResolver resolver = contribution.getModelResolver(); - compositeProcessor.resolve(composite, resolver); - if (composite.isUnresolved()) { - throw new IllegalArgumentException("Could not resolve composite: " + composite.getURI() - + " in contribution " - + contribution.getURI()); - } - } // end if - - // Build the composite and wire the components included in it - compositeBuilder.build(composite, systemDefinitions, monitor); - analyzeProblems(); - - // build the endpoint references - endpointReferenceBuilder.build(composite, systemDefinitions, monitor); - analyzeProblems(); - - // Create a top level composite to host our composite - // This is temporary to make the activator happy - Composite tempComposite = assemblyFactory.createComposite(); - tempComposite.setName(new QName(SCA11_TUSCANY_NS, "_tempComposite")); - tempComposite.setURI(SCA11_TUSCANY_NS); - - // Include the node composite in the top-level composite - tempComposite.getIncludes().add(composite); - - // Set the top level composite on the composite activator as - // logic in callable reference resolution relies on this being - // available - compositeActivator.setDomainComposite(tempComposite); -*/ - - } - - /** - * Pre-resolve phase for contributions, to set up handling of imports and exports prior to full resolution - * @param contributions - the contributions to preresolve - * @param resolver - the ModelResolver to use - * @throws ContributionResolveException - */ - private void contributionsPreresolve( List<Contribution> contributions, ModelResolver resolver ) - throws ContributionResolveException { - - for( Contribution contribution : contributions ) { - contributionProcessor.preResolve(contribution, resolver); - } // end for - } // end method contributionsPreresolve - - - - - /** - * Analyze problems reported by the artifact processors and builders. - * - * @throws Exception - */ - private void analyzeProblems() throws Exception { - for (Problem problem : monitor.getProblems()) { - if ((problem.getSeverity() == Severity.ERROR) && (!problem.getMessageId().equals("SchemaError"))) { - if (problem.getCause() != null) { - throw problem.getCause(); - } else { - throw new ServiceRuntimeException(problem.toString()); - } - } - } - } - - /* - * Sets a default composite by using any deployable one. - */ - private void setDefaultComposite(ConfiguredNodeImplementation configuration, Workspace workspace) { - // just use the first deployable composite - for (Contribution contribution : workspace.getContributions()) { - for (Composite c : contribution.getDeployables()) { - // Ensure that we pick a composite that has actually been found in its contribution!! - if( c.getURI() != null ) { - composite = assemblyFactory.createComposite(); - composite.setURI(c.getURI()); - composite.setUnresolved(true); - configuration.setComposite(composite); - return; - } // end if - } // end for - } // end for - throw new ServiceRuntimeException("No deployable composite found"); - } // end method setDefaultComposite - - public ExtensionPointRegistry getExtensionPoints() { - return extensionPoints; - } - - -} diff --git a/sandbox/slaws/backward-compatibility/contribution-processor/src/test/java/org/apache/tuscany/sca/bc/ConributionProcessorTestCase.java b/sandbox/slaws/backward-compatibility/contribution-processor/src/test/java/org/apache/tuscany/sca/bc/ConributionProcessorTestCase.java deleted file mode 100644 index 0a06f4bcd7..0000000000 --- a/sandbox/slaws/backward-compatibility/contribution-processor/src/test/java/org/apache/tuscany/sca/bc/ConributionProcessorTestCase.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.bc; - - -import java.io.File; - -import org.apache.tuscany.sca.node.Contribution; -import org.junit.Test; - -/** - * Test case for NodeImpl - */ -public class ConributionProcessorTestCase { - - @Test - public void testContributionProcessor() { - Contribution contribution = new Contribution("c1", new File("../references/target/classes").toURI().toString()); - Contribution[] contributions = new Contribution[]{contribution}; - - ContributionProcessorImpl cp = new ContributionProcessorImpl(contributions); - - } - -} diff --git a/sandbox/slaws/backward-compatibility/pom.xml b/sandbox/slaws/backward-compatibility/pom.xml deleted file mode 100644 index 9e672f9fef..0000000000 --- a/sandbox/slaws/backward-compatibility/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-itest-backward-compatibility</artifactId> - <packaging>pom</packaging> - <name>Apache Tuscany SCA Integration Test Backward Compatibility</name> - - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.easymock</groupId> - <artifactId>easymock</artifactId> - <version>2.4</version> - <scope>test</scope> - </dependency> - </dependencies> - - <properties> - <was.ant.script>${basedir}/build-was-integration.xml</was.ant.script> - <was.python.script>${basedir}/wasAdmin.py</was.python.script> - </properties> - - - <profiles> - - <profile> - <id>default</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <modules> - <module>contribution-processor</module> - <module>references</module> - </modules> - </profile> - - <profile> - <id>eclipse</id> - <modules> - <module>contribution-processor</module> - <module>references</module> - </modules> - <build> - <defaultGoal>org.apache.tuscany.maven.plugins:maven-bundle-plugin:eclipse</defaultGoal> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.tuscany.maven.plugins</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <version>1.0.2</version> - <extensions>true</extensions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-eclipse-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - </plugins> - </pluginManagement> - </build> - </profile> - - </profiles> - -</project> diff --git a/sandbox/slaws/backward-compatibility/references/pom.xml b/sandbox/slaws/backward-compatibility/references/pom.xml deleted file mode 100644 index 36c2b4ccc7..0000000000 --- a/sandbox/slaws/backward-compatibility/references/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-itest</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>bc-itest-references</artifactId> - <name>Apache Tuscany SCA Backward Compat iTest References</name> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>1.6-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-api</artifactId> - <type>pom</type> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-core</artifactId> - <type>pom</type> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-webservice</artifactId> - <type>pom</type> - <version>2.0-SNAPSHOT</version> - </dependency> - - </dependencies> -</project> diff --git a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java b/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java deleted file mode 100644 index f8c0850118..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.itest.references; - -public interface AComponent { - - String fooB(); - - String fooC(); - - String fooBC(); - - String fooD1(); - - String fooD2(); - - String fooMultipleD(); - - String fooMultipleDArray(); - - String fooMultipleDServiceRef(); - - DComponent getDReference(); -} diff --git a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java b/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java deleted file mode 100644 index 647fff0159..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.itest.references; - -import java.util.Collection; -import java.util.List; - -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Reference; - -public class AComponentImpl implements AComponent { - - @Reference(name = "bReference") - protected BComponent b; - - @Reference - protected CComponent cReference; - - @Reference(required = false) - protected DComponent dReference; - - @Reference(name = "dReferences") - public Collection<DComponent> dReferences; - - @Reference(name = "dReferenceArray") - public DComponent[] dReferenceArray; - - - @Reference(name = "dServiceReferences") - public List<ServiceReference<DComponent>> dServiceReferences; - - private DComponent dReference1; - - private DComponent dReference2; - - @Reference(name = "dReference1") - public void setDReference(DComponent dReference) { - this.dReference1 = dReference; - } - - @Reference - public void setDReference2(DComponent dReference2) { - this.dReference2 = dReference2; - } - - public String fooB() { - return b.bFoo(); - } - - public String fooC() { - return cReference.cFoo(); - } - - public String fooBC() { - return b.fooC(); - } - - public String fooD() { - return dReference1.dFoo(); - } - - public String fooD1() { - return dReference1.dFoo(); - } - - public String fooD2() { - return dReference2.dFoo(); - } - - public String fooMultipleDArray() { - StringBuffer str = new StringBuffer(); - for (DComponent d : dReferenceArray) { - str.append(d.getComponentName()); - str.append(','); - } - if (str.length() > 0) { - str.deleteCharAt(str.length() - 1); - } - return str.toString(); - } - - public String fooMultipleD() { - StringBuffer str = new StringBuffer(); - for (DComponent d : dReferences) { - str.append(d.getComponentName()); - str.append(','); - } - if (str.length() > 0) { - str.deleteCharAt(str.length() - 1); - } - return str.toString(); - } - - public String fooMultipleDServiceRef() { - StringBuffer str = new StringBuffer(); - for (ServiceReference<DComponent> d : dServiceReferences) { - str.append(d.getService().getComponentName()); - str.append(','); - } - if (str.length() > 0) { - str.deleteCharAt(str.length() - 1); - } - return str.toString(); - } - - public DComponent getDReference() { - return dReference; - } - -} diff --git a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java b/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java deleted file mode 100644 index 785920bb2d..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.itest.references; - -public interface BComponent { - - String bFoo(); - - String fooC(); -} diff --git a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java b/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java deleted file mode 100644 index 6b1065ab0d..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.itest.references; - -import org.osoa.sca.annotations.Reference; - -public class BComponentImpl implements BComponent { - - protected CComponent cReference; - - public BComponentImpl(@Reference(name = "cReference") CComponent cReference) { - this.cReference = cReference; - } - - public String bFoo() { - return "BComponent"; - } - - public String fooC() { - return "B" + cReference.cFoo(); - } - -} diff --git a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java b/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java deleted file mode 100644 index 1cd7cb7fe5..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.itest.references; - -import org.osoa.sca.annotations.Reference; - -public class BComponentWrongTargetImpl implements BComponent { - - protected CComponent cReference; - - public BComponentWrongTargetImpl(@Reference(name = "cReference") CComponent cReference) { - this.cReference = cReference; - } - - public String bFoo() { - return "BComponentWrongTarget"; - } - - public String fooC() { - return "B" + cReference.cFoo(); - } - -} diff --git a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java b/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java deleted file mode 100644 index d436c28adc..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.itest.references; - -public interface CComponent { - - String cFoo(); -} diff --git a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java b/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java deleted file mode 100644 index a1823e1cdc..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.itest.references; - -public class CComponentImpl implements CComponent { - - public String cFoo() { - return "CComponent"; - } - -} diff --git a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java b/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java deleted file mode 100644 index 2618ec7095..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.itest.references; - -import org.osoa.sca.annotations.Remotable; - -public interface DComponent { - - String dFoo(); - String getComponentName(); -} diff --git a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java b/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java deleted file mode 100644 index 79c802bc97..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.itest.references; - -import org.osoa.sca.annotations.ComponentName; - -public class DComponentImpl implements DComponent { - @ComponentName - public String name; - - public String dFoo() { - return "DComponent"; - } - - public String getComponentName() { - return name; - } - -} diff --git a/sandbox/slaws/backward-compatibility/references/src/main/resources/ManualWiredReferencesTest.composite b/sandbox/slaws/backward-compatibility/references/src/main/resources/ManualWiredReferencesTest.composite deleted file mode 100644 index 3cfd80cde5..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/main/resources/ManualWiredReferencesTest.composite +++ /dev/null @@ -1,64 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:foo="http://foo" targetNamespace="http://foo" - name="ManualWiredReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autowire="true"> - - <service name="AComponent" promote="AComponent"> - <!--interface.java interface="org.apache.tuscany.sca.itest.references.AComponent" /--> - </service> - - <component name="AComponent" > - <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" /> - <reference name="bReference" target="BComponent" /> - <reference name="cReference" target="CComponent/CComponentImpl"> - <!-- reference name="cReference" target="CComponent"--> - <binding.sca uri="DComponent"/> - </reference> - <reference name="dReference1" > - <binding.sca uri="DComponent"/> - </reference> - <reference name="DReference2" target="DComponent" > - <!-- binding.ws uri="DComponent"/--> - </reference> - <reference name="dReferences" target="DComponent DComponent1" /> - <reference name="dReferenceArray" target="DComponent DComponent1" /> - <reference name="dServiceReferences" target="DComponent DComponent1" /> - - </component> - - <component name="BComponent"> - <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentImpl" /> - </component> - - <component name="CComponent"> - <implementation.java class="org.apache.tuscany.sca.itest.references.CComponentImpl" /> - </component> - - <component name="DComponent"> - <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" /> - <service name="DComponentImpl"> - <binding.sca/> - <!-- binding.ws/--> - </service> - </component> - - <component name="DComponent1"> - <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" /> - </component> -</composite>
\ No newline at end of file diff --git a/sandbox/slaws/backward-compatibility/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java b/sandbox/slaws/backward-compatibility/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java deleted file mode 100644 index 98e736df00..0000000000 --- a/sandbox/slaws/backward-compatibility/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.itest.references; - -import static junit.framework.Assert.assertEquals; -import junit.framework.Assert; - -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.launcher.Contribution; -import org.apache.tuscany.sca.node.launcher.NodeLauncher; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -public class ManualWiredReferenceTestCase { - private static NodeLauncher launcher; - private static Node node; - private static AComponent acomponent; - - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - launcher = NodeLauncher.newInstance(); - node = launcher.createNode("ManualWiredReferencesTest.composite", - new Contribution("test", "./target/classes")); - - try { - node.start(); - } catch (Exception ex) { - String status = ex.toString(); - System.out.println(status); - } - - acomponent = node.getService(AComponent.class, "AComponent"); - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (node != null) { - node.stop(); - node.destroy(); - } - if (launcher != null) { - //launcher.destroy(); - } - } - - @Test - public void testBReference() { - assertEquals("BComponent", acomponent.fooB()); - } - - @Test - public void testCReference() { - assertEquals("CComponent", acomponent.fooC()); - } - - @Test - public void testBCReference() { - assertEquals("BCComponent", acomponent.fooBC()); - } - - @Test - public void testD1Reference() { - acomponent.fooD1(); - } - - @Ignore - @Test - public void testD2Reference() { - assertEquals("DComponent", acomponent.fooD2()); - } - - @Test - public void testMultiDReferenceArray() { - String components = acomponent.fooMultipleDArray(); - Assert.assertTrue(components.contains("DComponent1")); - } - - @Test - public void testMultiDServiceReference() { - String components = acomponent.fooMultipleDServiceRef(); - Assert.assertTrue(components.contains("DComponent")); - Assert.assertTrue(components.contains("DComponent1")); - } - - @Test - public void testRequiredFalseReference() { - try { - acomponent.getDReference().dFoo(); - } catch (Exception e) { - Assert.assertTrue(true); - } - } - -} |