diff options
Diffstat (limited to '')
186 files changed, 22 insertions, 15882 deletions
diff --git a/branches/sca-java-1.4/modules/api/LICENSE b/branches/sca-java-1.4/modules/api/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/branches/sca-java-1.4/modules/api/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ -
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-java-1.4/modules/api/NOTICE b/branches/sca-java-1.4/modules/api/NOTICE deleted file mode 100644 index 1325efd8bf..0000000000 --- a/branches/sca-java-1.4/modules/api/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name}
-Copyright (c) 2005 - 2008 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/branches/sca-java-1.4/modules/api/pom.xml b/branches/sca-java-1.4/modules/api/pom.xml deleted file mode 100644 index b97425d0d1..0000000000 --- a/branches/sca-java-1.4/modules/api/pom.xml +++ /dev/null @@ -1,304 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>tuscany-api</artifactId> - <name>Apache Tuscany SCA API</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-embedded</artifactId> - <version>1.4</version> - <exclusions> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-extensibility</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-definitions</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-definitions-xml</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-sca</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-sca-xml</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-impl</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-policy-xml</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core-databinding</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xsd</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-policy-xml</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-endpoint</artifactId> - </exclusion> - </exclusions> - </dependency> - - </dependencies> - - - <build> - <resources> - <resource> - <directory>src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - </resources> - - <plugins> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <executions> - - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <shadedGroupFilter>org.apache.tuscany.sca</shadedGroupFilter> - - <shadedArtifactAttached>false</shadedArtifactAttached> - <createSourcesJar>${createSourcesJar}</createSourcesJar> - <promoteTransitiveDependencies>false</promoteTransitiveDependencies> - <createDependencyReducedPom>true</createDependencyReducedPom> - - <!-- artifactSet> - <includes> - <include>org.apache.tuscany.sca:sca-api</include> - </includes> - <excludes> - <exclude>org.apache.tuscany.sca:extensibility</exclude> - </excludes> - </artifactSet --> - - <filters> - <filter> - <artifact>org.apache.tuscany.sca:tuscany-host-embedded</artifact> - <excludes> - <exclude>org/apache/tuscany/sca/host/embedded/impl/**</exclude> - </excludes> - </filter> - <filter> - <artifact>${project.groupId}:${project.artifactId}</artifact> - - <excludes> - <exclude>org/**</exclude> - </excludes> - </filter> - </filters> - - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.assembly.AssemblyFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.assembly.SCABindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.binding.feed.AtomBindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.binding.feed.RSSBindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.binding.atom.AtomBindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.binding.rss.RSSBindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.binding.http.HTTPResourceBindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.ContributionFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.java.JavaImportExportFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.ContributionPostProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.PackageProcessor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.PackageProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListenerExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.core.ModuleActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.DataBinding</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.DataBindingExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.TransformerExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.extension.helper.ImplementationActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.host.http.ServletHostExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.implementation.java.JavaImplementationFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.spi.ImplementationActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.work.WorkScheduler</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.definitions.SCADefinitionsProvider</resource> - </transformer> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/LICENSE b/branches/sca-java-1.4/modules/assembly-java-dsl/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/NOTICE b/branches/sca-java-1.4/modules/assembly-java-dsl/NOTICE deleted file mode 100644 index fdfa0e9faa..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2008 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/pom.xml b/branches/sca-java-1.4/modules/assembly-java-dsl/pom.xml deleted file mode 100644 index e997943ea3..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-assembly-java-dsl</artifactId> - <name>Apache Tuscany SCA Assembly Model Java DSL</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly</artifactId> - <version>1.4</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.assembly.java.dsl</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.assembly.java.dsl*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/AssemblyBuilder.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/AssemblyBuilder.java deleted file mode 100644 index 28a5ecdc24..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/AssemblyBuilder.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - - -public interface AssemblyBuilder { - - CompositeBuilder composite(String name); - - ComponentBuilder component(String name); - - ComponentReferenceBuilder reference(String name); - - ComponentServiceBuilder service(String name); - - ComponentPropertyBuilder property(String name); - - CompositeBuilder domain(String uri); - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentBuilder.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentBuilder.java deleted file mode 100644 index 3d97041907..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentBuilder.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.assembly.dsl; - -public interface ComponentBuilder { - - ComponentBuilder implementedBy(Class clazz); - - ComponentBuilder implementedBy(CompositeBuilder composite); - - ComponentBuilder uses(ComponentReferenceBuilder... componentReferences); - - ComponentBuilder provides(ComponentServiceBuilder... componentServices); - - ComponentBuilder declares(ComponentPropertyBuilder...componentProperties); - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentPropertyBuilder.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentPropertyBuilder.java deleted file mode 100644 index 7f3c89fd2f..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentPropertyBuilder.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public interface ComponentPropertyBuilder { - - ComponentPropertyBuilder ofType(String type); - - ComponentPropertyBuilder configuredTo(Object value); - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentReferenceBuilder.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentReferenceBuilder.java deleted file mode 100644 index 8966a4be9d..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentReferenceBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public interface ComponentReferenceBuilder { - - ComponentReferenceBuilder wiredTo(String target); - - ComponentReferenceBuilder wiredTo(ComponentServiceBuilder target); - - ComponentReferenceBuilder typedBy(Class interfaceClass); - - ComponentReferenceBuilder promotedAs(String promoted); - - ComponentReferenceBuilder promoted(); - - ComponentReferenceBuilder boundTo(String uri); - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentServiceBuilder.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentServiceBuilder.java deleted file mode 100644 index f3e36e8c38..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentServiceBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public interface ComponentServiceBuilder { - - ComponentServiceBuilder typedBy(Class interfaceClass); - - ComponentServiceBuilder promotedAs(String promoted); - - ComponentServiceBuilder promoted(); - - ComponentServiceBuilder boundTo(String uri); - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/CompositeBuilder.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/CompositeBuilder.java deleted file mode 100644 index e2108b5ef8..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/CompositeBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - - -public interface CompositeBuilder { - - CompositeBuilder contains(ComponentBuilder... components); - - CompositeBuilder includes(CompositeBuilder... includes); - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/AssemblyBuilderImpl.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/AssemblyBuilderImpl.java deleted file mode 100644 index 0968310548..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/AssemblyBuilderImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.dsl.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.dsl.AssemblyBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentPropertyBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentReferenceBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentServiceBuilder; -import org.apache.tuscany.sca.assembly.dsl.CompositeBuilder; - -public class AssemblyBuilderImpl extends DefaultAssemblyFactory implements AssemblyBuilder { - - public ComponentBuilder component(String name) { - ComponentBuilderImpl component = new ComponentBuilderImpl(); - component.setName(name); - return component; - } - - public CompositeBuilder composite(String name) { - CompositeBuilderImpl composite = new CompositeBuilderImpl(); - //TODO handle namespace - composite.setName(new QName("", name)); - return composite; - } - - public CompositeBuilder domain(String uri) { - CompositeBuilderImpl composite = new CompositeBuilderImpl(); - composite.setName(new QName(uri, "")); - return composite; - } - - public ComponentPropertyBuilder property(String name) { - ComponentPropertyBuilderImpl property = new ComponentPropertyBuilderImpl(); - property.setName(name); - return property; - } - - public ComponentReferenceBuilder reference(String name) { - ComponentReferenceBuilderImpl reference = new ComponentReferenceBuilderImpl(this); - reference.setName(name); - return reference; - } - - public ComponentServiceBuilder service(String name) { - ComponentServiceBuilderImpl service = new ComponentServiceBuilderImpl(this); - service.setName(name); - return service; - } - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentBuilderImpl.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentBuilderImpl.java deleted file mode 100644 index 9022b9d9e6..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentBuilderImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl.impl; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.dsl.ComponentBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentPropertyBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentReferenceBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentServiceBuilder; -import org.apache.tuscany.sca.assembly.dsl.CompositeBuilder; -import org.apache.tuscany.sca.assembly.impl.ComponentImpl; - -public class ComponentBuilderImpl extends ComponentImpl implements ComponentBuilder { - - public ComponentBuilderImpl() { - } - - public ComponentBuilder implementedBy(Class clazz) { - //FIXME support Java implementations - return this; - } - - public ComponentBuilder implementedBy(CompositeBuilder composite) { - setImplementation((Composite)composite); - return this; - } - - public ComponentBuilder uses(ComponentReferenceBuilder... componentReferences) { - List<ComponentReference> references = getReferences(); - for (ComponentReferenceBuilder componentReference: componentReferences) { - references.add((ComponentReference)componentReference); - } - return this; - } - - public ComponentBuilder provides(ComponentServiceBuilder... componentServices) { - List<ComponentService> services = getServices(); - for (ComponentServiceBuilder componentService: componentServices) { - services.add((ComponentService)componentService); - } - return this; - } - - public ComponentBuilder declares(ComponentPropertyBuilder...componentProperties) { - List<ComponentProperty> properties = getProperties(); - for (ComponentPropertyBuilder componentProperty: componentProperties) { - properties.add((ComponentProperty)componentProperty); - } - return this; - } - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentPropertyBuilderImpl.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentPropertyBuilderImpl.java deleted file mode 100644 index 49f7cd46b2..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentPropertyBuilderImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.dsl.ComponentPropertyBuilder; -import org.apache.tuscany.sca.assembly.impl.ComponentPropertyImpl; - -public class ComponentPropertyBuilderImpl extends ComponentPropertyImpl implements ComponentPropertyBuilder { - - public ComponentPropertyBuilderImpl ofType(String type) { - //TODO handle namespace - this.setXSDType(new QName("", type)); - return this; - } - - public ComponentPropertyBuilderImpl configuredTo(Object value) { - this.setValue(value); - return this; - } - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentReferenceBuilderImpl.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentReferenceBuilderImpl.java deleted file mode 100644 index d9aab9de22..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentReferenceBuilderImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl.impl; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.dsl.ComponentReferenceBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentServiceBuilder; -import org.apache.tuscany.sca.assembly.impl.ComponentReferenceImpl; -import org.apache.tuscany.sca.assembly.impl.ComponentServiceImpl; - -public class ComponentReferenceBuilderImpl extends ComponentReferenceImpl implements ComponentReferenceBuilder { - - private CompositeReference compositeReference; - private AssemblyFactory assemblyFactory; - - protected ComponentReferenceBuilderImpl(AssemblyFactory assemblyFactory) { - this.assemblyFactory = assemblyFactory; - } - - public ComponentReferenceBuilder wiredTo(String target) { - ComponentService componentService = assemblyFactory.createComponentService(); - componentService.setUnresolved(true); - componentService.setName(target); - getTargets().add(componentService); - return this; - } - - public ComponentReferenceBuilder wiredTo(ComponentServiceBuilder target) { - getTargets().add((ComponentServiceImpl)target); - return this; - } - - public ComponentReferenceBuilderImpl typedBy(Class interfaceClass) { - //FIXME support for Java interfaces - return this; - } - - public ComponentReferenceBuilderImpl promotedAs(String promoted) { - compositeReference = assemblyFactory.createCompositeReference(); - compositeReference.setName(promoted); - return this; - } - - public ComponentReferenceBuilderImpl promoted() { - compositeReference = assemblyFactory.createCompositeReference(); - compositeReference.setName(getName()); - return this; - } - - public ComponentReferenceBuilder boundTo(String uri) { - //TODO support bindings - return this; - } - - CompositeReference getCompositeReference() { - return compositeReference; - } -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentServiceBuilderImpl.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentServiceBuilderImpl.java deleted file mode 100644 index 379429d17e..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentServiceBuilderImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl.impl; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.dsl.ComponentServiceBuilder; -import org.apache.tuscany.sca.assembly.impl.ComponentServiceImpl; - -public class ComponentServiceBuilderImpl extends ComponentServiceImpl implements ComponentServiceBuilder { - - private CompositeService compositeService; - private AssemblyFactory assemblyFactory; - - protected ComponentServiceBuilderImpl(AssemblyFactory assemblyFactory) { - this.assemblyFactory = assemblyFactory; - } - - public ComponentServiceBuilderImpl typedBy(Class interfaceClass) { - //FIXME support for Java interfaces - return this; - } - - public ComponentServiceBuilderImpl promotedAs(String promoted) { - compositeService = assemblyFactory.createCompositeService(); - compositeService.setName(promoted); - return this; - } - - public ComponentServiceBuilderImpl promoted() { - compositeService = assemblyFactory.createCompositeService(); - compositeService.setName(getName()); - return this; - } - - public ComponentServiceBuilder boundTo(String uri) { - // TODO support bindings - return this; - } - - CompositeService getCompositeService() { - return compositeService; - } - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/CompositeBuilderImpl.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/CompositeBuilderImpl.java deleted file mode 100644 index 709562cd72..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/CompositeBuilderImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl.impl; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.dsl.ComponentBuilder; -import org.apache.tuscany.sca.assembly.dsl.CompositeBuilder; -import org.apache.tuscany.sca.assembly.impl.CompositeImpl; - -public class CompositeBuilderImpl extends CompositeImpl implements CompositeBuilder { - - public CompositeBuilder contains(ComponentBuilder... componentBuilders) { - List<Component> components = getComponents(); - for (ComponentBuilder componentBuilder: componentBuilders) { - Component component = (Component)componentBuilder; - components.add(component); - - for (ComponentService componentService: component.getServices()) { - ComponentServiceBuilderImpl builder = (ComponentServiceBuilderImpl)componentService; - if (builder.getCompositeService() != null) - getServices().add(builder.getCompositeService()); - } - for (ComponentReference componentReference: component.getReferences()) { - ComponentReferenceBuilderImpl builder = (ComponentReferenceBuilderImpl)componentReference; - if (builder.getCompositeReference() != null) - getReferences().add(builder.getCompositeReference()); - } - } - return this; - } - - public CompositeBuilder includes(CompositeBuilder... compositeBuilders) { - List<Composite> list = getIncludes(); - for (CompositeBuilder composite: compositeBuilders) { - list.add((Composite)composite); - } - return this; - } - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataService.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataService.java deleted file mode 100644 index ba91fd2168..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataService.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.assembly.dsl; - -public interface AccountDataService { - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataServiceImpl.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataServiceImpl.java deleted file mode 100644 index 4e239d03d3..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataServiceImpl.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.assembly.dsl; - -public class AccountDataServiceImpl { - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountService.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountService.java deleted file mode 100644 index 030c820ed2..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountService.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.assembly.dsl; - -public interface AccountService { - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountServiceImpl.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountServiceImpl.java deleted file mode 100644 index 92f448ec87..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountServiceImpl.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.assembly.dsl; - -public class AccountServiceImpl { - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilder.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilder.java deleted file mode 100644 index b856201551..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -import org.apache.tuscany.sca.assembly.dsl.impl.AssemblyBuilderImpl; - -public class BigBankBuilder extends AssemblyBuilderImpl { - - public CompositeBuilder build() { - - CompositeBuilder bigbankAccount = composite("bigbank.account").contains( - - component("AccountServiceComponent"). - implementedBy(AccountServiceImpl.class). - uses( - reference("accountDataService").typedBy(AccountDataService.class).wiredTo("AccountDataServiceComponent/AccountDataService"), - reference("stockQuoteService").promotedAs("StockQuoteService") - ). - provides( - service("AccountDataService").typedBy(AccountService.class).promoted() - ). - declares( - property("currency").ofType("string").configuredTo("USD") - ), - - component("AccountDataServiceComponent"). - implementedBy(AccountDataServiceImpl.class). - provides( - service("AccountDataService").typedBy(AccountDataService.class) - ) - ); - - CompositeBuilder bigbankApp = composite("bigbank.app"). - contains( - component("BigBankAccount").implementedBy(bigbankAccount) - ); - - CompositeBuilder domain = domain("http://bigbank.org").includes(bigbankApp); - - return domain; - } -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilderTestCase.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilderTestCase.java deleted file mode 100644 index fb950b5c13..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilderTestCase.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -import junit.framework.TestCase; - -public class BigBankBuilderTestCase extends TestCase { - - public void testBuild() throws Exception { - - BigBankBuilder builder = new BigBankBuilder(); - CompositeBuilder domain = builder.build(); - assertNotNull(domain); - } - -} diff --git a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/StockQuoteService.java b/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/StockQuoteService.java deleted file mode 100644 index a0580095a0..0000000000 --- a/branches/sca-java-1.4/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/StockQuoteService.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.assembly.dsl; - -public interface StockQuoteService { - -} diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/LICENSE b/branches/sca-java-1.4/modules/contribution-updater-impl/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/NOTICE b/branches/sca-java-1.4/modules/contribution-updater-impl/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/pom.xml b/branches/sca-java-1.4/modules/contribution-updater-impl/pom.xml deleted file mode 100644 index 22f31a3c62..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/pom.xml +++ /dev/null @@ -1,124 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-contribution-updater-impl</artifactId> - <name>Apache Tuscany SCA Contribution Updater Implementation</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-java</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-namespace</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-updater</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-embedded</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface-java</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.codehaus.woodstox</groupId> - <artifactId>wstx-asl</artifactId> - <version>3.2.1</version> - <scope>runtime</scope> - <exclusions> - <exclusion> - <groupId>stax</groupId> - <artifactId>stax-api</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.contribution.updater.impl</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.contribution.updater.impl*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/ArtifactsFinder.java b/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/ArtifactsFinder.java deleted file mode 100644 index a23bf6f8cd..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/ArtifactsFinder.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.contribution.updater.impl; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.DeployedArtifact; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -public class ArtifactsFinder { - - public static Composite findComposite(String compositeURI, - List<Composite> artifacts) { - for (Composite composite : artifacts) { - if (composite.getURI().equals(compositeURI)) - return composite; - } - return null; - } - - public static Component findComponent(Composite composite, - String componentName) { - for (Component component : composite.getComponents()) { - if (component.getName().equals(componentName)) { - return component; - - } - - } - return null; - } - -} diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/ComponentUpdaterImpl.java b/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/ComponentUpdaterImpl.java deleted file mode 100644 index a6a6084f5f..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/ComponentUpdaterImpl.java +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.updater.impl; - -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.util.List; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.Multiplicity; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilder; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.DeployedArtifact; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionService; -import org.apache.tuscany.sca.contribution.updater.ComponentNotFoundException; -import org.apache.tuscany.sca.contribution.updater.ComponentUpdater; -import org.apache.tuscany.sca.contribution.updater.ComponentUpdaterException; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.assembly.CompositeActivator; -import org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.contribution.updater.impl.ArtifactsFinder; -import org.apache.tuscany.sca.assembly.xml.MetaComponentProcessor; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.implementation.java.IntrospectionException; -import org.apache.tuscany.sca.implementation.java.introspect.impl.JavaIntrospectionHelper; - -public class ComponentUpdaterImpl implements ComponentUpdater { - - private String contribURI; - private String compositeURI; - private String componentName; - private JavaInterfaceFactory javaFactory; - private CompositeBuilder compositeBuilder; - private CompositeActivator compositeActivator; - private ContributionService contributionService; - private ExtensionPointRegistry registry; - private AssemblyFactory assemblyFactory; - private InterfaceContractMapper interfaceContractMapper; - private Contribution contrib; - - public ComponentUpdaterImpl(String contribURI, String compositeURI, - String componentName, AssemblyFactory assembly, - JavaInterfaceFactory javaFactory, - CompositeBuilder compositeBuilder, - CompositeActivator compositeActivator, - ContributionService contribService, - ExtensionPointRegistry registry, InterfaceContractMapper mapper) { - this.contribURI = contribURI; - this.compositeURI = compositeURI; - this.componentName = componentName; - this.javaFactory = javaFactory; - this.compositeBuilder = compositeBuilder; - this.compositeActivator = compositeActivator; - this.contributionService = contribService; - this.registry = registry; - this.assemblyFactory = assembly; - this.interfaceContractMapper = mapper; - this.contrib = this.contributionService.getContribution(contribURI); - } - - private void reconcileReference(Reference reference, - ComponentReference targetReference, String componentName) { - - targetReference.setReference(reference); - targetReference.setIsCallback(reference.isCallback()); - targetReference.setMultiplicity(reference.getMultiplicity()); - if (targetReference.getInterfaceContract() != null) { - if (!targetReference.getInterfaceContract().equals( - reference.getInterfaceContract())) { - if (!interfaceContractMapper.isCompatible(reference - .getInterfaceContract(), targetReference - .getInterfaceContract())) { - System.err - .println("Component reference interface incompatible with reference interface: " - + componentName - + "/" - + targetReference.getName()); - } - } - } else { - targetReference.setInterfaceContract(reference - .getInterfaceContract()); - } - if (targetReference.getBindings().isEmpty()) { - targetReference.getBindings().addAll(reference.getBindings()); - } - - // Reconcile callback bindings - if (targetReference.getCallback() == null) { - targetReference.setCallback(reference.getCallback()); - if (targetReference.getCallback() == null) { - targetReference.setCallback(assemblyFactory.createCallback()); - } - - } else if (targetReference.getCallback().getBindings().isEmpty() - && reference.getCallback() != null) { - targetReference.getCallback().getBindings().addAll( - reference.getCallback().getBindings()); - } - Contribution contrib = contributionService.getContribution(contribURI); - List<DeployedArtifact> artifacts = contrib.getArtifacts(); - // RuntimeComponent source = null; - Composite composite = ArtifactsFinder.findComposite(compositeURI, - artifacts); - Component c = ArtifactsFinder.findComponent(composite, componentName); - if (targetReference.getAutowire() == null) { - targetReference.setAutowire(c.getAutowire()); - } - - // Reconcile targets - if (targetReference.getTargets().isEmpty()) { - targetReference.getTargets().addAll(reference.getTargets()); - } - - } - - public org.apache.tuscany.sca.assembly.Reference buildReference( - String name, String className, Class<?> businessInterface, - boolean required) throws Exception { - - Class<?> rawType = contrib.getClassLoader().loadClass(className); - - if (rawType == null) - return null; - - org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory - .createReference(); - JavaInterfaceContract interfaceContract = javaFactory - .createJavaInterfaceContract(); - reference.setInterfaceContract(interfaceContract); - reference.setName(name); - - if (required) { - reference.setMultiplicity(Multiplicity.ONE_ONE); - } else { - reference.setMultiplicity(Multiplicity.ZERO_ONE); - } - Type[] interfaces = rawType.getGenericInterfaces(); - Type genericType = null; - - for (int i = 0; i < interfaces.length; ++i) { - Type tmp = interfaces[i]; - if (interfaces[i] instanceof ParameterizedType) { - ParameterizedType type = (ParameterizedType) tmp; - tmp = type.getRawType(); - } - if (tmp.getClass().getName().equals( - businessInterface.getClass().getName())) { - genericType = tmp; - } - } - if (genericType == null) - throw new ComponentUpdaterException( - "User has specified a wrong businessInterface:" - + businessInterface); - // baseType = JavaIntrospectionHelper.getBusinessInterface(baseType, - // genericType); - /* - * Class<?> baseType = getBaseType(rawType, genericType); if - * (CallableReference.class.isAssignableFrom(baseType)) { if - * (Collection.class.isAssignableFrom(rawType)) { genericType = - * JavaIntrospectionHelper.getParameterType(genericType); } baseType = - * JavaIntrospectionHelper.getBusinessInterface(baseType, genericType); } - */ - try { - - JavaInterface callInterface = javaFactory - .createJavaInterface(JavaIntrospectionHelper - .getErasure(genericType)); - reference.getInterfaceContract().setInterface(callInterface); - if (callInterface.getCallbackClass() != null) { - JavaInterface callbackInterface = javaFactory - .createJavaInterface(callInterface.getCallbackClass()); - reference.getInterfaceContract().setCallbackInterface( - callbackInterface); - } - } catch (InvalidInterfaceException e) { - throw new IntrospectionException(e); - } - return reference; - } - - /* - * private org.apache.tuscany.sca.assembly.Reference - * createReference(JavaElementImpl element, String name) throws - * IntrospectionException { org.apache.tuscany.sca.assembly.Reference - * reference = assemblyFactory.createReference(); JavaInterfaceContract - * interfaceContract = javaFactory.createJavaInterfaceContract(); - * reference.setInterfaceContract(interfaceContract); - * // reference.setMember((Member)element.getAnchor()); boolean required = - * true; Reference ref = element.getAnnotation(Reference.class); if (ref != - * null) { required = ref.required(); } // reference.setRequired(required); - * reference.setName(name); Class<?> rawType = element.getType(); if - * (rawType.isArray() || Collection.class.isAssignableFrom(rawType)) { if - * (required) { reference.setMultiplicity(Multiplicity.ONE_N); } else { - * reference.setMultiplicity(Multiplicity.ZERO_N); } } else { if (required) { - * reference.setMultiplicity(Multiplicity.ONE_ONE); } else { - * reference.setMultiplicity(Multiplicity.ZERO_ONE); } } Type genericType = - * element.getGenericType(); Class<?> baseType = getBaseType(rawType, - * genericType); if (CallableReference.class.isAssignableFrom(baseType)) { - * if (Collection.class.isAssignableFrom(rawType)) { genericType = - * JavaIntrospectionHelper.getParameterType(genericType); } baseType = - * JavaIntrospectionHelper.getBusinessInterface(baseType, genericType); } - * try { JavaInterface callInterface = - * javaFactory.createJavaInterface(baseType); - * reference.getInterfaceContract().setInterface(callInterface); if - * (callInterface.getCallbackClass() != null) { JavaInterface - * callbackInterface = - * javaFactory.createJavaInterface(callInterface.getCallbackClass()); - * reference.getInterfaceContract().setCallbackInterface(callbackInterface); } } - * catch (InvalidInterfaceException e) { throw new - * IntrospectionException(e); } return reference; } - */ - public ComponentReference addReferenceWire(String referenceName, - String className, Class<?> interfaceName, String targetComponent) - throws ComponentUpdaterException, ComponentNotFoundException { - - StAXArtifactProcessorExtensionPoint staxProcessors = registry - .getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); - MetaComponentProcessor processor = (MetaComponentProcessor) staxProcessors - .getProcessor(Component.class); - - Contribution contrib = contributionService.getContribution(contribURI); - - List<DeployedArtifact> artifacts = contrib.getArtifacts(); - RuntimeComponent source = null; - Composite composite = ArtifactsFinder.findComposite(compositeURI, - artifacts); - // TODO error handling - if (composite != null) - source = (RuntimeComponent) ArtifactsFinder.findComponent( - composite, componentName); - else { - throw new ComponentNotFoundException("Not found component " - + componentName + " for update"); - } - if (source != null) { - // Debig this - RuntimeComponentReference targetReference = (RuntimeComponentReference) assemblyFactory - .createComponentReference(); - targetReference.setName(referenceName); - targetReference.setUnresolved(true); - Reference reference = null; - try { - reference = buildReference(referenceName, className, - interfaceName, true); - } catch (Exception e) { - throw new ComponentUpdaterException(e.getMessage()); - } - source.getImplementation().getReferences().add(reference); - - // targetService. - ComponentService targetService = assemblyFactory - .createComponentService(); - targetService.setUnresolved(true); - targetService.setName(targetComponent); - targetReference.getTargets().add(targetService); - - // reconciliate - reconcileReference(reference, targetReference, componentName); - // create component reference for the reference - source.getReferences().add(targetReference); - try { - processor.resolveReference(targetReference, contrib - .getModelResolver()); - } catch (ContributionResolveException e) { - throw new ComponentUpdaterException( - "Contribution Resolving Exception while updating.."); - } - - CompositeActivatorImpl activator = (CompositeActivatorImpl) compositeActivator; - compositeBuilder.attachWire(source, composite, targetReference); - activator.activate(source, targetReference); - synchronized (source) { - activator.configureComponentContext(source); - } - // RuntimeComponentReference runtimeRef = - // ((RuntimeComponentReference)ref); - // runtimeRef.setComponent(component); - for (Binding binding : targetReference.getBindings()) { - ReferenceBindingProvider bindingProvider = targetReference - .getBindingProvider(binding); - if (bindingProvider != null) { - bindingProvider.start(); - } - - } - - ImplementationProvider implementationProvider = source - .getImplementationProvider(); - if (implementationProvider != null) { - /* - * con la reflection cosi tolgo la dipendneza if - * ((implementationProvider.getClass().getName().equals("JavaImplementationProvider")) { - * Clazz cget } implementationProvider.getClass(). if - * (implementationProvider instanceof - * JavaImplementationProvider) { ((JavaImplementationProvider) - * implementationProvider). startReference(targetReference); } - */ - } - return targetReference; - } else { - throw new ComponentNotFoundException("Not found component " - + componentName + " for update"); - } - } - - public ComponentReference removeReferenceWire(String referenceName, - String targetComponent) throws ComponentUpdaterException, - ComponentNotFoundException { - List<DeployedArtifact> artifacts = contributionService.getContribution( - contribURI).getArtifacts(); - RuntimeComponent source = null; - Composite composite = ArtifactsFinder.findComposite(compositeURI, - artifacts); - ComponentReference toRemove = null; - - if (composite != null) { - source = (RuntimeComponent) ArtifactsFinder.findComponent( - composite, this.componentName); - } else { - throw new ComponentNotFoundException("Not found component " - + componentName + " for update"); - } - if ((source != null) && (targetComponent != null)) { - /* source target refenence */ - - List<ComponentReference> references = source.getReferences(); - for (ComponentReference ref : references) { - if (ref.getName().equals(targetComponent)) { - toRemove = ref; - break; - } - } - if (toRemove != null) { - CompositeActivatorImpl activator = (CompositeActivatorImpl) compositeActivator; - activator.stop(source, toRemove); - activator.deactivate(source, - (RuntimeComponentReference) toRemove); - compositeBuilder.detachWire(composite, source, toRemove); - } else { - throw new ComponentNotFoundException("Not found component " - + componentName + " for update"); - } - - } - return toRemove; - } -} diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/CompositeUpdaterImpl.java b/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/CompositeUpdaterImpl.java deleted file mode 100644 index c5a15b5108..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/CompositeUpdaterImpl.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.contribution.updater.impl; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.MetaComponent; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilder; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.contribution.Artifact; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.DeployedArtifact; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.service.ContributionService; -import org.apache.tuscany.sca.contribution.updater.CompositeUpdater; -import org.apache.tuscany.sca.contribution.updater.CompositeUpdaterException; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.assembly.CompositeActivator; -import org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl; -import org.apache.tuscany.sca.contribution.updater.impl.ArtifactsFinder; -import org.apache.tuscany.sca.assembly.xml.MetaComponentProcessor; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -public class CompositeUpdaterImpl implements CompositeUpdater { - - private CompositeBuilder compositeBuilder; - private String compositeURI; - private AssemblyFactory assemblyFactory; - private String contribURI; - private CompositeActivator compositeActivator; - private ExtensionPointRegistry registry; - private ContributionService contribService; - - public CompositeUpdaterImpl(AssemblyFactory assembly, String contribURI, - String compositeURI, CompositeBuilder compositeBuilder, - CompositeActivator compositeActivator, - ExtensionPointRegistry registry, ContributionService contribService) { - this.compositeBuilder = compositeBuilder; - this.compositeURI = compositeURI; - this.assemblyFactory = assembly; - this.contribURI = contribURI; - this.compositeActivator = compositeActivator; - this.registry = registry; - this.contribService = contribService; - } - - public Component addComponent(MetaComponent c) - throws CompositeUpdaterException { - StAXArtifactProcessorExtensionPoint staxProcessors = registry - .getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); - MetaComponentProcessor processor = (MetaComponentProcessor) staxProcessors - .getProcessor(Component.class); - Contribution contrib = contribService.getContribution(contribURI); - List<DeployedArtifact> artifacts = contrib.getArtifacts(); - Composite composite = ArtifactsFinder.findComposite(compositeURI, - artifacts); - boolean found = false; - - if (composite == null) - throw new CompositeUpdaterException( - "Composite not found in contribution" + contribURI); - else { - processor.setComposite(composite); - try { - processor.read(c.build()); - } catch (Exception e) { - throw new CompositeUpdaterException( - "Component error parsing in contribution" + contribURI); - - } - found = true; - } - - if (found) { - Component component = processor.getParsedComponent(); - Composite augmentedComposite = processor.getParsedComposite(); - try { - processor.resolve(component, contrib.getModelResolver()); - compositeBuilder.attach(augmentedComposite, component); - ((CompositeActivatorImpl) compositeActivator) - .activateComponent(component); - } catch (Exception e) { - - throw new CompositeUpdaterException( - "Cannot activate the component"); - } - - return component; - } - return null; - } - - public Component findComponent(String componentName) { - Contribution contrib = contribService.getContribution(contribURI); - List<Composite> artifacts = contrib.getDeployables(); - Composite composite = ArtifactsFinder.findComposite(compositeURI, - artifacts); - return ArtifactsFinder.findComponent(composite, componentName); - } - - public Component removeComponent(String componentName) - throws CompositeUpdaterException { - Contribution contrib = contribService.getContribution(contribURI); - List<DeployedArtifact> artifacts = contrib.getArtifacts(); - - Composite composite = ArtifactsFinder.findComposite(compositeURI, - artifacts); - List<Component> components = composite.getComponents(); - Component toRemove = null; - for (Component component : components) { - if (((RuntimeComponent) component).getName().equals(componentName)) { - toRemove = component; - break; - } - } - if (toRemove == null) { - throw new CompositeUpdaterException( - "Component not found in contribution" + contribURI); - } else { - // start again - try { - composite.getComponents().remove(toRemove); - CompositeActivatorImpl impl = (CompositeActivatorImpl) compositeActivator; - impl.stop(toRemove); - impl.deactivateComponent(toRemove); - CompositeBuilderImpl builder = (CompositeBuilderImpl) compositeBuilder; - builder.detach(composite, toRemove); - } catch (Exception e) { - throw new CompositeUpdaterException( - "Cannot remove composite from the contribution" - + contribURI); - } - return toRemove; - } - } - -} diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/ContributionUpdaterFactoryImpl.java b/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/ContributionUpdaterFactoryImpl.java deleted file mode 100644 index 7f5870ad55..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/src/main/java/org/apache/tuscany/sca/contribution/updater/impl/ContributionUpdaterFactoryImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.updater.impl; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilder; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.service.ContributionService; -import org.apache.tuscany.sca.contribution.updater.ComponentUpdater; -import org.apache.tuscany.sca.contribution.updater.CompositeUpdater; -import org.apache.tuscany.sca.contribution.updater.ContributionUpdater; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.assembly.CompositeActivator; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.contribution.updater.impl.ComponentUpdaterImpl; -import org.apache.tuscany.sca.contribution.updater.impl.CompositeUpdaterImpl; -import org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime; - -public class ContributionUpdaterFactoryImpl implements ContributionUpdater { - private AssemblyFactory assembly; - private JavaInterfaceFactory javaFactory; - private CompositeActivator compositeActivator; - private CompositeBuilder compositeBuilder; - private ExtensionPointRegistry registry; - private ContributionService contribService; - private InterfaceContractMapper mapper; - - public ContributionUpdaterFactoryImpl(ReallySmallRuntime runtime) { - this.assembly = runtime.getAssemblyFactory(); - this.javaFactory = runtime.getExtensionPointRegistry() - .getExtensionPoint(ModelFactoryExtensionPoint.class) - .getFactory(JavaInterfaceFactory.class); - this.compositeActivator = runtime.getCompositeActivator(); - this.compositeBuilder = runtime.getCompositeBuilder(); - this.registry = runtime.getExtensionPointRegistry(); - this.contribService = runtime.getContributionService(); - this.mapper = runtime.getInterfaceContractMapper(); - } - - public void setContributionService(ContributionService s) { - this.contribService = s; - } - - public ComponentUpdater getComponentUpdater(String contribURI, - String compositeURI, String componentName) { - - return new ComponentUpdaterImpl(contribURI, compositeURI, - componentName, assembly, javaFactory, compositeBuilder, - compositeActivator, contribService, registry, mapper); - } - - public CompositeUpdater getCompositeUpdater(String contribURI, - String compositeURI) { - return new CompositeUpdaterImpl(assembly, contribURI, compositeURI, - compositeBuilder, compositeActivator, registry, contribService); - } - -} diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/ContributionUpdaterTestCase.java b/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/ContributionUpdaterTestCase.java deleted file mode 100644 index 83d0224ad4..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/ContributionUpdaterTestCase.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.contribution.updater.impl; - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.node.SCANode; - -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -/** - * Test ContributionUpdater. - * - */ -public class ContributionUpdaterTestCase { - - // private static SCADomain domain; - private static SCANode node; - private static MetaComponentHello helloMeta; - - @Before - public void setUp() throws Exception { - /* - * System.out.println("Setting up domain"); - * - * SCADomainFactory domainFactory = SCADomainFactory.newInstance(); - * domain = domainFactory.createSCADomain("http://localhost:9999"); - * - * System.out.println("Setting up calculator nodes"); - * - * ClassLoader cl = ContributionUpdaterTestCase.class.getClassLoader(); - * - * SCANodeFactory nodeFactory = SCANodeFactory.newInstance(); try { - * log.info("Staring entropy handler"); prng = - * SecureRandom.getInstance("SHA1PRNG"); } catch - * (NoSuchAlgorithmException e) { // TODO Auto-generated catch block - * e.printStackTrace(); } componentName = - * "HelloComponent"+this.uniqueID(); - * t.setAttribute("componentName",componentName); - * - * node = nodeFactory.createSCANode("http://localhost:8100/nodeA", - * "http://localhost:9999"); node.addContribution("nodeA", - * cl.getResource("nodeA/")); node.addToDomainLevelComposite(new - * QName("http://test", "HelloComposite")); node.start(); - * SCADomainFinder domainFinder = SCADomainFinder.newInstance(); domain = - * domainFinder.getSCADomain("http://localhost:9999"); helloMeta = new - * MetaComponentHello(); - * helloMeta.setComponentClass("org.apache.tuscany.sca.contribution.updater.impl.HelloComponent"); - */ - } - - @After - public void tearDown() throws Exception { - - } - - @Test - public void testAddNewComponent() throws ClassNotFoundException, - MalformedURLException { - /* - * String helloComponent1 = "<component - * xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" - * name=\"HelloComponent1\">\n" + "<implementation.java - * class=\"org.apache.tuscany.sca.contribution.updater.impl.HelloComponent\"/>"+ "</component>"; - * MetaComponent mc = - * MetaComponentFactory.newMetaComponent("HelloComponent1",helloComponent1); - * try { ((SCANodeImpl) node).addComponentToComposite(mc, "nodeA", - * "HelloComposite.composite"); GreetService greet = - * node.getDomain().getService(GreetService.class, "HelloComponent1"); - * greet.sayHello("Italian").equals("Ciao"); } catch (Exception e) { - * Assert.fail(e.getMessage()); } - */ - Assert.assertEquals("skip", "skip"); - } - - @Test - public void testWireComponents() throws ClassNotFoundException, - MalformedURLException { - Assert.assertEquals("skip", "skip"); - /* - * String helloComponent1 = "<component - * xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" - * name=\"HelloComponent1\">\n" + "<implementation.java - * class=\"org.apache.tuscany.sca.contribution.updater.impl.HelloComponent\"/>"+ "</component>"; - * String helloComponent2 = "<component - * xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" - * name=\"HelloComponent2\">\n" + "<implementation.java - * class=\"org.apache.tuscany.sca.contribution.updater.impl.HelloComponent\"/>"+ "</component>"; - * MetaComponent mc1 = - * MetaComponentFactory.newMetaComponent("HelloComponent1",helloComponent1); - * MetaComponent mc2 = - * MetaComponentFactory.newMetaComponent("HelloComponent2",helloComponent2); - * - * try { ((SCANodeImpl) node).addComponentToComposite(mc1, "nodeA", - * "HelloComposite.composite"); ((SCANodeImpl) - * node).addComponentToComposite(mc2, "nodeA", - * "HelloComposite.composite"); GreetService greet = - * node.getDomain().getService(GreetService.class, "HelloComponent1"); - * greet.sayHello("Italian").equals("Ciao"); } catch (Exception e) { - * Assert.fail(e.getMessage()); } - */ - } - -} diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/GreetService.java b/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/GreetService.java deleted file mode 100644 index 0eb7fb692b..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/GreetService.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.contribution.updater.impl; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface GreetService { - String sayHello(String language); -} diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/HelloComponent.java b/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/HelloComponent.java deleted file mode 100644 index 38fa2721bb..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/HelloComponent.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.contribution.updater.impl; - -import org.osoa.sca.annotations.Service; - -@Service(GreetService.class) -public class HelloComponent implements GreetService { - private String[][] languageGreets = { - { "English", "Italian", "Japanese", "German" }, - { "Hello!", "Ciao!", "Konnici wa!", "Hallo!" } }; - - public String sayHello(String language) { - for (int i = 0; i < 4; ++i) - for (int j = 0; j < 4; ++j) { - if (language.equals(languageGreets[i][j])) { - return languageGreets[0][0]; - } - } - return "I don't speak your language"; - } - -} diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/MetaComponentHello.java b/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/MetaComponentHello.java deleted file mode 100644 index 1495ff2cea..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/java/org/apache/tuscany/sca/contribution/updater/impl/MetaComponentHello.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.updater.impl; - -import java.io.StringReader; -import java.net.URI; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.util.logging.Logger; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.MetaComponent; - -public class MetaComponentHello implements MetaComponent { - private String componentName; - private String scdl; - private boolean loadedFromString = false; - private Logger log = Logger.getLogger(MetaComponentHello.class.getName()); - - public MetaComponentHello() { - } - - private MetaComponentHello(String scdl, boolean loadedFromString) { - this.scdl = scdl; - this.loadedFromString = loadedFromString; - } - - public MetaComponent fromSCDL(String scdl) { - return new MetaComponentHello(scdl, true); - } - - public XMLStreamReader build() throws Exception { - XMLInputFactory factory = XMLInputFactory.newInstance(); - return factory.createXMLStreamReader(new StringReader(scdl)); - } - - public String getName() { - - return componentName; - } - -} diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/resources/HelloComposite.composite b/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/resources/HelloComposite.composite deleted file mode 100644 index 76714a0e9c..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/resources/HelloComposite.composite +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - targetNamespace="http://test" - xmlns:test="http://test" - name="HelloComposite"> - <component name="HelloComponentService"> - <implementation.java="org.apache.tuscany.sca.contribution.updater.impl.HelloComponent"/> - </component> -</composite>
\ No newline at end of file diff --git a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/resources/repository/sample-calculator.jar b/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/resources/repository/sample-calculator.jar Binary files differdeleted file mode 100644 index 9c46c679d2..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater-impl/src/test/resources/repository/sample-calculator.jar +++ /dev/null diff --git a/branches/sca-java-1.4/modules/contribution-updater/LICENSE b/branches/sca-java-1.4/modules/contribution-updater/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-1.4/modules/contribution-updater/NOTICE b/branches/sca-java-1.4/modules/contribution-updater/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-1.4/modules/contribution-updater/pom.xml b/branches/sca-java-1.4/modules/contribution-updater/pom.xml deleted file mode 100644 index 775893295f..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-contribution-updater</artifactId> - <name>Apache Tuscany SCA Contribution Updater</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-java</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-namespace</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface-java</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-domain-api</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-api</artifactId> - <version>1.4</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.contribution.updater</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.contribution.updater*,org.apache.tuscany.sca.assembly*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/assembly/MetaComponent.java b/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/assembly/MetaComponent.java deleted file mode 100644 index 885fe8cfb0..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/assembly/MetaComponent.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import javax.xml.stream.XMLStreamReader; - -public interface MetaComponent { - XMLStreamReader build() throws Exception; - - String getName(); -} diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/assembly/xml/MetaComponentProcessor.java b/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/assembly/xml/MetaComponentProcessor.java deleted file mode 100644 index 44673bfdb9..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/assembly/xml/MetaComponentProcessor.java +++ /dev/null @@ -1,788 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Contract; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.Wire; -import org.apache.tuscany.sca.contribution.ContributionFactory; -import org.apache.tuscany.sca.contribution.DeployedArtifact; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.policy.PolicyFactory; -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; -import org.apache.tuscany.sca.policy.util.PolicyValidationException; -import org.w3c.dom.Document; - -/** - * A component processor. - * - * @version $Rev$ $Date$ - */ -public class MetaComponentProcessor extends BaseAssemblyProcessor implements - StAXArtifactProcessor<Component> { - - /** - * Construct a new composite processor - * - * @param contributionFactory - * @param assemblyFactory - * @param policyFactory - * @param extensionProcessor - */ - private Composite composite = null; - private Component generatedComponent = null; - - public MetaComponentProcessor(ContributionFactory contributionFactory, - AssemblyFactory factory, PolicyFactory policyFactory, - InterfaceContractMapper interfaceContractMapper, - StAXArtifactProcessor extensionProcessor) { - super(contributionFactory, factory, policyFactory, extensionProcessor); - } - - /** - * Construct a new composite processor - * - * @param assemblyFactory - * @param policyFactory - * @param extensionProcessor - * public CompositeProcessor(AssemblyFactory factory, - * PolicyFactory policyFactory, InterfaceContractMapper - * interfaceContractMapper, StAXArtifactProcessor - * extensionProcessor) { super(factory, policyFactory, - * extensionProcessor); } - */ - public void setComposite(Composite c) { - composite = c; - } - - public Component getParsedComponent() { - return this.generatedComponent; - } - - public Composite getParsedComposite() { - return this.composite; - } - - public Component read(XMLStreamReader reader) - throws ContributionReadException, XMLStreamException { - Composite include = null; - Component component = null; - Property property = null; - ComponentService componentService = null; - ComponentReference componentReference = null; - ComponentProperty componentProperty = null; - CompositeService compositeService = null; - CompositeReference compositeReference = null; - Contract contract = null; - Wire wire = null; - Callback callback = null; - QName name = null; - - // Read the component scdl - - while (reader.hasNext()) { - int event = reader.getEventType(); - switch (event) { - case START_ELEMENT: - QName itemName = reader.getName(); - if (!itemName.getNamespaceURI().equals(SCA10_NS)) - name = new QName(SCA10_NS, itemName.getLocalPart()); - else - name = itemName; - - if (SERVICE_QNAME.equals(name)) { - if (component != null) { - - // Read a <component><service> - componentService = assemblyFactory - .createComponentService(); - contract = componentService; - componentService.setName(getString(reader, NAME)); - component.getServices().add(componentService); - policyProcessor.readPolicies(contract, reader); - } - - } else if (REFERENCE_QNAME.equals(name)) { - if (component != null) { - // Read a <component><reference> - componentReference = assemblyFactory - .createComponentReference(); - contract = componentReference; - componentReference.setName(getString(reader, NAME)); - readMultiplicity(componentReference, reader); - if (isSet(reader, AUTOWIRE)) { - componentReference.setAutowire(getBoolean(reader, - AUTOWIRE)); - } - readTargets(componentReference, reader); - componentReference.setWiredByImpl(getBoolean(reader, - WIRED_BY_IMPL)); - component.getReferences().add(componentReference); - policyProcessor.readPolicies(contract, reader); - } - - } else if (PROPERTY_QNAME.equals(name)) { - if (component != null) { - - // Read a <component><property> - componentProperty = assemblyFactory - .createComponentProperty(); - property = componentProperty; - componentProperty.setSource(getString(reader, SOURCE)); - componentProperty.setFile(getString(reader, FILE)); - policyProcessor.readPolicies(property, reader); - readAbstractProperty(componentProperty, reader); - - // Read the property value - Document value = readPropertyValue(property - .getXSDElement(), property.getXSDType(), reader); - property.setValue(value); - - component.getProperties().add(componentProperty); - } - } else if (COMPONENT_QNAME.equals(name)) { - - // Read a <component> - component = assemblyFactory.createComponent(); - component.setName(getString(reader, NAME)); - if (isSet(reader, AUTOWIRE)) { - component.setAutowire(getBoolean(reader, AUTOWIRE)); - } - if (isSet(reader, URI)) { - component.setURI(getString(reader, URI)); - } - component.setConstrainingType(readConstrainingType(reader)); - composite.getComponents().add(component); - policyProcessor.readPolicies(component, reader); - - } else if (WIRE_QNAME.equals(name)) { - - // Read a <wire> - wire = assemblyFactory.createWire(); - ComponentReference source = assemblyFactory - .createComponentReference(); - source.setUnresolved(true); - source.setName(getString(reader, SOURCE)); - wire.setSource(source); - - ComponentService target = assemblyFactory - .createComponentService(); - target.setUnresolved(true); - target.setName(getString(reader, TARGET)); - wire.setTarget(target); - - composite.getWires().add(wire); - policyProcessor.readPolicies(wire, reader); - - } else if (CALLBACK_QNAME.equals(name)) { - - // Read a <callback> - callback = assemblyFactory.createCallback(); - contract.setCallback(callback); - policyProcessor.readPolicies(callback, reader); - - } else if (OPERATION_QNAME.equals(name)) { - - // Read an <operation> - Operation operation = assemblyFactory.createOperation(); - operation.setName(getString(reader, NAME)); - operation.setUnresolved(true); - if (callback != null) { - policyProcessor.readPolicies(callback, operation, - reader); - } else { - policyProcessor.readPolicies(contract, operation, - reader); - } - } else if (IMPLEMENTATION_COMPOSITE_QNAME.equals(name)) { - - // Read an implementation.composite - Composite implementation = assemblyFactory - .createComposite(); - implementation.setName(getQName(reader, NAME)); - implementation.setUnresolved(true); - component.setImplementation(implementation); - policyProcessor.readPolicies(implementation, reader); - } else { - - // Read an extension element - Object extension = extensionProcessor.read(reader); - if (extension != null) { - if (extension instanceof InterfaceContract) { - - // <service><interface> and - // <reference><interface> - if (contract != null) { - contract - .setInterfaceContract((InterfaceContract) extension); - } else { - if (name.getNamespaceURI().equals(SCA10_NS)) { - throw new ContributionReadException( - "Unexpected <interface> element found. It should appear inside a <service> or <reference> element"); - } else { - composite.getExtensions().add(extension); - } - } - - } else if (extension instanceof Binding) { - // <service><binding> and - // <reference><binding> - if (callback != null) { - callback.getBindings().add((Binding) extension); - } else { - if (contract != null) { - contract.getBindings().add( - (Binding) extension); - } else { - if (name.getNamespaceURI().equals(SCA10_NS)) { - throw new ContributionReadException( - "Unexpected <binding> element found. It should appear inside a <service> or <reference> element"); - } else { - composite.getExtensions() - .add(extension); - } - } - } - - } else if (extension instanceof Implementation) { - - // <component><implementation> - if (component != null) { - component - .setImplementation((Implementation) extension); - } else { - if (name.getNamespaceURI().equals(SCA10_NS)) { - throw new ContributionReadException( - "Unexpected <implementation> element found. It should appear inside a <component> element"); - } else { - composite.getExtensions().add(extension); - } - } - } else { - - // Add the extension element to the current - // element - if (callback != null) { - callback.getExtensions().add(extension); - } else if (contract != null) { - contract.getExtensions().add(extension); - } else if (property != null) { - property.getExtensions().add(extension); - } else if (component != null) { - component.getExtensions().add(extension); - } else { - composite.getExtensions().add(extension); - } - } - } - } - break; - - case XMLStreamConstants.CHARACTERS: - break; - - case END_ELEMENT: - name = reader.getName(); - - // Clear current state when reading reaching end element - if (SERVICE_QNAME.equals(name)) { - componentService = null; - compositeService = null; - contract = null; - } else if (INCLUDE_QNAME.equals(name)) { - include = null; - } else if (REFERENCE_QNAME.equals(name)) { - componentReference = null; - compositeReference = null; - contract = null; - } else if (PROPERTY_QNAME.equals(name)) { - componentProperty = null; - property = null; - } else if (COMPONENT_QNAME.equals(name)) { - // component = null; - } else if (WIRE_QNAME.equals(name)) { - wire = null; - } else if (CALLBACK_QNAME.equals(name)) { - callback = null; - } - break; - } - - // Read the next element - if (reader.hasNext()) { - reader.next(); - } - } - this.generatedComponent = component; - return component; - } - - public void write(Composite composite, XMLStreamWriter writer) - throws ContributionWriteException, XMLStreamException { - - // Write <composite> element - writeStartDocument(writer, COMPOSITE, writeConstrainingType(composite), - new XAttr(TARGET_NAMESPACE, composite.getName() - .getNamespaceURI()), new XAttr(NAME, composite - .getName().getLocalPart()), new XAttr(AUTOWIRE, - composite.getAutowire()), policyProcessor - .writePolicies(composite)); - - // Write <service> elements - for (Service service : composite.getServices()) { - CompositeService compositeService = (CompositeService) service; - Component promotedComponent = compositeService - .getPromotedComponent(); - ComponentService promotedService = compositeService - .getPromotedService(); - String promote; - if (promotedService != null) { - if (promotedService.getName() != null) { - promote = promotedComponent.getName() + '/' - + promotedService.getService(); - } else { - promote = promotedComponent.getName(); - } - } else { - promote = null; - } - writeStart(writer, SERVICE, new XAttr(NAME, service.getName()), - new XAttr(PROMOTE, promote), policyProcessor - .writePolicies(service)); - - // Write service interface - extensionProcessor.write(service.getInterfaceContract(), writer); - - // Write bindings - for (Binding binding : service.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write <callback> element - if (service.getCallback() != null) { - Callback callback = service.getCallback(); - writeStart(writer, CALLBACK, policyProcessor - .writePolicies(callback)); - - // Write callback bindings - for (Binding binding : callback.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write extensions - for (Object extension : callback.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEnd(writer); - } - - // Write extensions - for (Object extension : service.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEnd(writer); - } - - // Write <component> elements - for (Component component : composite.getComponents()) { - writeStart(writer, COMPONENT, new XAttr(NAME, component.getName()), - new XAttr(URI, component.getURI()), new XAttr(AUTOWIRE, - component.getAutowire()), policyProcessor - .writePolicies(component)); - - // Write <service> elements - for (ComponentService service : component.getServices()) { - writeStart(writer, SERVICE, new XAttr(NAME, service.getName()), - policyProcessor.writePolicies(service)); - - // Write service interface - extensionProcessor - .write(service.getInterfaceContract(), writer); - - // Write bindings - for (Binding binding : service.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write <callback> element - if (service.getCallback() != null) { - Callback callback = service.getCallback(); - writeStart(writer, CALLBACK, policyProcessor - .writePolicies(callback)); - - // Write bindings - for (Binding binding : callback.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write extensions - for (Object extension : callback.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEnd(writer); - } - - // Write extensions - for (Object extension : service.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEnd(writer); - } - - // Write <reference> elements - for (ComponentReference reference : component.getReferences()) { - writeStart(writer, REFERENCE, new XAttr(NAME, reference - .getName()), new XAttr(AUTOWIRE, reference - .getAutowire()), writeTargets(reference), - policyProcessor.writePolicies(reference)); - - // Write reference interface - extensionProcessor.write(reference.getInterfaceContract(), - writer); - - // Write bindings - for (Binding binding : reference.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write callback - if (reference.getCallback() != null) { - Callback callback = reference.getCallback(); - writeStart(writer, CALLBACK, policyProcessor - .writePolicies(callback)); - - // Write callback bindings - for (Binding binding : callback.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write extensions - for (Object extensions : callback.getExtensions()) { - extensionProcessor.write(extensions, writer); - } - - writeEnd(writer); - } - - // Write extensions - for (Object extensions : reference.getExtensions()) { - extensionProcessor.write(extensions, writer); - } - - writeEnd(writer); - } - - // Write <property> elements - for (ComponentProperty property : component.getProperties()) { - writeStart(writer, PROPERTY, - new XAttr(NAME, property.getName()), new XAttr( - MUST_SUPPLY, property.isMustSupply()), - new XAttr(MANY, property.isMany()), new XAttr(TYPE, - property.getXSDType()), new XAttr(ELEMENT, - property.getXSDElement()), new XAttr(SOURCE, - property.getSource()), new XAttr(FILE, property - .getFile()), policyProcessor - .writePolicies(property)); - - // Write property value - writePropertyValue(property.getValue(), property - .getXSDElement(), property.getXSDType(), writer); - - // Write extensions - for (Object extension : property.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEnd(writer); - } - - // Write the component implementation - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - writeStart(writer, IMPLEMENTATION_COMPOSITE, new XAttr(NAME, - composite.getName())); - writeEnd(writer); - } else { - extensionProcessor.write(component.getImplementation(), writer); - } - - writeEnd(writer); - } - - // Write <reference> elements - for (Reference reference : composite.getReferences()) { - CompositeReference compositeReference = (CompositeReference) reference; - - // Write list of promoted references - List<String> promote = new ArrayList<String>(); - for (ComponentReference promoted : compositeReference - .getPromotedReferences()) { - promote.add(promoted.getName()); - } - - // Write <reference> element - writeStart(writer, REFERENCE, new XAttr(NAME, reference.getName()), - new XAttr(PROMOTE, promote), policyProcessor - .writePolicies(reference)); - - // Write reference interface - extensionProcessor.write(reference.getInterfaceContract(), writer); - - // Write bindings - for (Binding binding : reference.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write <callback> element - if (reference.getCallback() != null) { - Callback callback = reference.getCallback(); - writeStart(writer, CALLBACK); - - // Write callback bindings - for (Binding binding : callback.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write extensions - for (Object extension : callback.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEnd(writer); - } - - // Write extensions - for (Object extension : reference.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEnd(writer); - } - - // Write <property> elements - for (Property property : composite.getProperties()) { - writeStart(writer, PROPERTY, new XAttr(NAME, property.getName()), - new XAttr(MUST_SUPPLY, property.isMustSupply()), new XAttr( - MANY, property.isMany()), new XAttr(TYPE, property - .getXSDType()), new XAttr(ELEMENT, property - .getXSDElement()), policyProcessor - .writePolicies(property)); - - // Write property value - writePropertyValue(property.getValue(), property.getXSDElement(), - property.getXSDType(), writer); - - // Write extensions - for (Object extension : property.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEnd(writer); - } - - // Write <wire> elements - for (Wire wire : composite.getWires()) { - writeStart(writer, WIRE, new XAttr(SOURCE, wire.getSource() - .getName()), new XAttr(TARGET, wire.getTarget().getName())); - - // Write extensions - for (Object extension : wire.getExtensions()) { - extensionProcessor.write(extension, writer); - } - writeEnd(writer); - } - - for (Object extension : composite.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEndDocument(writer); - } - - public void resolve(Composite composite, ModelResolver resolver) - throws ContributionResolveException, PolicyValidationException { - - // Resolve constraining type - ConstrainingType constrainingType = composite.getConstrainingType(); - if (constrainingType != null) { - constrainingType = resolver.resolveModel(ConstrainingType.class, - constrainingType); - composite.setConstrainingType(constrainingType); - } - - // Resolve includes in the composite - for (int i = 0, n = composite.getIncludes().size(); i < n; i++) { - Composite include = composite.getIncludes().get(i); - if (include != null) { - include = resolver.resolveModel(Composite.class, include); - composite.getIncludes().set(i, include); - } - } - - // Resolve extensions - for (Object extension : composite.getExtensions()) { - if (extension != null) { - extensionProcessor.resolve(extension, resolver); - } - } - - // Resolve component implementations, services and references - for (Component component : composite.getComponents()) { - constrainingType = component.getConstrainingType(); - if (constrainingType != null) { - constrainingType = resolver.resolveModel( - ConstrainingType.class, constrainingType); - component.setConstrainingType(constrainingType); - } - - Implementation implementation = component.getImplementation(); - if (implementation != null) { - implementation = resolveImplementation(implementation, resolver); - component.setImplementation(implementation); - } - - for (ComponentProperty componentProperty : component - .getProperties()) { - if (componentProperty.getFile() != null) { - DeployedArtifact deployedArtifact = contributionFactory - .createDeployedArtifact(); - deployedArtifact.setURI(componentProperty.getFile()); - deployedArtifact = resolver.resolveModel( - DeployedArtifact.class, deployedArtifact); - if (deployedArtifact.getLocation() != null) { - componentProperty.setFile(deployedArtifact - .getLocation()); - } - } - } - resolveIntents(component.getRequiredIntents(), resolver); - resolvePolicySets(component.getPolicySets(), resolver); - resolveContracts(component.getServices(), resolver); - resolveContracts(component.getReferences(), resolver); - } - - // Resolve composite services and references - resolveContracts(composite.getServices(), resolver); - resolveContracts(composite.getReferences(), resolver); - if (composite instanceof PolicySetAttachPoint) { - resolveIntents(((PolicySetAttachPoint) composite) - .getRequiredIntents(), resolver); - resolvePolicySets(((PolicySetAttachPoint) composite) - .getPolicySets(), resolver); - } - } - - public void write(Component model, XMLStreamWriter writer) - throws ContributionWriteException, XMLStreamException { - write(this.composite, writer); - - } - - public void resolve(Component component, ModelResolver resolver) - throws ContributionResolveException { - // Resolve component implementations, services and references - ConstrainingType constrainingType = component.getConstrainingType(); - if (constrainingType != null) { - constrainingType = resolver.resolveModel(ConstrainingType.class, - constrainingType); - component.setConstrainingType(constrainingType); - } - - Implementation implementation = component.getImplementation(); - if (implementation != null) { - implementation = resolveImplementation(implementation, resolver); - component.setImplementation(implementation); - } - - for (ComponentProperty componentProperty : component.getProperties()) { - if (componentProperty.getFile() != null) { - DeployedArtifact deployedArtifact = contributionFactory - .createDeployedArtifact(); - deployedArtifact.setURI(componentProperty.getFile()); - deployedArtifact = resolver.resolveModel( - DeployedArtifact.class, deployedArtifact); - if (deployedArtifact.getLocation() != null) { - componentProperty.setFile(deployedArtifact.getLocation()); - } - } - } - resolveIntents(component.getRequiredIntents(), resolver); - resolvePolicySets(component.getPolicySets(), resolver); - resolveContracts(component.getServices(), resolver); - resolveContracts(component.getReferences(), resolver); - } - - public void resolveReference(ComponentReference reference, - ModelResolver resolver) throws ContributionResolveException { - resolveIntents(reference.getRequiredIntents(), resolver); - resolvePolicySets(reference.getPolicySets(), resolver); - List<ComponentReference> contracts = new ArrayList<ComponentReference>(); - contracts.add(reference); - resolveContracts(contracts, resolver); - } - - public QName getArtifactType() { - return COMPONENT_QNAME; - } - - public Class<Component> getModelType() { - - return Component.class; - } - -} diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ComponentNotFoundException.java b/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ComponentNotFoundException.java deleted file mode 100644 index d93a92b32c..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ComponentNotFoundException.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.contribution.updater; - -public class ComponentNotFoundException extends Exception { - - public ComponentNotFoundException(String string) { - super(string); - } - -} diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ComponentUpdater.java b/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ComponentUpdater.java deleted file mode 100644 index 8743556538..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ComponentUpdater.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.updater; - -import org.apache.tuscany.sca.assembly.ComponentReference; - -public interface ComponentUpdater { - public ComponentReference addReferenceWire(String referenceName, - String className, Class<?> interfaceName, String targetComponent) - throws ComponentUpdaterException, ComponentNotFoundException; - - public ComponentReference removeReferenceWire(String referenceName, - String targetComponent) throws ComponentUpdaterException, - ComponentNotFoundException; -} diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ComponentUpdaterException.java b/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ComponentUpdaterException.java deleted file mode 100644 index f94238089f..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ComponentUpdaterException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.updater; - -public class ComponentUpdaterException extends Exception { - - private static final long serialVersionUID = 33909120912033L; - - public ComponentUpdaterException(String string) { - super(string); - } -} diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/CompositeNotFoundException.java b/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/CompositeNotFoundException.java deleted file mode 100644 index 52d7e602b7..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/CompositeNotFoundException.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.updater; - -public class CompositeNotFoundException extends Exception { - public CompositeNotFoundException(String msg) { - super(msg); - } -} diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/CompositeUpdater.java b/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/CompositeUpdater.java deleted file mode 100644 index 4f55148651..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/CompositeUpdater.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.updater; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.MetaComponent; - -public interface CompositeUpdater { - Component addComponent(MetaComponent c) throws CompositeUpdaterException; - - Component removeComponent(String componentName) - throws CompositeUpdaterException; - - Component findComponent(String componentName); -} diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/CompositeUpdaterException.java b/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/CompositeUpdaterException.java deleted file mode 100644 index 3dc86d97f7..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/CompositeUpdaterException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.updater; - -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; - -public class CompositeUpdaterException extends Exception { - - public CompositeUpdaterException(String string) { - super(string); - } - -} diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ContributionUpdater.java b/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ContributionUpdater.java deleted file mode 100644 index a364c23174..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/main/java/org/apache/tuscany/sca/contribution/updater/ContributionUpdater.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.updater; - -/* - * This interface is used to get and modify artifacts from an existing - * contribution - */ -public interface ContributionUpdater { - CompositeUpdater getCompositeUpdater(String contribURI, String compositeURI); - - ComponentUpdater getComponentUpdater(String contribURI, - String compositeURI, String componentName); -} diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/test/resources/HelloComposite.composite b/branches/sca-java-1.4/modules/contribution-updater/src/test/resources/HelloComposite.composite deleted file mode 100644 index 76714a0e9c..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/test/resources/HelloComposite.composite +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - targetNamespace="http://test" - xmlns:test="http://test" - name="HelloComposite"> - <component name="HelloComponentService"> - <implementation.java="org.apache.tuscany.sca.contribution.updater.impl.HelloComponent"/> - </component> -</composite>
\ No newline at end of file diff --git a/branches/sca-java-1.4/modules/contribution-updater/src/test/resources/repository/sample-calculator.jar b/branches/sca-java-1.4/modules/contribution-updater/src/test/resources/repository/sample-calculator.jar Binary files differdeleted file mode 100644 index 9c46c679d2..0000000000 --- a/branches/sca-java-1.4/modules/contribution-updater/src/test/resources/repository/sample-calculator.jar +++ /dev/null diff --git a/branches/sca-java-1.4/modules/core-spring/LICENSE b/branches/sca-java-1.4/modules/core-spring/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-1.4/modules/core-spring/NOTICE b/branches/sca-java-1.4/modules/core-spring/NOTICE deleted file mode 100644 index fdfa0e9faa..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2008 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-1.4/modules/core-spring/pom.xml b/branches/sca-java-1.4/modules/core-spring/pom.xml deleted file mode 100644 index 6af8cf1062..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/pom.xml +++ /dev/null @@ -1,126 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-core-spring</artifactId> - <name>Apache Tuscany SCA Spring-based Core Runtime</name> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface-java</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>2.5.5</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>2.5.5</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>2.5.5</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface-java-xml</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-xml</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-impl</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-sca</artifactId> - <version>1.4</version> - </dependency> - - </dependencies> - - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.core.spring</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.core.spring*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanAssemblyFactory.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanAssemblyFactory.java deleted file mode 100644 index 94bd5c8cf2..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanAssemblyFactory.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.assembly.impl; - -import org.apache.tuscany.sca.assembly.AbstractProperty; -import org.apache.tuscany.sca.assembly.AbstractReference; -import org.apache.tuscany.sca.assembly.AbstractService; -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.ConfiguredOperation; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.Wire; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; - -/** - * An alternate implementation of the SCA assembly model factory that creates SCA - * assembly model objects backed by Spring bean definitions. - * - * @version $Rev$ $Date$ - */ -public class BeanAssemblyFactory implements AssemblyFactory { - private AssemblyFactory defaultFactory; - private BeanDefinitionRegistry beanRegistry; - - public BeanAssemblyFactory(AssemblyFactory defaultFactory, BeanDefinitionRegistry beanRegistry) { - this.defaultFactory = defaultFactory; - this.beanRegistry = beanRegistry; - } - - public BeanAssemblyFactory(BeanDefinitionRegistry beanRegistry) { - this(new DefaultAssemblyFactory(), beanRegistry); - } - - public AbstractProperty createAbstractProperty() { - return defaultFactory.createAbstractProperty(); - } - - public AbstractReference createAbstractReference() { - return defaultFactory.createAbstractReference(); - } - - public AbstractService createAbstractService() { - return defaultFactory.createAbstractService(); - } - - public Callback createCallback() { - return defaultFactory.createCallback(); - } - - public Component createComponent() { - return new BeanComponentImpl(beanRegistry); - } - - public ComponentProperty createComponentProperty() { - return defaultFactory.createComponentProperty(); - } - - public ComponentReference createComponentReference() { - return defaultFactory.createComponentReference(); - } - - public ComponentService createComponentService() { - return defaultFactory.createComponentService(); - } - - public ComponentType createComponentType() { - return defaultFactory.createComponentType(); - } - - public Composite createComposite() { - return defaultFactory.createComposite(); - } - - public CompositeReference createCompositeReference() { - return defaultFactory.createCompositeReference(); - } - - public CompositeService createCompositeService() { - return defaultFactory.createCompositeService(); - } - - public ConstrainingType createConstrainingType() { - return defaultFactory.createConstrainingType(); - } - - public Property createProperty() { - return defaultFactory.createProperty(); - } - - public Reference createReference() { - return defaultFactory.createReference(); - } - - public Service createService() { - return defaultFactory.createService(); - } - - public Wire createWire() { - return defaultFactory.createWire(); - } - - public ConfiguredOperation createConfiguredOperation() { - return defaultFactory.createConfiguredOperation(); - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanComponentImpl.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanComponentImpl.java deleted file mode 100644 index f2c517b092..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanComponentImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.IntentAttachPointType; -import org.apache.tuscany.sca.policy.PolicySet; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.AbstractBeanDefinition; -import org.springframework.beans.factory.support.GenericBeanDefinition; - -/** - * An implementation of the SCA assembly Component interface backed by a Spring - * Bean definition. - * - * @version $Rev$ $Date$ - */ -public class BeanComponentImpl extends GenericBeanDefinition implements Component, Cloneable { - private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>(); - - public IntentAttachPointType getType() { - // TODO Auto-generated method stub - return null; - } - - public void setType(IntentAttachPointType type) { - // TODO Auto-generated method stub - - } - - private static final long serialVersionUID = 1L; - - private ConstrainingType constrainingType; - private Implementation implementation; - private String name; - private String uri; - private List<ComponentService> services = new ArrayList<ComponentService>(); - private List<Intent> requiredIntents = new ArrayList<Intent>(); - private List<PolicySet> policySets = new ArrayList<PolicySet>(); - private List<Object> extensions = new ArrayList<Object>(); - private boolean unresolved = false; - private BeanDefinitionRegistry beanRegistry; - - protected BeanComponentImpl(BeanDefinitionRegistry beanRegistry) { - //super((String)""); - this.beanRegistry = beanRegistry; - } - - @Override - public AbstractBeanDefinition cloneBeanDefinition() { - BeanComponentImpl clone = (BeanComponentImpl)super.cloneBeanDefinition(); - clone.getProperties().clear(); - try { - for (ComponentProperty property : getProperties()) { - clone.getProperties().add((ComponentProperty)property.clone()); - } - clone.getReferences().clear(); - for (ComponentReference reference : getReferences()) { - clone.getReferences().add((ComponentReference)reference.clone()); - } - clone.getServices().clear(); - for (ComponentService service : getServices()) { - clone.getServices().add((ComponentService)service.clone()); - } - return clone; - } catch (CloneNotSupportedException e) { - //throw new CloneNotSupportedException(e.getMessage()); - } - return clone; - } - - @Override - public String getParentName() { - //TODO find a better name for bean definitions representing component types - return String.valueOf(System.identityHashCode(implementation)); - } - - public ConstrainingType getConstrainingType() { - return constrainingType; - } - - public Implementation getImplementation() { - return implementation; - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - - // Register this bean definition in the bean registry - this.beanRegistry.registerBeanDefinition(uri, this); - } - - public String getName() { - return name; - } - - //TODO use a better list implementation - private List<ComponentProperty> properties = new ArrayList<ComponentProperty>() { - private static final long serialVersionUID = 1L; - - // Add a property - @Override - public boolean add(ComponentProperty property) { - - // Add corresponding bean property value - getPropertyValues().addPropertyValue(property.getName(), property.getValue()); - - return super.add(property); - } - }; - - public List<ComponentProperty> getProperties() { - return properties; - } - - //TODO use a better list implementation - private List<ComponentReference> references = new ArrayList<ComponentReference>() { - private static final long serialVersionUID = 1L; - - // Add a reference - @Override - public boolean add(ComponentReference reference) { - - // Add corresponding bean property value - if (!reference.getName().startsWith("$self$.")) { - BeanReferenceImpl beanReference = new BeanReferenceImpl(reference); - getPropertyValues().addPropertyValue(reference.getName(), beanReference); - } - return super.add(reference); - } - }; - - public List<ComponentReference> getReferences() { - return references; - } - - public List<ComponentService> getServices() { - return services; - } - - public void setConstrainingType(ConstrainingType constrainingType) { - this.constrainingType = constrainingType; - } - - public void setImplementation(Implementation implementation) { - this.implementation = implementation; - } - - public void setName(String name) { - this.name = name; - } - - public List<Intent> getRequiredIntents() { - return requiredIntents; - } - - public List<PolicySet> getPolicySets() { - return policySets; - } - - public boolean isAutowire() { - return super.getAutowireMode() == AUTOWIRE_BY_TYPE; - } - - public Boolean getAutowire() { - int autowire = super.getAutowireMode(); - if (autowire == AUTOWIRE_BY_TYPE) { - return Boolean.TRUE; - } else if (autowire == AUTOWIRE_NO) { - return Boolean.FALSE; - } else { - return null; - } - } - - public void setAutowire(Boolean autowire) { - super.setAutowireMode(autowire ? AUTOWIRE_BY_TYPE : AUTOWIRE_NO); - } - - public List<Object> getExtensions() { - return extensions; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean undefined) { - this.unresolved = undefined; - } - - public void setPolicySets(List<PolicySet> policySets) { - this.policySets = policySets; - } - - public void setRequiredIntents(List<Intent> intents) { - this.requiredIntents = intents; - } - - public List<PolicySet> getApplicablePolicySets() { - return applicablePolicySets; - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanReferenceImpl.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanReferenceImpl.java deleted file mode 100644 index 7b747372b4..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanReferenceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.assembly.impl; - -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.SCABinding; -import org.springframework.beans.factory.config.RuntimeBeanReference; - -/** - * An implementation of RuntimeBeanReference wrapping an SCA assembly - * Reference - * - * @version $Rev$ $Date$ - */ -public class BeanReferenceImpl extends RuntimeBeanReference { - private Reference reference; - - protected BeanReferenceImpl(Reference reference) { - super("temp"); - this.reference = reference; - } - - @Override - public String getBeanName() { - SCABinding binding = reference.getBinding(SCABinding.class); - String name = binding.getURI(); - if (name.startsWith("/")) { - name = name.substring(1); - } - int s = name.lastIndexOf('/'); - if (s != -1) { - name = name.substring(0, s); - } - return name; - } - - @Override - public boolean equals(Object other) { - if (this != other) { - if (other instanceof RuntimeBeanReference) { - RuntimeBeanReference br = (RuntimeBeanReference)other; - return (getBeanName().equals(br.getBeanName()) && this.isToParent() == br.isToParent()); - } else - return false; - } else - return true; - } - - @Override - public int hashCode() { - return getBeanName().hashCode() * 29 + (this.isToParent() ? 1 : 0); - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/ModelResolverImpl.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/ModelResolverImpl.java deleted file mode 100644 index b275bfa9a7..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/ModelResolverImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.spring.context; - -import java.lang.ref.WeakReference; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.contribution.resolver.ClassReference; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - - -/** - * A default implementation of an artifact resolver, based on a map. - * - * @version $Rev$ $Date$ - */ -public class ModelResolverImpl implements ModelResolver { - private static final long serialVersionUID = -7826976465762296634L; - - private Map<Object, Object> map = new HashMap<Object, Object>(); - - private WeakReference<ClassLoader> classLoader; - - public ModelResolverImpl(ClassLoader classLoader) { - this.classLoader = new WeakReference<ClassLoader>(classLoader); - } - - public <T> T resolveModel(Class<T> modelClass, T unresolved) { - Object resolved = map.get(unresolved); - if (resolved != null) { - - // Return the resolved object - return modelClass.cast(resolved); - - } else if (unresolved instanceof ClassReference) { - - // Load a class on demand - ClassReference classReference = (ClassReference)unresolved; - Class clazz; - try { - clazz = Class.forName(classReference.getClassName(), true, classLoader.get()); - } catch (ClassNotFoundException e) { - - // Return the unresolved object - return unresolved; - } - - // Store a new ClassReference wrapping the loaded class - resolved = new ClassReference(clazz); - map.put(resolved, resolved); - - // Return the resolved ClassReference - return modelClass.cast(resolved); - - } else { - - // Return the unresolved object - return unresolved; - } - } - - public void addModel(Object resolved) { - map.put(resolved, resolved); - } - - public Object removeModel(Object resolved) { - return map.remove(resolved); - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/SCADomainContext.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/SCADomainContext.java deleted file mode 100644 index 8fa5f4cd53..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/SCADomainContext.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.context; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.transform.TransformerFactory; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.service.ContributionException; -import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.core.spring.assembly.impl.BeanAssemblyFactory; -import org.apache.tuscany.sca.core.spring.implementation.java.impl.BeanJavaImplementationFactory; -import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory; -import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.AllowsPassByReferenceProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.BaseJavaClassVisitor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ComponentNameProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ConstructorProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ContextProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ConversationProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.DestroyProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.EagerInitProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.HeuristicPojoProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.InitProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.PolicyProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.PropertyProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ReferenceProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ResourceProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ScopeProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.policy.DefaultIntentAttachPointTypeFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; - -/** - * A mini test runtime that uses the SCA assembly model variant implementation - * backed by Spring bean definitions. - * - * @version $Rev$ $Date$ - */ -public class SCADomainContext { - - private DefaultListableBeanFactory beanFactory; - - public SCADomainContext(String... compositeFiles) { - - // Create Spring bean factory - beanFactory = new DefaultListableBeanFactory(); - - // Create SCA assembly and SCA Java factories - DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); - ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); - AssemblyFactory assemblyFactory = new BeanAssemblyFactory(new DefaultAssemblyFactory(), beanFactory); - modelFactories.addFactory(assemblyFactory); - UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); - InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class); - JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class); - PolicyFactory policyFactory = modelFactories.getFactory(PolicyFactory.class); - SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class); - modelFactories.addFactory(javaFactory); - JavaImplementationFactory javaImplementationFactory = new BeanJavaImplementationFactory(beanFactory); - modelFactories.addFactory(javaImplementationFactory); - - BaseJavaClassVisitor[] extensions = new BaseJavaClassVisitor[] { - new ConstructorProcessor(assemblyFactory), - new AllowsPassByReferenceProcessor(assemblyFactory), - new ComponentNameProcessor(assemblyFactory), - new ContextProcessor(assemblyFactory), - new ConversationProcessor(assemblyFactory), - new DestroyProcessor(assemblyFactory), - new EagerInitProcessor(assemblyFactory), - new InitProcessor(assemblyFactory), - new PropertyProcessor(assemblyFactory), - new ReferenceProcessor(assemblyFactory, javaFactory), - new ResourceProcessor(assemblyFactory), - new ScopeProcessor(assemblyFactory), - new ServiceProcessor(assemblyFactory, javaFactory), - new HeuristicPojoProcessor(assemblyFactory, javaFactory), - new PolicyProcessor(assemblyFactory, policyFactory) - }; - for (JavaClassVisitor e : extensions) { - javaImplementationFactory.addClassVisitor(e); - } - - // Populate ArtifactProcessor registry - StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); - StAXArtifactProcessor<Composite> compositeProcessor = staxProcessors.getProcessor(Composite.class); - - // Create a resolver - //FIXME The ClassLoader should be passed in - ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - ModelResolverImpl resolver = new ModelResolverImpl(classLoader); - - try { - XMLInputFactory inputFactory = XMLInputFactory.newInstance(); - - // Read the composite files - List<Composite> composites = new ArrayList<Composite>(); - for (String compositeFile: compositeFiles) { - InputStream is = classLoader.getResourceAsStream(compositeFile); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - Composite composite = compositeProcessor.read(reader); - resolver.addModel(composite); - composites.add(composite); - } - - for (Composite composite: composites) { - - // Resolve the composite - compositeProcessor.resolve(composite, resolver); - } - - // Wire the top level component's composite - DocumentBuilderFactory documentBuilderFactory = modelFactories.getFactory(DocumentBuilderFactory.class); - TransformerFactory transformerFactory = modelFactories.getFactory(TransformerFactory.class); - buildComposite(composites.get(0), assemblyFactory, scaBindingFactory, - documentBuilderFactory, transformerFactory, mapper); - - } catch (ContributionException e) { - throw new RuntimeException(e); - } catch (CompositeBuilderException e) { - throw new RuntimeException(e); - } catch (XMLStreamException e) { - throw new RuntimeException(e); - } - } - - private void buildComposite(Composite composite, AssemblyFactory assemblyFactory, - SCABindingFactory scaBindingFactory, - DocumentBuilderFactory documentBuilderFactory, - TransformerFactory transformerFactory, - InterfaceContractMapper interfaceContractMapper) throws CompositeBuilderException { - - Monitor monitor = new Monitor() { - - public void problem(Problem problem) { - System.out.println("Composite assembly problem: " + problem.toString()); - } - public List<Problem> getProblems() { - return null; - } - }; - - // Configure and wire the composite - CompositeBuilderImpl compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, new DefaultIntentAttachPointTypeFactory(), - documentBuilderFactory, transformerFactory, interfaceContractMapper, monitor); - compositeUtil.build(composite); - - } - - public <B> B getService(Class<B> businessInterface, String serviceName) { - Object bean = beanFactory.getBean(serviceName); - return businessInterface.cast(bean); - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanBaseJavaImplementationImpl.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanBaseJavaImplementationImpl.java deleted file mode 100644 index 49abfb4162..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanBaseJavaImplementationImpl.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.ConfiguredOperation; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.implementation.java.BaseJavaImplementation; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.IntentAttachPointType; -import org.apache.tuscany.sca.policy.PolicySet; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.AbstractBeanDefinition; -import org.springframework.beans.factory.support.GenericBeanDefinition; - -/** - * An implementation of the SCA assembly JavaImplementation interface backed by a Spring - * Bean definition. - * - * @version $Rev$ $Date$ - */ -public class BeanBaseJavaImplementationImpl extends GenericBeanDefinition implements BaseJavaImplementation, Cloneable { - private static final long serialVersionUID = 1L; - - private List<Service> services = new ArrayList<Service>(); - private ConstrainingType constrainingType; - private List<Object> extensions = new ArrayList<Object>(); - private boolean unresolved; - private BeanDefinitionRegistry beanRegistry; - private String uri; - - private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>(); - private List<ConfiguredOperation> configuredOperations = new ArrayList<ConfiguredOperation>(); - private List<PolicySet> policySets = new ArrayList<PolicySet>(); - private List<Intent> requiredIntents = new ArrayList<Intent>(); - private IntentAttachPointType type = null; - - protected BeanBaseJavaImplementationImpl(BeanDefinitionRegistry beanRegistry) { - this.beanRegistry = beanRegistry; - - // Register this bean definition in the bean registry - //TODO find a better name for bean definitions representing component types - String name = String.valueOf(System.identityHashCode(this)); - this.beanRegistry.registerBeanDefinition(name, this); - } - - @Override - public AbstractBeanDefinition cloneBeanDefinition() { - BeanBaseJavaImplementationImpl clone = (BeanBaseJavaImplementationImpl)super.cloneBeanDefinition(); - clone.getServices().clear(); - try { - for (Service service : getServices()) { - clone.getServices().add((Service)service.clone()); - } - clone.getReferences().clear(); - for (Reference reference : getReferences()) { - clone.getReferences().add((Reference)reference.clone()); - } - clone.getProperties().clear(); - for (Property property : getProperties()) { - clone.getProperties().add((Property)property.clone()); - } - return clone; - } catch (CloneNotSupportedException e) { - //throw new CloneNotSupportedException(e.getMessage()); - } - return clone; - } - - public Class<?> getJavaClass() { - return super.getBeanClass(); - } - - public String getName() { - return super.getBeanClassName(); - } - - public void setJavaClass(Class<?> javaClass) { - super.setBeanClass(javaClass); - } - - public void setName(String className) { - super.setBeanClassName(className); - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public ConstrainingType getConstrainingType() { - return constrainingType; - } - - //TODO use a better list implementation - private List<Property> properties = new ArrayList<Property>() { - private static final long serialVersionUID = 1L; - - // Add a property - @Override - public boolean add(Property property) { - - // Add corresponding bean property value - getPropertyValues().addPropertyValue(property.getName(), property.getValue()); - - return super.add(property); - } - }; - - public List<Property> getProperties() { - return properties; - } - - //TODO use a better list implementation - private List<Reference> references = new ArrayList<Reference>() { - private static final long serialVersionUID = 1L; - - // Add a reference - @Override - public boolean add(Reference reference) { - - // Add corresponding bean property value - String target; - if (!reference.getTargets().isEmpty()) { - //TODO handle multiplicity - target = reference.getTargets().get(0).getName(); - int i = target.indexOf('/'); - if (i != -1) - target = target.substring(0, i); - } else { - target = null; - } - getPropertyValues().addPropertyValue(reference.getName(), target); - - return super.add(reference); - } - }; - - - public List<Reference> getReferences() { - return references; - } - - public List<Service> getServices() { - return services; - } - - public void setConstrainingType(ConstrainingType constrainingType) { - this.constrainingType = constrainingType; - } - - public List<Object> getExtensions() { - return extensions; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean unresolved) { - this.unresolved = unresolved; - } - - public List<PolicySet> getApplicablePolicySets() { - return applicablePolicySets; - } - - public List<ConfiguredOperation> getConfiguredOperations() { - return configuredOperations; - } - - public List<PolicySet> getPolicySets() { - return policySets; - } - - public List<Intent> getRequiredIntents() { - return requiredIntents; - } - - public IntentAttachPointType getType() { - return type; - } - - public void setType(IntentAttachPointType type) { - this.type = type; - } -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationFactory.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationFactory.java deleted file mode 100644 index 6b19bac413..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationFactory.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.implementation.java.IntrospectionException; -import org.apache.tuscany.sca.implementation.java.JavaImplementation; -import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory; -import org.apache.tuscany.sca.implementation.java.impl.JavaClassIntrospectorImpl; -import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; - -/** - * An alternate implementation of the SCA Java assembly model factory that - * creates SCA Java assembly model objects backed by Spring bean definitions. - * - * @version $Rev$ $Date$ - */ -public class BeanJavaImplementationFactory implements JavaImplementationFactory { - - private BeanDefinitionRegistry beanRegistry; - private List<JavaClassVisitor> visitors = new ArrayList<JavaClassVisitor>(); - private JavaClassIntrospectorImpl introspector; - - public BeanJavaImplementationFactory(BeanDefinitionRegistry beanRegistry) { - this.beanRegistry = beanRegistry; - introspector = new JavaClassIntrospectorImpl(visitors); - } - - public JavaImplementation createJavaImplementation() { - return new BeanJavaImplementationImpl(beanRegistry); - } - - public void createJavaImplementation(JavaImplementation javaImplementation, Class<?> implementationClass) - throws IntrospectionException { - introspector.introspectClass(javaImplementation, implementationClass); - } - - public JavaImplementation createJavaImplementation(Class<?> implementationClass) throws IntrospectionException { - JavaImplementation javaImplementation = createJavaImplementation(); - introspector.introspectClass(javaImplementation, implementationClass); - return javaImplementation; - } - - public void addClassVisitor(JavaClassVisitor visitor) { - visitors.add(visitor); - } - - public void removeClassVisitor(JavaClassVisitor visitor) { - visitors.remove(visitor); - } - - public List<JavaClassVisitor> getClassVisitors() { - return visitors; - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationImpl.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationImpl.java deleted file mode 100644 index 7fc82d8711..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationImpl.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Member; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.implementation.java.JavaImplementation; -import org.apache.tuscany.sca.implementation.java.impl.JavaConstructorImpl; -import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl; -import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl; -import org.apache.tuscany.sca.implementation.java.impl.JavaScopeImpl; -import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; - -/** - * An implementation of the SCA assembly JavaImplementation interface backed by a Spring - * Bean definition. - * - * @version $Rev$ $Date$ - */ -public class BeanJavaImplementationImpl extends BeanBaseJavaImplementationImpl implements JavaImplementation { - private static final long serialVersionUID = 6792198458193774178L; - - private JavaConstructorImpl<?> constructorDefinition; - private Map<Constructor, JavaConstructorImpl> constructors = new HashMap<Constructor, JavaConstructorImpl>(); - private Method initMethod; - private Method destroyMethod; - private final Map<String, JavaResourceImpl> resources = new HashMap<String, JavaResourceImpl>(); - private final Map<String, JavaElementImpl> propertyMembers = new HashMap<String, JavaElementImpl>(); - private final Map<String, JavaElementImpl> referenceMembers = new HashMap<String, JavaElementImpl>(); - private final Map<String, Collection<JavaElementImpl>> callbackMembers = new HashMap<String, Collection<JavaElementImpl>>(); - private List<Member> conversationIDMember = new ArrayList<Member>(); - private boolean eagerInit; - private boolean allowsPassByReference; - private List<Method> allowsPassByReferenceMethods = new ArrayList<Method>(); - private long maxAge = -1; - private long maxIdleTime = -1; - private JavaScopeImpl scope = JavaScopeImpl.STATELESS; - private List<PolicyHandlerTuple> policyHandlerClassNames = null; - - protected BeanJavaImplementationImpl(BeanDefinitionRegistry beanRegistry) { - super(beanRegistry); - } - - public JavaConstructorImpl<?> getConstructor() { - return constructorDefinition; - } - - public void setConstructor(JavaConstructorImpl<?> definition) { - this.constructorDefinition = definition; - } - - public Method getInitMethod() { - return initMethod; - } - - public void setInitMethod(Method initMethod) { - this.initMethod = initMethod; - } - - public Method getDestroyMethod() { - return destroyMethod; - } - - public void setDestroyMethod(Method destroyMethod) { - this.destroyMethod = destroyMethod; - } - - public Map<String, JavaResourceImpl> getResources() { - return resources; - } - - public List<Member> getConversationIDMembers() { - return this.conversationIDMember; - } - - public void addConversationIDMember(Member conversationIDMember) { - this.conversationIDMember.add(conversationIDMember); - } - - public boolean isAllowsPassByReference() { - return allowsPassByReference; - } - - public void setAllowsPassByReference(boolean allowsPassByReference) { - this.allowsPassByReference = allowsPassByReference; - } - - public List<Method> getAllowsPassByReferenceMethods() { - return allowsPassByReferenceMethods; - } - - public boolean isAllowsPassByReference(Method method) { - return allowsPassByReference || allowsPassByReferenceMethods.contains(method); - } - - public Map<Constructor, JavaConstructorImpl> getConstructors() { - return constructors; - } - - public boolean isEagerInit() { - return eagerInit; - } - - public void setEagerInit(boolean eagerInit) { - this.eagerInit = eagerInit; - } - - public Map<String, Collection<JavaElementImpl>> getCallbackMembers() { - return callbackMembers; - } - - public Map<String, JavaElementImpl> getPropertyMembers() { - return propertyMembers; - } - - public Map<String, JavaElementImpl> getReferenceMembers() { - return referenceMembers; - } - - public JavaScopeImpl getJavaScope() { - return scope; - } - - public void setJavaScope(JavaScopeImpl scope) { - this.scope = scope; - } - - public long getMaxAge() { - return maxAge; - } - - public void setMaxAge(long maxAge) { - this.maxAge = maxAge; - } - - public long getMaxIdleTime() { - return maxIdleTime; - } - - public void setMaxIdleTime(long maxIdleTime) { - this.maxIdleTime = maxIdleTime; - } - - public List<PolicyHandlerTuple> getPolicyHandlerClassNames() { - return policyHandlerClassNames; - } - - public void setPolicyHandlerClassNames(List<PolicyHandlerTuple> policyHandlerClassNames) { - this.policyHandlerClassNames = policyHandlerClassNames; - } -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceContractImpl.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceContractImpl.java deleted file mode 100644 index 17a7e9084c..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceContractImpl.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.core.spring.implementation.java.impl; - -import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceContractImpl; - -/** - * An implementation of a Java interface contract. - * - * @version $Rev$ $Date$ - */ -public class BeanJavaInterfaceContractImpl extends JavaInterfaceContractImpl { - - protected BeanJavaInterfaceContractImpl() { - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceFactory.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceFactory.java deleted file mode 100644 index 492ab2732e..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceFactory.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceIntrospectorImpl; -import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor; - -/** - * An alternate implementation of the SCA Java assembly model factory that creates SCA - * Java assembly model objects backed by Spring bean definitions. - * - * @version $Rev$ $Date$ - */ -public class BeanJavaInterfaceFactory implements JavaInterfaceFactory { - - private List<JavaInterfaceVisitor> visitors = new ArrayList<JavaInterfaceVisitor>(); - private JavaInterfaceIntrospectorImpl introspector; - - public BeanJavaInterfaceFactory() { - introspector = new JavaInterfaceIntrospectorImpl(this); - } - - public JavaInterface createJavaInterface() { - return new BeanJavaInterfaceImpl(); - } - - public JavaInterface createJavaInterface(Class<?> interfaceClass) throws InvalidInterfaceException { - JavaInterface javaInterface = createJavaInterface(); - introspector.introspectInterface(javaInterface, interfaceClass); - return javaInterface; - } - - public void createJavaInterface(JavaInterface javaInterface, Class<?> interfaceClass) throws InvalidInterfaceException { - introspector.introspectInterface(javaInterface, interfaceClass); - } - - public JavaInterfaceContract createJavaInterfaceContract() { - return new BeanJavaInterfaceContractImpl(); - } - - public void addInterfaceVisitor(JavaInterfaceVisitor extension) { - visitors.add(extension); - } - - public void removeInterfaceVisitor(JavaInterfaceVisitor extension) { - visitors.remove(extension); - } - - public List<JavaInterfaceVisitor> getInterfaceVisitors() { - return visitors; - } -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceImpl.java b/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceImpl.java deleted file mode 100644 index 6c3afdb129..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceImpl; -import org.apache.tuscany.sca.policy.Intent; - -/** - * An alternate implementation of the SCA Java assembly model JavaInterface - * interface. - * - * @version $Rev$ $Date$ - */ -public class BeanJavaInterfaceImpl extends JavaInterfaceImpl implements JavaInterface { - - private String className; - private Class<?> javaClass; - private Class<?> callbackClass; - private boolean conversational; - private boolean remotable; - List<Intent> requiredIntents = new ArrayList<Intent>(); - private List<Object> extensions = new ArrayList<Object>(); - private List<Operation> operations = new ArrayList<Operation>(); - private boolean unresolved = false; - - protected BeanJavaInterfaceImpl() { - } - - @Override - public String getName() { - if (isUnresolved()) { - return className; - } - else { - return javaClass.getName(); - } - } - - @Override - public void setName(String className) { - if (!isUnresolved()) - throw new IllegalStateException(); - this.className = className; - } - - @Override - public Class<?> getJavaClass() { - return javaClass; - } - - @Override - public void setJavaClass(Class<?> javaClass) { - this.javaClass = javaClass; - } - - @Override - public Class<?> getCallbackClass() { - return callbackClass; - } - - @Override - public void setCallbackClass(Class<?> callbackClass) { - this.callbackClass = callbackClass; - } - - @Override - public boolean isConversational() { - return conversational; - } - - @Override - public boolean isRemotable() { - return remotable; - } - - @Override - public void setConversational(boolean conversational) { - this.conversational = conversational; - } - - @Override - public void setRemotable(boolean local) { - this.remotable = local; - } - - @Override - public List<Intent> getRequiredIntents() { - return requiredIntents; - } - - public List<Object> getExtensions() { - return extensions; - } - - @Override - public List<Operation> getOperations() { - return operations; - } - - @Override - public boolean isUnresolved() { - return unresolved; - } - - @Override - public void setUnresolved(boolean undefined) { - this.unresolved = undefined; - } - - @Override - public void resetDataBinding(String dataBinding) { - } - - @Deprecated - @Override - public void setDefaultDataBinding(String dataBinding) { - } - - @Override - public boolean isDynamic() { - return false; - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/AddService.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/AddService.java deleted file mode 100644 index f3a24ed6b2..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/AddService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add Service interface. - * - * @version $Rev$ $Date$ - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/AddServiceImpl.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/AddServiceImpl.java deleted file mode 100644 index 61654ea811..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.EagerInit; -import org.osoa.sca.annotations.Scope; - -/** - * An implementation of the Add service - * - * @version $Rev$ $Date$ - */ -@Scope("COMPOSITE") -@EagerInit -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - return n1 + n2; - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/CalculatorClient.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/CalculatorClient.java deleted file mode 100644 index 73aa028084..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/CalculatorClient.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 calculator; - -import org.apache.tuscany.sca.core.spring.context.SCADomainContext; - -/** - * This client program shows how to create an SCA runtime, start it, locate the - * Calculator service and invoke it. - * - * @version $Rev$ $Date$ - */ -public class CalculatorClient { - public static void main(String[] args) throws Exception { - - SCADomainContext context = new SCADomainContext("org/apache/tuscany/core/spring/Calculator.composite"); - - CalculatorService calculatorService = context.getService(CalculatorService.class, "CalculatorServiceComponent"); - - // Calculate - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - - } -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/CalculatorService.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/CalculatorService.java deleted file mode 100644 index e0cf23dc17..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/CalculatorService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Calculator service interface. - * - * @version $Rev$ $Date$ - */ -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/CalculatorServiceImpl.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index c1fceb575d..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; - -/** - * An implementation of the Calculator service. - * - * @version $Rev$ $Date$ - */ -@Scope("COMPOSITE") -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/DivideService.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/DivideService.java deleted file mode 100644 index 7c69b10b25..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/DivideService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Divide Service interface. - * - * @version $Rev$ $Date$ - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/DivideServiceImpl.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/DivideServiceImpl.java deleted file mode 100644 index e1f35f99b5..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Scope; - -/** - * An implementation of the Divide service. - * - * @version $Rev$ $Date$ - */ -@Scope("COMPOSITE") -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - return n1 / n2; - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/MultiplyService.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/MultiplyService.java deleted file mode 100644 index 686542c18e..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/MultiplyService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Multiply Service interface. - * - * @version $Rev$ $Date$ - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/MultiplyServiceImpl.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index d621407908..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Scope; - -/** - * An implementation of the Multiply service. - * - * @version $Rev$ $Date$ - */ -@Scope("COMPOSITE") -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - return n1 * n2; - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/NestedCalculatorClient.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/NestedCalculatorClient.java deleted file mode 100644 index e8e4a6f71b..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/NestedCalculatorClient.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 calculator; - -import org.apache.tuscany.sca.core.spring.context.SCADomainContext; - -/** - * This client program shows how to create an SCA runtime, start it, locate the - * Calculator service and invoke it. - * - * @version $Rev$ $Date$ - */ -public class NestedCalculatorClient { - public static void main(String[] args) throws Exception { - - SCADomainContext context = new SCADomainContext( - "org/apache/tuscany/core/spring/OuterCalculator.composite", - "org/apache/tuscany/core/spring/InnerCalculator.composite", - "org/apache/tuscany/core/spring/InnerOperations.composite"); - - CalculatorService calculatorService = context.getService(CalculatorService.class, "CalculatorServiceComponent/CalculatorServiceComponent"); - - // Calculate - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - - } -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/SubtractService.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/SubtractService.java deleted file mode 100644 index 30632688f9..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/SubtractService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Subtract Service interface. - * - * @version $Rev$ $Date$ - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/SubtractServiceImpl.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 4fed0a8c6a..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Scope; - -/** - * An implementation of the subtract service. - * - * @version $Rev$ $Date$ - */ -@Scope("COMPOSITE") -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - return n1 - n2; - } - -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/CalculatorTestCase.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/CalculatorTestCase.java deleted file mode 100644 index 44b447cc64..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/CalculatorTestCase.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.core.spring.context.SCADomainContext; - -import calculator.CalculatorService; - -/** - * This shows how to test the Calculator service component. - * - * @version $Rev$ $Date$ - */ -public class CalculatorTestCase extends TestCase { - - private SCADomainContext context; - private CalculatorService calculatorService; - - @Override - protected void setUp() throws Exception { - context = new SCADomainContext("org/apache/tuscany/sca/core/spring/Calculator.composite"); - - calculatorService = context.getService(CalculatorService.class, "CalculatorServiceComponent"); - } - - @Override - protected void tearDown() throws Exception { - } - - public void testCalculator() throws Exception { - // Calculate - assertEquals(calculatorService.add(3, 2), 5.0); - assertEquals(calculatorService.subtract(3, 2), 1.0); - assertEquals(calculatorService.multiply(3, 2), 6.0); - assertEquals(calculatorService.divide(3, 2), 1.5); - - } -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/NestedCalculatorTestCaseFIXME.java b/branches/sca-java-1.4/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/NestedCalculatorTestCaseFIXME.java deleted file mode 100644 index baf73ac197..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/NestedCalculatorTestCaseFIXME.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.core.spring.context.SCADomainContext; - -import calculator.CalculatorService; - -/** - * This shows how to test the Calculator service component. - * - * @version $Rev$ $Date$ - */ -public class NestedCalculatorTestCaseFIXME extends TestCase { - - private SCADomainContext context; - private CalculatorService calculatorService; - - @Override - protected void setUp() throws Exception { - context = new SCADomainContext( - "org/apache/tuscany/sca/core/spring/OuterCalculator.composite", - "org/apache/tuscany/sca/core/spring/InnerCalculator.composite", - "org/apache/tuscany/sca/core/spring/InnerOperations.composite"); - - calculatorService = context.getService(CalculatorService.class, "CalculatorServiceComponent/InnerCalculatorServiceComponent"); - } - - @Override - protected void tearDown() throws Exception { - } - - public void testCalculator() throws Exception { - // Calculate - assertEquals(calculatorService.add(3, 2), 5.0); - assertEquals(calculatorService.subtract(3, 2), 1.0); - assertEquals(calculatorService.multiply(3, 2), 6.0); - assertEquals(calculatorService.divide(3, 2), 1.5); - - } -} diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/Calculator.composite b/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/Calculator.composite deleted file mode 100644 index 6d998ba035..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/Calculator.composite +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:calc="http://sample.calculator" - name="calc:TestBeanCalculator"> - - <service name="CalculatorService" promote="CalculatorServiceComponent"> - <interface.java interface="calculator.CalculatorService"/> - </service> - - <component name="CalculatorServiceComponent"> - <implementation.java class="calculator.CalculatorServiceImpl"/> - <reference name="addService" target="AddServiceComponent"/> - <reference name="subtractService" target="SubtractServiceComponent"/> - <reference name="multiplyService" target="MultiplyServiceComponent"/> - <reference name="divideService" target="DivideServiceComponent"/> - </component> - - <component name="AddServiceComponent"> - <implementation.java class="calculator.AddServiceImpl"/> - </component> - - <component name="SubtractServiceComponent"> - <implementation.java class="calculator.SubtractServiceImpl"/> - </component> - - <component name="MultiplyServiceComponent"> - <implementation.java class="calculator.MultiplyServiceImpl"/> - </component> - - <component name="DivideServiceComponent"> - <implementation.java class="calculator.DivideServiceImpl"/> - </component> - -</composite> diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerCalculator.composite b/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerCalculator.composite deleted file mode 100644 index 8b043f2b4f..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerCalculator.composite +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:calc="http://calc" - targetNamespace="http://calc" - name="InnerCalculator"> - - <service name="CalculatorService" promote="InnerCalculatorServiceComponent"> - <interface.java interface="calculator.CalculatorService"/> - </service> - - <component name="InnerCalculatorServiceComponent"> - <implementation.java class="calculator.CalculatorServiceImpl"/> - <reference name="addService"/> - <reference name="subtractService"/> - <reference name="multiplyService"/> - <reference name="divideService"/> - </component> - - <reference name="addService" promote="InnerCalculatorServiceComponent/addService"/> - <reference name="subtractService" promote="InnerCalculatorServiceComponent/subtractService"/> - <reference name="multiplyService" promote="InnerCalculatorServiceComponent/multiplyService"/> - <reference name="divideService" promote="InnerCalculatorServiceComponent/divideService"/> - -</composite> diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerOperations.composite b/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerOperations.composite deleted file mode 100644 index d7d1124050..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerOperations.composite +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:calc="http://calc" - targetNamespace="http://calc" - name="InnerOperations"> - - <service name="AddService" promote="AddServiceComponent"> - <interface.java interface="calculator.AddService"/> - </service> - - <service name="SubtractService" promote="SubtractServiceComponent"> - <interface.java interface="calculator.SubtractService"/> - </service> - - <service name="MultiplyService" promote="MultiplyServiceComponent"> - <interface.java interface="calculator.MultiplyService"/> - </service> - - <service name="DivideService" promote="DivideServiceComponent"> - <interface.java interface="calculator.DivideService"/> - </service> - - <component name="AddServiceComponent"> - <implementation.java class="calculator.AddServiceImpl"/> - </component> - - <component name="SubtractServiceComponent"> - <implementation.java class="calculator.SubtractServiceImpl"/> - </component> - - <component name="MultiplyServiceComponent"> - <implementation.java class="calculator.MultiplyServiceImpl"/> - </component> - - <component name="DivideServiceComponent"> - <implementation.java class="calculator.DivideServiceImpl"/> - </component> - -</composite> diff --git a/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/OuterCalculator.composite b/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/OuterCalculator.composite deleted file mode 100644 index c2b6cced36..0000000000 --- a/branches/sca-java-1.4/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/OuterCalculator.composite +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:calc="http://calc" - targetNamespace="http://calc" - name="OuterCalculator"> - - <service name="CalculatorService" promote="CalculatorServiceComponent"> - <interface.java interface="calculator.CalculatorService"/> - </service> - - <component name="CalculatorServiceComponent"> - <implementation.composite name="calc:InnerCalculator"/> - <reference name="addService" target="OperationsServiceComponent/AddService"/> - <reference name="subtractService" target="OperationsServiceComponent/SubtractService"/> - <reference name="multiplyService" target="OperationsServiceComponent/MultiplyService"/> - <reference name="divideService" target="OperationsServiceComponent/DivideService"/> - </component> - - <component name="OperationsServiceComponent"> - <implementation.composite name="calc:InnerOperations"/> - </component> - -</composite> diff --git a/branches/sca-java-1.4/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java b/branches/sca-java-1.4/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java index 2e11234095..da3a12732d 100644 --- a/branches/sca-java-1.4/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java +++ b/branches/sca-java-1.4/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java @@ -44,7 +44,7 @@ import java.util.logging.Logger; /** * A ServiceDiscoverer that find META-INF/services/... using the Context ClassLoader. * - * @version $Rev: $ $Date: $ + * @version $Rev$ $Date$ */ public class ContextClassLoaderServiceDiscoverer implements ServiceDiscoverer { private static final Logger logger = Logger.getLogger(ContextClassLoaderServiceDiscoverer.class.getName()); diff --git a/branches/sca-java-1.4/modules/host-openejb/LICENSE b/branches/sca-java-1.4/modules/host-openejb/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-1.4/modules/host-openejb/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-1.4/modules/host-openejb/NOTICE b/branches/sca-java-1.4/modules/host-openejb/NOTICE deleted file mode 100644 index fdfa0e9faa..0000000000 --- a/branches/sca-java-1.4/modules/host-openejb/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2008 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-1.4/modules/host-openejb/pom.xml b/branches/sca-java-1.4/modules/host-openejb/pom.xml deleted file mode 100644 index 6759490639..0000000000 --- a/branches/sca-java-1.4/modules/host-openejb/pom.xml +++ /dev/null @@ -1,103 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-host-openejb</artifactId> - <name>Apache Tuscany SCA OpenEJB Host Extension</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-ejb</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.geronimo.modules</groupId> - <artifactId>geronimo-openejb</artifactId> - <version>2.1.1</version> - <exclusions> - <exclusion> - <groupId>org.apache.geronimo.modules</groupId> - <artifactId>geronimo-connector</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.geronimo.modules</groupId> - <artifactId>geronimo-persistence-jpa10</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.openejb</groupId> - <artifactId>openejb-javaagent</artifactId> - </exclusion> - <exclusion> - <groupId>com.sun.xml.bind</groupId> - <artifactId>jaxb-impl</artifactId> - </exclusion> - <exclusion> - <groupId>asm</groupId> - <artifactId>asm</artifactId> - </exclusion> - <exclusion> - <groupId>asm</groupId> - <artifactId>asm-commons</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>backport-util-concurrent</groupId> - <artifactId>backport-util-concurrent</artifactId> - <version>3.1</version> - </dependency> - - <dependency> - <groupId>asm</groupId> - <artifactId>asm-all</artifactId> - <version>3.1</version> - <scope>runtime</scope> - </dependency> - - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.host.openejb</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.host.openejb*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBRuntimeModuleActivator.java b/branches/sca-java-1.4/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBRuntimeModuleActivator.java deleted file mode 100644 index 70bba08789..0000000000 --- a/branches/sca-java-1.4/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBRuntimeModuleActivator.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.host.openejb; - -import java.util.logging.Logger; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.host.ejb.EJBHostExtensionPoint; - -/** - * @version $Rev$ $Date$ - */ -public class OpenEJBRuntimeModuleActivator implements ModuleActivator { - private static final Logger logger = Logger.getLogger(OpenEJBRuntimeModuleActivator.class.getName()); - - private OpenEJBServer server; - - public void start(ExtensionPointRegistry extensionPointRegistry) { - - // Register our EJB host - EJBHostExtensionPoint ejbHosts = - extensionPointRegistry.getExtensionPoint(EJBHostExtensionPoint.class); - - server = new OpenEJBServer(); - ejbHosts.addEJBHost(server); - } - - public void stop(ExtensionPointRegistry registry) { - if (server != null) { - server.stop(); - } - } - -} diff --git a/branches/sca-java-1.4/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBServer.java b/branches/sca-java-1.4/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBServer.java deleted file mode 100644 index 82e619ddbe..0000000000 --- a/branches/sca-java-1.4/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBServer.java +++ /dev/null @@ -1,145 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.host.openejb;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.apache.openejb.OpenEJB;
-import org.apache.openejb.OpenEJBException;
-import org.apache.openejb.assembler.classic.Assembler;
-import org.apache.openejb.assembler.classic.StatelessSessionContainerInfo;
-import org.apache.openejb.config.ConfigurationFactory;
-import org.apache.openejb.core.ServerFederation;
-import org.apache.openejb.jee.EjbJar;
-import org.apache.openejb.jee.StatelessBean;
-import org.apache.openejb.loader.SystemInstance;
-import org.apache.openejb.server.ServiceDaemon;
-import org.apache.openejb.server.ServiceException;
-import org.apache.openejb.server.ejbd.EjbServer;
-import org.apache.tuscany.sca.host.ejb.EJBHost;
-import org.apache.tuscany.sca.host.ejb.EJBRegistrationException;
-import org.apache.tuscany.sca.host.ejb.EJBSessionBean;
-
-/**
- * OpenEJB-based EJB host implementation.
- *
- * @version $Rev: $ $Date: $
- */
-public class OpenEJBServer implements EJBHost {
-
- private boolean started;
- private EjbServer ejbServer;
- private ServiceDaemon serviceDaemon;
- private ConfigurationFactory config;
- private Assembler assembler;
-
- public void addSessionBean(String ejbName, EJBSessionBean sessionBean) throws EJBRegistrationException {
- if (!started) {
- start();
- }
-
- try {
- StatelessBean bean = new StatelessBean(ejbName, sessionBean.getImplementationClass());
- bean.addBusinessRemote(sessionBean.getRemoteInterface().getName());
- bean.addPostConstruct("init");
- bean.addPreDestroy("destroy");
-
- EjbJar ejbJar = new EjbJar();
- ejbJar.addEnterpriseBean(bean);
-
- assembler.createApplication(config.configureApplication(ejbJar));
-
- } catch (NamingException e) {
- throw new EJBRegistrationException(e);
- } catch (IOException e) {
- throw new EJBRegistrationException(e);
- } catch (OpenEJBException e) {
- throw new EJBRegistrationException(e);
- }
- }
-
- public EJBSessionBean getSessionBean(String ejbName) throws EJBRegistrationException {
- // TODO Auto-generated method stub
- return null;
- }
-
- public EJBSessionBean removeSessionBean(String ejbName) throws EJBRegistrationException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * Start the OpenEJB server.
- *
- * @throws EJBRegistrationException
- */
- private void start() throws EJBRegistrationException {
- try {
- Properties properties = new Properties();
- properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
- properties.put(Context.PROVIDER_URL, "ejbd://localhost:2888");
- SystemInstance.init(properties);
-
- ejbServer = new EjbServer();
- SystemInstance.get().setComponent(EjbServer.class, ejbServer);
- OpenEJB.init(properties, new ServerFederation());
- ejbServer.init(properties);
-
- serviceDaemon = new ServiceDaemon(ejbServer, 2888, "localhost");
- serviceDaemon.start();
-
- config = new ConfigurationFactory();
- assembler = (Assembler)SystemInstance.get().getComponent(org.apache.openejb.spi.Assembler.class);
-
- // containers
- StatelessSessionContainerInfo statelessContainerInfo = config.configureService(StatelessSessionContainerInfo.class);
- statelessContainerInfo.properties.setProperty("TimeOut", "10");
- statelessContainerInfo.properties.setProperty("PoolSize", "0");
- statelessContainerInfo.properties.setProperty("StrictPooling", "false");
- assembler.createContainer(statelessContainerInfo);
-
- } catch (OpenEJBException e) {
- throw new EJBRegistrationException(e);
- } catch (Exception e) {
- throw new EJBRegistrationException(e);
- }
-
- started = true;
- }
-
- /**
- * Stop the OpenEJB server.
- */
- void stop() {
- if (started) {
- try {
- serviceDaemon.stop();
- } catch (ServiceException e) {
- throw new EJBRegistrationException(e);
- }
- }
- SystemInstance.get().removeComponent(EjbServer.class);
- OpenEJB.destroy();
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/host-openejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-java-1.4/modules/host-openejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index 9247f40913..0000000000 --- a/branches/sca-java-1.4/modules/host-openejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the ModuleActivator
-org.apache.tuscany.sca.host.openejb.OpenEJBRuntimeModuleActivator
diff --git a/branches/sca-java-1.4/modules/host-openejb/src/test/java/org/apache/tuscany/sca/host/openejb/OpenEJBServerTestCase.java b/branches/sca-java-1.4/modules/host-openejb/src/test/java/org/apache/tuscany/sca/host/openejb/OpenEJBServerTestCase.java deleted file mode 100644 index 7d2301a770..0000000000 --- a/branches/sca-java-1.4/modules/host-openejb/src/test/java/org/apache/tuscany/sca/host/openejb/OpenEJBServerTestCase.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.host.openejb; - -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.ejb.EJBSessionBean; - -/** - * @version $Rev$ $Date$ - */ -public class OpenEJBServerTestCase extends TestCase { - - public interface TestRemote { - String test(String s); - } - - public static class TestImpl implements TestRemote { - - public TestImpl() { - } - - public String test(String s) { - return s.toUpperCase(); - } - - public void init() { - } - - public void destroy() { - } - } - - private OpenEJBServer server; - - @Override - protected void setUp() throws Exception { - server = new OpenEJBServer(); - } - - @Override - protected void tearDown() throws Exception { - server.stop(); - } - - /** - * Verifies registration and invocation of a session bean - */ - public void testStatelessSessionBean() throws Exception { - server.addSessionBean("TestBean", new EJBSessionBean(TestImpl.class, TestRemote.class)); - - Properties properties = new Properties(System.getProperties()); - //properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, InitContextFactory.class.getName()); - properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory"); - properties.put(Context.PROVIDER_URL, "ejbd://localhost:2888"); - InitialContext ctx = new InitialContext(properties); - Object object = ctx.lookup("TestBeanRemote"); - assertTrue(object instanceof TestRemote); - - TestRemote testRemote = (TestRemote)object; - String s = testRemote.test("test"); - assertEquals("TEST", s); - } - -} diff --git a/branches/sca-java-1.4/modules/implementation-bpel-jbpm/LICENSE b/branches/sca-java-1.4/modules/implementation-bpel-jbpm/LICENSE deleted file mode 100644 index 4b5ab74408..0000000000 --- a/branches/sca-java-1.4/modules/implementation-bpel-jbpm/LICENSE +++ /dev/null @@ -1,251 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -=============================================================================================================== - -Apache Tuscany SCA for Java Subcomponents -=========================================: - -The Tuscany SCA for Java release includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -================================================================================================================= - -This module implementation-script temporarily includes one file under the following BSD license: - - Copyright (c) 2006, Sun Microsystems, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - - Neither the name of the Sun Microsystems, Inc. nor the names of - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - -================================================================================================================= diff --git a/branches/sca-java-1.4/modules/implementation-bpel-jbpm/NOTICE b/branches/sca-java-1.4/modules/implementation-bpel-jbpm/NOTICE deleted file mode 100644 index a3c65715e5..0000000000 --- a/branches/sca-java-1.4/modules/implementation-bpel-jbpm/NOTICE +++ /dev/null @@ -1,17 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2008 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - -Unless otherwise indicated, all distribution made available by the Apache Software Foundation -is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL"). -A copy of the AL is provided with this distribution as the LICENSE file present in the -root directory, and is also available at http://www.apache.org/licenses/. - -This product also includes software under the BSD license -(see the LICENSE file contained in this distribution), with -the following copyright: - -Copyright (c) 2006, Sun Microsystems, Inc. -All rights reserved. diff --git a/branches/sca-java-1.4/modules/implementation-bpel-jbpm/pom.xml b/branches/sca-java-1.4/modules/implementation-bpel-jbpm/pom.xml deleted file mode 100644 index 0d06296621..0000000000 --- a/branches/sca-java-1.4/modules/implementation-bpel-jbpm/pom.xml +++ /dev/null @@ -1,149 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-implementation-bpel-jbpm</artifactId> - <name>Apache Tuscany SCA BPEL jBPM Implementation Extension</name> - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-bpel</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-impl</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-databinding</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-databinding-sdo</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-embedded</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface-wsdl</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface-wsdl-xml</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sdo</groupId> - <artifactId>tuscany-sdo-impl</artifactId> - <version>1.1.1</version> - <scope>compile</scope> - <exclusions> - <exclusion> - <groupId>stax</groupId> - <artifactId>stax-api</artifactId> - </exclusion> - <exclusion> - <groupId>backport-util-concurrent</groupId> - <artifactId>backport-util-concurrent</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>backport-util-concurrent</groupId> - <artifactId>backport-util-concurrent</artifactId> - <version>3.1</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.easymock</groupId> - <artifactId>easymock</artifactId> - <version>2.2</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.implementation.bpel.jbpm</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.implementation.bpel.jbpm*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/branches/sca-java-1.4/modules/implementation-bpel-jbpm/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-java-1.4/modules/implementation-bpel-jbpm/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory deleted file mode 100644 index 61d74d4c37..0000000000 --- a/branches/sca-java-1.4/modules/implementation-bpel-jbpm/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory +++ /dev/null @@ -1,22 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the implementation extension
-# -# -# ==> Change this for JBPM -#org.apache.tuscany.sca.implementation.bpel.ode.provider.BPELImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.bpel.BPELImplementation
diff --git a/branches/sca-java-1.4/modules/implementation-das/LICENSE b/branches/sca-java-1.4/modules/implementation-das/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-1.4/modules/implementation-das/NOTICE b/branches/sca-java-1.4/modules/implementation-das/NOTICE deleted file mode 100644 index fdfa0e9faa..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2008 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-1.4/modules/implementation-das/company.sql b/branches/sca-java-1.4/modules/implementation-das/company.sql deleted file mode 100644 index e9f8b06901..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/company.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DROP TABLE COMPANY; - -CREATE TABLE COMPANY ( - ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY, - NAME VARCHAR(30)); - -INSERT INTO COMPANY (NAME) VALUES('ACME Publishing'); -INSERT INTO COMPANY (NAME) VALUES('Do-rite plumbing'); -INSERT INTO COMPANY (NAME) VALUES('MegaCorp');
\ No newline at end of file diff --git a/branches/sca-java-1.4/modules/implementation-das/pom.xml b/branches/sca-java-1.4/modules/implementation-das/pom.xml deleted file mode 100644 index 293fe9f06e..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/pom.xml +++ /dev/null @@ -1,198 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-implementation-das</artifactId> - <name>Apache Tuscany SCA DAS Implementation Extension</name> - - <repositories> - <repository> - <id>apache.incubator</id> - <url>http://people.apache.org/repo/m2-incubating-repository</url> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.das</groupId> - <artifactId>tuscany-das-rdb</artifactId> - <version>1.0-SNAPSHOT</version> - <scope>compile</scope> - <exclusions> - <exclusion> - <groupId>backport-util-concurrent</groupId> - <artifactId>backport-util-concurrent</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>backport-util-concurrent</groupId> - <artifactId>backport-util-concurrent</artifactId> - <version>3.1</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-impl</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-databinding</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-embedded</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-engine-helper</artifactId> - <version>1.4</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.easymock</groupId> - <artifactId>easymock</artifactId> - <version>2.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <version>10.3.1.4</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>sql-maven-plugin</artifactId> - <!-- 1.1 due to MOJO-619 --> - <version>1.1-SNAPSHOT</version> - - <dependencies> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <version>10.3.1.4</version> - </dependency> - </dependencies> - - <executions> - <execution> - <id>create-db</id> - <phase>generate-resources</phase> - <goals> - <goal>execute</goal> - </goals> - <configuration> - <driver>org.apache.derby.jdbc.EmbeddedDriver</driver> - <url>jdbc:derby:${pom.basedir}/target/test-classes/company;create=true</url> - <autocommit>true</autocommit> - <onError>continue</onError> - <onConnectionError>skip</onConnectionError> - <delimiter>;</delimiter> - <srcFiles> - <srcFile>${pom.basedir}/company.sql</srcFile> - </srcFiles> - </configuration> - </execution> - - <!-- Shutdown DB in order to be able to run unit tests --> - <execution> - <id>shutdown-database-sothat-test-can-run</id> - <phase>process-test-resources</phase> - <goals> - <goal>execute</goal> - </goals> - <configuration> - <driver>org.apache.derby.jdbc.EmbeddedDriver</driver> - <url>jdbc:derby:${pom.basedir}/target/test-classes/company;shutdown=true</url> - <skipOnConnectionError>true</skipOnConnectionError> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.implementation.das</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.implementation.das*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java b/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java deleted file mode 100644 index b0b4b132e6..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.das; - -/** - * Generic constants used in this implementation - * - * @version $Rev$ $Date$ - */ -public interface Constants { - /** - * Identify Relation Database data store - */ - String DATA_ACCESS_TYPE_RDB = "rdb"; - -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java b/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java deleted file mode 100644 index 1fc46ea710..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.implementation.das; - -import commonj.sdo.DataObject; - - -/** - * The service interface of a DAS service provided by DAS components. - * - * @version $Rev$ $Date$ - */ -public interface DAS { - - /** - * Execute a DAS Command specified on the DAS config file. - * @param commandName The name of the command - * @return - */ - DataObject executeCommand(String commandName); - - /**Execute a DAS Command specified on the DAS config file, - * and narrow the results based on the provided XPath - * - * @param commandName The name of the command - * @param xPath The xPath filter - * @return - */ - DataObject executeCommand(String commandName, String xPath); - - - -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java b/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java deleted file mode 100644 index 0e0c689b41..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.implementation.das; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.data.engine.config.ConnectionInfo; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; - - -/** - * The model representing a sample DAS implementation in an SCA assembly model. - * - * @version $Rev$ $Date$ - */ -public class DASImplementation implements Implementation { - - private String dasConfig; - private String dataAccessType; - - private ConnectionInfo connectionInfo; - - private boolean unresolved; - private List<Service> services = new ArrayList<Service>(); - - /** - * Constructs a new DAS implementation. - */ - public DASImplementation(AssemblyFactory assemblyFactory, - JavaInterfaceFactory javaFactory) { - - // DAS implementation always provide a single service exposing - // the DAS interface, and have no references and properties - Service dasService = null; - dasService = assemblyFactory.createService(); - dasService.setName("DAS"); - JavaInterface javaInterface; - try { - javaInterface = javaFactory.createJavaInterface(DAS.class); - } catch (InvalidInterfaceException e) { - throw new IllegalArgumentException(e); - } - JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract(); - interfaceContract.setInterface(javaInterface); - dasService.setInterfaceContract(interfaceContract); - - services.add(dasService); - } - - /* DAS Model Information */ - - public String getConfig() { - return this.dasConfig; - } - - public void setConfig(String config) { - this.dasConfig = config; - } - - public String getDataAccessType() { - return this.dataAccessType; - } - - public void setDataAccessType (String dataAccessType) { - this.dataAccessType = dataAccessType; - } - - public ConnectionInfo getConnectionInfo() { - return this.connectionInfo; - } - - public void setConnectionInfo(ConnectionInfo connectionInfo) { - this.connectionInfo = connectionInfo; - } - - /* SCA Model Information */ - - public ConstrainingType getConstrainingType() { - // DAS implementation does not support constrainingTypes - return null; - } - - public List<Property> getProperties() { - // DAS implementation does not support properties - return Collections.emptyList(); - } - - public List<Reference> getReferences() { - // DAS implementation does not support references - return Collections.emptyList(); - } - - public List<Service> getServices() { - return services; - } - - public String getURI() { - // DAS implementation does not have a URI - return null; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setConstrainingType(ConstrainingType constrainingType) { - // DAS implementation does not support constrainingTypes - } - - public void setURI(String uri) { - // DAS implementation does not have a URI - - } - - public void setUnresolved(boolean undefined) { - this.unresolved = undefined; - } - -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java b/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java deleted file mode 100644 index 93d22d2d5a..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.das; - -/** - * A factory for the sample DAS implementation model. - * - * @version $Rev$ $Date$ - */ -public interface DASImplementationFactory { - - /** - * Creates a new CRUD implementation. - * - * @return - */ - DASImplementation createDASImplementation(); - -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.java b/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.java deleted file mode 100644 index 0e90c90082..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.implementation.das; - -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl; -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.data.engine.ConnectionInfoArtifactProcessor; -import org.apache.tuscany.sca.data.engine.config.ConnectionInfo; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.monitor.Problem.Severity; - - -/** - * Implements a StAX artifact processor for DAS implementations. - * - * The artifact processor is responsible for processing <implementation.das> - * elements in SCA assembly XML composite files and populating the DAS - * implementation model, resolving its references to other artifacts in the SCA - * contribution, and optionally write the model back to SCA assembly XML. - * - * @version $Rev$ $Date$ - */ -public class DASImplementationProcessor implements StAXArtifactProcessor<DASImplementation> { - private static final QName IMPLEMENTATION_DAS = new QName(Constants.SCA10_TUSCANY_NS, "implementation.das"); - - private DASImplementationFactory dasFactory; - - private final AssemblyFactory assemblyFactory; - private final JavaInterfaceFactory javaFactory; - private Monitor monitor; - private StAXArtifactProcessor<ConnectionInfo> connectionInfoProcessor; - - public DASImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) { - assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); - javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class); - this.monitor = monitor; - this.dasFactory = new DefaultDASImplementationFactory(assemblyFactory, javaFactory); - this.connectionInfoProcessor = new ConnectionInfoArtifactProcessor(modelFactories, this.monitor); - } - - public QName getArtifactType() { - // Returns the QName of the XML element processed by this processor - return IMPLEMENTATION_DAS; - } - - public Class<DASImplementation> getModelType() { - // Returns the type of model processed by this processor - return DASImplementation.class; - } - - /** - * Report a error. - * - * @param problems - * @param message - * @param model - */ - private void error(String message, Object model, Object... messageParameters) { - if (monitor != null) { - Problem problem = new ProblemImpl(this.getClass().getName(), "impl-das-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters); - monitor.problem(problem); - } - } - - /* - * <component name="CompanyDataComponent"> - * <implementation.das config="/CompanyConfig.xml" dataAccessType="rdb"> - * <connectionInfo> - * <connectionProperties - * driverClass="org.apache.derby.jdbc.EmbeddedDriver" - * databaseURL="jdbc:derby:target/test-classes/dastest; create = true" - * loginTimeout="600000"/> - * </connectionInfo> - * </implementation.data> - * </component> - */ - public DASImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException { - assert IMPLEMENTATION_DAS.equals(reader.getName()); - - // Read an <implementation.das> element - - // Create an initialize the DAS implementation model - DASImplementation implementation = null; - - // Read the das config file attribute. - // This is das configuration side file to use - String config = reader.getAttributeValue(null, "config"); - - // Read the data access type attribute - // This is the type of data store in use (e.g RDB, XML, etc) - String dataAccessType = reader.getAttributeValue(null, "dataAccessType"); - - // Both config and dataAccessType are required attributes, hence validating. - if (config == null || dataAccessType == null) { - if (config == null) - error("ConfigAttributeMissing", reader); - if (dataAccessType == null) - error("DataAccessTypeAttributeMissing", reader); - return implementation; - } - - // Create an initialize the DAS implementation model - implementation = dasFactory.createDASImplementation(); - implementation.setConfig(config); - implementation.setDataAccessType(dataAccessType); - implementation.setUnresolved(true); - - while (true) { - int event = reader.next(); - switch (event) { - - case START_ELEMENT: - if (ConnectionInfoArtifactProcessor.CONNECTION_INFO.equals(reader.getName())) { - - // Read connection info - ConnectionInfo connectionInfo = (ConnectionInfo) connectionInfoProcessor.read(reader); - implementation.setConnectionInfo(connectionInfo); - } - break; - case XMLStreamConstants.END_ELEMENT: - if (IMPLEMENTATION_DAS.equals(reader.getName())) { - return implementation; - } - break; - } - } - } - - public void resolve(DASImplementation impl, ModelResolver resolver) throws ContributionResolveException { - if( impl != null && impl.isUnresolved()) { - //resolve component type - mergeComponentType(resolver, impl); - - //set current implementation resolved - impl.setUnresolved(false); - } - } - - public void write(DASImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException { - - writer.writeStartElement(IMPLEMENTATION_DAS.getNamespaceURI(), IMPLEMENTATION_DAS.getLocalPart()); - - if (implementation.getConfig() != null) { - writer.writeAttribute("config", implementation.getConfig()); - } - if (implementation.getDataAccessType() != null) { - writer.writeAttribute("dataAccessType", implementation.getDataAccessType()); - } - - if (implementation.getConnectionInfo() != null) { - connectionInfoProcessor.write(implementation.getConnectionInfo(), writer); - } - - writer.writeEndElement(); - } - - /** - * Merge the componentType from introspection and external file - * @param resolver - * @param impl - */ - private void mergeComponentType(ModelResolver resolver, DASImplementation impl) { - // FIXME: Need to clarify how to merge - ComponentType componentType = getComponentType(resolver, impl); - if (componentType != null && !componentType.isUnresolved()) { - /* - Map<String, Reference> refMap = new HashMap<String, Reference>(); - for (Reference ref : impl.getReferences()) { - refMap.put(ref.getName(), ref); - } - for (Reference reference : componentType.getReferences()) { - refMap.put(reference.getName(), reference); - } - impl.getReferences().clear(); - impl.getReferences().addAll(refMap.values()); - - // Try to match references by type - Map<String, JavaElementImpl> refMembers = impl.getReferenceMembers(); - for (Reference ref : impl.getReferences()) { - if (ref.getInterfaceContract() != null) { - Interface i = ref.getInterfaceContract().getInterface(); - if (i instanceof JavaInterface) { - Class<?> type = ((JavaInterface)i).getJavaClass(); - if (!refMembers.containsKey(ref.getName())) { - JavaElementImpl e = getMemeber(impl, ref.getName(), type); - if (e != null) { - refMembers.put(ref.getName(), e); - } - } - } - } - }*/ - - Map<String, Service> serviceMap = new HashMap<String, Service>(); - for (Service svc : impl.getServices()) { - if(svc != null) { - serviceMap.put(svc.getName(), svc); - } - } - for (Service service : componentType.getServices()) { - serviceMap.put(service.getName(), service); - } - impl.getServices().clear(); - impl.getServices().addAll(serviceMap.values()); - - Map<String, Property> propMap = new HashMap<String, Property>(); - for (Property prop : impl.getProperties()) { - propMap.put(prop.getName(), prop); - } - } - } - - private String getFileName(String filePath) { - int pos = filePath.lastIndexOf("."); - - return filePath.substring(0, pos); - - } - - private ComponentType getComponentType(ModelResolver resolver, DASImplementation impl) { - String dasConfig = this.getFileName(impl.getConfig()); - String componentTypeURI = dasConfig.replace('.', '/') + ".componentType"; - ComponentType componentType = assemblyFactory.createComponentType(); - componentType.setUnresolved(true); - componentType.setURI(componentTypeURI); - componentType = resolver.resolveModel(ComponentType.class, componentType); - if (!componentType.isUnresolved()) { - return componentType; - } - return null; - } -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java b/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java deleted file mode 100644 index 2e18541b3b..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.das; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; - - -/** - * A default factory for the DAS implementation model. - * - * @version $Rev$ $Date$ - */ -public class DefaultDASImplementationFactory implements DASImplementationFactory { - - private AssemblyFactory assemblyFactory; - private JavaInterfaceFactory javaFactory; - - public DefaultDASImplementationFactory(AssemblyFactory assemblyFactory, - JavaInterfaceFactory javaFactory) { - this.assemblyFactory = assemblyFactory; - this.javaFactory = javaFactory; - } - - public DASImplementation createDASImplementation() { - return new DASImplementation(assemblyFactory, javaFactory); - } - -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/annotations/Command.java b/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/annotations/Command.java deleted file mode 100644 index c8c3fd75e6..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/annotations/Command.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.das.annotations; - -/** - * - * @version $Rev$ $Date$ - */ -public @interface Command { - enum TYPE {SELECT, INSERT, DELETE, UPDATE} - - /** - * Defines an Ad hoc command query - * @return - */ - String query() default ""; - - TYPE type() default TYPE.SELECT; -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java b/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java deleted file mode 100644 index 40f414b7ef..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.implementation.das.provider; - -import org.apache.tuscany.das.rdb.DAS; -import org.apache.tuscany.sca.data.engine.DataAccessEngine; -import org.apache.tuscany.sca.data.engine.DataAccessEngineManager; -import org.apache.tuscany.sca.implementation.das.DASImplementation; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * DAS Implementation provider - * - * @version $Rev$ $Date$ - */ -public class DASImplementationProvider implements ImplementationProvider { - - private RuntimeComponent component; - private DASImplementation implementation; - private final DataAccessEngineManager dataAccessEngineManager; - - /** - * Constructs a new DAS implementation. - */ - public DASImplementationProvider(RuntimeComponent component, DASImplementation implementation) { - this.component = component; - this.implementation = implementation; - this.dataAccessEngineManager = new DataAccessEngineManager(); - } - - public Invoker createInvoker(RuntimeComponentService service, Operation operation) { - DAS das = null; - try { - das = dataAccessEngineManager.getDAS(implementation.getConfig(), implementation.getConnectionInfo()); - } catch(Exception e) { - e.printStackTrace(); - //what now ? - } - DASInvoker invoker = new DASInvoker(operation, new DataAccessEngine(das) ); - return invoker; - } - - public boolean supportsOneWayInvocation() { - return false; - } - - public void start() { - System.out.println("Starting " + component.getName()); - } - - public void stop() { - System.out.println("Stopping " + component.getName()); - } - -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java b/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java deleted file mode 100644 index 3ce182347c..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.implementation.das.provider; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.implementation.das.DASImplementation; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.provider.ImplementationProviderFactory; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * Factory for DAS Implementation Provider - * - * @version $Rev$ $Date$ - */ -public class DASImplementationProviderFactory implements ImplementationProviderFactory<DASImplementation> { - - /** - * Constructs a new DAS implementation. - */ - public DASImplementationProviderFactory(ExtensionPointRegistry extensionPoints) { - } - - public ImplementationProvider createImplementationProvider(RuntimeComponent component, DASImplementation implementation) { - return new DASImplementationProvider(component, implementation); - } - - public Class<DASImplementation> getModelType() { - return DASImplementation.class; - } -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java b/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java deleted file mode 100644 index 4cd227717c..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.das.provider; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.tuscany.sca.data.engine.DataAccessEngine; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; - - -/** - * Implements a target invoker for DAS component implementations. - * - * The target invoker is responsible for dispatching invocations to the particular - * component implementation logic. The current component implementation will - * dispatch calls to the DAS APIs to retrieve the requested data from the back-end store - * - * @version $Rev$ $Date$ - */ -public class DASInvoker implements Invoker { - private final Operation operation; - private final DataAccessEngine dataAccessEngine; - - public DASInvoker(Operation operation, DataAccessEngine dataAccessEngine) { - this.operation = operation; - this.dataAccessEngine = dataAccessEngine; - } - - public Message invoke(Message msg) { - try { - Object[] args = msg.getBody(); - Object resp = doTheWork(args); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setFaultBody(e.getCause()); - } - return msg; - } - - public Object doTheWork(Object[] args) throws InvocationTargetException { - //check annotation -// try { -// Method methodDeclaration = this.getClass().getMethod(operation.getName(), null); -// methodDeclaration.getAnnotation(org.apache.tuscany.sca.implementation.das.annotations.Command.class); -// } catch (Exception e) { -// //ignore -// } - - //check if static way - if (operation.getName().equals("executeCommand")) { - String commandName, xPath; - - //simple execute command by name - if( args.length == 1){ - commandName = (String) args[0]; - return this.dataAccessEngine.executeCommand(commandName); - } else { - commandName = (String) args[0]; - xPath = (String) args[1]; - - return this.dataAccessEngine.executeCommand(commandName, xPath); - } - } else { // dynamic mapping to command - - return this.dataAccessEngine.executeCommand(operation.getName()); - } - } -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-java-1.4/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index 417195c684..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.implementation.das.DASImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.das,model=org.apache.tuscany.sca.implementation.das.DASImplementation diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-java-1.4/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory deleted file mode 100644 index 290f05d03e..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the implementation extension
-org.apache.tuscany.sca.implementation.das.provider.DASImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.das.DASImplementation
diff --git a/branches/sca-java-1.4/modules/implementation-das/src/main/resources/impl-das-validation-messages.properties b/branches/sca-java-1.4/modules/implementation-das/src/main/resources/impl-das-validation-messages.properties deleted file mode 100644 index a002d3cef0..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/main/resources/impl-das-validation-messages.properties +++ /dev/null @@ -1,23 +0,0 @@ -# -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# -ConfigAttributeMissing = Attribute 'config' is missing. -DataAccessTypeAttributeMissing = Attribute 'dataAccessType' is missing. - diff --git a/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.java b/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.java deleted file mode 100644 index 8659280891..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.das; - -import java.io.StringReader; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.data.engine.config.ConnectionInfo; -import org.apache.tuscany.sca.data.engine.config.ConnectionProperties; -import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.monitor.MonitorFactory; -import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.monitor.impl.DefaultMonitorFactoryImpl; -import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl; - -/** - * @version $Rev$ $Date$ - */ -public class DASImplementationProcessorTestCase extends TestCase { - - protected static final QName IMPLEMENTATION_DAS = new QName(Constants.SCA10_TUSCANY_NS, "implementation.das"); - - private static final String COMPOSITE_USING_DATASOURCE = - "<?xml version=\"1.0\" encoding=\"ASCII\"?>" - + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">" - + " <component name=\"DasComponent\">" - + " <tuscany:implementation.das config=\"config.xml\" dataAccessType=\"rdb\">" - + " <tuscany:connectionInfo datasource=\"dataSource\"/>" - + " </tuscany:implementation.das>" - + "</component>"; - - private static final String COMPOSITE_USING_CONNECTION_PROPERTIES = - "<?xml version=\"1.0\" encoding=\"ASCII\"?>" - + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">" - + " <component name=\"DasComponent\">" - + " <tuscany:implementation.das config=\"config.xml\" dataAccessType=\"rdb\">" - + " <tuscany:connectionInfo>" - + " <tuscany:connectionProperties" - + " driverClass=\"driverClass\"" - + " databaseURL=\"databaseURL\"" - + " loginTimeout=\"1\"/>" - + " </tuscany:connectionInfo>" - + " </tuscany:implementation.das>" - + "</component>"; - - private static final String INVALID_XML = - "<?xml version=\"1.0\" encoding=\"ASCII\"?>" - + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">" - + " <component name=\"DasComponent\">" - + " <tuscany:implementation.das>" - + " <tuscany:connectionInfo datasource=\"dataSource\"/>" - + " </tuscany:implementation.das>" - + "</component>"; - - private XMLInputFactory xmlFactory; - private ModelFactoryExtensionPoint modelFactories; - private Monitor monitor; - - @Override - protected void setUp() throws Exception { - super.setUp(); - xmlFactory = XMLInputFactory.newInstance(); - // Create a monitor - MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl(); - if (monitorFactory != null) - this.monitor = monitorFactory.createMonitor(); - modelFactories = new DefaultModelFactoryExtensionPoint(); - AssemblyFactory assemblyFactory = new DefaultAssemblyFactory(); - modelFactories.addFactory(assemblyFactory); - JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory(); - modelFactories.addFactory(javaFactory); - } - - public void testLoadCompositeUsingDatasource() throws Exception { - XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_DATASOURCE)); - - DASImplementationProcessor dataProcessor = new DASImplementationProcessor(modelFactories, monitor); - - while(true) { - int event = reader.next(); - if(event == XMLStreamConstants.START_ELEMENT && IMPLEMENTATION_DAS.equals(reader.getName())) { - break; - } - } - - DASImplementation implementation = dataProcessor.read(reader); - - assertNotNull(implementation); - assertEquals("config.xml", implementation.getConfig()); - assertEquals("rdb", implementation.getDataAccessType()); - - ConnectionInfo connInfo = implementation.getConnectionInfo(); - assertNotNull(connInfo); - assertEquals("dataSource", connInfo.getDataSource()); - - ConnectionProperties connProperties = connInfo.getConnectionProperties(); - assertNull(connProperties); - } - - public void testLoadCompositeUsingConnectionProperties() throws Exception { - XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_CONNECTION_PROPERTIES)); - - DASImplementationProcessor dataProcessor = new DASImplementationProcessor(modelFactories, monitor); - - while(true) { - int event = reader.next(); - if(event == XMLStreamConstants.START_ELEMENT && IMPLEMENTATION_DAS.equals(reader.getName())) { - break; - } - } - - DASImplementation implementation = dataProcessor.read(reader); - - assertNotNull(implementation); - assertEquals("config.xml", implementation.getConfig()); - assertEquals("rdb", implementation.getDataAccessType()); - - ConnectionInfo connInfo = implementation.getConnectionInfo(); - assertNotNull(connInfo); - assertNull("dataSource", connInfo.getDataSource()); - - ConnectionProperties connProperties = connInfo.getConnectionProperties(); - assertNotNull(connProperties); - assertEquals("driverClass",connProperties.getDriverClass()); - assertEquals("databaseURL",connProperties.getDatabaseURL()); - assertEquals(1,connProperties.getLoginTimeout().intValue()); - } - - /** - * Test loading an INVALID implementation.das element from a contribution metadata stream - */ - public void testLoadInvalid() throws Exception { - XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(INVALID_XML)); - - DASImplementationProcessor dataProcessor = new DASImplementationProcessor(modelFactories, monitor); - - while(true) { - int event = reader.next(); - if(event == XMLStreamConstants.START_ELEMENT && IMPLEMENTATION_DAS.equals(reader.getName())) { - break; - } - } - - dataProcessor.read(reader); - Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem(); - assertNotNull(problem); - assertEquals("DataAccessTypeAttributeMissing", problem.getMessageId()); - } -} diff --git a/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java b/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java deleted file mode 100644 index 7d8b4181c1..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java +++ /dev/null @@ -1,73 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.das;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import commonj.sdo.DataObject;
-
-/**
- * Tests the DAS service
- *
- * @version $Rev$ $Date$
- */
-public class DASTestCase extends TestCase {
-
- private SCADomain scaDomain;
- private DAS dasService;
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("das.composite");
- dasService = scaDomain.getService(DAS.class, "DASServiceComponent/DAS");
-
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
-
- public void testExecuteCommand() throws Exception {
- String commandName = "all companies";
-
- DataObject resultRoot= dasService.executeCommand(commandName);
- assertNotNull(resultRoot);
- assertEquals(3, resultRoot.getList("COMPANY").size());
- }
-
- public void testExecuteCommandWithFilter() throws Exception {
- String commandName = "all companies";
-
- DataObject resultRoot= dasService.executeCommand(commandName, "COMPANY[1]");
- assertNotNull(resultRoot);
- }
-
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java b/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java deleted file mode 100644 index 63d0c92683..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java +++ /dev/null @@ -1,33 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.das.company;
-
-import org.apache.tuscany.sca.implementation.das.annotations.Command;
-
-import commonj.sdo.DataObject;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public interface CompanyService {
- @Command(query="select * from COMPANY")
- DataObject getCompanies();
-}
diff --git a/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java b/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java deleted file mode 100644 index 565a930ebe..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java +++ /dev/null @@ -1,62 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.das.company;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import commonj.sdo.DataObject;
-
-/**
- * Tests the DAS service
- *
- * @version $Rev$ $Date$
- */
-public class CompanyServiceTestCase extends TestCase {
-
- private SCADomain scaDomain;
- private CompanyService dasCompanyService;
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("company.composite");
- dasCompanyService = scaDomain.getService(CompanyService.class, "CompanyServiceComponent/CompanyService");
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- public void testGetCompanies() throws Exception {
- DataObject root = dasCompanyService.getCompanies();
- assertNotNull(root);
- String nome = root.getString("COMPANY[1]/NAME");
- assertEquals("ACME Publishing", root.getString("COMPANY[1]/NAME"));
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-das/src/test/resources/company.componentType b/branches/sca-java-1.4/modules/implementation-das/src/test/resources/company.componentType deleted file mode 100644 index 5017cfcffd..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/test/resources/company.componentType +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - - <service name="CompanyService"> - <interface.java interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/> - </service> - -</componentType>
\ No newline at end of file diff --git a/branches/sca-java-1.4/modules/implementation-das/src/test/resources/company.composite b/branches/sca-java-1.4/modules/implementation-das/src/test/resources/company.composite deleted file mode 100644 index ee6104360e..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/test/resources/company.composite +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://sample/das" - name="das">
-
- <component name="CompanyServiceComponent">
- <tuscany:implementation.das config="company.xml" dataAccessType="rdb">
- <tuscany:connectionInfo>
- <tuscany:connectionProperties
- driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- databaseURL="jdbc:derby:target/test-classes/company; create = true"
- loginTimeout="600000"/>
- </tuscany:connectionInfo>
- </tuscany:implementation.das>
- </component>
-</composite>
diff --git a/branches/sca-java-1.4/modules/implementation-das/src/test/resources/company.xml b/branches/sca-java-1.4/modules/implementation-das/src/test/resources/company.xml deleted file mode 100644 index 350c8b99ce..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/test/resources/company.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- -->
-<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">
-
- <Command name="getCompanies" SQL="select * from COMPANY" kind="Select"/>
-
- <Command name="all companies" SQL="select * from COMPANY" kind="Select"/>
-
- <Command name="all companies and departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID" kind="Select"/>
-
- <Command name="all departments for company" SQL="select * from COMPANY inner join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
-
- <Command name="company by id with departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
-
- <Table tableName="COMPANY">
- <Column columnName="ID" primaryKey="true" generated="true"/>
- </Table>
-
- <Table tableName="DEPARTMENT">
- <Column columnName="ID" primaryKey="true" generated="true"/>
- </Table>
-
- <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true">
- <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/>
- </Relationship>
-
-
-</Config>
diff --git a/branches/sca-java-1.4/modules/implementation-das/src/test/resources/das.composite b/branches/sca-java-1.4/modules/implementation-das/src/test/resources/das.composite deleted file mode 100644 index e54f4390ac..0000000000 --- a/branches/sca-java-1.4/modules/implementation-das/src/test/resources/das.composite +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://sample/das" - name="das">
-
- <component name="DASServiceComponent">
- <tuscany:implementation.das config="company.xml" dataAccessType="rdb">
- <tuscany:connectionInfo>
- <tuscany:connectionProperties
- driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- databaseURL="jdbc:derby:target/test-classes/company; create = true"
- loginTimeout="600000"/>
- </tuscany:connectionInfo>
- </tuscany:implementation.das>
- </component>
-</composite>
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/LICENSE b/branches/sca-java-1.4/modules/implementation-data-xml/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/NOTICE b/branches/sca-java-1.4/modules/implementation-data-xml/NOTICE deleted file mode 100644 index fdfa0e9faa..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2008 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/company.sql b/branches/sca-java-1.4/modules/implementation-data-xml/company.sql deleted file mode 100644 index e9f8b06901..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/company.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DROP TABLE COMPANY; - -CREATE TABLE COMPANY ( - ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY, - NAME VARCHAR(30)); - -INSERT INTO COMPANY (NAME) VALUES('ACME Publishing'); -INSERT INTO COMPANY (NAME) VALUES('Do-rite plumbing'); -INSERT INTO COMPANY (NAME) VALUES('MegaCorp');
\ No newline at end of file diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/pom.xml b/branches/sca-java-1.4/modules/implementation-data-xml/pom.xml deleted file mode 100644 index d65382fccb..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/pom.xml +++ /dev/null @@ -1,220 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---><project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-implementation-data-xml</artifactId> - <name>Apache Tuscany SCA Data Implementation Extension</name> - - <repositories> - <repository> - <id>apache.incubator</id> - <url>http://people.apache.org/repo/m2-incubating-repository</url> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.das</groupId> - <artifactId>tuscany-das-rdb</artifactId> - <version>1.0-SNAPSHOT</version> - <scope>compile</scope> - <exclusions> - <exclusion> - <groupId>backport-util-concurrent</groupId> - <artifactId>backport-util-concurrent</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>backport-util-concurrent</groupId> - <artifactId>backport-util-concurrent</artifactId> - <version>3.1</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-impl</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-databinding</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-embedded</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-engine-helper</artifactId> - <version>1.4</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-abdera</artifactId> - <version>1.4</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <version>10.3.1.4</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-jetty</artifactId> - <version>1.4</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.easymock</groupId> - <artifactId>easymock</artifactId> - <version>2.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-api</artifactId> - <version>1.4</version> - <scope>compile</scope> - </dependency> - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>sql-maven-plugin</artifactId> - <!-- 1.1 due to MOJO-619 --> - <version>1.1-SNAPSHOT</version> - - <dependencies> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <version>10.1.2.1</version> - </dependency> - </dependencies> - - <executions> - <execution> - <id>create-db</id> - <phase>generate-resources</phase> - <goals> - <goal>execute</goal> - </goals> - <configuration> - <driver>org.apache.derby.jdbc.EmbeddedDriver</driver> - <url>jdbc:derby:${pom.basedir}/target/test-classes/company;create=true</url> - <autocommit>true</autocommit> - <onError>continue</onError> - <onConnectionError>skip</onConnectionError> - <delimiter>;</delimiter> - <srcFiles> - <srcFile>${pom.basedir}/company.sql</srcFile> - </srcFiles> - </configuration> - </execution> - - <!-- Shutdown DB in order to be able to run unit tests --> - <execution> - <id>shutdown-database-sothat-test-can-run</id> - <phase>process-test-resources</phase> - <goals> - <goal>execute</goal> - </goals> - <configuration> - <driver>org.apache.derby.jdbc.EmbeddedDriver</driver> - <url>jdbc:derby:${pom.basedir}/target/test-classes/company;shutdown=true</url> - <skipOnConnectionError>true</skipOnConnectionError> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.implementation.data.xml</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.implementation.data*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATA.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATA.java deleted file mode 100644 index 3ce96e58da..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATA.java +++ /dev/null @@ -1,64 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.data;
-
-import javax.xml.stream.XMLStreamReader;
-
-/**
- * The service interface of a DAS service provided by DAS components.
- *
- * @version $Rev$ $Date$
- */
-public interface DATA {
-
- /**
- * Retrieve the Database table contents If a id is given, the results will
- * be filtered to a matching row
- *
- * @param id The PK that identifies the row on the table
- * @return The row content in XML format
- */
- XMLStreamReader get(String id);
-
- /**
- * Insert new content in the Database
- *
- * @param insertStream The insertion in XML format
- * @return The number of rows affected
- */
- int insert(XMLStreamReader insertStream);
-
- /**
- * Update the Database table contents
- *
- * @param updateStream The updates in XML format
- * @return The number of rows affected
- */
- int update(XMLStreamReader updateStream);
-
- /**
- * Delete the Database table contents If a id is given, only a specific row
- * will be deleted
- *
- * @param id The PK that identifies the row on the table
- * @return The number of rows affected
- */
- int delete(String id);
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATACollection.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATACollection.java deleted file mode 100644 index 1dc5673fe5..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATACollection.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.data; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.data.collection.Collection; - -public interface DATACollection extends Collection<String, XMLStreamReader> { - -} diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementation.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementation.java deleted file mode 100644 index a50ad89b64..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementation.java +++ /dev/null @@ -1,161 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.data;
-
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-import org.apache.tuscany.sca.implementation.data.jdbc.JDBCHelper;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-
-
-/**
- * The model representing a sample DATA implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public class DATAImplementation implements Implementation {
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
-
- private ConnectionInfo connectionInfo;
- private List<Service> services = new ArrayList<Service>();
-
- /**
- * Constructs a new DAS implementation.
- */
- public DATAImplementation(AssemblyFactory assemblyFactory,
- JavaInterfaceFactory javaFactory) {
-
- // DATA implementation provides one service per database table
- // exposing the DATA interface, and have no references and properties
- this.assemblyFactory = assemblyFactory;
- this.javaFactory = javaFactory;
- }
-
- private void introspectServices( AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory) {
- Connection connection = null;
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- DatabaseMetaData databaseMetaData = connection.getMetaData();
- ResultSet tables = databaseMetaData.getTables(null, null, "%", null);
- while(tables.next()) {
- //create the SCA service for the table
- Service dataService = assemblyFactory.createService();
- Service dataCollectionService = assemblyFactory.createService();
-
- dataService.setName(tables.getString(3)+"_DATA");
- dataCollectionService.setName(tables.getString(3));
-
- JavaInterface dataInterface;
- JavaInterface dataCollectionInterface;
-
- try {
- dataInterface = javaFactory.createJavaInterface(DATA.class);
- dataCollectionInterface = javaFactory.createJavaInterface(DATACollection.class);
- } catch (InvalidInterfaceException e) {
- throw new IllegalArgumentException(e);
- }
- JavaInterfaceContract dataInterfaceContract = javaFactory.createJavaInterfaceContract();
- JavaInterfaceContract dataCollectionInterfaceContract = javaFactory.createJavaInterfaceContract();
-
- dataInterfaceContract.setInterface(dataInterface);
- dataCollectionInterfaceContract.setInterface(dataCollectionInterface);
-
- dataService.setInterfaceContract(dataInterfaceContract);
- dataCollectionService.setInterfaceContract(dataCollectionInterfaceContract);
-
- services.add(dataService);
- services.add(dataCollectionService);
-
- }
- } catch(SQLException e) {
-
- } finally {
- JDBCHelper.cleanupResources(connection, null, null);
- }
- }
-
- public ConnectionInfo getConnectionInfo() {
- return this.connectionInfo;
- }
-
- public void setConnectionInfo(ConnectionInfo connectionInfo) {
- this.connectionInfo = connectionInfo;
- }
-
- public ConstrainingType getConstrainingType() {
- // The sample DATA implementation does not support constrainingTypes
- return null;
- }
-
- public List<Property> getProperties() {
- // The sample DATA implementation does not support properties
- return Collections.emptyList();
- }
-
- public List<Service> getServices() {
- if(services == null || services.size() == 0) {
- introspectServices(assemblyFactory, javaFactory);
- }
- return services;
- }
-
- public List<Reference> getReferences() {
- // The sample DATA implementation does not support references
- return Collections.emptyList();
- }
-
- public String getURI() {
- // The sample DATA implementation does not have a URI
- return null;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- // The sample DATA implementation does not support constrainingTypes
- }
-
- public void setURI(String uri) {
- // The sample DATA implementation does not have a URI
- }
-
- public boolean isUnresolved() {
- // The sample DATA implementation is always resolved
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- // The sample DATA implementation is always resolved
- }
-}
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationFactory.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationFactory.java deleted file mode 100644 index d4cf816dbf..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.data;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-
-/**
- * A default factory for the DATA implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class DATAImplementationFactory {
-
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
-
- public DATAImplementationFactory(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory) {
- this.assemblyFactory = assemblyFactory;
- this.javaFactory = javaFactory;
- }
-
- public DATAImplementation createDASImplementation() {
- return new DATAImplementation(assemblyFactory, javaFactory);
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.java deleted file mode 100644 index 16c5a370ec..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.implementation.data; - -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.data.engine.ConnectionInfoArtifactProcessor; -import org.apache.tuscany.sca.data.engine.config.ConnectionInfo; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.monitor.Monitor; - - -/** - * Implements a StAX artifact processor for DATA implementations. - * - * The artifact processor is responsible for processing <implementation.data> - * elements in SCA assembly XML composite files and populating the DATA - * implementation model, resolving its references to other artifacts in the SCA - * contribution, and optionally write the model back to SCA assembly XML. - * - * @version $Rev$ $Date$ - */ -public class DATAImplementationProcessor implements StAXArtifactProcessor<DATAImplementation> { - protected static final QName IMPLEMENTATION_DATA_XML = new QName(Constants.SCA10_TUSCANY_NS, "implementation.data.xml"); - - private DATAImplementationFactory dataFactory; - private Monitor monitor; - private StAXArtifactProcessor<ConnectionInfo> connectionInfoProcessor; - - public DATAImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) { - AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); - JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class); - this.monitor = monitor; - this.dataFactory = new DATAImplementationFactory(assemblyFactory, javaFactory); - this.connectionInfoProcessor = new ConnectionInfoArtifactProcessor(modelFactories, this.monitor); - } - - public QName getArtifactType() { - // Returns the qname of the XML element processed by this processor - return IMPLEMENTATION_DATA_XML; - } - - public Class<DATAImplementation> getModelType() { - // Returns the type of model processed by this processor - return DATAImplementation.class; - } - - /* - * <component name="CompanyDataComponent"> - * <implementation.data.xml> - * <connectionInfo> - * <connectionProperties - * driverClass="org.apache.derby.jdbc.EmbeddedDriver" - * databaseURL="jdbc:derby:target/test-classes/dastest; create = true" - * loginTimeout="600000"/> - * </connectionInfo> - * </implementation.data> - * </component> - */ - public DATAImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException { - assert IMPLEMENTATION_DATA_XML.equals(reader.getName()); - - // Read an <implementation.data.xml> element - - // Create an initialize the DAS implementation model - DATAImplementation implementation = dataFactory.createDASImplementation(); - - while (true) { - int event = reader.next(); - switch (event) { - - case START_ELEMENT: - if (ConnectionInfoArtifactProcessor.CONNECTION_INFO.equals(reader.getName())) { - - // Read connection info - ConnectionInfo connectionInfo = (ConnectionInfo) connectionInfoProcessor.read(reader); - implementation.setConnectionInfo(connectionInfo); - } - break; - case XMLStreamConstants.END_ELEMENT: - if (IMPLEMENTATION_DATA_XML.equals(reader.getName())) { - return implementation; - } - break; - } - } - - } - - public void resolve(DATAImplementation impl, ModelResolver resolver) throws ContributionResolveException { - } - - public void write(DATAImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException { - writer.writeStartElement(IMPLEMENTATION_DATA_XML.getNamespaceURI(), IMPLEMENTATION_DATA_XML.getLocalPart()); - - if (implementation.getConnectionInfo() != null) { - connectionInfoProcessor.write(implementation.getConnectionInfo(), writer); - } - - writer.writeEndElement(); - } -} diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCHelper.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCHelper.java deleted file mode 100644 index 265f250717..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCHelper.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.data.jdbc; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Properties; - -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.sql.DataSource; - -import org.apache.tuscany.das.rdb.exception.DataSourceInitializationException; -import org.apache.tuscany.sca.data.engine.config.ConnectionInfo; - -/** - * JDBC Helper - * - JDBC Connection utility methods - * - JDBC Resource cleanup methods - * - * @version $Rev$ $Date$ - */ -public class JDBCHelper { - - /** - * protected constructor - */ - protected JDBCHelper() { - - } - - /** - * - * @param connectionInfo - * @return - */ - public static Connection getConnection(ConnectionInfo connectionInfo) { - if (connectionInfo.getDataSource() == null && connectionInfo.getConnectionProperties() == null) { - throw new IllegalArgumentException("Not enough information to create Database Connection."); - } - - if(connectionInfo.getDataSource() != null && connectionInfo.getConnectionProperties() != null) { - throw new IllegalArgumentException("Use either dataSource or ConnectionProperties. Can't use both !"); - } - - if(connectionInfo.getDataSource() != null) { - return getDataSourceConnection(connectionInfo); - } else { - return getDriverManagerConnection(connectionInfo); - } - } - - /** - * Initializes a DB connection on a managed environment (e.g inside Tomcat) - * - * @param connectionInfo - * @return - */ - private static Connection getDataSourceConnection(ConnectionInfo connectionInfo) { - Connection connection = null; - - InitialContext ctx; - try { - ctx = new InitialContext(); - } catch (NamingException e) { - throw new RuntimeException(e); - } - try { - DataSource ds = (DataSource) ctx.lookup(connectionInfo.getDataSource()); - try { - connection = ds.getConnection(); - if (connection == null) { - throw new RuntimeException("Could not obtain a Connection from DataSource"); - } - connection.setAutoCommit(false); - } catch (SQLException e) { - throw new RuntimeException(e); - } - } catch (NamingException e) { - throw new RuntimeException(e); - } - - return connection; - } - - /** - * Initialize a DB connection on a J2SE environment - * For more info, see http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/drivermanager.html - * - * @param connectionInfo - * @return - */ - private static Connection getDriverManagerConnection(ConnectionInfo connectionInfo) { - Connection connection = null; - - if (connectionInfo.getConnectionProperties() == null) { - throw new RuntimeException("No existing context and no connection properties"); - } - - if (connectionInfo.getConnectionProperties().getDriverClass() == null) { - throw new RuntimeException("No jdbc driver class specified!"); - } - - try { - Properties p = System.getProperties(); - p.put("derby.system.home", "target"); - - //initialize driver and register it with DriverManager - Class.forName(connectionInfo.getConnectionProperties().getDriverClass()); - - //prepare to initialize connection - String databaseUrl = connectionInfo.getConnectionProperties().getDatabaseURL(); - String userName = connectionInfo.getConnectionProperties().getUsername(); - String userPassword = connectionInfo.getConnectionProperties().getPassword(); - int loginTimeout = connectionInfo.getConnectionProperties().getLoginTimeout(); - - DriverManager.setLoginTimeout(loginTimeout); - if( (userName == null || userName.length() ==0) && (userPassword == null || userPassword.length()==0) ){ - //no username or password supplied - connection = DriverManager.getConnection(databaseUrl); - }else{ - connection = DriverManager.getConnection(databaseUrl, userName, userPassword); - } - - if(connection == null){ - throw new DataSourceInitializationException("Error initializing connection : null"); - } - - //FIXME we should make this flexible, we can't autocommit when participating in transactions - connection.setAutoCommit(true); - - }catch(ClassNotFoundException cnf){ - throw new DataSourceInitializationException("JDBC Driver '" + connectionInfo.getConnectionProperties().getDriverClass() + "' not found", cnf); - }catch(SQLException sqle){ - throw new DataSourceInitializationException(sqle.getMessage(), sqle); - } - - return connection; - } - - /** - * Cleanup and close all JDBC resources in the proper order and ignoring erros - * @param connection The connection to be closed - * @param queryStatement The statement to be closed - * @param resultSet The ResultSet to be closed - */ - public static void cleanupResources(Connection connection, PreparedStatement queryStatement, ResultSet resultSet) { - cleanupResultSet(resultSet); - cleanupPreparedStatement(queryStatement); - cleanupConnection(connection); - } - - /** - * Proper cleanup the ResultSet - * @param resultSet - */ - private static void cleanupResultSet(ResultSet resultSet) { - if (resultSet != null) { - try { - resultSet.close(); - } catch (SQLException e) { - // We should log the error. Since we're trying to close, we don't re-throw. - } - } - } - - /** - * Proper cleanup the prepared statement - * @param queryStatement - */ - private static void cleanupPreparedStatement(PreparedStatement queryStatement) { - if (queryStatement != null) { - try { - queryStatement.close(); - } catch (SQLException e) { - // We should log the error. Since we're trying to close, we don't re-throw. - } - } - } - - /** - * proper cleanup the connection - * @param connection - */ - private static void cleanupConnection(Connection connection) { - if (connection != null) { - try { - connection.close(); - } catch (SQLException e) { - // We should log the error. Since we're trying to close, we don't re-throw. - } - } - } - -} diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCResultSetStreamReader.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCResultSetStreamReader.java deleted file mode 100644 index 316330243b..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/JDBCResultSetStreamReader.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.data.jdbc; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import javax.xml.stream.XMLStreamException; - -import org.apache.tuscany.sca.databinding.xml.XmlTreeStreamReaderImpl; - -/** - * JDBCResultSetStreamReader perform streaming of database tables as XML - * - * @version $Rev$ $Date$ - */ -public class JDBCResultSetStreamReader extends XmlTreeStreamReaderImpl { - private ResultSet resultSet; - - /** - * @param root - */ - public JDBCResultSetStreamReader(ResultSet resultSet) { - super(new ResultSetXmlNodeImpl(resultSet)); - this.resultSet = resultSet; - } - - @Override - public void close() throws XMLStreamException { - try { - resultSet.close(); - } catch (SQLException e) { - } - } -} - diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/ResultSetXmlNodeImpl.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/ResultSetXmlNodeImpl.java deleted file mode 100644 index 576fe5605d..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/jdbc/ResultSetXmlNodeImpl.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.data.jdbc; - -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.SQLException; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.xml.SimpleXmlNodeImpl; -import org.apache.tuscany.sca.databinding.xml.XmlNode; - -/** - * @version $Rev$ $Date$ - */ -public class ResultSetXmlNodeImpl implements XmlNode { - private static final String NS = ""; - private static final QName RESULT_SET = new QName(NS, "resultSet"); - private static final QName RECORD = new QName(NS, "record"); - private static final QName COLUMN = new QName(NS, "column"); - private static final QName NAME = new QName(NS, "name"); - - private ResultSet resultSet; - private String[] columnNames; - - /** - * @param resultSet - */ - public ResultSetXmlNodeImpl(ResultSet resultSet) { - super(); - this.resultSet = resultSet; - try { - ResultSetMetaData metaData = resultSet.getMetaData(); - columnNames = new String[metaData.getColumnCount()]; - for (int i = 0; i < columnNames.length; i++) { - columnNames[i] = metaData.getColumnName(i + 1); - } - } catch (SQLException e) { - throw new IllegalStateException(e); - } - } - - /** - * @see org.apache.tuscany.sca.databinding.xml.XmlNode#attributes() - */ - public List<XmlNode> attributes() { - return Collections.emptyList(); - } - - public Type getType() { - return Type.ELEMENT; - } - - - /** - * @see org.apache.tuscany.sca.databinding.xml.XmlNode#children() - */ - public Iterator<XmlNode> children() { - return new ResultSetIteraror(); - } - - private class ResultSetIteraror implements Iterator<XmlNode> { - private Boolean hasNext; - - public ResultSetIteraror() { - } - - public boolean hasNext() { - try { - if (hasNext == null) { - hasNext = resultSet.next(); - } - return hasNext; - } catch (SQLException e) { - throw new IllegalStateException(e); - } - } - - public XmlNode next() { - hasNext(); - hasNext = null; - return new RecordXmlNodeImpl(); - } - - public void remove() { - } - } - - /** - * @see org.apache.tuscany.sca.databinding.xml.XmlNode#getName() - */ - public QName getName() { - return RESULT_SET; - } - - /** - * @see org.apache.tuscany.sca.databinding.xml.XmlNode#getValue() - */ - public String getValue() { - return null; - } - - /** - * @see org.apache.tuscany.sca.databinding.xml.XmlNode#namespaces() - */ - public Map<String, String> namespaces() { - return Collections.emptyMap(); - } - - private class RecordXmlNodeImpl extends XmlNodeImpl { - int index = 0; - - @Override - public Iterator<XmlNode> children() { - return new Iterator<XmlNode>() { - - public boolean hasNext() { - return index < columnNames.length; - } - - public XmlNode next() { - return new ColumnXmlNodeImpl(index++); - } - - public void remove() { - } - - }; - } - - @Override - public QName getName() { - return RECORD; - } - - } - - private class ColumnXmlNodeImpl extends XmlNodeImpl { - private int index; - - /** - * @param index - */ - public ColumnXmlNodeImpl(int index) { - super(); - this.index = index; - } - - @Override - public List<XmlNode> attributes() { - XmlNode attr = new SimpleXmlNodeImpl(NAME, columnNames[index], XmlNode.Type.ATTRIBUTE); - return Arrays.asList(attr); - } - - @Override - public Iterator<XmlNode> children() { - XmlNode[] nodes = {new ValueXmlNodeImpl(index)}; - return Arrays.asList(nodes).iterator(); - } - - @Override - public QName getName() { - return COLUMN; - } - - } - - private class ValueXmlNodeImpl extends XmlNodeImpl { - private int index; - - /** - * @param index - */ - public ValueXmlNodeImpl(int index) { - super(); - this.index = index; - } - - @Override - public String getValue() { - try { - return String.valueOf(resultSet.getObject(index + 1)); - } catch (SQLException e) { - throw new IllegalStateException(e); - } - } - - @Override - public Type getType() { - return Type.CHARACTERS; - } - - } - - private static abstract class XmlNodeImpl implements XmlNode { - - public List<XmlNode> attributes() { - return Collections.emptyList(); - } - - public Iterator<XmlNode> children() { - return null; - } - - public QName getName() { - return null; - } - - public String getValue() { - return null; - } - - public boolean isLeaf() { - return false; - } - - public Map<String, String> namespaces() { - return Collections.emptyMap(); - } - - public Type getType() { - return Type.ELEMENT; - } - - } - - -} diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProvider.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProvider.java deleted file mode 100644 index bbd963922c..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProvider.java +++ /dev/null @@ -1,98 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.data.provider;
-
-import org.apache.tuscany.sca.implementation.data.DATAImplementation;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * DATA Implementation provider
- *
- * @version $Rev$ $Date$
- */
-public class DATAImplementationProvider implements ImplementationProvider {
- //private RuntimeComponent component;
- private DATAImplementation implementation;
-
- /**
- * Constructs a new DATA implementation.
- */
- public DATAImplementationProvider(RuntimeComponent component, DATAImplementation implementation) {
- //this.component = component;
- this.implementation = implementation;
- }
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- String operationName = operation.getName();
- String tableName = service.getName();
-
- String interfaceFullName = operation.getInterface().toString();
- int index = interfaceFullName.lastIndexOf(".") + 1;
- String interfaceName = interfaceFullName.substring(index, interfaceFullName.length());
-
- if (interfaceName.equals("DATACollection")) {
-
- if (operationName.equals("getAll")) {
- return new DATAInvoker.GetAllInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("query")) {
- return new DATAInvoker.QueryInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("post")) {
- return new DATAInvoker.PostInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("get")) {
- return new DATAInvoker.GetInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("put")) {
- return new DATAInvoker.PutInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("delete")) {
- return new DATAInvoker.DeleteInvoker(operation, implementation.getConnectionInfo(), tableName);
- }
-
- } else if (interfaceName.equals("DATA")) {
-
- tableName = tableName.split("_")[0];
-
- if (operationName.equals("get")) {
- return new DATAInvoker.GetDATAInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("insert")) {
- return new DATAInvoker.InsertDATAInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("update")) {
- return new DATAInvoker.UpdateDATAInvoker(operation, implementation.getConnectionInfo(), tableName);
- } else if (operationName.equals("delete")) {
- return new DATAInvoker.DeleteDATAInvoker(operation, implementation.getConnectionInfo(), tableName);
- }
- }
-
- return new DATAInvoker(operation, implementation.getConnectionInfo(), tableName);
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- // System.out.println("Starting " + component.getName());
- }
-
- public void stop() {
- // System.out.println("Stopping " + component.getName());
- }
-}
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProviderFactory.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProviderFactory.java deleted file mode 100644 index e1af9ecd92..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAImplementationProviderFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.data.provider;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.data.DATAImplementation;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * Factory for DATA Implementation Provider
- *
- * @version $Rev$ $Date$
- */
-public class DATAImplementationProviderFactory implements ImplementationProviderFactory<DATAImplementation> {
-
- /**
- * Constructs a new DATA implementation.
- */
- public DATAImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component, DATAImplementation implementation) {
- return new DATAImplementationProvider(component, implementation);
- }
-
- public Class<DATAImplementation> getModelType() {
- return DATAImplementation.class;
- }
-}
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAInvoker.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAInvoker.java deleted file mode 100644 index e74bf4d134..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/provider/DATAInvoker.java +++ /dev/null @@ -1,583 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.data.provider;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-import org.apache.tuscany.sca.implementation.data.jdbc.JDBCHelper;
-import org.apache.tuscany.sca.implementation.data.jdbc.JDBCResultSetStreamReader;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.osoa.sca.ServiceRuntimeException;
-
-/**
- * Implements a target invoker for DAS component implementations.
- *
- * The target invoker is responsible for dispatching invocations to the particular
- * component implementation logic. The current component implementation will
- * dispatch calls to the DAS APIs to retrieve the requested data from the back-end store
- *
- * @version $Rev$ $Date$
- */
-public class DATAInvoker implements Invoker {
-
- protected final Operation operation;
- protected final ConnectionInfo connectionInfo;
- protected final String table;
-
- public DATAInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- this.operation = operation;
- this.connectionInfo = connectionInfo;
- this.table = table;
- }
-
- public Message invoke(Message msg) {
- // Shouldn't get here, as the only supported operations
- // are the ones defined DATA interface and implemented
- // by specific invoker subclasses
-
- throw new UnsupportedOperationException(operation.getName());
- }
-
- /****************************************************************
- *
- * Internal invoker implementations for each supported operation
- *
- *****************************************************************/
- /**
- * GetAll operation invoker
- */
- public static class GetAllInvoker extends DATAInvoker {
-
- public GetAllInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
- return msg;
- }
- }
-
- /**
- * Query operation invoker
- */
- public static class QueryInvoker extends DATAInvoker {
-
- public QueryInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
- return msg;
- }
- }
-
- /**
- * Post operation invoker
- */
- public static class PostInvoker extends DATAInvoker {
-
- public PostInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- StringBuilder sqlInsert = new StringBuilder();
- XMLStreamReader insertStream = (XMLStreamReader) ((Object[]) msg.getBody())[1];
-
- if (insertStream == null) {
- throw new IllegalArgumentException("The XMLStreamReader \"insertStream\" must not be null");
- }
-
-
- Connection connection = null;
- PreparedStatement inStmt = null;
-
- List<String> colNames = new ArrayList<String>();
- List<String> values = new ArrayList<String>();
-
- int result = 0;
- try {
-
- connection = JDBCHelper.getConnection(connectionInfo);
-
- while (insertStream.hasNext()) {
-
- insertStream.next();
- if (insertStream.isStartElement()) {
- if (insertStream.getLocalName().equals("record")) {
- sqlInsert.append("INSERT INTO " + this.table + " (");
- } else if (insertStream.getLocalName().equals("column")) {
- colNames.add(insertStream.getAttributeValue(0));
- insertStream.next();
- if (insertStream.isCharacters()) {
- values.add(insertStream.getText());
- }
- }
- } else if (insertStream.isEndElement() && insertStream.getLocalName().equals("record")) {
- for (String c : colNames) {
- sqlInsert.append(" " + c + ",");
- }
-
- sqlInsert.deleteCharAt(sqlInsert.length() - 1);
- sqlInsert.append(" ) VALUES (");
-
- for (String v : values) {
- sqlInsert.append(" '" + v + "',");
- }
-
- sqlInsert.deleteCharAt(sqlInsert.length() - 1);
- sqlInsert.append(" )");
-
- inStmt = connection.prepareStatement(sqlInsert.toString());
-
- result += inStmt.executeUpdate();
-
- // Clean up resources
- inStmt.close();
- sqlInsert.delete(0, sqlInsert.length());
- values.clear();
- colNames.clear();
- }
- }
- } catch (XMLStreamException e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } catch (SQLException sqle) {
- sqle.printStackTrace();
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, inStmt, null);
- }
-
- msg.setBody(Integer.toString(result));
- return msg;
- }
- }
-
- /**
- * Get operation invoker
- */
- public static class GetInvoker extends DATAInvoker {
-
- public GetInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- // Get an entry
- String sqlQuery = null;
- String id = (String) ((Object[]) msg.getBody())[0];
-
- if (id == null) {
- sqlQuery = "SELECT * FROM " + this.table;
- } else {
- sqlQuery = "SELECT * FROM " + this.table + " WHERE ID = " + id;
- }
-
- Connection connection = null;
- PreparedStatement queryStatement = null;
- ResultSet resultSet = null;
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- queryStatement = connection.prepareStatement(sqlQuery);
- resultSet = queryStatement.executeQuery();
-
-
- } catch (SQLException sqle) {
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- JDBCHelper.cleanupResources(connection, queryStatement, resultSet);
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- JDBCHelper.cleanupResources(connection, queryStatement, resultSet);
- } finally {
- //default we leave the connection open to pass to the JDBCStreamReader
- }
-
- msg.setBody(new JDBCResultSetStreamReader(resultSet));
- return msg;
- }
- }
-
- /**
- * Put operation invoker
- */
- public static class PutInvoker extends DATAInvoker {
-
- public PutInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- XMLStreamReader updateStream = (XMLStreamReader) ((Object[]) msg.getBody())[1];
-
- if (updateStream == null) {
- throw new IllegalArgumentException("The XMLStreamReader \"updateStream\" must not be null");
- }
-
- Connection connection = null;
- PreparedStatement upStmt = null;
-
- String id = null;
- String columnName = null;
- String newValue = null;
- int result = 0;
-
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- while (updateStream.hasNext()) {
- updateStream.next();
-
- if (updateStream.isStartElement() && updateStream.getLocalName().equals("column")) {
- columnName = updateStream.getAttributeValue(0);
- updateStream.next();
- if (updateStream.isCharacters()) {
- if (columnName.equals("ID")) {
- id = updateStream.getText();
- } else {
- newValue = updateStream.getText();
-
- upStmt = connection.prepareStatement("UPDATE " + this.table + " SET " + columnName + " = '" + newValue + "' WHERE ID = " + id);
-
- result += upStmt.executeUpdate();
- upStmt.close();
- }
- }
- }
- }
- } catch (XMLStreamException e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } catch (SQLException sqle) {
- sqle.printStackTrace();
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, upStmt, null);
- }
-
- msg.setBody(result);
- return msg;
- }
- }
-
- /**
- * Delete operation invoker
- */
- public static class DeleteInvoker extends DATAInvoker {
-
- public DeleteInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- // Get an entry
- String sqlDelete = null;
- String id = (String) ((Object[]) msg.getBody())[0];
-
- if (id == null) {
- sqlDelete = "DELETE FROM " + this.table;
- } else {
- sqlDelete = "DELETE FROM " + this.table + " WHERE ID = " + id;
- }
-
- Connection connection = null;
- PreparedStatement deleteStatement = null;
- int result = -1;
-
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- deleteStatement = connection.prepareStatement(sqlDelete);
- result = deleteStatement.executeUpdate();
-
- } catch (SQLException sqle) {
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, deleteStatement, null);
- }
-
- msg.setBody(result);
- return msg;
- }
- }
- /**
- * Get operation invoker
- *
- * @version $Rev$ $Date$
- */
- public static class GetDATAInvoker extends DATAInvoker {
-
- public GetDATAInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- // Get an entry
- String sqlQuery = null;
- String id = (String) ((Object[]) msg.getBody())[0];
-
- if (id == null) {
- sqlQuery = "SELECT * FROM " + this.table;
- } else {
- sqlQuery = "SELECT * FROM " + this.table + " WHERE ID = " + id;
- }
-
- Connection connection = null;
- PreparedStatement queryStatement = null;
- ResultSet resultSet = null;
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- queryStatement = connection.prepareStatement(sqlQuery);
- resultSet = queryStatement.executeQuery();
-
-
- } catch (SQLException sqle) {
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- JDBCHelper.cleanupResources(connection, queryStatement, resultSet);
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- JDBCHelper.cleanupResources(connection, queryStatement, resultSet);
- } finally {
- //default we leave the connection open to pass to the JDBCStreamReader
- }
-
- msg.setBody(new JDBCResultSetStreamReader(resultSet));
- return msg;
- }
- }
-
- /**
- * Insert operation invoker
- */
- public static class InsertDATAInvoker extends DATAInvoker {
-
- public InsertDATAInvoker(Operation operation,
- ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) throws IllegalArgumentException {
- StringBuilder sqlInsert = new StringBuilder();
- XMLStreamReader insertStream = (XMLStreamReader) ((Object[]) msg.getBody())[0];
-
- if (insertStream == null) {
- throw new IllegalArgumentException("The XMLStreamReader \"insertStream\" must not be null");
- }
-
-
- Connection connection = null;
- PreparedStatement inStmt = null;
-
- List<String> colNames = new ArrayList<String>();
- List<String> values = new ArrayList<String>();
-
- int result = 0;
- try {
-
- connection = JDBCHelper.getConnection(connectionInfo);
-
- while (insertStream.hasNext()) {
-
- insertStream.next();
- if (insertStream.isStartElement()) {
- if (insertStream.getLocalName().equals("record")) {
- sqlInsert.append("INSERT INTO " + this.table + " (");
- } else if (insertStream.getLocalName().equals("column")) {
- colNames.add(insertStream.getAttributeValue(0));
- insertStream.next();
- if (insertStream.isCharacters()) {
- values.add(insertStream.getText());
- }
- }
- } else if (insertStream.isEndElement() && insertStream.getLocalName().equals("record")) {
- for (String c : colNames) {
- sqlInsert.append(" " + c + ",");
- }
-
- sqlInsert.deleteCharAt(sqlInsert.length() - 1);
- sqlInsert.append(" ) VALUES (");
-
- for (String v : values) {
- sqlInsert.append(" '" + v + "',");
- }
-
- sqlInsert.deleteCharAt(sqlInsert.length() - 1);
- sqlInsert.append(" )");
-
- inStmt = connection.prepareStatement(sqlInsert.toString());
- result += inStmt.executeUpdate();
-
- // Clean up resources
- inStmt.close();
- sqlInsert.delete(0, sqlInsert.length());
- values.clear();
- colNames.clear();
- }
- }
- } catch (XMLStreamException e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } catch (SQLException sqle) {
- sqle.printStackTrace();
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, inStmt, null);
- }
-
- msg.setBody(result);
- return msg;
- }
- }
-
- /**
- * Update operation invoker
- */
- public static class UpdateDATAInvoker extends DATAInvoker {
-
- public UpdateDATAInvoker(Operation operation,
- ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) throws IllegalArgumentException {
-
- XMLStreamReader updateStream = (XMLStreamReader) ((Object[]) msg.getBody())[0];
-
- if (updateStream == null) {
- throw new IllegalArgumentException("The XMLStreamReader \"updateStream\" must not be null");
- }
-
- Connection connection = null;
- PreparedStatement upStmt = null;
-
- String id = null;
- String columnName = null;
- String newValue = null;
- int result = 0;
-
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- while (updateStream.hasNext()) {
- updateStream.next();
-
- if (updateStream.isStartElement() && updateStream.getLocalName().equals("column")) {
- columnName = updateStream.getAttributeValue(0);
- updateStream.next();
- if (updateStream.isCharacters()) {
- if (columnName.equals("ID")) {
- id = updateStream.getText();
- } else {
- newValue = updateStream.getText();
-
- upStmt = connection.prepareStatement("UPDATE " + this.table + " SET " + columnName + " = '" + newValue + "' WHERE ID = " + id);
-
- result += upStmt.executeUpdate();
- upStmt.close();
- }
- }
- }
- }
- } catch (XMLStreamException e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } catch (SQLException sqle) {
- sqle.printStackTrace();
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, upStmt, null);
- }
-
- msg.setBody(result);
- return msg;
- }
- }
-
- /**
- * Delete operation invoker
- */
- public static class DeleteDATAInvoker extends DATAInvoker {
-
- public DeleteDATAInvoker(Operation operation, ConnectionInfo connectionInfo, String table) {
- super(operation, connectionInfo, table);
- }
-
- @Override
- public Message invoke(Message msg) {
-
- // Get an entry
- String sqlDelete = null;
- String id = (String) ((Object[]) msg.getBody())[0];
-
- if (id == null) {
- sqlDelete = "DELETE FROM " + this.table;
- } else {
- sqlDelete = "DELETE FROM " + this.table + " WHERE ID = " + id;
- }
-
- Connection connection = null;
- PreparedStatement deleteStatement = null;
- int result = -1;
-
- try {
- connection = JDBCHelper.getConnection(connectionInfo);
- deleteStatement = connection.prepareStatement(sqlDelete);
- result = deleteStatement.executeUpdate();
-
- } catch (SQLException sqle) {
- msg.setFaultBody(new ServiceRuntimeException(sqle.getCause()));
- } catch (Exception e) {
- msg.setFaultBody(new ServiceRuntimeException(e));
- } finally {
- JDBCHelper.cleanupResources(connection, deleteStatement, null);
- }
-
- msg.setBody(result);
- return msg;
- }
- }
-}
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index 5cd3334e3f..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.implementation.data.DATAImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.data.xml,model=org.apache.tuscany.sca.implementation.data.DATAImplementation diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-java-1.4/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory deleted file mode 100644 index e20f1a6379..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the implementation extension
-org.apache.tuscany.sca.implementation.data.provider.DATAImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.data.DATAImplementation
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATACollectionTestCaseFIXME.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATACollectionTestCaseFIXME.java deleted file mode 100644 index 458025dd66..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATACollectionTestCaseFIXME.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.implementation.data; - -import java.io.FileInputStream; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; -import junit.framework.TestCase; -import org.apache.tuscany.sca.databinding.xml.XMLStreamReader2String; -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.apache.tuscany.sca.implementation.data.DATACollection; - -public class DATACollectionTestCaseFIXME extends TestCase { - - private SCADomain scaDomain; - private DATACollection dataService; - - /** - * @throws java.lang.Exception - */ - @Override - protected void setUp() throws Exception { - scaDomain = SCADomain.newInstance("data.composite"); - dataService = scaDomain.getService(DATACollection.class, "DataComponent/COMPANY"); - } - - /** - * @throws java.lang.Exception - */ - @Override - protected void tearDown() throws Exception { - scaDomain.close(); - } - - public void testInsert() throws Exception { - System.out.println(">testInsert"); - - //Read and process the XML file - FileInputStream fileInputStream = new FileInputStream("src/test/resources/insert.xml"); - XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(fileInputStream); - - String result = dataService.post(null, reader); - assertEquals(result, "2"); - - System.out.println("Number of rows inserted: " + result); - - reader.close(); - } - - public void testGet() throws Exception { - - System.out.println(">testGet"); - - XMLStreamReader reader = dataService.get(null); - assertNotNull(reader); - String xml = new XMLStreamReader2String().transform(reader, null); - System.out.println(xml); - reader.close(); - } - - public void testUpdate() throws Exception { - - System.out.println(">testUpdate"); - - //Read and process the XML file - FileInputStream fileInputStream = new FileInputStream("src/test/resources/update.xml"); - XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(fileInputStream); - - dataService.put(null,reader); - - reader.close(); - } - - public void testGetByID() throws Exception { - System.out.println(">testGetByID"); - - Integer companyID = new Integer(4); - - XMLStreamReader reader = dataService.get(companyID.toString()); - assertNotNull(reader); - String xml = new XMLStreamReader2String().transform(reader, null); - System.out.println(xml); - reader.close(); - } - - public void testDeleteByID() throws Exception { - System.out.println(">testDeleteByID"); - - Integer companyID = new Integer(4); - dataService.delete(companyID.toString()); - } - - public void testDelete() throws Exception { - System.out.println(">testDelete"); - - dataService.delete(null); - - System.out.println("recreating database..."); - //Helper.createDB(); - System.out.println("done!"); - } -} diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.java deleted file mode 100644 index dcf87d8c68..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.data; - -import java.io.StringReader; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilder; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.data.engine.config.ConnectionInfo; -import org.apache.tuscany.sca.data.engine.config.ConnectionProperties; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory; - -/** - * @version $Rev: 538445 $ $Date: 2007-05-15 23:20:37 -0700 (Tue, 15 May 2007) $ - */ -public class DATAImplementationProcessorTestCase extends TestCase { - - protected static final QName IMPLEMENTATION_DATA = new QName(Constants.SCA10_TUSCANY_NS, "implementation.data.xml"); - - private static final String COMPOSITE_USING_DATASOURCE = - "<?xml version=\"1.0\" encoding=\"ASCII\"?>" - + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">" - + " <component name=\"DataComponent\">" - + " <tuscany:implementation.data.xml>" - + " <tuscany:connectionInfo datasource=\"dataSource\"/>" - + " </tuscany:implementation.data.xml>" - + " </component>" - + "</composite>"; - - private static final String COMPOSITE_USING_CONNECTION_PROPERTIES = - "<?xml version=\"1.0\" encoding=\"ASCII\"?>" - + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">" - + " <component name=\"DataComponent\">" - + " <tuscany:implementation.data.xml>" - + " <tuscany:connectionInfo>" - + " <tuscany:connectionProperties" - + " driverClass=\"driverClass\"" - + " databaseURL=\"databaseURL\"" - + " loginTimeout=\"1\"/>" - + " </tuscany:connectionInfo>" - + " </tuscany:implementation.data.xml>" - + " </component>" - + "</composite>"; - - private XMLInputFactory inputFactory; - private StAXArtifactProcessor<Object> staxProcessor; - private CompositeBuilder compositeBuilder; - - @Override - protected void setUp() throws Exception { - DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); - inputFactory = XMLInputFactory.newInstance(); - StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null); - - ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); - AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); - SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class); - UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); - InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class); - IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class); - compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, mapper, null); - } - - public void testLoadCompositeUsingDatasource() throws Exception { - XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_DATASOURCE)); - - Composite composite = (Composite)staxProcessor.read(reader); - DATAImplementation implementation = (DATAImplementation)composite.getComponents().get(0).getImplementation(); - assertNotNull(implementation); - - ConnectionInfo connInfo = implementation.getConnectionInfo(); - assertNotNull(connInfo); - assertEquals("dataSource", connInfo.getDataSource()); - - ConnectionProperties connProperties = connInfo.getConnectionProperties(); - assertNull(connProperties); - } - - public void testLoadCompositeUsingConnectionProperties() throws Exception { - XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_CONNECTION_PROPERTIES)); - - Composite composite = (Composite)staxProcessor.read(reader); - DATAImplementation implementation = (DATAImplementation)composite.getComponents().get(0).getImplementation(); - assertNotNull(implementation); - - ConnectionInfo connInfo = implementation.getConnectionInfo(); - assertNotNull(connInfo); - assertNull("dataSource", connInfo.getDataSource()); - - ConnectionProperties connProperties = connInfo.getConnectionProperties(); - assertNotNull(connProperties); - assertEquals("driverClass",connProperties.getDriverClass()); - assertEquals("databaseURL",connProperties.getDatabaseURL()); - assertEquals(1,connProperties.getLoginTimeout().intValue()); - } -} diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATATestCase.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATATestCase.java deleted file mode 100644 index 4010cb63d3..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATATestCase.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.data; - -import java.io.FileInputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.databinding.xml.XMLStreamReader2String; -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.apache.tuscany.sca.implementation.data.DATA; - -/** - * Tests the DAS service - * - * @version $Rev$ $Date$ - */ -public class DATATestCase extends TestCase { - private SCADomain scaDomain; - private DATA dataService; - - /** - * @throws java.lang.Exception - */ - @Override - protected void setUp() throws Exception { - scaDomain = SCADomain.newInstance("data.composite"); - dataService = scaDomain.getService(DATA.class, "DataComponent/COMPANY_DATA"); - } - - /** - * @throws java.lang.Exception - */ - @Override - protected void tearDown() throws Exception { - scaDomain.close(); - } - - public void testInsert() throws Exception { - System.out.println(">testInsert"); - - //Read and process the XML file - FileInputStream fileInputStream = new FileInputStream("src/test/resources/insert.xml"); - XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(fileInputStream); - - int result = dataService.insert(reader); - assertEquals(result,2); - - System.out.println("Number of rows inserted: "+result); - - reader.close(); - } - - public void testGet() throws Exception { - - System.out.println(">testGet"); - - XMLStreamReader reader = dataService.get(null); - assertNotNull(reader); - String xml = new XMLStreamReader2String().transform(reader, null); - System.out.println(xml); - reader.close(); - } - - public void testUpdate() throws Exception { - - System.out.println(">testUpdate"); - - //Read and process the XML file - FileInputStream fileInputStream = new FileInputStream("src/test/resources/update.xml"); - XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(fileInputStream); - - int result = dataService.update(reader); - assertEquals(result,1); - System.out.println("Number of rows affected: "+result); - - reader.close(); - } - - public void testGetByID() throws Exception { - System.out.println(">testGetByID"); - - Integer companyID = new Integer(4); - - XMLStreamReader reader = dataService.get(companyID.toString()); - assertNotNull(reader); - String xml = new XMLStreamReader2String().transform(reader, null); - System.out.println(xml); - reader.close(); - } - - public void testDeleteByID() throws Exception { - System.out.println(">testDeleteByID"); - - Integer companyID = new Integer(4); - int result = dataService.delete(companyID.toString()); - assertEquals(result,1); - System.out.println("Number of rows deleted: "+result); - } - - public void testDelete() throws Exception { - System.out.println(">testDelete"); - - int result = dataService.delete(null); - assertEquals(result,4); - System.out.println("Number of rows deleted: "+result); - - System.out.println("recreating database..."); - //Helper.createDB(); - System.out.println("done!"); - } - -} diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeed.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeed.java deleted file mode 100644 index 7f0707c0bc..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeed.java +++ /dev/null @@ -1,62 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.data.companyFeed;
-
-import org.apache.tuscany.sca.data.collection.Collection;
-import org.apache.tuscany.sca.data.collection.Entry;
-import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.apache.tuscany.sca.implementation.data.DATA;
-import org.osoa.sca.annotations.Reference;
-
-import commonj.sdo.DataObject;
-
-public class CompanyFeed implements Collection<String, DataObject> {
-
- @Reference
- protected DATA dataService;
-
- public Entry<String, DataObject>[] getAll() {
- return null;
- }
-
- public DataObject get(String id) throws NotFoundException{
-
- DataObject data = null;//dataService.get(id);
- if(data == null) {
- throw new NotFoundException();
- } else {
- return data;
- }
- }
-
- public void delete(String id) throws NotFoundException {
- }
-
- public String post(String key, DataObject item) {
- return null;
- }
-
- public void put(String key, DataObject item) throws NotFoundException {
- }
-
- public Entry<String, DataObject>[] query(String queryString) {
- return null;
- }
-}
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeedTestCaseFIXME.java b/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeedTestCaseFIXME.java deleted file mode 100644 index b72ff89e3b..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/companyFeed/CompanyFeedTestCaseFIXME.java +++ /dev/null @@ -1,51 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.data.companyFeed;
-
-import java.io.IOException;
-import java.net.Socket;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * @version $Rev: 543175 $ $Date: 2007-05-31 09:09:12 -0700 (Thu, 31 May 2007) $
- */
-public class CompanyFeedTestCaseFIXME extends TestCase {
- private SCADomain scaDomain;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- scaDomain = SCADomain.newInstance("data-feed.composite");
- //System.in.read();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- scaDomain.close();
- }
-
- public void testPing() throws IOException {
- new Socket("127.0.0.1", 8085);
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/data-feed.composite b/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/data-feed.composite deleted file mode 100644 index 40c755b134..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/data-feed.composite +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://data" - name="data-feed">
-
-
- <service name="CompanyFeed" promote="CompanyFeedComponent">
- <tuscany:binding.atom uri="http://localhost:8085/comnpanyfeed/*"/>
- </service>
-
- <component name="CompanyFeedComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.data.companyFeed.CompanyFeed"/>
- <reference name="dataService" target="CompanyDataComponent"/>
- </component>
-
- <!-- service name="CompanyDataServiceComponent" promote="CompanyDataComponent">
- <binding.atom uri="http://localhost:8085/comnpanyfeed/"/>
- </service -->
-
- <component name="CompanyDataComponent">
- <tuscany:implementation.data.xml table="company">
- <tuscany:connectionInfo>
- <tuscany:connectionProperties
- driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- databaseURL="jdbc:derby:target/test-classes/company; create = true"
- loginTimeout="600000"/>
- </tuscany:connectionInfo>
- </tuscany:implementation.data.xml>
- </component>
-
-</composite>
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/data.composite b/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/data.composite deleted file mode 100644 index f30b15e34c..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/data.composite +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://data"
- name="data">
-
- <component name="DataComponent">
- <tuscany:implementation.data.xml>
- <tuscany:connectionInfo>
- <tuscany:connectionProperties
- driverClass="org.apache.derby.jdbc.EmbeddedDriver"
- databaseURL="jdbc:derby:target/test-classes/company; create = true"
- loginTimeout="600000"/>
- </tuscany:connectionInfo>
- </tuscany:implementation.data.xml>
- </component>
-
-</composite>
diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/insert.xml b/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/insert.xml deleted file mode 100644 index c0a5ada4bf..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/insert.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resultSet> - <record> - <column name="NAME">New Coorporation I</column> - </record> - <record> - <column name="NAME">New Coorporation II</column> - </record> -</resultSet> diff --git a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/update.xml b/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/update.xml deleted file mode 100644 index c6cef75274..0000000000 --- a/branches/sca-java-1.4/modules/implementation-data-xml/src/test/resources/update.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<result_set> - <record> - <column name="ID">4</column> - <column name="NAME">Update Coorporation</column> - </record> -</result_set> diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/LICENSE b/branches/sca-java-1.4/modules/implementation-web-runtime/LICENSE deleted file mode 100644 index 6b0b1270ff..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/LICENSE +++ /dev/null @@ -1,203 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/NOTICE b/branches/sca-java-1.4/modules/implementation-web-runtime/NOTICE deleted file mode 100644 index fdfa0e9faa..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2008 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/pom.xml b/branches/sca-java-1.4/modules/implementation-web-runtime/pom.xml deleted file mode 100644 index e69cc09938..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/pom.xml +++ /dev/null @@ -1,109 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>tuscany-implementation-web-runtime</artifactId> - <name>Apache Tuscany SCA implementation.web Extension</name> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-web</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-http</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-jsp_2.1_spec</artifactId> - <version>1.0</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>1.4</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.easymock</groupId> - <artifactId>easymock</artifactId> - <version>2.2</version> - <scope>test</scope> - </dependency> - - </dependencies> - - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.implementation.web.runtime</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.implementation.web.runtime*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java deleted file mode 100644 index bf33f7ad9e..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.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.implementation.web; - -import java.io.IOException; -import java.io.PrintWriter; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * Servlet that handles the GET request for the componentContext.js script - * - * The script is generated by calling ScriptProcessors to output the code - * for the SCA references, properties etc. - */ -public class ComponentContextServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - protected static final String HEADER = "/** --- Apache Tuscany componentContext.js --- */\n"; - protected static final String FOOTER = "/** --- Apache Tuscany componentContext.js EOF --- */\n"; - - public static final String COMPONENT_CONTEXT_SCRIPT_URI = "org.apache.tuscany.sca.componentContext.js"; - - protected transient Map<String, Object> attributes = new HashMap<String, Object>(); - protected transient ServletContext servletContext; - private transient List<ContextScriptProcessor> contextScriptProcessors = new ArrayList<ContextScriptProcessor>(); - - public ComponentContextServlet() { - contextScriptProcessors.add(new JSONRPCScripProcessor()); - } - - @Override - public void init(ServletConfig servletConfig) throws ServletException { - this.servletContext = servletConfig.getServletContext(); - if (attributes.size() > 0) { - for (String name : attributes.keySet()) { - servletContext.setAttribute(name, attributes.get(name)); - } - } - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse response) throws IOException { - response.setContentType("text/plain;charset=utf-8"); - PrintWriter out = response.getWriter(); - - out.write(HEADER); - - doScriptInit(req, response); - - doScriptReferences(req, response); - - out.write(FOOTER); - - out.flush(); - out.close(); - } - - /** - * Calls each ContextScriptProcessor once to insert any required initilization code into componentContext.js - */ - protected void doScriptInit(HttpServletRequest req, HttpServletResponse response) throws IOException, UnsupportedEncodingException { - - PrintWriter out = response.getWriter(); - - out.println("if (SCA == undefined) var SCA = new Object();"); - out.println("if (SCA.componentContext == undefined) {"); - out.println(" SCA.componentContext = new Object();"); - out.println(" SCA.componentContext.serviceNames = [];"); - out.println(" SCA.componentContext.serviceProxys = [];"); - out.println(" SCA.componentContext.getService = function(serviceName){"); - out.println(" var i = SCA.componentContext.serviceNames.indexOf(serviceName);"); - out.println(" return SCA.componentContext.serviceProxys[i];"); - out.println(" };"); - out.println(" if (componentContext == undefined) var componentContext = SCA.componentContext;"); - out.println("}"); - - for (ContextScriptProcessor csp : contextScriptProcessors) { - csp.scriptInit(req, response); - } - } - - /** - * Calls each ContextScriptProcessor for each SCA reference to insert code for the reference into componentContext.js - */ - protected void doScriptReferences(HttpServletRequest req, HttpServletResponse response) throws IOException, UnsupportedEncodingException { - - PrintWriter out = response.getWriter(); - - out.write("// SCA References\n"); - - RuntimeComponent component = (RuntimeComponent)servletContext.getAttribute("org.apache.tuscany.sca.implementation.web.RuntimeComponent"); - - for (ComponentReference cr : component.getReferences()) { - String ref = "// SCA Reference " + cr.getName() + "\n"; - out.write(ref); - for (ContextScriptProcessor csp : contextScriptProcessors) { - csp.scriptReference(cr, req, response); - } - } - - out.write("\n// SCA References end.\n"); - } - - /** - * Calls each ContextScriptProcessor for each SCA property to insert code for the property into componentContext.js - */ - protected void doScriptProperties(HttpServletRequest req, HttpServletResponse response) throws IOException, UnsupportedEncodingException { - // TODO: support properties - } - - /** - * Set an attribute on the ServletContext - */ - public void setAttribute(String name, Object value) { - if (servletContext != null) { - servletContext.setAttribute(name, value); - } else { - attributes.put(name, value); - } - } - - public void addContextScriptProcessor(ContextScriptProcessor csp) { - contextScriptProcessors.add(csp); - } -} diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java deleted file mode 100644 index 02c99debb0..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.web; - -import java.io.IOException; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.tuscany.sca.assembly.ComponentReference; - -public interface ContextScriptProcessor { - void scriptInit(HttpServletRequest req, HttpServletResponse response) throws IOException; - void scriptReference(ComponentReference cr, HttpServletRequest req, HttpServletResponse response) throws IOException; -} diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessorExtensionPoint.java b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessorExtensionPoint.java deleted file mode 100644 index 6d3f590309..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessorExtensionPoint.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.web; - - -public interface ContextScriptProcessorExtensionPoint { - - void addContextScriptProcessor(ContextScriptProcessor csp); - -} diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/DefaultContextScriptProcessorExtensionPoint.java b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/DefaultContextScriptProcessorExtensionPoint.java deleted file mode 100644 index 89b951e7d2..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/DefaultContextScriptProcessorExtensionPoint.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.implementation.web; - -import java.util.ArrayList; -import java.util.List; - - -public class DefaultContextScriptProcessorExtensionPoint implements ContextScriptProcessorExtensionPoint { - - protected ComponentContextServlet componentContextServlet; - protected List<ContextScriptProcessor> tempCSPHolder = new ArrayList<ContextScriptProcessor>(); - - public DefaultContextScriptProcessorExtensionPoint() { - } - - public void addContextScriptProcessor(ContextScriptProcessor csp) { - if (componentContextServlet != null) { - componentContextServlet.addContextScriptProcessor(csp); - } else { - tempCSPHolder.add(csp); - } - } - - public void setComponentContextServlet(ComponentContextServlet servlet) { - componentContextServlet = servlet; - if (tempCSPHolder.size() > 0) { - for (ContextScriptProcessor csp : tempCSPHolder) { - componentContextServlet.addContextScriptProcessor(csp); - } - } - } - -} diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/JSONRPCScripProcessor.java b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/JSONRPCScripProcessor.java deleted file mode 100644 index e4ec0d71f9..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/JSONRPCScripProcessor.java +++ /dev/null @@ -1,57 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-
-public class JSONRPCScripProcessor implements ContextScriptProcessor {
-
- public void scriptInit(HttpServletRequest req, HttpServletResponse response) throws IOException {
- PrintWriter out = response.getWriter();
- InputStream is = getClass().getClassLoader().getResourceAsStream("jsonrpc.js");
- if (is != null) {
- int i;
- while ((i = is.read()) != -1) {
- out.write(i);
- }
- }
-
- out.println();
- }
-
- public void scriptReference(ComponentReference cr, HttpServletRequest req, HttpServletResponse response) throws IOException {
- for (Binding b : cr.getBindings()) {
- if ("org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding".equals(b.getClass().getName())) {
- PrintWriter out = response.getWriter();
- out.println("SCA.componentContext.serviceNames.push('" + cr.getName() + "');");
- out.println("SCA.componentContext.serviceProxys.push(new JSONRpcClient('" + cr.getReference().getTargets().get(0).getName() + "').Service);");
- }
- }
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/ComponentContextProxy.java b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/ComponentContextProxy.java deleted file mode 100644 index dba3f62d35..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/ComponentContextProxy.java +++ /dev/null @@ -1,87 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web.runtime;
-
-import java.util.Collection;
-
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.osoa.sca.CallableReference;
-import org.osoa.sca.ComponentContext;
-import org.osoa.sca.RequestContext;
-import org.osoa.sca.ServiceReference;
-
-/**
- * Proxy ComponentContext wrappering a RuntimeComponent as the
- * RuntimeComponent ComponentContext has not been created till later
- */
-public class ComponentContextProxy implements ComponentContext {
-
- protected RuntimeComponent runtimeComponent;
-
- public ComponentContextProxy(RuntimeComponent runtimeComponent) {
- this.runtimeComponent = runtimeComponent;
- }
-
- protected ComponentContext getComponentContext() {
- return runtimeComponent.getComponentContext();
- }
-
- @SuppressWarnings("unchecked")
- public <B, R extends CallableReference<B>> R cast(B arg0) throws IllegalArgumentException {
- return (R) getComponentContext().cast(arg0);
- }
-
- public <B> ServiceReference<B> createSelfReference(Class<B> arg0) {
- return getComponentContext().createSelfReference(arg0);
- }
-
- public <B> ServiceReference<B> createSelfReference(Class<B> arg0, String arg1) {
- return getComponentContext().createSelfReference(arg0, arg1);
- }
-
- public <B> B getProperty(Class<B> arg0, String arg1) {
- return getComponentContext().getProperty(arg0, arg1);
- }
-
- public RequestContext getRequestContext() {
- return getComponentContext().getRequestContext();
- }
-
- public <B> B getService(Class<B> arg0, String arg1) {
- return getComponentContext().getService(arg0, arg1);
- }
-
- public <B> ServiceReference<B> getServiceReference(Class<B> arg0, String arg1) {
- return getComponentContext().getServiceReference(arg0, arg1);
- }
-
- public String getURI() {
- return getComponentContext().getURI();
- }
-
- public <B> Collection<ServiceReference<B>> getServiceReferences(Class<B> businessInterface, String referenceName) {
- return getComponentContext().getServiceReferences(businessInterface, referenceName);
- }
-
- public <B> Collection<B> getServices(Class<B> businessInterface, String referenceName) {
- return getComponentContext().getServices(businessInterface, referenceName);
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java deleted file mode 100644 index 2518ba5381..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java +++ /dev/null @@ -1,78 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.web.runtime;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.implementation.web.ComponentContextServlet;
-import org.apache.tuscany.sca.implementation.web.ContextScriptProcessorExtensionPoint;
-import org.apache.tuscany.sca.implementation.web.DefaultContextScriptProcessorExtensionPoint;
-import org.apache.tuscany.sca.implementation.web.WebImplementation;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-public class WebImplementationProviderFactory implements ImplementationProviderFactory<WebImplementation> {
-
- private ServletHost servletHost;
- private ComponentContextServlet contextServlet;
-
- public WebImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- List<ServletHost> hosts = servletHosts.getServletHosts();
- if (!hosts.isEmpty()) {
- this.servletHost = hosts.get(0);
- }
-
- contextServlet = new ComponentContextServlet();
-
- DefaultContextScriptProcessorExtensionPoint dcspep = (DefaultContextScriptProcessorExtensionPoint)extensionPoints.getExtensionPoint(ContextScriptProcessorExtensionPoint.class);
- dcspep.setComponentContextServlet(contextServlet);
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component, WebImplementation implementation) {
-
- servletHost.addServletMapping("org.osoa.sca.componentContext.js", contextServlet);
- contextServlet.setAttribute("org.osoa.sca.ComponentContext", new ComponentContextProxy(component));
- contextServlet.setAttribute("org.apache.tuscany.sca.implementation.web.RuntimeComponent", component);
-
- return new ImplementationProvider() {
- public Invoker createInvoker(RuntimeComponentService arg0, Operation arg1) {
- throw new UnsupportedOperationException("Components using implementation.web have no services");
- }
- public void start() {
- }
- public void stop() {
- }
- public boolean supportsOneWayInvocation() {
- return false;
- }
- };
- }
-
- public Class<WebImplementation> getModelType() {
- return WebImplementation.class;
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/META-INF/sca.tld b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/META-INF/sca.tld deleted file mode 100644 index 4807ba517a..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/META-INF/sca.tld +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version = '1.0' encoding = 'ISO-8859-1'?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- -->
-
-<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd">
-
-<taglib version="2.1">
-
- <tlib-version>1.0</tlib-version>
- <short-name>SCA-JSP</short-name>
- <uri>http://www.osog.org/sca/sca.tld</uri>
- <description>A tag library for integrating sca components with jsp</description>
-
- <tag>
-
- <name>reference</name>
-
- <tag-class>org.apache.tuscany.sca.implementation.web.taglib.ReferenceTag</tag-class>
- <tei-class>org.apache.tuscany.sca.implementation.web.taglib.ReferenceTEI</tei-class>
-
- <attribute>
- <name>name</name>
- <required>true</required>
- <type>java.lang.String</type>
- </attribute>
-
- <attribute>
- <name>type</name>
- <required>true</required>
- <type>java.lang.String</type>
- </attribute>
-
- <attribute>
- <name>scope</name>
- <required>false</required>
- <type>java.lang.Integer</type>
- </attribute>
-
- <body-content>empty</body-content>
-
- </tag>
-
-</taglib>
diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.web.ContextScriptProcessorExtensionPoint b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.web.ContextScriptProcessorExtensionPoint deleted file mode 100644 index 960ae30552..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.web.ContextScriptProcessorExtensionPoint +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# Implementation class for the ModuleActivator
-org.apache.tuscany.sca.implementation.web.DefaultContextScriptProcessorExtensionPoint
-
diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory deleted file mode 100644 index 9b769c9b10..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the implementation extension
-org.apache.tuscany.sca.implementation.web.runtime.WebImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.web.WebImplementation
diff --git a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/jsonrpc.js b/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/jsonrpc.js deleted file mode 100644 index 8eb477c2e5..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web-runtime/src/main/resources/jsonrpc.js +++ /dev/null @@ -1,493 +0,0 @@ -/*
- * JSON-RPC JavaScript client
- *
- * $Id: jsonrpc.js,v 1.36.2.3 2006/03/08 15:09:37 mclark Exp $
- *
- * Copyright (c) 2003-2004 Jan-Klaas Kollhof
- * Copyright (c) 2005 Michael Clark, Metaparadigm Pte Ltd
- *
- * This code is based on Jan-Klaas' JavaScript o lait library (jsolait).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/*
- * Modifications for Apache Tuscany:
- * - JSONRpcClient_createMethod changed so callback is last arg
- */
-
-/* escape a character */
-
-escapeJSONChar =
-function escapeJSONChar(c)
-{
- if(c == "\"" || c == "\\") return "\\" + c;
- else if (c == "\b") return "\\b";
- else if (c == "\f") return "\\f";
- else if (c == "\n") return "\\n";
- else if (c == "\r") return "\\r";
- else if (c == "\t") return "\\t";
- var hex = c.charCodeAt(0).toString(16);
- if(hex.length == 1) return "\\u000" + hex;
- else if(hex.length == 2) return "\\u00" + hex;
- else if(hex.length == 3) return "\\u0" + hex;
- else return "\\u" + hex;
-};
-
-
-/* encode a string into JSON format */
-
-escapeJSONString =
-function escapeJSONString(s)
-{
- /* The following should suffice but Safari's regex is b0rken
- (doesn't support callback substitutions)
- return "\"" + s.replace(/([^\u0020-\u007f]|[\\\"])/g,
- escapeJSONChar) + "\"";
- */
-
- /* Rather inefficient way to do it */
- var parts = s.split("");
- for(var i=0; i < parts.length; i++) {
- var c =parts[i];
- if(c == '"' ||
- c == '\\' ||
- c.charCodeAt(0) < 32 ||
- c.charCodeAt(0) >= 128)
- parts[i] = escapeJSONChar(parts[i]);
- }
- return "\"" + parts.join("") + "\"";
-};
-
-
-/* Marshall objects to JSON format */
-
-toJSON = function toJSON(o)
-{
- if(o == null) {
- return "null";
- } else if(o.constructor == String) {
- return escapeJSONString(o);
- } else if(o.constructor == Number) {
- return o.toString();
- } else if(o.constructor == Boolean) {
- return o.toString();
- } else if(o.constructor == Date) {
- return '{javaClass: "java.util.Date", time: ' + o.valueOf() +'}';
- } else if(o.constructor == Array) {
- var v = [];
- for(var i = 0; i < o.length; i++) v.push(toJSON(o[i]));
- return "[" + v.join(", ") + "]";
- } else {
- var v = [];
- for(attr in o) {
- if(o[attr] == null) v.push("\"" + attr + "\": null");
- else if(typeof o[attr] == "function"); /* skip */
- else v.push(escapeJSONString(attr) + ": " + toJSON(o[attr]));
- }
- return "{" + v.join(", ") + "}";
- }
-};
-
-
-/* JSONRpcClient constructor */
-
-JSONRpcClient =
-function JSONRpcClient_ctor(serverURL, user, pass, objectID)
-{
- this.serverURL = serverURL;
- this.user = user;
- this.pass = pass;
- this.objectID = objectID;
-
- /* Add standard methods */
- if(this.objectID) {
- this._addMethods(["listMethods"]);
- var req = this._makeRequest("listMethods", []);
- } else {
- this._addMethods(["system.listMethods"]);
- var req = this._makeRequest("system.listMethods", []);
- }
- var m = this._sendRequest(req);
- this._addMethods(m);
-};
-
-
-/* JSONRpcCLient.Exception */
-
-JSONRpcClient.Exception =
-function JSONRpcClient_Exception_ctor(code, message, javaStack)
-{
- this.code = code;
- var name;
- if(javaStack) {
- this.javaStack = javaStack;
- var m = javaStack.match(/^([^:]*)/);
- if(m) name = m[0];
- }
- if(name) this.name = name;
- else this.name = "JSONRpcClientException";
- this.message = message;
-};
-
-JSONRpcClient.Exception.CODE_REMOTE_EXCEPTION = 490;
-JSONRpcClient.Exception.CODE_ERR_CLIENT = 550;
-JSONRpcClient.Exception.CODE_ERR_PARSE = 590;
-JSONRpcClient.Exception.CODE_ERR_NOMETHOD = 591;
-JSONRpcClient.Exception.CODE_ERR_UNMARSHALL = 592;
-JSONRpcClient.Exception.CODE_ERR_MARSHALL = 593;
-
-JSONRpcClient.Exception.prototype = new Error();
-
-JSONRpcClient.Exception.prototype.toString =
-function JSONRpcClient_Exception_toString(code, msg)
-{
- return this.name + ": " + this.message;
-};
-
-
-/* Default top level exception handler */
-
-JSONRpcClient.default_ex_handler =
-function JSONRpcClient_default_ex_handler(e) { alert(e); };
-
-
-/* Client settable variables */
-
-JSONRpcClient.toplevel_ex_handler = JSONRpcClient.default_ex_handler;
-JSONRpcClient.profile_async = false;
-JSONRpcClient.max_req_active = 1;
-JSONRpcClient.requestId = 1;
-
-
-/* JSONRpcClient implementation */
-
-JSONRpcClient.prototype._createMethod =
-function JSONRpcClient_createMethod(methodName)
-{
- var fn=function()
- {
- var args = [];
- var callback = null;
- for(var i=0;i<arguments.length;i++) args.push(arguments[i]);
-
-/* TUSCANY change callback to be last arg instead of first to match binding.ajax
- if(typeof args[0] == "function") callback = args.shift();
-*/
- if(typeof args[arguments.length-1] == "function") callback = args.pop();
-
- var req = fn.client._makeRequest.call(fn.client, fn.methodName,
- args, callback);
- if(callback == null) {
- return fn.client._sendRequest.call(fn.client, req);
- } else {
- JSONRpcClient.async_requests.push(req);
- JSONRpcClient.kick_async();
- return req.requestId;
- }
- };
- fn.client = this;
- fn.methodName = methodName;
- return fn;
-};
-
-JSONRpcClient.prototype._addMethods =
-function JSONRpcClient_addMethods(methodNames)
-{
- for(var i=0; i<methodNames.length; i++) {
- var obj = this;
- var names = methodNames[i].split(".");
- for(var n=0; n<names.length-1; n++) {
- var name = names[n];
- if(obj[name]) {
- obj = obj[name];
- } else {
- obj[name] = new Object();
- obj = obj[name];
- }
- }
- var name = names[names.length-1];
- if(!obj[name]) {
- var method = this._createMethod(methodNames[i]);
- obj[name] = method;
- }
- }
-};
-
-JSONRpcClient._getCharsetFromHeaders =
-function JSONRpcClient_getCharsetFromHeaders(http)
-{
- try {
- var contentType = http.getResponseHeader("Content-type");
- var parts = contentType.split(/\s*;\s*/);
- for(var i =0; i < parts.length; i++) {
- if(parts[i].substring(0, 8) == "charset=")
- return parts[i].substring(8, parts[i].length);
- }
- } catch (e) {}
- return "UTF-8"; /* default */
-};
-
-/* Async queue globals */
-JSONRpcClient.async_requests = [];
-JSONRpcClient.async_inflight = {};
-JSONRpcClient.async_responses = [];
-JSONRpcClient.async_timeout = null;
-JSONRpcClient.num_req_active = 0;
-
-JSONRpcClient._async_handler =
-function JSONRpcClient_async_handler()
-{
- JSONRpcClient.async_timeout = null;
-
- while(JSONRpcClient.async_responses.length > 0) {
- var res = JSONRpcClient.async_responses.shift();
- if(res.canceled) continue;
- if(res.profile) res.profile.dispatch = new Date();
- try {
- res.cb(res.result, res.ex, res.profile);
- } catch(e) {
- JSONRpcClient.toplevel_ex_handler(e);
- }
- }
-
- while(JSONRpcClient.async_requests.length > 0 &&
- JSONRpcClient.num_req_active < JSONRpcClient.max_req_active) {
- var req = JSONRpcClient.async_requests.shift();
- if(req.canceled) continue;
- req.client._sendRequest.call(req.client, req);
- }
-};
-
-JSONRpcClient.kick_async =
-function JSONRpcClient_kick_async()
-{
- if(JSONRpcClient.async_timeout == null)
- JSONRpcClient.async_timeout =
- setTimeout(JSONRpcClient._async_handler, 0);
-};
-
-JSONRpcClient.cancelRequest =
-function JSONRpcClient_cancelRequest(requestId)
-{
- /* If it is in flight then mark it as canceled in the inflight map
- and the XMLHttpRequest callback will discard the reply. */
- if(JSONRpcClient.async_inflight[requestId]) {
- JSONRpcClient.async_inflight[requestId].canceled = true;
- return true;
- }
-
- /* If its not in flight yet then we can just mark it as canceled in
- the the request queue and it will get discarded before being sent. */
- for(var i in JSONRpcClient.async_requests) {
- if(JSONRpcClient.async_requests[i].requestId == requestId) {
- JSONRpcClient.async_requests[i].canceled = true;
- return true;
- }
- }
-
- /* It may have returned from the network and be waiting for its callback
- to be dispatched, so mark it as canceled in the response queue
- and the response will get discarded before calling the callback. */
- for(var i in JSONRpcClient.async_responses) {
- if(JSONRpcClient.async_responses[i].requestId == requestId) {
- JSONRpcClient.async_responses[i].canceled = true;
- return true;
- }
- }
-
- return false;
-};
-
-JSONRpcClient.prototype._makeRequest =
-function JSONRpcClient_makeRequest(methodName, args, cb)
-{
- var req = {};
- req.client = this;
- req.requestId = JSONRpcClient.requestId++;
-
- var obj = {};
- obj.id = req.requestId;
- if (this.objectID)
- obj.method = ".obj#" + this.objectID + "." + methodName;
- else
- obj.method = methodName;
- obj.params = args;
-
- if (cb) req.cb = cb;
- if (JSONRpcClient.profile_async)
- req.profile = { "submit": new Date() };
- req.data = toJSON(obj);
-
- return req;
-};
-
-JSONRpcClient.prototype._sendRequest =
-function JSONRpcClient_sendRequest(req)
-{
- if(req.profile) req.profile.start = new Date();
-
- /* Get free http object from the pool */
- var http = JSONRpcClient.poolGetHTTPRequest();
- JSONRpcClient.num_req_active++;
-
- /* Send the request */
- if (typeof(this.user) == "undefined") {
- http.open("POST", this.serverURL, (req.cb != null));
- } else {
- http.open("POST", this.serverURL, (req.cb != null), this.user, this.pass);
- }
-
- /* setRequestHeader is missing in Opera 8 Beta */
- try { http.setRequestHeader("Content-type", "text/plain"); } catch(e) {}
-
- /* Construct call back if we have one */
- if(req.cb) {
- var self = this;
- http.onreadystatechange = function() {
- if(http.readyState == 4) {
- http.onreadystatechange = function () {};
- var res = { "cb": req.cb, "result": null, "ex": null};
- if (req.profile) {
- res.profile = req.profile;
- res.profile.end = new Date();
- }
- try { res.result = self._handleResponse(http); }
- catch(e) { res.ex = e; }
- if(!JSONRpcClient.async_inflight[req.requestId].canceled)
- JSONRpcClient.async_responses.push(res);
- delete JSONRpcClient.async_inflight[req.requestId];
- JSONRpcClient.kick_async();
- }
- };
- } else {
- http.onreadystatechange = function() {};
- }
-
- JSONRpcClient.async_inflight[req.requestId] = req;
-
- try {
- http.send(req.data);
- } catch(e) {
- JSONRpcClient.poolReturnHTTPRequest(http);
- JSONRpcClient.num_req_active--;
- throw new JSONRpcClient.Exception
- (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed");
- }
-
- if(!req.cb) return this._handleResponse(http);
-};
-
-JSONRpcClient.prototype._handleResponse =
-function JSONRpcClient_handleResponse(http)
-{
- /* Get the charset */
- if(!this.charset) {
- this.charset = JSONRpcClient._getCharsetFromHeaders(http);
- }
-
- /* Get request results */
- var status, statusText, data;
- try {
- status = http.status;
- statusText = http.statusText;
- data = http.responseText;
- } catch(e) {
- JSONRpcClient.poolReturnHTTPRequest(http);
- JSONRpcClient.num_req_active--;
- JSONRpcClient.kick_async();
- throw new JSONRpcClient.Exception
- (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed");
- }
-
- /* Return http object to the pool; */
- JSONRpcClient.poolReturnHTTPRequest(http);
- JSONRpcClient.num_req_active--;
-
- /* Unmarshall the response */
- if(status != 200) {
- throw new JSONRpcClient.Exception(status, statusText);
- }
- var obj;
- try {
- eval("obj = " + data);
- } catch(e) {
- throw new JSONRpcClient.Exception(550, "error parsing result");
- }
- if(obj.error)
- throw new JSONRpcClient.Exception(obj.error.code, obj.error.msg,
- obj.error.trace);
- var res = obj.result;
-
- /* Handle CallableProxy */
- if(res && res.objectID && res.JSONRPCType == "CallableReference")
- return new JSONRpcClient(this.serverURL, this.user,
- this.pass, res.objectID);
-
- return res;
-};
-
-
-/* XMLHttpRequest wrapper code */
-
-/* XMLHttpRequest pool globals */
-JSONRpcClient.http_spare = [];
-JSONRpcClient.http_max_spare = 8;
-
-JSONRpcClient.poolGetHTTPRequest =
-function JSONRpcClient_pool_getHTTPRequest()
-{
- if(JSONRpcClient.http_spare.length > 0) {
- return JSONRpcClient.http_spare.pop();
- }
- return JSONRpcClient.getHTTPRequest();
-};
-
-JSONRpcClient.poolReturnHTTPRequest =
-function JSONRpcClient_poolReturnHTTPRequest(http)
-{
- if(JSONRpcClient.http_spare.length >= JSONRpcClient.http_max_spare)
- delete http;
- else
- JSONRpcClient.http_spare.push(http);
-};
-
-JSONRpcClient.msxmlNames = [ "MSXML2.XMLHTTP.5.0",
- "MSXML2.XMLHTTP.4.0",
- "MSXML2.XMLHTTP.3.0",
- "MSXML2.XMLHTTP",
- "Microsoft.XMLHTTP" ];
-
-JSONRpcClient.getHTTPRequest =
-function JSONRpcClient_getHTTPRequest()
-{
- /* Mozilla XMLHttpRequest */
- try {
- JSONRpcClient.httpObjectName = "XMLHttpRequest";
- return new XMLHttpRequest();
- } catch(e) {}
-
- /* Microsoft MSXML ActiveX */
- for (var i=0;i < JSONRpcClient.msxmlNames.length; i++) {
- try {
- JSONRpcClient.httpObjectName = JSONRpcClient.msxmlNames[i];
- return new ActiveXObject(JSONRpcClient.msxmlNames[i]);
- } catch (e) {}
- }
-
- /* None found */
- JSONRpcClient.httpObjectName = null;
- throw new JSONRpcClient.Exception(0, "Can't create XMLHttpRequest object");
-};
-
diff --git a/branches/sca-java-1.4/modules/implementation-web/LICENSE b/branches/sca-java-1.4/modules/implementation-web/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ -
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/branches/sca-java-1.4/modules/implementation-web/NOTICE b/branches/sca-java-1.4/modules/implementation-web/NOTICE deleted file mode 100644 index 1325efd8bf..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name}
-Copyright (c) 2005 - 2008 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/branches/sca-java-1.4/modules/implementation-web/pom.xml b/branches/sca-java-1.4/modules/implementation-web/pom.xml deleted file mode 100644 index f24fdea1ee..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>tuscany-implementation-web</artifactId> - <name>Apache Tuscany SCA Web Implementation Model</name> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - <version>1.4</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-xml</artifactId> - <version>1.4</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-embedded</artifactId> - <version>1.4</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.implementation.web</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.implementation.web*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java b/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java deleted file mode 100644 index 86af3d7204..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java +++ /dev/null @@ -1,42 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.web;
-
-import org.apache.tuscany.sca.assembly.Implementation;
-
-
-
-/**
- * The model representing an Web implementation in an SCA assembly model.
- */
-public interface WebImplementation extends Implementation {
-
- /**
- * Returns the webapp URI.
- * @return the webapp URI
- */
- String getWebURI();
-
- /**
- * Sets the Webapp URI.
- * @param uri the webapp URI
- */
- void setWebURI(String webappURI);
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementationFactory.java b/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementationFactory.java deleted file mode 100644 index 0cb80de03e..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementationFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web;
-
-
-/**
- * Factory for the Web implementation model.
- */
-public interface WebImplementationFactory {
-
- /**
- * Creates a new Web implementation.
- * @return a new Web implementation
- */
- WebImplementation createWebImplementation();
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationFactoryImpl.java b/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationFactoryImpl.java deleted file mode 100644 index 744fefc39b..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationFactoryImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web.impl;
-
-import org.apache.tuscany.sca.implementation.web.WebImplementation;
-import org.apache.tuscany.sca.implementation.web.WebImplementationFactory;
-
-/**
- * Factory for the Web implementation model.
- */
-public class WebImplementationFactoryImpl implements WebImplementationFactory {
-
- public WebImplementationFactoryImpl() {
- }
-
- public WebImplementation createWebImplementation() {
- return new WebImplementationImpl();
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java b/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java deleted file mode 100644 index f44da1f5bb..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.web.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.builder.ComponentPreProcessor;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.implementation.web.WebImplementation;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-
-/**
- * The model representing an Web implementation in an SCA assembly model.
- */
-class WebImplementationImpl implements WebImplementation, ComponentPreProcessor {
-
- private List<Property> properties = new ArrayList<Property>();
- private List<Reference> references = new ArrayList<Reference>();
- private String uri;
- private boolean unresolved;
-
- private String webURI;
-
- /**
- * Constructs a new Web implementation.
- */
- WebImplementationImpl() {
- }
-
- public ConstrainingType getConstrainingType() {
- // The Web implementation does not support constrainingTypes
- return null;
- }
-
- public List<Property> getProperties() {
- return properties;
- }
-
- public List<Service> getServices() {
- // The Web implementation does not offer services
- return Collections.emptyList();
- }
-
- public List<Reference> getReferences() {
- return references;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- // The Web implementation does not support constrainingTypes
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public String getWebURI() {
- return webURI;
- }
-
- public void setWebURI(String webURI) {
- this.webURI = webURI;
- }
-
- /**
- * Use preProcess to add any references and properties dynamically
- * TODO: also support introspection and handle WEB-INF/web.componentType (spec line 503)
- */
- public void preProcess(Component component) {
- if (!(component instanceof RuntimeComponent)) {
- return;
- }
- RuntimeComponent rtc = (RuntimeComponent) component;
-
- for (Reference reference : rtc.getReferences()) {
- if (getReference(reference.getName()) == null) {
- getReferences().add(createReference(reference));
- }
- }
-
- for (Property property : rtc.getProperties()) {
- if (getProperty(property.getName()) == null) {
- getProperties().add(createProperty(property));
- }
- }
- }
-
- protected Reference getReference(String name) {
- for (Reference reference : getReferences()) {
- if (reference.getName().equals(name)) {
- return reference;
- }
- }
- return null;
- }
-
- protected Reference createReference(Reference reference) {
- Reference newReference;
- try {
- newReference = (Reference)reference.clone();
- } catch (CloneNotSupportedException e) {
- throw new AssertionError(e); // should not ever happen
- }
- return newReference;
- }
-
- protected Property getProperty(String name) {
- for (Property property : getProperties()) {
- if (property.getName().equals(name)) {
- return property;
- }
- }
- return null;
- }
-
- protected Property createProperty(Property property) {
- Property newProperty;
- try {
- newProperty = (Property)property.clone();
- } catch (CloneNotSupportedException e) {
- throw new AssertionError(e); // should not ever happen
- }
- return newProperty;
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java b/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java deleted file mode 100644 index d4a0ab7ef1..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java +++ /dev/null @@ -1,121 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.web.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.implementation.web.WebImplementation;
-import org.apache.tuscany.sca.implementation.web.WebImplementationFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-
-/**
- * Implements a StAX artifact processor for Web implementations.
- */
-public class WebImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<WebImplementation> {
- private static final QName IMPLEMENTATION_WEB = new QName(Constants.SCA10_NS, "implementation.web");
-
- private AssemblyFactory assemblyFactory;
- private WebImplementationFactory implementationFactory;
- private Monitor monitor;
-
- public WebImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.implementationFactory = modelFactories.getFactory(WebImplementationFactory.class);
- this.monitor = monitor;
- }
-
- public QName getArtifactType() {
- // Returns the QName of the XML element processed by this processor
- return IMPLEMENTATION_WEB;
- }
-
- public Class<WebImplementation> getModelType() {
- // Returns the type of model processed by this processor
- return WebImplementation.class;
- }
-
- public WebImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Read an <implementation.web> element
- WebImplementation implementation = implementationFactory.createWebImplementation();
- implementation.setUnresolved(true);
-
- // Read the webapp uri attribute
- String webURI = getString(reader, "web-uri");
- if (webURI != null) {
- implementation.setWebURI(webURI);
-
- // Set the URI of the component type
- implementation.setURI(webURI);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && IMPLEMENTATION_WEB.equals(reader.getName())) {
- break;
- }
- }
-
- return implementation;
- }
-
- public void resolve(WebImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve the component type
- String uri = implementation.getURI();
- if (uri != null) {
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setURI(uri + ".componentType");
- componentType = resolver.resolveModel(ComponentType.class, componentType);
- if (!componentType.isUnresolved()) {
-
- // Initialize the implementation's services, references and properties
- implementation.getServices().addAll(componentType.getServices());
- implementation.getReferences().addAll(componentType.getReferences());
- implementation.getProperties().addAll(componentType.getProperties());
- }
- }
- implementation.setUnresolved(false);
- }
-
- public void write(WebImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <implementation.web>
- writeStart(writer, IMPLEMENTATION_WEB.getNamespaceURI(), IMPLEMENTATION_WEB.getLocalPart(),
- new XAttr("web-uri", implementation.getWebURI()));
-
- writeEnd(writer);
- }
-}
diff --git a/branches/sca-java-1.4/modules/implementation-web/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-java-1.4/modules/implementation-web/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index 3f1e888e16..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.implementation.web.xml.WebImplementationProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#implementation.web,model=org.apache.tuscany.sca.implementation.web.WebImplementation,factory=org.apache.tuscany.sca.implementation.web.WebImplementationFactory diff --git a/branches/sca-java-1.4/modules/implementation-web/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.web.WebImplementationFactory b/branches/sca-java-1.4/modules/implementation-web/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.web.WebImplementationFactory deleted file mode 100644 index d54fe9fcee..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.web.WebImplementationFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for model factory -org.apache.tuscany.sca.implementation.web.impl.WebImplementationFactoryImpl diff --git a/branches/sca-java-1.4/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java b/branches/sca-java-1.4/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java deleted file mode 100644 index 10a7df7ae5..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java +++ /dev/null @@ -1,81 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web.xml;
-
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.implementation.web.WebImplementation;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-
-/**
- * Test reading Web implementations.
- */
-public class ReadTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private CompositeBuilder compositeBuilder;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
- IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, mapper, null);
- }
-
- public void testReadComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestWeb.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite) staxProcessor.read(reader);
- assertNotNull(composite);
-
- compositeBuilder.build(composite);
-
- assertTrue(((WebImplementation) composite.getComponents().get(0).getImplementation()).getWebURI().equals("MyWebapp"));
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java b/branches/sca-java-1.4/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java deleted file mode 100644 index 723672270d..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java +++ /dev/null @@ -1,66 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web.xml;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-
-/**
- * Test reading/write Web implementations.
- */
-public class WriteTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- }
-
- public void testReadWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestWeb.composite");
- Composite composite = (Composite) staxProcessor.read(inputFactory.createXMLStreamReader(is));
- assertNotNull(composite);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
-
- assertTrue(bos.toString().contains("web-uri=\"MyWebapp\""));
-
- }
-
-}
diff --git a/branches/sca-java-1.4/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite b/branches/sca-java-1.4/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite deleted file mode 100644 index 181de3772b..0000000000 --- a/branches/sca-java-1.4/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample/web"
- xmlns:sc="http://sample/composite"
- name="TestWeb">
-
- <component name="TestWeb">
- <implementation.web web-uri="MyWebapp"/>
- </component>
-
-</composite>
diff --git a/branches/sca-java-1.4/modules/pom.xml b/branches/sca-java-1.4/modules/pom.xml index 1ea06e065b..dd29806ee9 100644 --- a/branches/sca-java-1.4/modules/pom.xml +++ b/branches/sca-java-1.4/modules/pom.xml @@ -55,8 +55,10 @@ <module>binding-atom-abdera</module> <module>binding-gdata</module> <module>binding-gdata-runtime</module> + <!-- <module>binding-gdata2</module> <module>binding-gdata2-runtime</module> + --> <module>binding-http</module> <module>binding-http-runtime</module> <module>binding-jms</module> @@ -90,7 +92,7 @@ <module>core</module> <module>core-databinding</module> <module>core-spi</module> - <module>core-spring</module> + <!--module>core-spring</module--> <module>data-api</module> <module>databinding</module> <module>databinding-axiom</module> @@ -100,10 +102,10 @@ <module>databinding-sdo-axiom</module> <module>databinding-json</module> <module>databinding-saxon</module> - <module>databinding-xmlbeans</module> + <!--module>databinding-xmlbeans</module--> <module>databinding-fastinfoset</module> - <module>databinding-xstream</module> - <module>data-engine-helper</module> + <!--module>databinding-xstream</module--> + <!--module>data-engine-helper</module--> <module>definitions</module> <module>definitions-xml</module> <module>domain-manager</module> @@ -113,16 +115,16 @@ <module>extensibility-equinox</module> <module>extension-helper</module> <module>host-corba</module> - <module>host-corba-jee</module> + <!-- module>host-corba-jee</module --> <module>host-corba-jse</module> <module>host-corba-jse-tns</module> <module>host-ejb</module> <module>host-embedded</module> <module>host-http</module> - <module>host-openejb</module> + <!-- module>host-openejb</module --> <module>host-rmi</module> <module>host-webapp</module> - <module>host-webapp-junit</module> + <!-- module>host-webapp-junit</module --> <module>host-jetty</module> <module>host-tomcat</module> <module>interface</module> @@ -133,8 +135,8 @@ <module>interface-wsdl-xml</module> <module>implementation-bpel</module> <module>implementation-bpel-ode</module> - <module>implementation-bpel-jbpm</module> - <module>implementation-data-xml</module> + <!-- module>implementation-bpel-jbpm</module> + <module>implementation-data-xml</module --> <module>implementation-ejb</module> <module>implementation-java</module> <module>implementation-java-xml</module> @@ -148,21 +150,21 @@ <module>implementation-resource-runtime</module> <module>implementation-script</module> <module>implementation-spring</module> - <module>implementation-web</module> - <module>implementation-web-runtime</module> + <!-- module>implementation-web</module> + <module>implementation-web-runtime</module --> <module>implementation-widget</module> <module>implementation-widget-runtime</module> <module>implementation-xquery</module> <module>monitor</module> <module>node-api</module> - <module>node-dynamic</module> + <!-- module>node-dynamic</module --> <module>node-impl</module> <module>node-launcher</module> <!-- - <module>node-launcher-equinox</module> - --> + <module>node-launcher-equinox</module> <module>node-launcher-osgi</module> - <module>node-launcher-webapp</module> + --> + <!-- module>node-launcher-webapp</module --> <module>node-manager</module> <module>osgi-runtime</module> <module>policy</module> @@ -173,8 +175,8 @@ <module>policy-security</module> <module>policy-security-jsr250</module> <module>policy-transaction</module> - <module>runtime</module> - <module>runtime-tomcat</module> + <!-- module>runtime</module> + <module>runtime-tomcat</module --> <!--module>runtime-war</module--> <module>sca-api</module> <module>workspace</module> diff --git a/branches/sca-java-1.4/modules/runtime-standalone/LICENSE b/branches/sca-java-1.4/modules/runtime-standalone/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-1.4/modules/runtime-standalone/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-1.4/modules/runtime-standalone/NOTICE b/branches/sca-java-1.4/modules/runtime-standalone/NOTICE deleted file mode 100644 index fdfa0e9faa..0000000000 --- a/branches/sca-java-1.4/modules/runtime-standalone/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2008 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-1.4/modules/runtime-standalone/pom.xml b/branches/sca-java-1.4/modules/runtime-standalone/pom.xml deleted file mode 100644 index 4bf72158a2..0000000000 --- a/branches/sca-java-1.4/modules/runtime-standalone/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-runtime-standalone</artifactId> - <name>Apache Tuscany SCA Standalone Runtime</name> - - <dependencies> - - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-runtime</artifactId> - <version>${pom.version}</version> - </dependency> - - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-host-tomcat</artifactId> - <version>${pom.version}</version> - </dependency> - - <dependency> - <groupId>commons-cli</groupId> - <artifactId>commons-cli</artifactId> - <version>1.0</version> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.runtime.standalone</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.runtime.standalone*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/runtime-standalone/src/main/java/org/apache/tuscany/sca/runtime/standalone/StandaloneLauncher.java b/branches/sca-java-1.4/modules/runtime-standalone/src/main/java/org/apache/tuscany/sca/runtime/standalone/StandaloneLauncher.java deleted file mode 100644 index ae05f0bd29..0000000000 --- a/branches/sca-java-1.4/modules/runtime-standalone/src/main/java/org/apache/tuscany/sca/runtime/standalone/StandaloneLauncher.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime.standalone; - -import java.io.File; - -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.PosixParser; -import org.apache.tuscany.sca.runtime.Launcher; - -/** - * Strawman for a J2SE standalone launcher - * Try it with: - * - * mvn -o - * mvn dependency:copy-dependencies -o - * java -Djava.ext.dirs=target/dependency -jar target\tuscany-sca.jar C:\MyTuscanyRepository - * - * where MyTuscanyRepository is a folder containing SCA contribution jars - */ -public class StandaloneLauncher { - - private Launcher launcher; - - public StandaloneLauncher(File repository) { - this.launcher = new Launcher(repository); - launcher.start(); - } - - public void stop() { - launcher.stop(); - } - - public static void main(String[] args) throws Exception { - - Options options = new Options(); - options.addOption("domain", true, "the url of the remote domain this node should connect to"); - CommandLineParser parser = new PosixParser(); - CommandLine cmd = parser.parse( options, args); - if (cmd.getArgs().length != 1) { - System.err.println("missing contributions folder parameter"); - System.exit(1); - } - File f = new File(cmd.getArgs()[0]); - if (!f.exists()) { - System.err.println("repository not found: " + cmd.getArgs()[0]); - System.exit(1); - } - - StandaloneLauncher launcher = new StandaloneLauncher(f); - - System.out.println("Press enter to exit..."); - System.in.read(); - - launcher.stop(); - - } - -} diff --git a/branches/sca-java-1.4/modules/runtime-standalone/src/test/java/org/apache/tuscany/sca/runtime/standalone/LauncherTestCase.java b/branches/sca-java-1.4/modules/runtime-standalone/src/test/java/org/apache/tuscany/sca/runtime/standalone/LauncherTestCase.java deleted file mode 100644 index d29d4a3851..0000000000 --- a/branches/sca-java-1.4/modules/runtime-standalone/src/test/java/org/apache/tuscany/sca/runtime/standalone/LauncherTestCase.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime.standalone; - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.domain.DomainException; -import org.apache.tuscany.sca.node.NodeException; -import org.apache.tuscany.sca.runtime.Launcher; - -public class LauncherTestCase extends TestCase { - - private File repo; - private Launcher launcher; - - public void test1() throws NodeException, URISyntaxException, InterruptedException, DomainException, MalformedURLException { - launcher.start(); - } - - public void setUp() throws URISyntaxException { - URL propsURL = getClass().getClassLoader().getResource("repo/tuscany.properties"); - repo = new File(propsURL.toURI()).getParentFile(); - launcher = new Launcher(repo); - } - - public void tearDown() throws NodeException, URISyntaxException, InterruptedException, DomainException { - if (launcher != null) { - launcher.stop(); - } - } - -} diff --git a/branches/sca-java-1.4/modules/runtime-standalone/src/test/resources/repo/bla/helloworld-ws-js.jar b/branches/sca-java-1.4/modules/runtime-standalone/src/test/resources/repo/bla/helloworld-ws-js.jar Binary files differdeleted file mode 100644 index 6978bee727..0000000000 --- a/branches/sca-java-1.4/modules/runtime-standalone/src/test/resources/repo/bla/helloworld-ws-js.jar +++ /dev/null diff --git a/branches/sca-java-1.4/modules/runtime-standalone/src/test/resources/repo/tuscany.properties b/branches/sca-java-1.4/modules/runtime-standalone/src/test/resources/repo/tuscany.properties deleted file mode 100644 index 2735d130e8..0000000000 --- a/branches/sca-java-1.4/modules/runtime-standalone/src/test/resources/repo/tuscany.properties +++ /dev/null @@ -1,5 +0,0 @@ -nodeName=http://localhost:8080/myNode/ -#domainName=http://localhost:8777/tuscany/foo/ -#startManager=true -#hotDeployInterval=10000 -#useHotUpdate=true diff --git a/branches/sca-java-1.4/modules/runtime/pom.xml b/branches/sca-java-1.4/modules/runtime/pom.xml index eaf1e8f33f..970190d420 100644 --- a/branches/sca-java-1.4/modules/runtime/pom.xml +++ b/branches/sca-java-1.4/modules/runtime/pom.xml @@ -156,11 +156,11 @@ <artifactId>tuscany-core-spi</artifactId> <version>${pom.version}</version> </dependency> - <dependency> + <!-- dependency> <groupId>${pom.groupId}</groupId> <artifactId>tuscany-core-spring</artifactId> <version>${pom.version}</version> - </dependency> + </dependency --> <dependency> <groupId>${pom.groupId}</groupId> <artifactId>tuscany-databinding</artifactId> diff --git a/branches/sca-java-1.4/modules/runtime2/pom.xml b/branches/sca-java-1.4/modules/runtime2/pom.xml deleted file mode 100644 index 47222dc4b8..0000000000 --- a/branches/sca-java-1.4/modules/runtime2/pom.xml +++ /dev/null @@ -1,329 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>tuscany-runtime2</artifactId> - <name>Apache Tuscany SCA runtime</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-impl</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-java</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-namespace</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-xml</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core-databinding</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core-spi</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-databinding</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-databinding-jaxb</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-endpoint</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-extensibility</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-embedded</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-http</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-webapp</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-monitor</artifactId> - <version>1.4</version> - </dependency> - </dependencies> - - - <build> - <resources> - <resource> - <directory>src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - </resources> - - <plugins> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <executions> - - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <shadedGroupFilter>org.apache.tuscany.sca</shadedGroupFilter> - - <shadedArtifactAttached>false</shadedArtifactAttached> - <createSourcesJar>${createSourcesJar}</createSourcesJar> - <promoteTransitiveDependencies>true</promoteTransitiveDependencies> - <createDependencyReducedPom>true</createDependencyReducedPom> - - <!-- artifactSet> - <includes> - <include>org.apache.tuscany.sca:sca-api</include> - </includes> - <excludes> - <exclude>org.apache.tuscany.sca:extensibility</exclude> - </excludes> - </artifactSet --> - - <filters> - <filter> - <artifact>org.apache.tuscany.sca:tuscany-host-embedded</artifact> - <!-- excludes> - <exclude>org/apache/tuscany/sca/host/embedded/*</exclude> - </excludes --> - <includes> - <include>org/apache/tuscany/sca/host/embedded/impl/**</include> - </includes> - </filter> - <filter> - <artifact>${project.groupId}:${project.artifactId}</artifact> - - <excludes> - <exclude>org/**</exclude> - </excludes> - </filter> - </filters> - - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.assembly.AssemblyFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.assembly.SCABindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.binding.feed.AtomBindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.binding.feed.RSSBindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.binding.atom.AtomBindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.binding.rss.RSSBindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.binding.http.HTTPResourceBindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.ContributionFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.java.JavaImportExportFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.ContributionPostProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.PackageProcessor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.PackageProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListenerExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.core.ModuleActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.DataBinding</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.DataBindingExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.TransformerExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.extension.helper.ImplementationActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.host.http.ServletHostExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.implementation.java.JavaImplementationFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.implementation.java.JavaImplementationFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.spi.ImplementationActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.work.WorkScheduler</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.definitions.SCADefinitionsProvider</resource> - </transformer> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/scdl4j/pom.xml b/branches/sca-java-1.4/modules/scdl4j/pom.xml deleted file mode 100644 index bad28c23d6..0000000000 --- a/branches/sca-java-1.4/modules/scdl4j/pom.xml +++ /dev/null @@ -1,315 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <name>Apache Tuscany SCDL4J</name> - <artifactId>tuscany-scdl4j</artifactId> - <packaging>jar</packaging> - - <dependencies> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-assembly</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-assembly-xsd</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-definitions</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-definitions-xml</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-interface</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-policy</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-policy-xml</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-xsd</artifactId> - <version>${pom.version}</version> - </dependency> - - <!-- extensions --> - - <!-- - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-binding-atom</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-binding-corba</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-binding-ejb</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-binding-jsonrpc</artifactId> - <version>${pom.version}</version> - </dependency> ---> - - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-interface-java</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-interface-java-xml</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-interface-java-jaxws</artifactId> - <version>${pom.version}</version> - </dependency> - - <!-- dependencies to keep in the shaded pom.xml --> - - <dependency> - <groupId>javax.xml.stream</groupId> - <artifactId>stax-api</artifactId> - <version>1.0-2</version> - </dependency> - - <dependency> - <groupId>org.codehaus.woodstox</groupId> - <artifactId>wstx-asl</artifactId> - <version>3.2.1</version> - <scope>runtime</scope> - </dependency> - - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <!-- promoteTransitiveDependencies>true</promoteTransitiveDependencies --> - <!-- shadedArtifactAttached>true</shadedArtifactAttached --> - <artifactSet> - <excludes> - <exclude>javax.xml.stream:stax-api</exclude> - <exclude>stax:stax-api</exclude> - <exclude>com.sun.xml.bind:jaxb-impl</exclude> - <exclude>xml-apis:xml-apis</exclude> - <exclude>javax.jws:jsr181-api</exclude> - <exclude>javax.xml.bind:jaxb-api</exclude> - <exclude>org.jvnet.jaxb.reflection:jaxb2-reflection</exclude> - <exclude>org.codehaus.woodstox:wstx-asl</exclude> - <exclude>asm:asm-all</exclude> - <exclude>javax.annotation:jsr250-api</exclude> - <exclude>javax.activation:activation</exclude> - <exclude>cglib:cglib-nodep</exclude> - <exclude>javax.xml.ws:jaxws-api</exclude> - <exclude>javax.xml.soap:saaj-api</exclude> - <exclude>org.apache.geronimo.specs:geronimo-commonj_1.1_spec</exclude> - <exclude>org.apache.ws.commons.schema:XmlSchema</exclude> - </excludes> - </artifactSet> - <filters> - <filter> - <artifact>org.apache.tuscany.sca:tuscany-interface-java-jaxws</artifact> - <excludes> - <exclude>com/example/**</exclude> - </excludes> - </filter> - <filter> - <artifact>org.apache.tuscany.sca:tuscany-databinding-jaxb</artifact> - <excludes> - <exclude>com/example/**</exclude> - </excludes> - </filter> - </filters> - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.assembly.AssemblyFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.assembly.SCABindingFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.ContributionFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.java.JavaImportExportFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.ContributionPostProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.PackageProcessor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.PackageProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListenerExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.core.ModuleActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.DataBinding</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.DataBindingExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.databinding.TransformerExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.extension.helper.ImplementationActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.host.http.ServletHostExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.implementation.java.JavaImplementationFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.spi.ImplementationActivator</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.work.WorkScheduler</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/services/org.apache.tuscany.sca.definitions.SCADefinitionsProvider</resource> - </transformer> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/branches/sca-java-1.4/modules/thirdparty-library/pom.xml b/branches/sca-java-1.4/modules/thirdparty-library/pom.xml deleted file mode 100644 index c62526b221..0000000000 --- a/branches/sca-java-1.4/modules/thirdparty-library/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.4</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-thirdparty-library</artifactId> - <name>Apache Tuscany OSGi Bundle for Third Party Jars</name> - <properties> - <maven.test.skip>true</maven.test.skip> - <tuscany.version>${pom.version}</tuscany.version> - </properties> - <dependencies> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-core</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-node-impl</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>tuscany-host-jetty</artifactId> - <version>${pom.version}</version> - </dependency> - </dependencies> - <build> - <plugins> - <!-- - <plugin> <artifactId>maven-eclipse-plugin</artifactId> <version>2.5.1</version> <configuration> - <pde>true</pde> </configuration> </plugin> - --> - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile> - </archive> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-maven-bundle-plugin</artifactId> - <configuration> - <copyJars>false</copyJars> - </configuration> - <executions> - <execution> - <id>build-manifest</id> - <goals> - <goal>build</goal> - </goals> - <phase>process-sources</phase> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project>
\ No newline at end of file |