diff options
Diffstat (limited to 'sca-java-1.x/branches/sca-java-1.6.1/modules')
104 files changed, 3 insertions, 8367 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/LICENSE b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/LICENSE deleted file mode 100644 index e98e07d698..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/LICENSE +++ /dev/null @@ -1,253 +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.
-
-
-===============================================================================
-HessianServiceListenerServlet.java
-
-/*
- * Copyright (c) 2001-2008 Caucho Technology, Inc. All rights reserved.
- *
- * The Apache Software License, Version 1.1
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. 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.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Caucho Technology (http://www.caucho.com/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "Hessian", "Resin", and "Caucho" must not be used to
- * endorse or promote products derived from this software without prior
- * written permission. For written permission, please contact
- * info@caucho.com.
- *
- * 5. Products derived from this software may not be called "Resin"
- * nor may "Resin" appear in their names without prior written
- * permission of Caucho Technology.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 CAUCHO TECHNOLOGY OR ITS 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/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/NOTICE b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/NOTICE deleted file mode 100644 index 82e4513d39..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - -This product includes software developed by the - Caucho Technology (http://www.caucho.com/).
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/pom.xml deleted file mode 100644 index 1181709f06..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/pom.xml +++ /dev/null @@ -1,107 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing pehessianssions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-hessian</artifactId>
- <name>Apache Tuscany SCA Hessian Binding Extension</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>com.caucho</groupId>
- <artifactId>hessian</artifactId>
- <version>3.1.5</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Bundle-Version>${tuscany.version}</Bundle-Version>
- <Bundle-SymbolicName>org.apache.tuscany.sca.binding.hessian</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.hessian*</Export-Package>
- <DynamicImport-Package>*</DynamicImport-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBinding.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBinding.java deleted file mode 100644 index 7f90d78424..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBinding.java +++ /dev/null @@ -1,94 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.hessian.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-public class HessianBinding implements Binding {
-
- // properties required to implement the Tuscany
- // binding extension SPI
- private String uri = null;
- private String name = null;
- private boolean unresolved = false;
- private List<Object> extensions = new ArrayList<Object>();
-
- public HessianBinding() {
- super();
- }
-
- /**
- * Returns the binding URI.
- *
- * @return the binding URI
- */
- public String getURI() {
- return this.uri;
- }
-
- /**
- * Sets the binding URI.
- *
- * @param uri the binding URI
- */
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- /**
- * Returns the binding name.
- *
- * @return the binding name
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Sets the binding name.
- *
- * @param name the binding name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- public boolean isUnresolved() {
- return this.unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public List<Object> getExtensions() {
- return extensions;
- }
-
- /**
- * Clone the binding
- */
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingException.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingException.java deleted file mode 100644 index 456f0d11ba..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingException.java +++ /dev/null @@ -1,40 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.hessian.impl;
-
-public class HessianBindingException extends RuntimeException {
- private static final long serialVersionUID = 1L;
-
- public HessianBindingException() {
- super();
- }
-
- public HessianBindingException(String arg0, Throwable arg1) {
- super(arg0, arg1);
- }
-
- public HessianBindingException(String arg0) {
- super(arg0);
- }
-
- public HessianBindingException(Throwable arg0) {
- super(arg0);
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingProcessor.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingProcessor.java deleted file mode 100644 index f5564b926b..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingProcessor.java +++ /dev/null @@ -1,135 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.hessian.impl;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-public class HessianBindingProcessor implements StAXArtifactProcessor<HessianBinding> {
-
- private QName BINDING_HESSIAN = new QName("http://hessian", "binding.hessian");
-
- private PolicyFactory policyFactory;
- private PolicyAttachPointProcessor policyProcessor;
- private Monitor monitor;
-
- public HessianBindingProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- this.monitor = monitor;
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void warning(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem =
- new ProblemImpl(this.getClass().getName(), "binding-hessian-validation-messages", Severity.WARNING,
- model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem =
- new ProblemImpl(this.getClass().getName(), "binding-hessian-validation-messages", Severity.ERROR,
- model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return BINDING_HESSIAN;
- }
-
- public Class<HessianBinding> getModelType() {
- return HessianBinding.class;
- }
-
- public HessianBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- HessianBinding hessianBinding = new HessianBinding();
-
- // Read policies
- policyProcessor.readPolicies(hessianBinding, reader);
-
- // Read binding name
- String name = reader.getAttributeValue(null, "name");
- if (name != null) {
- hessianBinding.setName(name);
- }
-
- // Read binding URI
- String uri = reader.getAttributeValue(null, "uri");
- if (uri != null) {
- hessianBinding.setURI(uri);
- }
-
- return hessianBinding;
- }
-
- public void resolve(HessianBinding model, ModelResolver resolver) throws ContributionResolveException {
- }
-
- public void write(HessianBinding hessianBinding, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- policyProcessor.writePolicyPrefixes(hessianBinding, writer);
- writer.writeStartElement(BINDING_HESSIAN.getNamespaceURI(), BINDING_HESSIAN.getLocalPart());
- policyProcessor.writePolicyAttributes(hessianBinding, writer);
-
- if (hessianBinding.getName() != null) {
- writer.writeAttribute("name", hessianBinding.getName());
- }
-
- if (hessianBinding.getURI() != null) {
- writer.writeAttribute("uri", hessianBinding.getURI());
- }
-
- writer.writeEndElement();
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingInvoker.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingInvoker.java deleted file mode 100644 index 9d6ede2dbc..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingInvoker.java +++ /dev/null @@ -1,73 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.hessian.provider;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.binding.hessian.impl.HessianBinding;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-import com.caucho.hessian.client.HessianProxyFactory;
-
-public class HessianBindingInvoker implements Invoker {
-
- private String serviceURL;
- private Interface homeImpl;
-
- HessianBindingInvoker(Interface homeImpl, HessianBinding binding) {
- this.serviceURL = binding.getURI();
- this.homeImpl = homeImpl;
- }
-
- public Message invoke(Message msg) {
- try {
- Method method = ((JavaOperation)msg.getOperation()).getJavaMethod();
- Object[] args = msg.getBody();
-
- HessianProxyFactory proxyFactory = new HessianProxyFactory();
- Object service = proxyFactory.create(loadClass(homeImpl.toString()), serviceURL);
- Object result = null;
- result = method.invoke(service, args);
- msg.setBody(result);
- } catch (Throwable e) {
- e.printStackTrace();
- if (e instanceof InvocationTargetException)
- e = ((InvocationTargetException)e).getTargetException();
- msg.setFaultBody(e);
- }
- return msg;
- }
-
- private Class loadClass(String className) {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try {
- if (loader != null)
- return Class.forName(className, false, loader);
- else
- return Class.forName(className);
- } catch (Exception e) {
-
- }
- return null;
- }
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingProviderFactory.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingProviderFactory.java deleted file mode 100644 index 77a5f6f675..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingProviderFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.hessian.provider;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.hessian.impl.HessianBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-public class HessianBindingProviderFactory implements BindingProviderFactory<HessianBinding> {
-
- private MessageFactory messageFactory;
- private ServletHost servletHost;
-
- public HessianBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- List<ServletHost> hosts = servletHosts.getServletHosts();
- if (!hosts.isEmpty()) {
- this.servletHost = hosts.get(0);
- }
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- messageFactory = modelFactories.getFactory(MessageFactory.class);
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- HessianBinding binding) {
- return new HessianReferenceBindingProvider(component, reference, binding);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- HessianBinding binding) {
- return new HessianServiceBindingProvider(component, service, binding, messageFactory, servletHost);
- }
-
- public Class<HessianBinding> getModelType() {
- return HessianBinding.class;
- }
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianReferenceBindingProvider.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianReferenceBindingProvider.java deleted file mode 100644 index 27711932d7..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianReferenceBindingProvider.java +++ /dev/null @@ -1,62 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.hessian.provider;
-
-import org.apache.tuscany.sca.binding.hessian.impl.HessianBinding;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-
-public class HessianReferenceBindingProvider implements ReferenceBindingProvider {
-
- private RuntimeComponentReference reference;
- private HessianBinding hessianBinding;
-
- public HessianReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- HessianBinding binding) {
- this.reference = reference;
- this.hessianBinding = binding;
- }
-
- public Invoker createInvoker(Operation operation) {
- return new HessianBindingInvoker(getBindingInterfaceContract().getInterface(), hessianBinding);
- }
-
- public boolean supportsOneWayInvocation() {
- return true;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- public void start() {
-
- }
-
- public void stop() {
-
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceBindingProvider.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceBindingProvider.java deleted file mode 100644 index 3e4922dc13..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceBindingProvider.java +++ /dev/null @@ -1,87 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.hessian.provider;
-
-import java.util.logging.Logger;
-
-import javax.servlet.Servlet;
-
-import org.apache.tuscany.sca.binding.hessian.impl.HessianBinding;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-public class HessianServiceBindingProvider implements ServiceBindingProvider {
- private static final Logger logger = Logger.getLogger(HessianServiceBindingProvider.class.getName());
-
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private HessianBinding hessianBinding;
- private MessageFactory messageFactory;
- private ServletHost servletHost;
- private String servletMapping;
-
- public HessianServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- HessianBinding binding,
- MessageFactory messageFactory,
- ServletHost servletHost) {
- this.component = component;
- this.service = service;
- this.hessianBinding = binding;
- this.messageFactory = messageFactory;
- this.servletHost = servletHost;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return true;
- }
-
- public void start() {
- Servlet servlet = null;
- Interface homeImpl = service.getInterfaceContract().getInterface();
- RuntimeWire wire = service.getRuntimeWire(hessianBinding);
- servlet = new HessianServiceListenerServlet(homeImpl, wire, messageFactory);
-
- if (servlet == null) {
- throw new IllegalStateException("No get or service method found on the service");
- }
-
- servletMapping = hessianBinding.getURI();
- servletHost.addServletMapping(servletMapping, servlet);
-
- // Save the actual binding URI in the binding
- hessianBinding.setURI(servletHost.getURLMapping(hessianBinding.getURI()).toString());
- }
-
- public void stop() {
- servletHost.removeServletMapping(servletMapping);
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceListenerServlet.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceListenerServlet.java deleted file mode 100644 index de9b4927c6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceListenerServlet.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright (c) 2001-2008 Caucho Technology, Inc. All rights reserved. - * - * The Apache Software License, Version 1.1 - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowlegement: - * "This product includes software developed by the - * Caucho Technology (http://www.caucho.com/)." - * Alternately, this acknowlegement may appear in the software itself, - * if and wherever such third-party acknowlegements normally appear. - * - * 4. The names "Hessian", "Resin", and "Caucho" must not be used to - * endorse or promote products derived from this software without prior - * written permission. For written permission, please contact - * info@caucho.com. - * - * 5. Products derived from this software may not be called "Resin" - * nor may "Resin" appear in their names without prior written - * permission of Caucho Technology. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 CAUCHO TECHNOLOGY OR ITS 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. - * - * @author Scott Ferguson - */ - -package org.apache.tuscany.sca.binding.hessian.provider; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; -import java.util.logging.Logger; - -import javax.servlet.GenericServlet; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.java.JavaOperation; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -import com.caucho.hessian.io.AbstractHessianInput; -import com.caucho.hessian.io.AbstractHessianOutput; -import com.caucho.hessian.io.Hessian2Input; -import com.caucho.hessian.io.Hessian2Output; -import com.caucho.hessian.io.HessianOutput; -import com.caucho.hessian.io.SerializerFactory; -import com.caucho.services.server.ServiceContext; - -/** - * Servlet for serving Hessian services. - */ -public class HessianServiceListenerServlet extends GenericServlet { - - private static final Logger logger = Logger.getLogger(HessianServiceListenerServlet.class.getName()); - - private Interface homeImpl; - private RuntimeWire wire; - private MessageFactory messageFactory; - - private SerializerFactory _serializerFactory; - - private Map<String, JavaOperation> _operationMap = new Hashtable<String, JavaOperation>(); - - public HessianServiceListenerServlet(Interface homeImpl, RuntimeWire wire, MessageFactory messageFactory) { - this.homeImpl = homeImpl; - this.wire = wire; - this.messageFactory = messageFactory; - - List<Operation> operations = homeImpl.getOperations(); - for (int i = 0; i < operations.size(); i++) { - JavaOperation op = (JavaOperation)operations.get(i); - Method method = op.getJavaMethod(); - if (_operationMap.get(method.getName()) == null) - _operationMap.put(method.getName(), op); - - Class[] param = method.getParameterTypes(); - String mangledName = method.getName() + "__" + param.length; - _operationMap.put(mangledName, op); - _operationMap.put(mangleName(method, false), op); - } - } - - public String getServletInfo() { - return "Tuscany Binding Hessian Servlet"; - } - - /** - * Sets the serializer factory. - */ - public void setSerializerFactory(SerializerFactory factory) { - _serializerFactory = factory; - } - - /** - * Gets the serializer factory. - */ - public SerializerFactory getSerializerFactory() { - if (_serializerFactory == null) - _serializerFactory = new SerializerFactory(); - - return _serializerFactory; - } - - /** - * Sets the serializer send collection java type. - */ - public void setSendCollectionType(boolean sendType) { - getSerializerFactory().setSendCollectionType(sendType); - } - - /** - * Execute a request. The path-info of the request selects the bean. Once - * the bean's selected, it will be applied. - */ - public void service(ServletRequest request, ServletResponse response) throws IOException, ServletException { - HttpServletRequest req = (HttpServletRequest)request; - HttpServletResponse res = (HttpServletResponse)response; - - if (!req.getMethod().equals("POST")) { - res.setStatus(500, "Hessian Requires POST"); - PrintWriter out = res.getWriter(); - res.setContentType("text/html"); - out.println("<h1>Hessian Requires POST</h1>"); - return; - } - - String serviceId = req.getPathInfo(); - String objectId = req.getParameter("id"); - if (objectId == null) - objectId = req.getParameter("ejbid"); - - ServiceContext.begin(req, serviceId, objectId); - - try { - InputStream is = request.getInputStream(); - OutputStream os = response.getOutputStream(); - - Hessian2Input in = new Hessian2Input(is); - AbstractHessianOutput out; - - SerializerFactory serializerFactory = getSerializerFactory(); - - in.setSerializerFactory(serializerFactory); - - int code = in.read(); - - if (code != 'c') { - // XXX: deflate - throw new IOException("expected 'c' in hessian input at " + code); - } - - int major = in.read(); - int minor = in.read(); - - if (major >= 2) - out = new Hessian2Output(os); - else - out = new HessianOutput(os); - - out.setSerializerFactory(serializerFactory); - - invoke(in, out); - - out.close(); - } catch (RuntimeException e) { - throw e; - } catch (ServletException e) { - throw e; - } catch (Throwable e) { - throw new ServletException(e); - } finally { - ServiceContext.end(); - } - } - - private String mangleName(Method method, boolean isFull) { - StringBuffer sb = new StringBuffer(); - sb.append(method.getName()); - Class[] params = method.getParameterTypes(); - for (int i = 0; i < params.length; i++) { - sb.append('_'); - sb.append(mangleClass(params[i], isFull)); - } - return sb.toString(); - } - - private String mangleClass(Class cl, boolean isFull) { - String name = cl.getName(); - if (name.equals("boolean") || name.equals("java.lang.Boolean")) - return "boolean"; - else if (name.equals("int") || name.equals("java.lang.Integer") - || name.equals("short") - || name.equals("java.lang.Short") - || name.equals("byte") - || name.equals("java.lang.Byte")) - return "int"; - else if (name.equals("long") || name.equals("java.lang.Long")) - return "long"; - else if (name.equals("float") || name.equals("java.lang.Float") - || name.equals("double") - || name.equals("java.lang.Double")) - return "double"; - else if (name.equals("java.lang.String") || name.equals("com.caucho.util.CharBuffer") - || name.equals("char") - || name.equals("java.lang.Character") - || name.equals("java.io.Reader")) - return "string"; - else if (name.equals("java.util.Date") || name.equals("com.caucho.util.QDate")) - return "date"; - else if (InputStream.class.isAssignableFrom(cl) || name.equals("[B")) - return "binary"; - else if (cl.isArray()) { - return "[" + mangleClass(cl.getComponentType(), isFull); - } else if (name.equals("org.w3c.dom.Node") || name.equals("org.w3c.dom.Element") - || name.equals("org.w3c.dom.Document")) - return "xml"; - else if (isFull) - return name; - else { - int p = name.lastIndexOf('.'); - if (p > 0) - return name.substring(p + 1); - else - return name; - } - } - - public void invoke(AbstractHessianInput in, AbstractHessianOutput out) throws Exception { - ServiceContext context = ServiceContext.getContext(); - - // backward compatibility for some frameworks that don't read - // the call type first - in.skipOptionalCall(); - - String header; - while ((header = in.readHeader()) != null) { - Object value = in.readObject(); - context.addHeader(header, value); - } - - String methodName = in.readMethod(); - Method method = null; - JavaOperation operation = _operationMap.get(methodName); - if (operation != null) - method = operation.getJavaMethod(); - - if (method != null) { - } else if ("_hessian_getAttribute".equals(methodName)) { - String attrName = in.readString(); - in.completeCall(); - String value = null; - if ("java.api.class".equals(attrName)) - value = homeImpl.toString(); - else if ("java.home.class".equals(attrName)) - value = homeImpl.toString(); - else if ("java.object.class".equals(attrName)) - value = homeImpl.toString(); - out.startReply(); - out.writeObject(value); - out.completeReply(); - return; - } else if (method == null) { - out.startReply(); - out.writeFault("NoSuchMethodException", "The service has no method named: " + in.getMethod(), null); - out.completeReply(); - return; - } - - Class[] args = method.getParameterTypes(); - Object[] values = new Object[args.length]; - - for (int i = 0; i < args.length; i++) { - values[i] = in.readObject(args[i]); - } - - Object result = null; - try { - Message msg = messageFactory.createMessage(); - msg.setOperation(operation); - msg.setBody(values); - result = wire.invoke(operation, msg); - } catch (Throwable e) { - while (e instanceof InvocationTargetException) - e = ((InvocationTargetException)e).getTargetException(); - out.startReply(); - out.writeFault("ServiceException", e.getMessage(), e); - out.completeReply(); - return; - } - - // The complete call needs to be after the invoke to handle a - // trailing InputStream - in.completeCall(); - out.startReply(); - out.writeObject(result); - out.completeReply(); - out.close(); - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index 1bbe97e514..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.binding.hessian.impl.HessianBindingProcessor;qname=http://hessian#binding.hessian,model=org.apache.tuscany.sca.binding.hessian.impl.HessianBinding diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema deleted file mode 100644 index dfd4823a13..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema +++ /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. - -# URI of the XML schema to be used for validation -binding-hessian.xsd diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory deleted file mode 100644 index 244449ddf0..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the binding extension
-org.apache.tuscany.sca.binding.hessian.provider.HessianBindingProviderFactory;model=org.apache.tuscany.sca.binding.hessian.impl.HessianBinding
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/binding-hessian.xsd b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/binding-hessian.xsd deleted file mode 100644 index 01d7437878..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/main/resources/binding-hessian.xsd +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://hessian"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:e="http://hessian"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0"/>
-
- <element name="binding.hessian" type="e:HessianBinding"/>
-
- <complexType name="HessianBinding">
- <complexContent>
- <extension base="sca:Binding">
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstImpl.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstImpl.java deleted file mode 100644 index 03ae16792a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstImpl.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.zhulei.test.hessian.first;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class FirstImpl implements IFirst {
-
- public String getString(String str) {
- return str + "_first";
- }
-
- public List<String> getData(String str1, String str2) {
- List<String> list = new ArrayList<String>();
- list.add(str1 + "_first");
- list.add(str2 + "_first");
- return list;
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstTestCase.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstTestCase.java deleted file mode 100644 index 919cbe90ff..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstTestCase.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.zhulei.test.hessian.first;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.tuscany.sca.node.SCANode;
-import org.apache.tuscany.sca.node.SCANodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.caucho.hessian.client.HessianProxyFactory;
-
-/**
- *
- */
-public class FirstTestCase {
- private static SCANode node;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- node = SCANodeFactory.newInstance().createSCANodeFromClassLoader("first_hessian.composite", null);
- node.start();
- }
-
- @Test
- public void testServer() throws IOException {
- try {
- HessianProxyFactory proxyFactory = new HessianProxyFactory();
- IFirst service = (IFirst)proxyFactory.create(IFirst.class, "http://localhost:8085/hessian1");
- List<String> datas = service.getData("123", "ABC");
- for (int i = 0; i < datas.size(); i++) {
- System.out.println(datas.get(i));
- }
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- node.stop();
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/first/IFirst.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/first/IFirst.java deleted file mode 100644 index 03ec25721f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/first/IFirst.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.zhulei.test.hessian.first;
-
-import java.util.List;
-
-public interface IFirst {
-
- public String getString(String str);
-
- public List<String> getData(String str1, String str2);
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/second/ISecond.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/second/ISecond.java deleted file mode 100644 index 5ab32673cd..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/second/ISecond.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.zhulei.test.hessian.second;
-
-public interface ISecond {
-
- public String getString(String str);
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondImpl.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondImpl.java deleted file mode 100644 index 3fe66f6cbb..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondImpl.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.zhulei.test.hessian.second;
-
-import org.osoa.sca.annotations.Reference;
-import org.zhulei.test.hessian.first.IFirst;
-
-public class SecondImpl implements ISecond {
-
- private IFirst first;
-
- public String getString(String str) {
- return first.getString(str) + "_second";
- }
-
- @Reference
- public void setFirst(IFirst first) {
- this.first = first;
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondTestCase.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondTestCase.java deleted file mode 100644 index f390d5b104..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondTestCase.java +++ /dev/null @@ -1,72 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.zhulei.test.hessian.second;
-
-import java.io.IOException;
-
-import org.apache.tuscany.sca.node.SCANode;
-import org.apache.tuscany.sca.node.SCANodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.caucho.hessian.client.HessianProxyFactory;
-
-/**
- *
- */
-public class SecondTestCase {
- private static SCANode node1;
- private static SCANode node2;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- node1 = SCANodeFactory.newInstance().createSCANodeFromClassLoader("second_hessian.composite", null);
- node1.start();
-
- node2 = SCANodeFactory.newInstance().createSCANodeFromClassLoader("first_hessian.composite", null);
- node2.start();
- }
-
- @Test
- public void testServer() throws IOException {
- try {
- HessianProxyFactory proxyFactory = new HessianProxyFactory();
- ISecond service = (ISecond)proxyFactory.create(ISecond.class, "http://localhost:8085/hessian2");
- String str = service.getString("XYZ");
- System.out.println(str);
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- node1.stop();
- node2.stop();
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/resources/first_hessian.composite b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/resources/first_hessian.composite deleted file mode 100644 index 3b14069063..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/resources/first_hessian.composite +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
- xmlns:e="http://hessian"
- targetNamespace="http://FirstHessianSCA"
- name="FirstHessianSCA">
-
- <component name="FirstHessianComponent">
- <implementation.java
- class="org.zhulei.test.hessian.first.FirstImpl" />
- </component>
-
- <service name="Hessian"
- promote="FirstHessianComponent">
- <interface.java
- interface="org.zhulei.test.hessian.first.IFirst" />
- <e:binding.hessian uri="/hessian1" />
- </service>
-
-</composite>
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/resources/second_hessian.composite b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/resources/second_hessian.composite deleted file mode 100644 index 76ddd89341..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-hessian/src/test/resources/second_hessian.composite +++ /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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
- xmlns:e="http://hessian"
- targetNamespace="http://FirstHessianSCA"
- name="FirstHessianSCA">
-
- <component name="SecondHessianComponent">
- <implementation.java
- class="org.zhulei.test.hessian.second.SecondImpl" />
- <reference name="first">
- <interface.java
- interface="org.zhulei.test.hessian.first.IFirst" />
- <e:binding.hessian
- uri="http://localhost:8085/hessian1" />
- </reference>
- </component>
-
- <service name="Hessian"
- promote="SecondHessianComponent">
- <interface.java
- interface="org.zhulei.test.hessian.second.ISecond" />
- <e:binding.hessian uri="/hessian2" />
- </service>
-
-</composite>
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/LICENSE b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ -
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/NOTICE b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/NOTICE deleted file mode 100644 index ad2ba40961..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/pom.xml deleted file mode 100644 index 6d40629880..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/pom.xml +++ /dev/null @@ -1,115 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.6.1-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-sca-jms</artifactId>
- <name>Apache Tuscany SCA JMS-based Default Binding Extension</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.1.0</version>
- </dependency>
-
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- <version>3.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Bundle-Version>${tuscany.version}</Bundle-Version>
- <Bundle-SymbolicName>org.apache.tuscany.sca.binding.sca.jms</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.sca.jms*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/AMQJMSResourceFactory.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/AMQJMSResourceFactory.java deleted file mode 100644 index a484ca5813..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/AMQJMSResourceFactory.java +++ /dev/null @@ -1,39 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.sca.jms;
-
-import javax.jms.JMSException;
-import javax.naming.NamingException;
-
-import org.apache.activemq.ActiveMQConnection;
-import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactoryImpl;
-
-public class AMQJMSResourceFactory extends JMSResourceFactoryImpl {
-
- public AMQJMSResourceFactory(String connectionFactoryName, String responseConnectionFactoryName, String initialContextFactoryName, String jndiURL) {
- super(connectionFactoryName, responseConnectionFactoryName, initialContextFactoryName, jndiURL);
- }
-
- @Override
- protected void createConnection() throws NamingException, JMSException {
- super.createConnection();
- ((ActiveMQConnection)connection).setWatchTopicAdvisories(false);
- }
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/AMQResourceFactoryExtensionPoint.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/AMQResourceFactoryExtensionPoint.java deleted file mode 100644 index 6aab7e53f5..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/AMQResourceFactoryExtensionPoint.java +++ /dev/null @@ -1,32 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.sca.jms;
-
-import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
-import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
-import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactoryExtensionPoint;
-
-public class AMQResourceFactoryExtensionPoint implements JMSResourceFactoryExtensionPoint{
-
- public JMSResourceFactory createJMSResourceFactory(JMSBinding binding) {
- return new AMQJMSResourceFactory(binding.getConnectionFactoryName(), binding.getResponseConnectionFactoryName(), binding.getInitialContextFactoryName(), binding.getJndiURL());
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/JMSBroker.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/JMSBroker.java deleted file mode 100644 index 28e7ff9797..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/JMSBroker.java +++ /dev/null @@ -1,75 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.sca.jms;
-
-import java.net.URI;
-
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.TransportConnector;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-
-/**
- * The JMS broker for the JMS based SCA binding TODO: configure from a binding.jms in definitions.xml
- */
-public class JMSBroker implements ModuleActivator {
-
- // this is static so that there is only one broker per JVM
- // if that wasn't the case then to use the vm: transport each broker
- // would need a unique name and clients would need to know the name
- private static BrokerService broker;
-
- public void start(ExtensionPointRegistry arg0) {
- if (broker == null) {
- broker = new BrokerService();
- broker.setPersistent(false);
- broker.setUseJmx(false);
- try {
-
- TransportConnector tc = broker.addConnector("tcp://localhost:0");
- tc.setDiscoveryUri(URI.create("multicast://default"));
-
- broker.addNetworkConnector("multicast://default");
-
- broker.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
- }
-
- public void stop(ExtensionPointRegistry arg0) {
- if (broker != null) {
- try {
- broker.stop();
- broker = null;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- public static BrokerService getBroker() {
- return broker;
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/JMSSCABindingProviderFactory.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/JMSSCABindingProviderFactory.java deleted file mode 100644 index 44ab8f3fbf..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/java/org/apache/tuscany/sca/binding/sca/jms/JMSSCABindingProviderFactory.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.sca.jms; - -import org.apache.tuscany.sca.binding.jms.impl.JMSBinding; -import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants; -import org.apache.tuscany.sca.binding.jms.provider.JMSBindingReferenceBindingProvider; -import org.apache.tuscany.sca.binding.jms.provider.JMSBindingServiceBindingProvider; -import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory; -import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactoryExtensionPoint; -import org.apache.tuscany.sca.binding.sca.DistributedSCABinding; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.host.jms.JMSHostExtensionPoint; -import org.apache.tuscany.sca.host.jms.JMSServiceListenerFactory; -import org.apache.tuscany.sca.provider.BindingProviderFactory; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; -import org.apache.tuscany.sca.work.WorkScheduler; - -/** - * The factory for the JMS based implementation of the distributed sca binding - */ -public class JMSSCABindingProviderFactory implements BindingProviderFactory<DistributedSCABinding> { - - private WorkScheduler workScheduler; - private ExtensionPointRegistry extensionPoints; - private JMSResourceFactoryExtensionPoint jmsRFEP; - private JMSServiceListenerFactory serviceListenerFactory; - - public JMSSCABindingProviderFactory(ExtensionPointRegistry extensionPoints) { - this.extensionPoints = extensionPoints; - UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); - workScheduler = utilities.getUtility(WorkScheduler.class); - assert workScheduler != null; - jmsRFEP = (JMSResourceFactoryExtensionPoint)extensionPoints.getExtensionPoint(JMSResourceFactoryExtensionPoint.class); - if (jmsRFEP == null) { - jmsRFEP = new AMQResourceFactoryExtensionPoint(); - } - JMSHostExtensionPoint jmsHostExtensionPoint = (JMSHostExtensionPoint)extensionPoints.getExtensionPoint(JMSHostExtensionPoint.class); - serviceListenerFactory = jmsHostExtensionPoint.getJMSServiceListenerFactory(); - } - - public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, - RuntimeComponentReference reference, - DistributedSCABinding binding) { - JMSBinding jmsBinding = createBinding(binding); - - // FIXME: CREATE_NEVER doesn't work as the dynamically created JNDI destinations - // aren't replicated around the broker cluster. Maybe it needs an AMQ specific - // impl of the Tuscany JMSResourceFactory which uses use physical destinations - // instead of JNDI - // jmsBinding.setDestinationCreate(JMSBindingConstants.CREATE_NEVER); - - JMSResourceFactory jmsRF = jmsRFEP.createJMSResourceFactory(jmsBinding); - return new JMSBindingReferenceBindingProvider(component, reference, jmsBinding, extensionPoints, jmsRF); - } - - public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, - RuntimeComponentService service, - DistributedSCABinding binding) { - JMSBinding jmsBinding = createBinding(binding); - jmsBinding.setDestinationCreate(JMSBindingConstants.CREATE_ALWAYS); - JMSResourceFactory jmsRF = jmsRFEP.createJMSResourceFactory(jmsBinding); - return new JMSBindingServiceBindingProvider(component, service, binding.getSCABinding(), jmsBinding, serviceListenerFactory, extensionPoints, jmsRF); - } - - private JMSBinding createBinding(DistributedSCABinding binding) { - JMSBinding b = new JMSBinding(); - b.setInitialContextFactoryName("org.apache.activemq.jndi.ActiveMQInitialContextFactory"); - b.setJndiURL("vm://localhost"); // TODO: plug in jndi url from definitions.xml - - b.setJMSTimeToLive(9); - - b.setRequestMessageProcessorName(JMSBindingConstants.OBJECT_MP_CLASSNAME); - b.setResponseMessageProcessorName(JMSBindingConstants.OBJECT_MP_CLASSNAME); - if (binding.getSCABinding().getURI().startsWith("/")) { - b.setDestinationName(binding.getSCABinding().getURI().substring(1)); - } else { - b.setDestinationName(binding.getSCABinding().getURI()); - } - return b; - } - - public Class<DistributedSCABinding> getModelType() { - return DistributedSCABinding.class; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index f1b9825130..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.binding.sca.jms.JMSBroker
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory deleted file mode 100644 index 8e53649af1..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the binding extension
-org.apache.tuscany.sca.binding.sca.jms.JMSSCABindingProviderFactory;model=org.apache.tuscany.sca.binding.sca.DistributedSCABinding
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/LICENSE b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-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/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/NOTICE b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/NOTICE deleted file mode 100644 index ad2ba40961..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/pom.xml deleted file mode 100644 index e90d886a0d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/pom.xml +++ /dev/null @@ -1,127 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.6.1-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-contribution-jee-impl</artifactId> - <name>Apache Tuscany SCA Java EE Impl</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-impl</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-jee</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core-spi</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface-java</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface-java-xml</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - - <!-- TUSCANY-3165 Waiting for 3.0.2 to be released so - reverting to 3.0.1 for now. JEE itest will no work on - windows due to this - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>openejb-core</artifactId> - <version>3.0.2-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>openejb-jee</artifactId> - <version>3.0.2-SNAPSHOT</version> - </dependency> - --> - - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>openejb-core</artifactId> - <version>3.0.1</version> - </dependency> - - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>openejb-jee</artifactId> - <version>3.0.1</version> - </dependency> - - <dependency> - <groupId>org.codehaus.woodstox</groupId> - <artifactId>wstx-asl</artifactId> - <version>3.2.4</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.jee</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.contribution.jee*</Export-Package> - <DynamicImport-Package>org.apache.tuscany.sca.contribution.osgi.impl</DynamicImport-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/JEEDefinitionsProvider.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/JEEDefinitionsProvider.java deleted file mode 100644 index 262875c49a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/JEEDefinitionsProvider.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.contribution.jee; - -import java.net.URI; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; - -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.definitions.SCADefinitions; -import org.apache.tuscany.sca.definitions.util.SCADefinitionsUtil; -import org.apache.tuscany.sca.provider.SCADefinitionsProvider; -import org.apache.tuscany.sca.provider.SCADefinitionsProviderException; - -/** - * Provider for Policy Intents and PolicySet definitions related to security - * - * @version $Rev$ $Date$ - */ -public class JEEDefinitionsProvider implements SCADefinitionsProvider { - private static final String definitionsFile = "org/apache/tuscany/sca/contribution/jee/definitions.xml"; - - URLArtifactProcessor urlArtifactProcessor = null; - - public JEEDefinitionsProvider(ExtensionPointRegistry registry) { - URLArtifactProcessorExtensionPoint documentProcessors = - registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class); - urlArtifactProcessor = (URLArtifactProcessor)documentProcessors.getProcessor(SCADefinitions.class); - } - - public SCADefinitions getSCADefinition() throws SCADefinitionsProviderException { - SCADefinitions scaDefns = null; - try { - // Allow privileged access to load resource. Requires - // RuntimePermssion in security policy. - URL definitionsFileUrl = AccessController.doPrivileged(new PrivilegedAction<URL>() { - public URL run() { - return getClass().getClassLoader().getResource(definitionsFile); - } - }); - - URI uri = new URI(definitionsFile); - - scaDefns = (SCADefinitions)urlArtifactProcessor.read(null, uri, definitionsFileUrl); - - return scaDefns; - - } catch (Exception e) { - throw new SCADefinitionsProviderException(e); - } - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/JavaEEModuleHelper.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/JavaEEModuleHelper.java deleted file mode 100644 index a903f6dbc0..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/JavaEEModuleHelper.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.jee; - -import java.io.File; - -import org.apache.openejb.OpenEJBException; -import org.apache.openejb.config.AnnotationDeployer; -import org.apache.openejb.config.AppModule; -import org.apache.openejb.config.DeploymentLoader; -import org.apache.openejb.config.EjbModule; -import org.apache.openejb.config.ReadDescriptors; -import org.apache.openejb.config.WebModule; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; - -/** - * @version $Rev$ $Date$ - */ -public class JavaEEModuleHelper { - - public AppModule getMetadataCompleteModules(String jarFilePath) throws ContributionReadException { - DeploymentLoader loader = new DeploymentLoader(); - AppModule appModule = null; - try { - appModule = loader.load(new File(jarFilePath)); - } catch (OpenEJBException e) { - throw new ContributionReadException(e); - } - - // Set the Thread context class loader as the module's class loader and all the Web and EJB modules - // inside. Otherwise, SCA annotations could not be processed - // TODO: Eliminate the use of reflection for setting the class loader - java.lang.reflect.Field field = null; - try { - field = appModule.getClass().getDeclaredField("classLoader"); - } catch (SecurityException e) { - throw new ContributionReadException(e); - } catch (NoSuchFieldException e) { - throw new ContributionReadException(e); - } - field.setAccessible(true); - try{ - field.set(appModule, Thread.currentThread().getContextClassLoader()); - } catch (IllegalArgumentException e) { - throw new ContributionReadException(e); - } catch (IllegalAccessException e) { - throw new ContributionReadException(e); - } - - for(EjbModule ejbModule:appModule.getEjbModules()) { - java.lang.reflect.Field field1 = null; - try { - field1 = ejbModule.getClass().getDeclaredField("classLoader"); - } catch (SecurityException e) { - throw new ContributionReadException(e); - } catch (NoSuchFieldException e) { - throw new ContributionReadException(e); - } - field1.setAccessible(true); - try { - field1.set(ejbModule, Thread.currentThread().getContextClassLoader()); - } catch (IllegalArgumentException e) { - throw new ContributionReadException(e); - } catch (IllegalAccessException e) { - throw new ContributionReadException(e); - } - } - - for(WebModule webModule:appModule.getWebModules()) { - java.lang.reflect.Field field1 = null; - try { - field1 = webModule.getClass().getDeclaredField("classLoader"); - } catch (SecurityException e) { - throw new ContributionReadException(e); - } catch (NoSuchFieldException e) { - throw new ContributionReadException(e); - } - field1.setAccessible(true); - try { - field1.set(webModule, Thread.currentThread().getContextClassLoader()); - } catch (IllegalArgumentException e) { - throw new ContributionReadException(e); - } catch (IllegalAccessException e) { - throw new ContributionReadException(e); - } - } - - // Process deployment descriptor files - ReadDescriptors readDescriptors = new ReadDescriptors(); - try { - readDescriptors.deploy(appModule); - } catch (OpenEJBException e) { - throw new ContributionReadException(e); - } - - // Process annotations - AnnotationDeployer annDeployer = new AnnotationDeployer(); - try { - annDeployer.deploy(appModule); - } catch (OpenEJBException e) { - throw new ContributionReadException(e); - } - - return appModule; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EARContributionClassLoader.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EARContributionClassLoader.java deleted file mode 100644 index 87cdaa2cf3..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EARContributionClassLoader.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * 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.jee.impl; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.List; - -import org.apache.tuscany.sca.contribution.Artifact; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.Export; -import org.apache.tuscany.sca.contribution.Import; -import org.apache.tuscany.sca.contribution.java.JavaImport; -import org.apache.tuscany.sca.contribution.jee.EjbModuleInfo; -import org.apache.tuscany.sca.contribution.jee.JavaEEApplicationInfo; -import org.apache.tuscany.sca.contribution.jee.WebModuleInfo; - - -public class EARContributionClassLoader extends URLClassLoader { - - private Contribution contribution; - private List<EjbModuleInfo> ejbModules = new ArrayList<EjbModuleInfo>(); - - /** - * Constructor for contribution ClassLoader - * - * @param contribution - * @param parent - * @throws MalformedURLException - */ - public EARContributionClassLoader(Contribution contribution, final ClassLoader parent) { - super(new URL[0], parent); - - this.contribution = contribution; - - // get the classloaders for any EAR archive that is a contribution - for (Artifact artifact : contribution.getArtifacts()){ - if (artifact.getModel() instanceof JavaEEApplicationInfo){ - JavaEEApplicationInfo jeeAppInfo = (JavaEEApplicationInfo)artifact.getModel(); - // TODO - won't these all have the same classloader? - ejbModules.addAll(jeeAppInfo.getEjbModuleInfos().values()); - } - } - - } - - /* (non-Javadoc) - * @see java.net.URLClassLoader#findClass(java.lang.String) - * - * Search path for class: - * This contribution - * Imported contributions - */ - @Override - protected Class<?> findClass(String className) throws ClassNotFoundException { - - Class<?> clazz = null; - ClassNotFoundException cne = null; - - // TODO - Won't these classloaders all be the same? - for (EjbModuleInfo ejbModuleInfo : ejbModules){ - try { - clazz = ejbModuleInfo.getModuleClassloader().loadClass(className); - } catch (ClassNotFoundException e) { - cne = e; - } - - if (clazz != null){ - break; - } - } - - if (clazz == null){ - throw cne; - } - - return clazz; - } - - - /* (non-Javadoc) - * @see java.lang.ClassLoader#loadClass(java.lang.String, boolean) - * - * Search path for class: - * Parent ClassLoader - * This contribution - * Imported contributions - * - */ - @Override - protected synchronized Class<?> loadClass(String className, boolean resolveClass) - throws ClassNotFoundException { - - Class<?> clazz = null; - try { - - if (this.getParent() != null) - clazz = this.getParent().loadClass(className); - - } catch (ClassNotFoundException e) { - } - - if (clazz == null) - clazz = findClass(className); - - - if (resolveClass) - this.resolveClass(clazz); - return clazz; - - } - - - - /* (non-Javadoc) - * @see java.lang.ClassLoader#getResource(java.lang.String) - * - * Find a resource. - * Search path for resource: - * Parent ClassLoader - * This contribution - */ - @Override - public URL getResource(String resName) { - - URL resource = null; - - if (this.getParent() != null) { - resource = this.getParent().getResource(resName); - } - if (resource == null) { -// TODO Which classloader? -// resource = webModuleInfo.getModuleClassloader().getResource(resName); - } - - return resource; - } - - - /* (non-Javadoc) - * @see java.lang.ClassLoader#getResources(java.lang.String) - * - * Return list of resources from this contribution, resources - * imported through imported contributions and resources from parent - * ClassLoader. - */ - @Override - public Enumeration<URL> getResources(String resName) throws IOException { - - HashSet<URL> resourceSet = new HashSet<URL>(); - -// TODO - which classloader -// addEnumerationToCollection(resourceSet, webModuleInfo.getModuleClassloader().getResources(resName)); - addEnumerationToCollection(resourceSet, super.getResources(resName)); - - return Collections.enumeration(resourceSet); - } - - /* - * Add an enumeration to a Collection - */ - private <T extends Object> void addEnumerationToCollection(Collection<T> collection, Enumeration<T> enumeration) { - - while (enumeration.hasMoreElements()) - collection.add(enumeration.nextElement()); - } - - - @Override - public String toString() { - return "SCA JEE ClassLoader, parent ClassLoader: " + getParent(); - } - - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EARContributionClassLoaderProvider.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EARContributionClassLoaderProvider.java deleted file mode 100644 index 5ea7dc55f7..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EARContributionClassLoaderProvider.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.contribution.jee.impl; - -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.PackageType; -import org.apache.tuscany.sca.contribution.java.ContributionClassLoaderProvider; -import org.apache.tuscany.sca.contribution.java.impl.ContributionClassLoader; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; - -/** - * The default implementation of the ContributionClassLoaderProvider - */ -public class EARContributionClassLoaderProvider implements ContributionClassLoaderProvider { - - public EARContributionClassLoaderProvider() { - super(); - } - - public String getContributionType() { - return PackageType.EAR; - } - - public ClassLoader getClassLoader(Contribution contribution, ClassLoader parent) { - // TODO - This is not quite right at the CCL will load up the nested jars - // also. However we do need to pick up the import processing so - // need a bit of a refactor - ContributionClassLoader ccl = new ContributionClassLoader(contribution, parent); - return new EARContributionClassLoader(contribution, ccl); - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java deleted file mode 100644 index c0830cbb2c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * 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.jee.impl; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; -import java.util.Map; - -import org.apache.openejb.config.AppModule; -import org.apache.openejb.config.EjbModule; -import org.apache.openejb.config.UnknownModuleTypeException; -import org.apache.openejb.config.UnsupportedModuleTypeException; -import org.apache.openejb.config.WebModule; -import org.apache.openejb.jee.EjbJar; -import org.apache.openejb.jee.EjbRef; -import org.apache.openejb.jee.EjbRefType; -import org.apache.openejb.jee.EjbReference; -import org.apache.openejb.jee.EnterpriseBean; -import org.apache.openejb.jee.EnvEntry; -import org.apache.openejb.jee.Filter; -import org.apache.openejb.jee.InjectionTarget; -import org.apache.openejb.jee.Listener; -import org.apache.openejb.jee.MessageDrivenBean; -import org.apache.openejb.jee.Servlet; -import org.apache.openejb.jee.SessionBean; -import org.apache.openejb.jee.SessionType; -import org.apache.openejb.jee.WebApp; -import org.apache.tuscany.sca.contribution.jee.EjbInfo; -import org.apache.tuscany.sca.contribution.jee.EjbModuleInfo; -import org.apache.tuscany.sca.contribution.jee.JavaEEApplicationInfo; -import org.apache.tuscany.sca.contribution.jee.JavaEEIntrospector; -import org.apache.tuscany.sca.contribution.jee.JavaEEModuleHelper; -import org.apache.tuscany.sca.contribution.jee.WebModuleInfo; -import org.apache.tuscany.sca.contribution.jee.EjbReferenceInfo.EjbType; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.util.IOHelper; - -/** - * @version $Rev$ $Date$ - */ -public class JavaEEIntrospectorImpl implements JavaEEIntrospector { - - public WebModuleInfo introspectWebArchive(URL artifactURL) throws ContributionReadException { - // Create a temporary file since openejb extracts the archive to process - InputStream inp = null; - File tempFile = null; - try { - URLConnection connection = artifactURL.openConnection(); - connection.setUseCaches(false); - inp = connection.getInputStream(); - tempFile = File.createTempFile("temp", ".war"); - FileOutputStream fout = new FileOutputStream(tempFile); - IOHelper.copy(inp, fout); - fout.close(); - inp.close(); - } catch (IOException e) { - throw new ContributionReadException(e); - } - - JavaEEModuleHelper jmh = new JavaEEModuleHelper(); - WebModule wm = jmh.getMetadataCompleteModules(tempFile.getAbsolutePath()).getWebModules().get(0); - if(!tempFile.delete()) { - tempFile.deleteOnExit(); - } - return createWebModuleInfo(wm); - } - - private WebModuleInfo createWebModuleInfo(WebModule webModule) { - WebModuleInfo wmInfo = new WebModuleInfoImpl(); - - WebApp webApp = webModule.getWebApp(); - ClassLoader classLoader = webModule.getClassLoader(); - wmInfo.setmoduleClassloader(classLoader); - - // Process Remote EJB References - for (Map.Entry<String, EjbRef> entry : webApp.getEjbRefMap().entrySet()) { - EjbRef ejbRef = entry.getValue(); - if(ejbRef.getHome() != null) { - // References to only EJB3 beans need to be considered. - // Skip the current on as it is not a reference to an EJB3 bean. - continue; - } - if (ejbRef.getRefType().compareTo(EjbReference.Type.REMOTE) != 0) { - // Only Remote EJB references need to be considered. - // Skip the current one as it is not a remote reference. - continue; - } - //FIXME: ejbRef.getEjbRefType() is null sometimes. Need a different way to figure the type. - if(ejbRef.getEjbRefType() != null && ejbRef.getEjbRefType().compareTo(EjbRefType.SESSION) != 0) { - // Only references to Session beans need to be considered. - // Skip the current one as it is not a Session bean. - continue; - } - - try { - wmInfo.getEjbReferences().put(ejbRef.getEjbRefName(), createEjbReferenceInfo(ejbRef, classLoader)); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - // Process env-entries to compute properties - for (Map.Entry<String, EnvEntry> entry : webApp.getEnvEntryMap().entrySet()) { - EnvEntry envEntry = entry.getValue(); - wmInfo.getEnvEntries().put(envEntry.getEnvEntryName(), createEnvEntryInfo(envEntry)); - } - - // Process Servlets - for(Servlet servlet: webApp.getServlet()) { - try { - wmInfo.getServletClasses().add(classLoader.loadClass(servlet.getServletClass())); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - // Process Filters - for(Filter filter: webApp.getFilter()) { - try { - wmInfo.getFilterClasses().add(classLoader.loadClass(filter.getFilterClass())); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - // Process Listeners - for(Listener listener: webApp.getListener()) { - try { - wmInfo.getListenerClasses().add(classLoader.loadClass(listener.getListenerClass())); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - // TODO: Process JSF Managed beans - - // TODO: Process JSP pages - - return wmInfo; - } - - private org.apache.tuscany.sca.contribution.jee.EnvEntryInfo createEnvEntryInfo(EnvEntry envEntry) { - org.apache.tuscany.sca.contribution.jee.EnvEntryInfo envEntryInfo = new org.apache.tuscany.sca.contribution.jee.EnvEntryInfo(); - envEntryInfo.name = envEntry.getEnvEntryName(); - envEntryInfo.type = envEntry.getEnvEntryType(); - envEntryInfo.value = envEntry.getEnvEntryValue(); - - return envEntryInfo; - } - - private org.apache.tuscany.sca.contribution.jee.EjbReferenceInfo createEjbReferenceInfo(EjbRef ejbRef, ClassLoader classLoader) throws ClassNotFoundException { - org.apache.tuscany.sca.contribution.jee.EjbReferenceInfo ejbReferenceInfo = new org.apache.tuscany.sca.contribution.jee.EjbReferenceInfo(); - - ejbReferenceInfo.referenceName = ejbRef.getEjbRefName(); - ejbReferenceInfo.referenceType = ejbRef.getRefType().compareTo(EjbReference.Type.REMOTE) == 0 ? org.apache.tuscany.sca.contribution.jee.EjbReferenceInfo.RefType.REMOTE : ejbRef.getRefType().compareTo(EjbReference.Type.LOCAL) == 0 ? org.apache.tuscany.sca.contribution.jee.EjbReferenceInfo.RefType.LOCAL : org.apache.tuscany.sca.contribution.jee.EjbReferenceInfo.RefType.UNKNOWN; - ejbReferenceInfo.businessInterface = classLoader.loadClass(ejbRef.getInterface()); - - ejbReferenceInfo.ejbType = EjbType.UNKNOWN; - if(ejbRef.getEjbRefType() != null) { - if(ejbRef.getEjbRefType().compareTo(EjbRefType.SESSION) == 0) { - ejbReferenceInfo.ejbType = EjbType.SESSION_UNKNOWN; - } - } - - ejbReferenceInfo.ejbLink = ejbRef.getEjbLink(); - ejbReferenceInfo.mappedName = ejbRef.getMappedName(); - if(ejbRef.getInjectionTarget().size() > 0) { - InjectionTarget it = ejbRef.getInjectionTarget().iterator().next(); - ejbReferenceInfo.injectionTarget.targetClass = it.getInjectionTargetClass(); - ejbReferenceInfo.injectionTarget.targetName = it.getInjectionTargetName(); - } - - return ejbReferenceInfo; - } - - public EjbModuleInfo introspectEjbArchive(URL artifactURL) throws ContributionReadException { - // Create a temporary file since openejb extracts the archive to process - InputStream inp = null; - File tempFile = null; - try { - URLConnection connection = artifactURL.openConnection(); - connection.setUseCaches(false); - inp = connection.getInputStream(); - tempFile = File.createTempFile("temp", ".jar"); - FileOutputStream fout = new FileOutputStream(tempFile); - IOHelper.copy(inp, fout); - fout.close(); - inp.close(); - } catch (IOException e) { - throw new ContributionReadException(e); - } - - JavaEEModuleHelper jmh = new JavaEEModuleHelper(); - EjbModule em; - try { - em = jmh.getMetadataCompleteModules(tempFile.getAbsolutePath()).getEjbModules().get(0); - } catch(ContributionReadException e) { - if((e.getCause() instanceof UnknownModuleTypeException) || - (e.getCause() instanceof UnsupportedModuleTypeException)) { - // Not an EJB jar - return null; - } else { - throw e; - } - } finally { - if(!tempFile.delete()) { - tempFile.deleteOnExit(); - } - } - return createEjbModuleInfo(em); - } - - private EjbModuleInfo createEjbModuleInfo(EjbModule ejbModule) { - EjbModuleInfo ejbModuleInfo = new EjbModuleInfoImpl(); - - EjbJar ejbJar = ejbModule.getEjbJar(); - if (!ejbJar.getVersion().startsWith("3")) { - // Not an EJB3 module - // TODO: should throw an exception - return null; - } - - ClassLoader classLoader = ejbModule.getClassLoader(); - ejbModuleInfo.setmoduleClassloader(classLoader); - Map<String, EnterpriseBean> beansMap = ejbJar.getEnterpriseBeansByEjbName(); - for (Map.Entry<String, EnterpriseBean> entry : beansMap.entrySet()) { - EnterpriseBean bean = entry.getValue(); - EjbInfo ejbInfo = null; - if (bean instanceof SessionBean) { - SessionBean sbean = (SessionBean)bean; - ejbInfo = createEjbInfo(sbean, classLoader); - } else if (bean instanceof MessageDrivenBean) { - MessageDrivenBean mdbean = (MessageDrivenBean)bean; - ejbInfo = createEjbInfo(mdbean, classLoader); - } else { - continue; - } - if (ejbInfo != null) { - // Bean is an EJB3 bean - ejbModuleInfo.getEjbInfos().put(bean.getEjbName(), ejbInfo); - } - } - - return ejbModuleInfo; - } - - private EjbInfo createEjbInfo(MessageDrivenBean bean, ClassLoader classLoader) { - try { - if(javax.ejb.MessageDrivenBean.class.isAssignableFrom(classLoader.loadClass(bean.getEjbClass()))) { - // Not an EJB3 bean - return null; - } - } catch (ClassNotFoundException ignored) { - // Should not happen - } - EjbInfo ejbInfo = new EjbInfo(); - - ejbInfo.beanName = bean.getEjbName(); - - try { - ejbInfo.beanClass = classLoader.loadClass(bean.getEjbClass()); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - ejbInfo.ejbType = org.apache.tuscany.sca.contribution.jee.EjbInfo.EjbType.MESSAGE_DRIVEN; - - ejbInfo.mappedName = bean.getMappedName(); - - processReferencesEnvEntries(bean, classLoader, ejbInfo); - - return ejbInfo; - } - - private EjbInfo createEjbInfo(SessionBean bean, ClassLoader classLoader) { - if(bean.getBusinessRemote().size() == 0 && bean.getBusinessLocal().size() == 0) { - // Not an EJB3 Session bean - return null; - } - EjbInfo ejbInfo = new EjbInfo(); - - ejbInfo.beanName = bean.getEjbName(); - - try { - ejbInfo.beanClass = classLoader.loadClass(bean.getEjbClass()); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - ejbInfo.ejbType = bean.getSessionType().equals(SessionType.STATEFUL) ? org.apache.tuscany.sca.contribution.jee.EjbInfo.EjbType.SESSION_STATEFUL : bean.getSessionType().equals(SessionType.STATELESS) ? org.apache.tuscany.sca.contribution.jee.EjbInfo.EjbType.SESSION_STATELESS : org.apache.tuscany.sca.contribution.jee.EjbInfo.EjbType.SESSION_UNKNOWN; - - ejbInfo.mappedName = bean.getMappedName(); - //FIXME: Is it ok to use beanName when mapped name is null? - if(ejbInfo.mappedName == null) { - ejbInfo.mappedName = ejbInfo.beanName; - } - - // Process Remote Business interfaces of the SessionBean - for (String intfName : bean.getBusinessRemote()) { - try { - ejbInfo.businessRemote.add(classLoader.loadClass(intfName)); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - // Process Local Business interfaces of the SessionBean - for (String intfName : bean.getBusinessLocal()) { - try { - ejbInfo.businessLocal.add(classLoader.loadClass(intfName)); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - processReferencesEnvEntries(bean, classLoader, ejbInfo); - - return ejbInfo; - } - - private void processReferencesEnvEntries(EnterpriseBean bean, ClassLoader classLoader, EjbInfo ejbInfo) { - // Process Remote EJB References - for (Map.Entry<String, EjbRef> entry : bean.getEjbRefMap().entrySet()) { - EjbRef ejbRef = entry.getValue(); - if(ejbRef.getHome() != null) { - // References to only EJB3 beans need to be considered. - // Skip the current on as it is not a reference to an EJB3 bean. - continue; - } - if (ejbRef.getRefType().compareTo(EjbReference.Type.REMOTE) != 0) { - // Only Remote EJB references need to be considered. - // Skip the current one as it is not a remote reference. - continue; - } - //FIXME: ejbRef.getEjbRefType() is null sometimes. Need a different way to figure the type. - if(ejbRef.getEjbRefType() != null && ejbRef.getEjbRefType().compareTo(EjbRefType.SESSION) != 0) { - // Only references to Session beans need to be considered. - // Skip the current one as it is not a Session bean. - continue; - } - - try { - ejbInfo.ejbReferences.put(ejbRef.getEjbRefName(), createEjbReferenceInfo(ejbRef, classLoader)); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - // Process env-entries - for (Map.Entry<String, EnvEntry> entry : bean.getEnvEntryMap().entrySet()) { - EnvEntry envEntry = entry.getValue(); - - ejbInfo.envEntries.put(envEntry.getEnvEntryName(), createEnvEntryInfo(envEntry)); - } - } - - public JavaEEApplicationInfo introspectJeeArchive(URL artifactURL) throws ContributionReadException { - // Create a temporary file since openejb extracts the archive to process - InputStream inp = null; - File tempFile = null; - try { - URLConnection connection = artifactURL.openConnection(); - connection.setUseCaches(false); - inp = connection.getInputStream(); - tempFile = File.createTempFile("temp", ".ear"); - FileOutputStream fout = new FileOutputStream(tempFile); - IOHelper.copy(inp, fout); - fout.close(); - inp.close(); - } catch (IOException e) { - throw new ContributionReadException(e); - } - - JavaEEModuleHelper jmh = new JavaEEModuleHelper(); - AppModule appModule = jmh.getMetadataCompleteModules(tempFile.getAbsolutePath()); - if(!tempFile.delete()) { - tempFile.deleteOnExit(); - } - return createJavaEEApplicationInfo(appModule); - } - - private org.apache.tuscany.sca.contribution.jee.JavaEEApplicationInfo createJavaEEApplicationInfo(AppModule appModule) { - JavaEEApplicationInfo appInfo = new JavaEEApplicationInfoImpl(); - for(EjbModule em : appModule.getEjbModules()){ - EjbModuleInfo ejbModuleInfo = createEjbModuleInfo(em); - ejbModuleInfo.setModuleName(em.getModuleId()); - appInfo.getEjbModuleInfos().put(em.getModuleId(), ejbModuleInfo); - } - - for(WebModule wm : appModule.getWebModules()) { - WebModuleInfo webModuleInfo = createWebModuleInfo(wm); - webModuleInfo.setModuleName(wm.getModuleId()); - appInfo.getWebModuleInfos().put(wm.getModuleId(), webModuleInfo); - } - - return appInfo; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/WARContributionClassLoader.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/WARContributionClassLoader.java deleted file mode 100644 index 4047371583..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/WARContributionClassLoader.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * 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.jee.impl; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.List; - -import org.apache.tuscany.sca.contribution.Artifact; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.Export; -import org.apache.tuscany.sca.contribution.Import; -import org.apache.tuscany.sca.contribution.java.JavaImport; -import org.apache.tuscany.sca.contribution.jee.EjbModuleInfo; -import org.apache.tuscany.sca.contribution.jee.JavaEEApplicationInfo; -import org.apache.tuscany.sca.contribution.jee.WebModuleInfo; - - -public class WARContributionClassLoader extends URLClassLoader { - - private Contribution contribution; - private WebModuleInfo webModuleInfo = null; - - /** - * Constructor for contribution ClassLoader - * - * @param contribution - * @param parent - * @throws MalformedURLException - */ - public WARContributionClassLoader(Contribution contribution, final ClassLoader parent) { - super(new URL[0], parent); - - this.contribution = contribution; - - // get the classloaders for any WAR archive that is a contribution - // TODO extend to case where JEE archive is outside the contribution - for (Artifact artifact : contribution.getArtifacts()){ - if (artifact.getModel() instanceof WebModuleInfo){ - webModuleInfo = (WebModuleInfo)artifact.getModel(); - break; - } - } - - } - - /* (non-Javadoc) - * @see java.net.URLClassLoader#findClass(java.lang.String) - * - * Search path for class: - * This contribution - * Imported contributions - */ - @Override - protected Class<?> findClass(String className) throws ClassNotFoundException { - - Class<?> clazz = null; - ClassNotFoundException cne = null; - - try { - clazz = webModuleInfo.getModuleClassloader().loadClass(className); - } catch (ClassNotFoundException e) { - cne = e; - } - - if (clazz == null){ - throw cne; - } - - return clazz; - } - - - /* (non-Javadoc) - * @see java.lang.ClassLoader#loadClass(java.lang.String, boolean) - * - * Search path for class: - * Parent ClassLoader - * This contribution - * Imported contributions - * - */ - @Override - protected synchronized Class<?> loadClass(String className, boolean resolveClass) - throws ClassNotFoundException { - - Class<?> clazz = null; - try { - - if (this.getParent() != null) - clazz = this.getParent().loadClass(className); - - } catch (ClassNotFoundException e) { - } - - if (clazz == null) - clazz = findClass(className); - - - if (resolveClass) - this.resolveClass(clazz); - return clazz; - - } - - - /* (non-Javadoc) - * @see java.lang.ClassLoader#getResource(java.lang.String) - * - * Find a resource. - * Search path for resource: - * Parent ClassLoader - * This contribution - */ - @Override - public URL getResource(String resName) { - - URL resource = null; - - if (this.getParent() != null) { - resource = this.getParent().getResource(resName); - } - if (resource == null) - resource = webModuleInfo.getModuleClassloader().getResource(resName); - - return resource; - } - - - /* (non-Javadoc) - * @see java.lang.ClassLoader#getResources(java.lang.String) - * - * Return list of resources from this contribution, resources - * imported through imported contributions and resources from parent - * ClassLoader. - */ - @Override - public Enumeration<URL> getResources(String resName) throws IOException { - - HashSet<URL> resourceSet = new HashSet<URL>(); - - addEnumerationToCollection(resourceSet, webModuleInfo.getModuleClassloader().getResources(resName)); - addEnumerationToCollection(resourceSet, super.getResources(resName)); - - return Collections.enumeration(resourceSet); - } - - - /* - * Add an enumeration to a Collection - */ - private <T extends Object> void addEnumerationToCollection(Collection<T> collection, Enumeration<T> enumeration) { - - while (enumeration.hasMoreElements()) - collection.add(enumeration.nextElement()); - } - - - @Override - public String toString() { - return "SCA WAR ClassLoader, parent ClassLoader: " + getParent(); - } - - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/WARContributionClassLoaderProvider.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/WARContributionClassLoaderProvider.java deleted file mode 100644 index d2af85a7d5..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/WARContributionClassLoaderProvider.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.contribution.jee.impl; - -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.PackageType; -import org.apache.tuscany.sca.contribution.java.ContributionClassLoaderProvider; -import org.apache.tuscany.sca.contribution.java.impl.ContributionClassLoader; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; - -/** - * The default implementation of the ContributionClassLoaderProvider - */ -public class WARContributionClassLoaderProvider implements ContributionClassLoaderProvider { - - public WARContributionClassLoaderProvider() { - super(); - } - - public String getContributionType() { - return PackageType.WAR; - } - - public ClassLoader getClassLoader(Contribution contribution, ClassLoader parent) { - // TODO - This is not quite right at the CCL will load up the nested jars - // also. However we do need to pick up the import processing so - // need a bit of a refactor - ContributionClassLoader ccl = new ContributionClassLoader(contribution, parent); - return new WARContributionClassLoader(contribution, ccl); - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.java.ContributionClassLoaderProvider b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.java.ContributionClassLoaderProvider deleted file mode 100644 index 460bf3206c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.java.ContributionClassLoaderProvider +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-org.apache.tuscany.sca.contribution.jee.impl.EARContributionClassLoaderProvider;type=application/ear
-org.apache.tuscany.sca.contribution.jee.impl.WARContributionClassLoaderProvider;type=application/war
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.jee.JavaEEIntrospector b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.jee.JavaEEIntrospector deleted file mode 100644 index 35c1b709a5..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.jee.JavaEEIntrospector +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.jee.impl.JavaEEIntrospectorImpl
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider deleted file mode 100644 index cd81aab7a0..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for SCA Definitions Providers -org.apache.tuscany.sca.contribution.jee.JEEDefinitionsProvider
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/org/apache/tuscany/sca/contribution/jee/definitions.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/org/apache/tuscany/sca/contribution/jee/definitions.xml deleted file mode 100644 index bfc7f9097c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-jee-impl/src/main/resources/org/apache/tuscany/sca/contribution/jee/definitions.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0" - targetNamespace="http://www.osoa.org/xmlns/sca/1.0" - xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"> - - - <!-- JEE Intents Defined by the SCA Runtime --> - <intent name="ejb" - constrains="sca:service sca:reference"> - <description> - This intent is used to indicate that a message passing - through a service or reference observers the same rules - as if it had been received/sent by a vanilla Java EE EJB. - </description> - </intent> - -</definitions>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/LICENSE b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/NOTICE b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/NOTICE deleted file mode 100644 index d83ebbe236..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/NOTICE +++ /dev/null @@ -1,14 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2006 The Apache Software Foundation - -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/pom.xml deleted file mode 100644 index 4a92847892..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/pom.xml +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.6.1-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-databinding-fastinfoset</artifactId> - <name>Apache Tuscany SCA Data Binding for FastInfoset</name> - <description>Tuscany FastInfoset Data Binding</description> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core-spi</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-databinding</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>com.sun.xml.fastinfoset</groupId> - <artifactId>FastInfoset</artifactId> - <version>1.2.2</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.1</version> - </dependency> - </dependencies> - <repositories> - <repository> - <snapshots> - <enabled>true</enabled> - </snapshots> - <id>java.net</id> - <name>java.net Maven 1.x Repository</name> - <url>http://download.java.net/maven/1</url> - <layout>legacy</layout> - </repository> - </repositories> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.databinding.fastinfoset</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.databinding.fastinfoset*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2Node.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2Node.java deleted file mode 100644 index 2e0aa629f3..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2Node.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.fastinfoset; - -import java.io.InputStream; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.databinding.impl.DOMHelper; -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -import com.sun.xml.fastinfoset.dom.DOMDocumentParser; - -/** - * @version $Rev$ $Date$ - */ -public class FastInfoset2Node extends BaseTransformer<InputStream, Node> implements - PullTransformer<InputStream, Node> { - - @Override - protected Class<InputStream> getSourceType() { - return InputStream.class; - } - - @Override - protected Class<Node> getTargetType() { - return Node.class; - } - - public Node transform(InputStream source, TransformationContext context) { - try { - DOMDocumentParser parser = new DOMDocumentParser(); - Document doc = DOMHelper.newDocument(); - parser.parse(doc, source); - return doc.getDocumentElement(); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getSourceDataBinding() { - return "xml:fastinfoset:java.io.InputStream"; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2SAX.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2SAX.java deleted file mode 100644 index 77f6b77636..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2SAX.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.fastinfoset; - -import java.io.InputStream; - -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.xml.sax.ContentHandler; - -import com.sun.xml.fastinfoset.sax.SAXDocumentParser; - -/** - * @version $Rev$ $Date$ - */ -public class FastInfoset2SAX extends BaseTransformer<InputStream, ContentHandler> implements - PushTransformer<InputStream, ContentHandler> { - - @Override - protected Class<InputStream> getSourceType() { - return InputStream.class; - } - - @Override - protected Class<ContentHandler> getTargetType() { - return ContentHandler.class; - } - - - /** - * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext) - */ - public void transform(InputStream source, ContentHandler target, TransformationContext context) { - try { - SAXDocumentParser parser = new SAXDocumentParser(); - parser.setContentHandler(target); - parser.parse(source); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getSourceDataBinding() { - return "xml:fastinfoset:java.io.InputStream"; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2XMLStreamReader.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2XMLStreamReader.java deleted file mode 100644 index 73d549f4f8..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfoset2XMLStreamReader.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.fastinfoset; - -import java.io.InputStream; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -import com.sun.xml.fastinfoset.stax.StAXDocumentParser; - -/** - * @version $Rev$ $Date$ - */ -public class FastInfoset2XMLStreamReader extends BaseTransformer<InputStream, XMLStreamReader> implements - PullTransformer<InputStream, XMLStreamReader> { - - @Override - protected Class<InputStream> getSourceType() { - return InputStream.class; - } - - @Override - protected Class<XMLStreamReader> getTargetType() { - return XMLStreamReader.class; - } - - public XMLStreamReader transform(InputStream source, TransformationContext context) { - try { - StAXDocumentParser parser = new StAXDocumentParser(source); - return parser; - } catch (Exception e) { - throw new TransformationException(e); - } - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getSourceDataBinding() { - return "xml:fastinfoset:java.io.InputStream"; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/Node2FastInfoset.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/Node2FastInfoset.java deleted file mode 100644 index 1c12a5dcad..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/Node2FastInfoset.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.fastinfoset; - -import java.io.OutputStream; - -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Node; - -import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer; - -/** - * @version $Rev$ $Date$ - */ -public class Node2FastInfoset extends BaseTransformer<Node, OutputStream> implements - PushTransformer<Node, OutputStream> { - - @Override - protected Class<Node> getSourceType() { - return Node.class; - } - - @Override - protected Class<OutputStream> getTargetType() { - return OutputStream.class; - } - - - /** - * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext) - */ - public void transform(Node source, OutputStream target, TransformationContext context) { - try { - DOMDocumentSerializer serializer = new DOMDocumentSerializer(); - serializer.setOutputStream(target); - serializer.serialize(source); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getTargetDataBinding() { - return "xml:fastinfoset:java.io.OutputStream"; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLInputStream2FastInfoset.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLInputStream2FastInfoset.java deleted file mode 100644 index b0d56b3bb6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLInputStream2FastInfoset.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.fastinfoset; - -import java.io.InputStream; -import java.io.OutputStream; - -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -import com.sun.xml.fastinfoset.sax.SAXDocumentSerializer; - -/** - * @version $Rev$ $Date$ - */ -public class XMLInputStream2FastInfoset extends BaseTransformer<InputStream, OutputStream> implements - PushTransformer<InputStream, OutputStream> { - - @Override - protected Class<InputStream> getSourceType() { - return InputStream.class; - } - - @Override - protected Class<OutputStream> getTargetType() { - return OutputStream.class; - } - - /** - * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext) - */ - public void transform(InputStream source, OutputStream target, TransformationContext context) { - try { - - // Create Fast Infoset SAX serializer - SAXDocumentSerializer saxDocumentSerializer = new SAXDocumentSerializer(); - // Set the output stream - saxDocumentSerializer.setOutputStream(target); - - // Instantiate JAXP SAX parser factory - SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); - /* Set parser to be namespace aware - * Very important to do otherwise invalid FI documents will be - * created by the SAXDocumentSerializer - */ - saxParserFactory.setNamespaceAware(true); - // Instantiate the JAXP SAX parser - SAXParser saxParser = saxParserFactory.newSAXParser(); - // Set the lexical handler - saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", saxDocumentSerializer); - // Parse the XML document and convert to a fast infoset document - saxParser.parse(source, saxDocumentSerializer); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getTargetDataBinding() { - return "xml:fastinfoset:java.io.OutputStream"; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLStreamReader2FastInfoset.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLStreamReader2FastInfoset.java deleted file mode 100644 index d18206600c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/java/org/apache/tuscany/sca/databinding/fastinfoset/XMLStreamReader2FastInfoset.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.fastinfoset; - -import java.io.OutputStream; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.databinding.xml.XMLStreamSerializer; - -import com.sun.xml.fastinfoset.stax.StAXDocumentSerializer; - -/** - * @version $Rev$ $Date$ - */ -public class XMLStreamReader2FastInfoset extends BaseTransformer<XMLStreamReader, OutputStream> implements - PushTransformer<XMLStreamReader, OutputStream> { - - @Override - protected Class<XMLStreamReader> getSourceType() { - return XMLStreamReader.class; - } - - @Override - protected Class<OutputStream> getTargetType() { - return OutputStream.class; - } - - - /** - * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext) - */ - public void transform(XMLStreamReader source, OutputStream target, TransformationContext context) { - try { - StAXDocumentSerializer serializer = new StAXDocumentSerializer(target); - XMLStreamSerializer streamSerializer = new XMLStreamSerializer(); - streamSerializer.serialize(source, serializer); - serializer.flush(); - source.close(); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getTargetDataBinding() { - return "xml:fastinfoset:java.io.OutputStream"; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer deleted file mode 100644 index ea47ee7191..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer +++ /dev/null @@ -1,22 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation classes for the transformers -org.apache.tuscany.sca.databinding.fastinfoset.FastInfoset2Node;source=xml:fastinfoset:java.io.InputStream,target=org.w3c.dom.Node,weight=100 -org.apache.tuscany.sca.databinding.fastinfoset.FastInfoset2XMLStreamReader;source=xml:fastinfoset:java.io.InputStream,target=javax.xml.stream.XMLStreamReader,weight=80 - - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer deleted file mode 100644 index 1610b4f54d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer +++ /dev/null @@ -1,22 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation classes for the transformers -org.apache.tuscany.sca.databinding.fastinfoset.FastInfoset2SAX;source=xml:fastinfoset:java.io.InputStream,target=org.xml.sax.ContentHandler ,weight=80 -org.apache.tuscany.sca.databinding.fastinfoset.Node2FastInfoset;source=org.w3c.dom.Node,target=xml:fastinfoset:java.io.OutputStream,weight=100 -org.apache.tuscany.sca.databinding.fastinfoset.XMLInputStream2FastInfoset;source=java.io.InputStream,target=xml:fastinfoset:java.io.OutputStream,weight=120 -org.apache.tuscany.sca.databinding.fastinfoset.XMLStreamReader2FastInfoset;source=javax.xml.stream.XMLStreamReader,target=xml:fastinfoset:java.io.OutputStream,weight=70 diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/test/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfosetTransformerTestCase.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/test/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfosetTransformerTestCase.java deleted file mode 100644 index bb8adf39be..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/test/java/org/apache/tuscany/sca/databinding/fastinfoset/FastInfosetTransformerTestCase.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.fastinfoset; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.StringReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.databinding.xml.InputStream2Node; -import org.apache.tuscany.sca.databinding.xml.Node2OutputStream; -import org.apache.tuscany.sca.databinding.xml.Node2String; -import org.w3c.dom.Node; - -/** - * - * @version $Rev$ $Date$ - */ -public class FastInfosetTransformerTestCase extends TestCase { - private static final String IPO_XML = - "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder" - + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" - + " xmlns:ipo=\"http://www.example.com/IPO\"" - + " xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\"" - + " orderDate=\"1999-12-01\">" - + " <shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\">" - + " <name>Helen Zoe</name>" - + " <street>47 Eden Street</street>" - + " <city>Cambridge</city>" - + " <postcode>CB1 1JR</postcode>" - + " </shipTo>" - + " <billTo xsi:type=\"ipo:USAddress\">" - + " <name>Robert Smith</name>" - + " <street>8 Oak Avenue</street>" - + " <city>Old Town</city>" - + " <state>PA</state>" - + " <zip>95819</zip>" - + " </billTo>" - + " <items>" - + " <item partNum=\"833-AA\">" - + " <productName>Lapis necklace</productName>" - + " <quantity>1</quantity>" - + " <USPrice>99.95</USPrice>" - + " <ipo:comment>Want this for the holidays</ipo:comment>" - + " <shipDate>1999-12-05</shipDate>" - + " </item>" - + " </items>" - + "</ipo:purchaseOrder>"; - - public void testXML2FastInfoset() throws Exception { - XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(IPO_XML)); - XMLStreamReader2FastInfoset t1 = new XMLStreamReader2FastInfoset(); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - t1.transform(reader, bos, null); - // System.out.println(bos.toString()); - - ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); - FastInfoset2Node t2 = new FastInfoset2Node(); - Node node = t2.transform(bis, null); - String xml = new Node2String().transform(node, null); - - // System.out.println(xml); - - } - - public void testPerf() throws Exception { - byte[] str = IPO_XML.getBytes(); - ByteArrayInputStream bis = new ByteArrayInputStream(str); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - XMLInputStream2FastInfoset t = new XMLInputStream2FastInfoset(); - t.transform(bis, bos, null); - byte[] fast = bos.toByteArray(); - System.out.println(str.length + ".vs." + fast.length); - - long d1 = 0L; - long d2 = 0L; - for (int i = 0; i < 100; i++) { - InputStream2Node t1 = new InputStream2Node(); - FastInfoset2Node t2 = new FastInfoset2Node(); - InputStream is1 = new ByteArrayInputStream(str); - InputStream is2 = new ByteArrayInputStream(fast); - long s1 = System.currentTimeMillis(); - Node n1 = t1.transform(is1, null); - long s2 = System.currentTimeMillis(); - Node n2 = t2.transform(is2, null); - long s3 = System.currentTimeMillis(); - d1 += s2 - s1; // from plain xml - d2 += s3 - s2; // from fastinfoset - Node2OutputStream t3 = new Node2OutputStream(); - Node2FastInfoset t4 = new Node2FastInfoset(); - ByteArrayOutputStream os1 = new ByteArrayOutputStream(); - ByteArrayOutputStream os2 = new ByteArrayOutputStream(); - long s4 = System.currentTimeMillis(); - t3.transform(n1, os1, null); - long s5 = System.currentTimeMillis(); - t4.transform(n2, os2, null); - long s6 = System.currentTimeMillis(); - d1 += s5 - s4; // to plain xml - d2 += s6 - s5; // to fastinfoset - } - System.out.println("POX " + d1 + ".vs. FIS " + d2); - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/test/resources/ipo.xsd b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/test/resources/ipo.xsd deleted file mode 100644 index 5a493e1746..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-fastinfoset/src/test/resources/ipo.xsd +++ /dev/null @@ -1,136 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<schema targetNamespace="http://www.example.com/IPO" - xmlns="http://www.w3.org/2001/XMLSchema" - xmlns:ipo="http://www.example.com/IPO"> - - <annotation> - <documentation xml:lang="en"> - International Purchase order schema for Example.com - Copyright 2000 Example.com. All rights reserved. - </documentation> - </annotation> - - - <element name="purchaseOrder" type="ipo:PurchaseOrderType" /> - - <element name="comment" type="string" /> - - <complexType name="PurchaseOrderType"> - <sequence> - <element name="shipTo" type="ipo:Address" /> - <element name="billTo" type="ipo:Address" /> - <element ref="ipo:comment" minOccurs="0" /> - <element name="items" type="ipo:Items" /> - </sequence> - <attribute name="orderDate" type="date" /> - </complexType> - - <complexType name="Items"> - <sequence> - <element name="item" minOccurs="0" maxOccurs="unbounded"> - <complexType> - <sequence> - <element name="productName" type="string" /> - <element name="quantity"> - <simpleType> - <restriction base="positiveInteger"> - <maxExclusive value="100" /> - </restriction> - </simpleType> - </element> - <element name="USPrice" type="decimal" /> - <element ref="ipo:comment" minOccurs="0" /> - <element name="shipDate" type="date" - minOccurs="0" /> - </sequence> - <attribute name="partNum" type="ipo:SKU" - use="required" /> - </complexType> - </element> - </sequence> - </complexType> - - <simpleType name="SKU"> - <restriction base="string"> - <pattern value="\d{3}-[A-Z]{2}" /> - </restriction> - </simpleType> - - <complexType name="Address"> - <sequence> - <element name="name" type="string" /> - <element name="street" type="string" /> - <element name="city" type="string" /> - </sequence> - </complexType> - - <complexType name="USAddress"> - <complexContent> - <extension base="ipo:Address"> - <sequence> - <element name="state" type="ipo:USState" /> - <element name="zip" type="positiveInteger" /> - </sequence> - </extension> - </complexContent> - </complexType> - - <complexType name="UKAddress"> - <complexContent> - <extension base="ipo:Address"> - <sequence> - <element name="postcode" type="ipo:UKPostcode" /> - </sequence> - <attribute name="exportCode" type="positiveInteger" - fixed="1" /> - </extension> - </complexContent> - </complexType> - - <!-- other Address derivations for more countries --> - - <simpleType name="USState"> - <restriction base="string"> - <enumeration value="AK" /> - <enumeration value="AL" /> - <enumeration value="AR" /> - <enumeration value="CA" /> - <enumeration value="PA" /> - <!-- and so on ... --> - </restriction> - </simpleType> - - <simpleType name="Postcode"> - <restriction base="string"> - <length value="7" fixed="true" /> - </restriction> - </simpleType> - - - <simpleType name="UKPostcode"> - <restriction base="ipo:Postcode"> - <pattern value="[A-Z]{2}\d\s\d[A-Z]{2}" /> - </restriction> - </simpleType> - - - -</schema> - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/LICENSE b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ -
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/NOTICE b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/NOTICE deleted file mode 100644 index ad2ba40961..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/pom.xml deleted file mode 100644 index 7a45d9a6ca..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/pom.xml +++ /dev/null @@ -1,121 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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.6.1-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-databinding-xstream</artifactId> - <name>Apache Tuscany SCA Data Binding for XStream</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core-spi</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-databinding</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>javax.xml.stream</groupId> - <artifactId>stax-api</artifactId> - <version>1.0-2</version> - </dependency> - - <dependency> - <groupId>com.thoughtworks.xstream</groupId> - <artifactId>xstream</artifactId> - <version>1.3</version> - </dependency> - - <dependency> - <groupId>org.apache.ws.commons.axiom</groupId> - <artifactId>axiom-api</artifactId> - <exclusions> - <exclusion> - <groupId>xerces</groupId> - <artifactId>xercesImpl</artifactId> - </exclusion> - </exclusions> - <version>1.2.7</version> - </dependency> - - <dependency> - <groupId>xerces</groupId> - <artifactId>xercesImpl</artifactId> - <version>2.8.1</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.ws.commons.axiom</groupId> - <artifactId>axiom-impl</artifactId> - <version>1.2.7</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.1.1</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.codehaus.woodstox</groupId> - <artifactId>wstx-asl</artifactId> - <version>3.2.4</version> - <scope>runtime</scope> - <exclusions> - <exclusion> - <groupId>stax</groupId> - <artifactId>stax-api</artifactId> - </exclusion> - </exclusions> - </dependency> - - </dependencies> - - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.databinding.xstream</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Export-Package>org.apache.tuscany.sca.databinding.xstream*</Export-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/MetaObject.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/MetaObject.java deleted file mode 100644 index 4c57cfe06b..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/MetaObject.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.databinding.xstream; - -/** - * Wrapper for XObject - * @version $Rev$ $Date$ - */ -public interface MetaObject { - void setName(String name); - - String getName(); - - Class<?> getType(); - - String getID(); - - XObject getInstance(); - //byte[] getByteCode(); -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/MetaObjectImpl.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/MetaObjectImpl.java deleted file mode 100644 index d223a4db23..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/MetaObjectImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xstream; - -import java.io.FileNotFoundException; -import java.io.IOException; - -/** - * Implementation of a wrapper for XObject. - * - * @version $Rev$ $Date$ - */ -public class MetaObjectImpl implements MetaObject { - private String obID; - private String name; - private XObject obInstance; - - //private byte[] bytecode = null; - - public MetaObjectImpl() { - this.obID = Utils.uniqueID(); - } - - public MetaObjectImpl(XObject x) { - //this.name = path; - this.obID = Utils.uniqueID(); - this.obInstance = x; - - try { - initMetaOb(this.obInstance.getClass()); - - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - private void initMetaOb(Class<?> class1) throws FileNotFoundException, IOException { - /* - File file = new File(cname); - DataInputStream cstream = new DataInputStream(new FileInputStream(file)); - bytecode = new byte[(int)file.length()]; - cstream.readFully(bytecode); - */ - name = class1.getName(); - - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public String getID() { - return obID; - } - - public Class<?> getType() { - - return this.obInstance.getClass(); - } - - public XObject getInstance() { - return this.obInstance; - } - /* - * TODO Add bytecode with Serialization - public byte[] getByteCode() { - return bytecode; - } - */ - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/Node2XObject.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/Node2XObject.java deleted file mode 100644 index 2b7fa9d506..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/Node2XObject.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xstream; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.io.xml.DomReader; - -/** - * DOM Node --> XStream transformer - * - * @version $Rev$ $Date$ - */ -public class Node2XObject extends BaseTransformer<Node, XObject> implements PullTransformer<Node, XObject> { - - public XObject transform(Node source, TransformationContext context) { - try { - DomReader in = null; - if (source instanceof Document) { - in = new DomReader((Document)source); - } else if (source instanceof Element) { - in = new DomReader((Element)source); - } - XStream xs = new XStream(); - return (XObject)xs.unmarshal(in); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - @Override - public Class<Node> getSourceType() { - return Node.class; - } - - @Override - public Class<XObject> getTargetType() { - return XObject.class; - } - - @Override - public int getWeight() { - return 10; - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/OMElement2XObject.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/OMElement2XObject.java deleted file mode 100644 index a465e92e65..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/OMElement2XObject.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xstream; - -import java.io.StringWriter; - -import javax.xml.stream.XMLStreamException; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -import com.thoughtworks.xstream.XStream; - -/** - * Job DataObject --> AXIOM OMElement transformer - * - * @version $Rev$ $Date$ - */ -public class OMElement2XObject extends BaseTransformer<OMElement, XObject> implements - PullTransformer<OMElement, XObject> { - - public XObject transform(OMElement source, TransformationContext context) { - - XStream xs = new XStream(); - xs.alias("xobject", MetaObjectImpl.class); - MetaObjectImpl mo; - try { - java.io.StringWriter writer = new StringWriter(); - source.serialize(writer); - String w = writer.toString(); - // FIXME: a better way to get eliminate param0 - w = w.replaceAll("param0", "xobject"); - w = w.replaceAll("xmlns=\"\"", ""); - mo = (MetaObjectImpl)xs.fromXML(w.trim()); - return mo.getInstance(); - } catch (XMLStreamException e) { - - e.printStackTrace(); - } - return null; - } - - @Override - public Class<OMElement> getSourceType() { - return OMElement.class; - } - - @Override - public Class<XObject> getTargetType() { - return XObject.class; - } - - @Override - public int getWeight() { - return 10; - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/Utils.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/Utils.java deleted file mode 100644 index d819975910..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/Utils.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xstream; - -import java.io.IOException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; - -/** - * Utility methods. - * - * @version $Rev$ $Date$ - */ -public class Utils { - public static String toBase64(byte[] array) { - String code = null; - code = new sun.misc.BASE64Encoder().encode(array); - return code; - } - - public static byte[] fromBase64(String bytecode) { - byte[] dec = null; - try { - dec = new sun.misc.BASE64Decoder().decodeBuffer(bytecode); - } catch (IOException e) { - e.printStackTrace(); - } - return dec; - } - - public static String uniqueID() { - try { - //Initialize SecureRandom - //This is a lengthy operation, to be done only upon - //initialization of the application - SecureRandom prng = SecureRandom.getInstance("SHA1PRNG"); - - //generate a random number - String randomNum = Integer.toString(prng.nextInt()); - - //get its digest - MessageDigest sha = MessageDigest.getInstance("SHA-1"); - byte[] result = sha.digest(randomNum.getBytes()); - return hexEncode(result); - } catch (NoSuchAlgorithmException ex) { - ex.printStackTrace(); - } - return null; - } - - private static String hexEncode(byte[] aInput) { - StringBuffer result = new StringBuffer(); - char[] digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; - for (int idx = 0; idx < aInput.length; ++idx) { - byte b = aInput[idx]; - result.append(digits[(b & 0xf0) >> 4]); - result.append(digits[b & 0x0f]); - } - return result.toString(); - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObject.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObject.java deleted file mode 100644 index 21112efcf5..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObject.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.databinding.xstream; - -/** - * Marker interface for XStream Serializable objects - * - * @version $Rev$ $Date$ - */ -// FIXME: Why do we require a marker interface? -public interface XObject { -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObject2Node.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObject2Node.java deleted file mode 100644 index 98e0e69f9b..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObject2Node.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xstream; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.databinding.impl.DOMHelper; -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.io.xml.DomWriter; - -/** - * XObject --> DOM Node transformer - * - * @version $Rev$ $Date$ - */ -public class XObject2Node extends BaseTransformer<XObject, Node> implements PullTransformer<XObject, Node> { - - public Node transform(XObject source, TransformationContext context) { - try { - MetaObject mj = new MetaObjectImpl(source); - Document root = DOMHelper.newDocument(); - DomWriter out = new DomWriter(DOMHelper.newDocument()); - XStream xs = new XStream(); - xs.alias("xobject", mj.getClass()); - xs.marshal(source, out); - DOMHelper.adjustElementName(context, root.getDocumentElement()); - return root; - } catch (Exception e) { - throw new TransformationException(e); - } - } - - @Override - public Class<XObject> getSourceType() { - return XObject.class; - } - - @Override - public Class<Node> getTargetType() { - return Node.class; - } - - @Override - public int getWeight() { - return 10; - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObject2OMElement.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObject2OMElement.java deleted file mode 100644 index ff4305491a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObject2OMElement.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xstream; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; - -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.OMNamespace; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import com.thoughtworks.xstream.XStream; - -/** - * XObject --> AXIOM OMElement transformer - * - * @version $Rev$ $Date$ - */ -public class XObject2OMElement extends BaseTransformer<XObject, OMElement> implements - PullTransformer<XObject, OMElement> { - - public OMElement transform(XObject source, TransformationContext context) { - MetaObject mj = new MetaObjectImpl(source); - OMElement element = null; - ByteArrayOutputStream out = new ByteArrayOutputStream(); - XStream xs = new XStream(); - xs.alias("xobject", mj.getClass()); - xs.toXML(mj, out); - /* TODO: Maybe a base64 conversion...? or not? - * ie. new ByteArrayInputStream(Utils.toBase64(out.toByteArray()).getBytes()) - */ - try { - // what's better this one: - StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(out.toByteArray())); - // or this one: - // StaAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(Utils.toBase64(out.toByteArray()).getBytes())) - element = builder.getDocumentElement(); - adjustElementName(context, element); - } catch (Exception e) { - throw new TransformationException(e); - } - return element; - - } - - private static void adjustElementName(TransformationContext context, OMElement element) { - if (context != null) { - DataType dataType = context.getTargetDataType(); - Object logical = dataType == null ? null : dataType.getLogical(); - if (!(logical instanceof XMLType)) { - return; - } - XMLType xmlType = (XMLType)logical; - if (xmlType.isElement() && !xmlType.getElementName().equals(element.getQName())) { - // FIXME:: Throw exception or switch to the new Element? - OMFactory factory = OMAbstractFactory.getOMFactory(); - QName name = xmlType.getElementName(); - OMNamespace namespace = factory.createOMNamespace(name.getNamespaceURI(), name.getPrefix()); - element.setNamespace(namespace); - element.setLocalName(name.getLocalPart()); - } - } - } - - @Override - public Class<XObject> getSourceType() { - return XObject.class; - } - - @Override - public Class<OMElement> getTargetType() { - return OMElement.class; - } - - @Override - public int getWeight() { - return 10; - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObjectDataBinding.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObjectDataBinding.java deleted file mode 100644 index b319c7d557..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/java/org/apache/tuscany/sca/databinding/xstream/XObjectDataBinding.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.databinding.xstream; - -import org.apache.tuscany.sca.databinding.impl.BaseDataBinding; - -/** - * DataBinding for Jobs - * - * @version $Rev$ $Date$ - */ -public class XObjectDataBinding extends BaseDataBinding { - - public static final String NAME = XObject.class.getName(); - - public XObjectDataBinding() { - super(NAME, XObject.class); - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding deleted file mode 100644 index e2f467b8dd..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# implementation classes for the databindings
-org.apache.tuscany.sca.databinding.xstream.XObjectDataBinding;name=org.apache.tuscany.sca.databinding.xstream.XObject
-
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer deleted file mode 100644 index a733ad7b7d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-org.apache.tuscany.sca.databinding.xstream.XObject2OMElement;source=org.apache.tuscany.sca.databinding.xstream.XObject,target=org.apache.axiom.om.OMElement,weight=10
-org.apache.tuscany.sca.databinding.xstream.OMElement2XObject;source=org.apache.axiom.om.OMElement,target=org.apache.tuscany.sca.databinding.xstream.XObject,weight=10
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/test/resources/ipo.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/test/resources/ipo.xml deleted file mode 100644 index 1699538d62..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/test/resources/ipo.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<ipo:purchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ipo="http://www.example.com/IPO" - xsi:schemaLocation="http://www.example.com/IPO ipo.xsd" orderDate="1999-12-01"> - - <shipTo exportCode="1" xsi:type="ipo:UKAddress"> - <name>Helen Zoe</name> - <street>47 Eden Street</street> - <city>Cambridge</city> - <postcode>CB1 1JR</postcode> - </shipTo> - - <billTo xsi:type="ipo:USAddress"> - <name>Robert Smith</name> - <street>8 Oak Avenue</street> - <city>Old Town</city> - <state>PA</state> - <zip>95819</zip> - </billTo> - - <items> - <item partNum="833-AA"> - <productName>Lapis necklace</productName> - <quantity>1</quantity> - <USPrice>99.95</USPrice> - <ipo:comment>Want this for the holidays</ipo:comment> - <shipDate>1999-12-05</shipDate> - </item> - </items> -</ipo:purchaseOrder> - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/test/resources/ipo.xsd b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/test/resources/ipo.xsd deleted file mode 100644 index aac7ded180..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/test/resources/ipo.xsd +++ /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. ---> - -<schema targetNamespace="http://www.example.com/IPO" xmlns="http://www.w3.org/2001/XMLSchema" - xmlns:ipo="http://www.example.com/IPO"> - - <annotation> - <documentation xml:lang="en"> - International Purchase order schema for Example.com Copyright 2000 Example.com. All rights reserved. - </documentation> - </annotation> - - - <element name="purchaseOrder" type="ipo:PurchaseOrderType" /> - - <element name="comment" type="string" /> - - <complexType name="PurchaseOrderType"> - <sequence> - <element name="shipTo" type="ipo:Address" /> - <element name="billTo" type="ipo:Address" /> - <element ref="ipo:comment" minOccurs="0" /> - <element name="items" type="ipo:Items" /> - </sequence> - <attribute name="orderDate" type="date" /> - </complexType> - - <complexType name="Items"> - <sequence> - <element name="item" minOccurs="0" maxOccurs="unbounded"> - <complexType> - <sequence> - <element name="productName" type="string" /> - <element name="quantity"> - <simpleType> - <restriction base="positiveInteger"> - <maxExclusive value="100" /> - </restriction> - </simpleType> - </element> - <element name="USPrice" type="decimal" /> - <element ref="ipo:comment" minOccurs="0" /> - <element name="shipDate" type="date" minOccurs="0" /> - </sequence> - <attribute name="partNum" type="ipo:SKU" use="required" /> - </complexType> - </element> - </sequence> - </complexType> - - <simpleType name="SKU"> - <restriction base="string"> - <pattern value="\d{3}-[A-Z]{2}" /> - </restriction> - </simpleType> - - <complexType name="Address"> - <sequence> - <element name="name" type="string" /> - <element name="street" type="string" /> - <element name="city" type="string" /> - </sequence> - </complexType> - - <complexType name="USAddress"> - <complexContent> - <extension base="ipo:Address"> - <sequence> - <element name="state" type="ipo:USState" /> - <element name="zip" type="positiveInteger" /> - </sequence> - </extension> - </complexContent> - </complexType> - - <complexType name="UKAddress"> - <complexContent> - <extension base="ipo:Address"> - <sequence> - <element name="postcode" type="ipo:UKPostcode" /> - </sequence> - <attribute name="exportCode" type="positiveInteger" fixed="1" /> - </extension> - </complexContent> - </complexType> - - <!-- other Address derivations for more countries --> - - <simpleType name="USState"> - <restriction base="string"> - <enumeration value="AK" /> - <enumeration value="AL" /> - <enumeration value="AR" /> - <enumeration value="CA" /> - <enumeration value="PA" /> - <!-- and so on ... --> - </restriction> - </simpleType> - - <simpleType name="Postcode"> - <restriction base="string"> - <length value="7" fixed="true" /> - </restriction> - </simpleType> - - - <simpleType name="UKPostcode"> - <restriction base="ipo:Postcode"> - <pattern value="[A-Z]{2}\d\s\d[A-Z]{2}" /> - </restriction> - </simpleType> - - - -</schema> - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/test/resources/order.wsdl b/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/test/resources/order.wsdl deleted file mode 100644 index 65da5b602a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/databinding-xstream/src/test/resources/order.wsdl +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions name="StockQuote" targetNamespace="http://example.com/order.wsdl" xmlns:tns="http://example.com/order.wsdl"
- xmlns:xsd1="http://example.com/order.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema targetNamespace="http://example.com/order.xsd" xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ipo="http://www.example.com/IPO">
- <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd" />
- <element name="checkOrderStatus">
- <complexType>
- <sequence>
- <element name="customerId" type="string" />
- <element name="order" type="ipo:PurchaseOrderType" />
- <element name="flag" type="int" />
- </sequence>
- </complexType>
- </element>
- <element name="checkOrderStatusResponse">
- <complexType>
- <sequence>
- <element name="status" type="string" />
- </sequence>
- </complexType>
- </element>
- <element name="note" type="string" />
- </schema>
- </types>
-
- <message name="CheckOrderStatusInput1">
- <part name="body" element="xsd1:checkOrderStatus" />
- </message>
-
- <message name="CheckOrderStatusOutput1">
- <part name="body" element="xsd1:checkOrderStatusResponse" />
- </message>
-
- <message name="CheckOrderStatusInput2">
- <part name="p1" element="xsd1:checkOrderStatus" />
- <part name="p2" element="xsd1:note" />
- </message>
-
- <message name="CheckOrderStatusOutput2">
- <part name="p1" element="xsd1:checkOrderStatusResponse" />
- </message>
-
- <portType name="OrderPortType">
- <operation name="checkOrderStatus">
- <input message="tns:CheckOrderStatusInput1" />
- <output message="tns:CheckOrderStatusOutput1" />
- </operation>
- <operation name="checkOrderStatus2">
- <input message="tns:CheckOrderStatusInput2" />
- <output message="tns:CheckOrderStatusOutput2" />
- </operation>
- </portType>
-
-</definitions>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/LICENSE b/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ -
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/NOTICE b/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/NOTICE deleted file mode 100644 index 6d6a276d96..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/pom.xml deleted file mode 100644 index 8745b2a90e..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.6.1-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-extensibility-equinox</artifactId> - <name>Apache Tuscany SCA Extensibility for Eclipse Equinox</name> - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-extensibility</artifactId> - <version>1.6.1-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.eclipse</groupId> - <artifactId>osgi</artifactId> - <version>3.3.0-v20070530</version> - <scope>compile</scope> - </dependency> - - <!-- - Exclude org.eclipse.equinox:app to avoid maven bug/bad equinox version scheme. i.e.: - - Couldn't find a version in [1.0.0-v20070606] to match range [1.0.0,2.0.0) - org.eclipse.equinox:app:jar:null - --> - <dependency> - <groupId>org.eclipse.core</groupId> - <artifactId>runtime</artifactId> - <version>3.3.100-v20070530</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>org.eclipse.equinox</groupId> - <artifactId>app</artifactId> - </exclusion> - </exclusions> - </dependency> - - <!-- - Now include org.eclipse.equinox:app explicitly - --> - <dependency> - <groupId>org.eclipse.equinox</groupId> - <artifactId>app</artifactId> - <version>1.0.0-v20070606</version> - <scope>test</scope> - </dependency> - - </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <version>2.0</version> - <executions> - <execution> - <id>copy-dependencies</id> - <phase>process-test-resources</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <outputDirectory>${project.build.directory}/bundles</outputDirectory> - <excludeArtifactIds>osgi,junit,easymock,tuscany-extensibility</excludeArtifactIds> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.extensibility.equinox</Bundle-SymbolicName> - <Bundle-Description>${pom.name}</Bundle-Description> - <Bundle-Activator>org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator</Bundle-Activator> - <Export-Package>org.apache.tuscany.sca.extensibility.equinox*</Export-Package> - <Eclipse-LazyStart>true</Eclipse-LazyStart> - <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy> - <DynamicImport-Package>*</DynamicImport-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java deleted file mode 100644 index 5ab5a66077..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.extensibility.equinox; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.util.Arrays; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.apache.tuscany.sca.extensibility.ServiceDeclaration; -import org.apache.tuscany.sca.extensibility.ServiceDiscoverer; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; - -/** - * A ServiceDiscoverer that find META-INF/services/... in installed bundles - * - * @version $Rev$ $Date$ - */ -public class EquinoxServiceDiscoverer implements ServiceDiscoverer { - private static final Logger logger = Logger.getLogger(EquinoxServiceDiscoverer.class.getName()); - - private BundleContext context; - - public EquinoxServiceDiscoverer(BundleContext context) { - this.context = context; - } - - public static class ServiceDeclarationImpl implements ServiceDeclaration { - private Bundle bundle; - private URL url; - private String className; - private Class<?> javaClass; - private Map<String, String> attributes; - - public ServiceDeclarationImpl(Bundle bundle, URL url, String className, Map<String, String> attributes) { - super(); - this.bundle = bundle; - this.url = url; - this.className = className; - this.attributes = attributes; - } - - public Map<String, String> getAttributes() { - return attributes; - } - - public String getClassName() { - return className; - } - - public Class<?> loadClass() throws ClassNotFoundException { - if (className == null) { - return null; - } - if (javaClass == null) { - javaClass = loadClass(className); - } - return javaClass; - } - - public Class<?> loadClass(String className) throws ClassNotFoundException { - return bundle.loadClass(className); - } - - public URL getLocation() { - return url; - } - - public URL getResource(final String name) { - return AccessController.doPrivileged(new PrivilegedAction<URL>() { - public URL run() { - return bundle.getResource(name); - } - }); - } - - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("Bundle: ").append(EquinoxServiceDiscoverer.toString(bundle)); - sb.append(" Resource: ").append(url); - sb.append(" Attributes: ").append(attributes); - return sb.toString(); - } - - } - - public static void init() { - // Empty static method to trigger the activation of this bundle - } - - private static String toString(Bundle b) { - StringBuffer sb = new StringBuffer(); - sb.append(b.getBundleId()).append(" ").append(b.getSymbolicName()); - int s = b.getState(); - if ((s & Bundle.UNINSTALLED) != 0) { - sb.append(" UNINSTALLED"); - } - if ((s & Bundle.INSTALLED) != 0) { - sb.append(" INSTALLED"); - } - if ((s & Bundle.RESOLVED) != 0) { - sb.append(" RESOLVED"); - } - if ((s & Bundle.STARTING) != 0) { - sb.append(" STARTING"); - } - if ((s & Bundle.STOPPING) != 0) { - sb.append(" STOPPING"); - } - if ((s & Bundle.ACTIVE) != 0) { - sb.append(" ACTIVE"); - } - return sb.toString(); - - } - - /** - * Parse a service declaration in the form class;attr=value,attr=value and - * return a map of attributes - * - * @param declaration - * @return a map of attributes - */ - private static Map<String, String> parseServiceDeclaration(String declaration) { - Map<String, String> attributes = new HashMap<String, String>(); - int index = declaration.indexOf(';'); - if (index != -1) { - attributes.put("class", declaration.substring(0, index).trim()); - declaration = declaration.substring(index); - } else { - int j = declaration.indexOf('='); - if (j == -1) { - attributes.put("class", declaration.trim()); - return attributes; - } else { - declaration = ";" + declaration; - } - } - StringTokenizer tokens = new StringTokenizer(declaration); - for (; tokens.hasMoreTokens();) { - String key = tokens.nextToken("=").substring(1).trim(); - if (key == null) - break; - String value = tokens.nextToken(",").substring(1).trim(); - if (value == null) - break; - attributes.put(key, value); - } - return attributes; - } - - public Set<ServiceDeclaration> discover(String serviceName, boolean firstOnly) { - boolean debug = logger.isLoggable(Level.FINE); - Set<ServiceDeclaration> descriptors = new HashSet<ServiceDeclaration>(); - - serviceName = "META-INF/services/" + serviceName; - - for (Bundle bundle : context.getBundles()) { - if (bundle.getBundleId() == 0) { - // Skip system bundle as it has access to the application classloader - continue; - } - Enumeration<URL> urls = null; - try { - // Use getResources to find resources on the classpath of the bundle - // Please note if there is an DynamicImport-Package=*, and another bundle - // exports the resource package, there is a possiblity that it doesn't - // find the containing entry - urls = bundle.getResources(serviceName); - if (urls == null) { - URL entry = bundle.getEntry(serviceName); - if (entry != null) { - urls = Collections.enumeration(Arrays.asList(entry)); - } - } - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - if (urls == null) { - continue; - } - while (urls.hasMoreElements()) { - final URL url = urls.nextElement(); - - if (debug) { - logger.fine("Reading service provider file: " + url.toExternalForm()); - } - try { - // Allow privileged access to open URL stream. Add FilePermission to added to security - // policy file. - InputStream is; - try { - is = AccessController.doPrivileged(new PrivilegedExceptionAction<InputStream>() { - public InputStream run() throws IOException { - return url.openStream(); - } - }); - } catch (PrivilegedActionException e) { - throw (IOException)e.getException(); - } - BufferedReader reader = null; - try { - reader = new BufferedReader(new InputStreamReader(is)); - int count = 0; - while (true) { - String line = reader.readLine(); - if (line == null) - break; - line = line.trim(); - if (!line.startsWith("#") && !"".equals(line)) { - String reg = line.trim(); - if (debug) { - logger.fine("Registering service provider: " + reg); - } - - Map<String, String> attributes = parseServiceDeclaration(reg); - String className = attributes.get("class"); - if (className == null) { - // Add a unique class name to prevent equals() from returning true - className = "_class_" + count; - count++; - } - ServiceDeclarationImpl descriptor = - new ServiceDeclarationImpl(bundle, url, className, attributes); - descriptors.add(descriptor); - if (firstOnly) { - return descriptors; - } - } - } - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - // Ignore - } - } - } - } catch (IOException e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - } - } - return descriptors; - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java deleted file mode 100644 index fa137daa16..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.extensibility.equinox; - -import java.util.logging.Logger; - -import org.apache.tuscany.sca.extensibility.ServiceDiscovery; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * The Bundle Activator that creates the Equinox-based service discoverer - * - * @version $Rev$ $Date$ - */ -public class EquinoxServiceDiscoveryActivator implements BundleActivator { - private static Logger logger = Logger.getLogger(EquinoxServiceDiscoveryActivator.class.getName()); - - public void start(BundleContext context) throws Exception { - logger.info("Installing service discovery"); - EquinoxServiceDiscoverer discoverer = new EquinoxServiceDiscoverer(context); - ServiceDiscovery.getInstance().setServiceDiscoverer(discoverer); - logger.info("Installed service discovery"); - } - - public void stop(BundleContext context) throws Exception { - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java deleted file mode 100644 index 7602b02488..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.extensibility.equinox; - -import java.util.Dictionary; -import java.util.Enumeration; - -import junit.framework.Assert; - -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; - -/** - * Test start/stop the Equinox runtime. - * - * @version $Rev: $ $Date: $ - */ -public class EquinoxHostTestCase { - @Test - public void testStartThenStop() { - TestEquinoxHost host = new TestEquinoxHost(); - BundleContext context = host.start(); - Assert.assertNotNull(context); - for (Bundle b : context.getBundles()) { - System.out.println(toString(b, false)); - } - host.stop(); - } - - @Test - public void testStartTwice() { - TestEquinoxHost host = new TestEquinoxHost(); - host.start(); - try { - host.start(); - Assert.fail(); - } catch (IllegalStateException e) { - Assert.assertTrue(IllegalStateException.class.isInstance(e.getCause())); - } finally { - host.stop(); - } - } - - public static String toString(Bundle b, boolean verbose) { - StringBuffer sb = new StringBuffer(); - sb.append(b.getBundleId()).append(" ").append(b.getSymbolicName()); - int s = b.getState(); - if ((s & Bundle.UNINSTALLED) != 0) { - sb.append(" UNINSTALLED"); - } - if ((s & Bundle.INSTALLED) != 0) { - sb.append(" INSTALLED"); - } - if ((s & Bundle.RESOLVED) != 0) { - sb.append(" RESOLVED"); - } - if ((s & Bundle.STARTING) != 0) { - sb.append(" STARTING"); - } - if ((s & Bundle.STOPPING) != 0) { - sb.append(" STOPPING"); - } - if ((s & Bundle.ACTIVE) != 0) { - sb.append(" ACTIVE"); - } - - sb.append(" ").append(b.getLocation()); - if (verbose) { - Dictionary<Object, Object> dict = b.getHeaders(); - Enumeration<Object> keys = dict.keys(); - while (keys.hasMoreElements()) { - Object key = keys.nextElement(); - sb.append(" ").append(key).append("=").append(dict.get(key)); - } - } - return sb.toString(); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java deleted file mode 100644 index 3126365748..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.extensibility.equinox; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.jar.JarInputStream; -import java.util.jar.Manifest; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.extensibility.ServiceDeclaration; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; - -/** - * Test the Equinox service discoverer. - * - * @version $Rev$ $Date$ - */ -public class EquinoxServiceDiscovererTestCase { - private static EquinoxServiceDiscoverer discoverer; - private static Bundle testBundle; - private static TestEquinoxHost host; - - private static String getState(Bundle b) { - StringBuffer sb = new StringBuffer(); - int s = b.getState(); - if ((s & Bundle.UNINSTALLED) != 0) { - sb.append("UNINSTALLED "); - } - if ((s & Bundle.INSTALLED) != 0) { - sb.append("INSTALLED "); - } - if ((s & Bundle.RESOLVED) != 0) { - sb.append("RESOLVED "); - } - if ((s & Bundle.STARTING) != 0) { - sb.append("STARTING "); - } - if ((s & Bundle.STOPPING) != 0) { - sb.append("STOPPING "); - } - if ((s & Bundle.ACTIVE) != 0) { - sb.append("ACTIVE "); - } - return sb.toString(); - - } - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - host = new TestEquinoxHost(); - BundleContext context = host.start(); - - InputStream is = EquinoxServiceDiscovererTestCase.class.getResourceAsStream("/test-bundle.jar"); - testBundle = context.installBundle("test-bundle", is); - is.close(); - discoverer = new EquinoxServiceDiscoverer(context); - File dep = new File("target/bundles"); - List<Bundle> bundles = new ArrayList<Bundle>(); - for (File f : dep.listFiles()) { - BufferedInputStream bis = new BufferedInputStream(new FileInputStream(f)); - JarInputStream jis = new JarInputStream(bis); - Manifest manifest = jis.getManifest(); - if (manifest == null || manifest.getMainAttributes().getValue("Bundle-Name") == null) { - bis.close(); - continue; - } - bis.close(); - bis = new BufferedInputStream(new FileInputStream(f)); - Bundle b = context.installBundle(f.getName(), bis); - System.out.println("Installed "+b.getSymbolicName() + " [" + getState(b) + "]"); - bundles.add(b); - bis.close(); - } - for (Bundle b : bundles) { - b.start(); - System.out.println("Started "+b.getSymbolicName() + " [" + getState(b) + "]"); - // Get the Platform.getExtensionRegistry() - if ("org.eclipse.core.runtime".equals(b.getSymbolicName())) { - // The Platform class loaded by the bundle is different that the one - // on the classpath - Class<?> cls = b.loadClass("org.eclipse.core.runtime.Platform"); - Method m = cls.getMethod("getExtensionRegistry"); - Object reg = m.invoke(cls); - System.out.println(reg); - } - } - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (testBundle != null) { - // Uninstall the bundle to clean up the cache - testBundle.uninstall(); - } - host.stop(); - } - - @Test - public void testDiscovery() { - Set<ServiceDeclaration> descriptors = - discoverer.discover("test.TestService", false); - Assert.assertEquals(1, descriptors.size()); - descriptors = discoverer.discover("notthere", false); - Assert.assertEquals(0, descriptors.size()); - } - - @Test - public void testDiscoveryFirst() { - Set<ServiceDeclaration> descriptors = - discoverer.discover("test.TestService", true); - Assert.assertEquals(1, descriptors.size()); - descriptors = discoverer.discover("notthere", true); - Assert.assertEquals(0, descriptors.size()); - } - - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java deleted file mode 100644 index e000faa447..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.extensibility.equinox; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.adaptor.EclipseStarter; -import org.eclipse.core.runtime.adaptor.LocationManager; -import org.osgi.framework.BundleContext; - -/** - * A test host that starts/stops Equinox. - * - * @version $Rev: $ $Date: $ - */ -public class TestEquinoxHost { - - private final static String systemPackages = - "org.osgi.framework; version=1.3.0," + "org.osgi.service.packageadmin; version=1.2.0, " - + "org.osgi.service.startlevel; version=1.0.0, " - + "org.osgi.service.url; version=1.0.0, " - + "org.osgi.util.tracker; version=1.3.2, " - + "javax.xml, " - + "javax.xml.datatype, " - + "javax.xml.namespace, " - + "javax.xml.parsers, " - + "javax.xml.transform, " - + "javax.xml.transform.dom, " - + "javax.xml.transform.sax, " - + "javax.xml.transform.stream, " - + "javax.xml.validation, " - + "javax.xml.xpath, " - // Force the classes to be imported from the system bundle - + "javax.xml.stream, " - + "javax.xml.stream.util, " - + "javax.sql," - + "org.w3c.dom, " - + "org.xml.sax, " - + "org.xml.sax.ext, " - + "org.xml.sax.helpers, " - + "javax.security.auth, " - + "javax.security.cert, " - + "javax.security.auth.login, " - + "javax.security.auth.callback, " - + "javax.naming, " - + "javax.naming.spi, " - + "javax.naming.directory, " - + "javax.management, " - + "javax.imageio, " - + "sun.misc, " - + "javax.net, " - + "javax.net.ssl, " - + "javax.crypto, " - + "javax.rmi, " - + "javax.transaction, " - + "javax.transaction.xa"; - - public BundleContext start() { - try { - Map<Object, Object> props = new HashMap<Object, Object>(); - props.put("org.osgi.framework.system.packages", systemPackages); - props.put(EclipseStarter.PROP_CLEAN, "true"); - props.put(LocationManager.PROP_INSTANCE_AREA, new File("target/workspace").toURI().toString()); - props.put(LocationManager.PROP_INSTALL_AREA, new File("target/eclipse").toURI().toString()); - EclipseStarter.setInitialProperties(props); - BundleContext context = EclipseStarter.startup(new String[]{}, null); - return context; - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - - public void stop() { - try { - EclipseStarter.shutdown(); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/resources/test-bundle.jar b/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/resources/test-bundle.jar Binary files differdeleted file mode 100644 index afee051f61..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/extensibility-equinox/src/test/resources/test-bundle.jar +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/LICENSE b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/NOTICE b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/NOTICE deleted file mode 100644 index ad2ba40961..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/pom.xml deleted file mode 100644 index 3521689681..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-host-ejb</artifactId>
- <name>Apache Tuscany SCA EJB Host Extension Point</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Bundle-Version>${tuscany.version}</Bundle-Version>
- <Bundle-SymbolicName>org.apache.tuscany.sca.host.ejb</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.host.ejb*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/DefaultEJBHostExtensionPoint.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/DefaultEJBHostExtensionPoint.java deleted file mode 100644 index c0107cb316..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/DefaultEJBHostExtensionPoint.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.host.ejb; - -import java.util.ArrayList; -import java.util.List; - -/** - * Default implementation of an EJB host extension point. - * - * @version $Rev$ $Date$ - */ -public class DefaultEJBHostExtensionPoint implements EJBHostExtensionPoint { - - private List<EJBHost> ejbHosts = new ArrayList<EJBHost>(); - - public void addEJBHost(EJBHost ejbHost) { - ejbHosts.add(ejbHost); - } - - public void removeEJBHost(EJBHost ejbHost) { - ejbHosts.remove(ejbHost); - } - - public List<EJBHost> getEJBHosts() { - return ejbHosts; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHost.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHost.java deleted file mode 100644 index 842dd7a4f5..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHost.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.host.ejb; - - - -/** - * Interface implemented by host environments that allow EJBs - * to be registered. - * <p/> - * This interface allows a system service to register an EJB session - * bean to handle inbound requests. - * - * @version $Rev$ $Date$ - */ -public interface EJBHost { - - /** - * Add an EJB session bean. - * - * @param ejbName the EJB name - * @param sessionBean the EJB session bean descriptor - * @throws EJBRegistrationException - */ - void addSessionBean(String ejbName, EJBSessionBean sessionBean) throws EJBRegistrationException; - - /** - * Remove an EJB session bean. - * - * @param ejbName the EJB name - * @return the EJB session bean descriptor that was registered under that name - * @throws EJBRegistrationException - */ - EJBSessionBean removeSessionBean(String ejbName) throws EJBRegistrationException; - - /** - * Returns the EJB session bean descriptor registered under - * the given EJB name. - * - * @param ejbName the EJB name - * @return the EJB session bean descriptor - * @throws EJBRegistrationException - */ - EJBSessionBean getSessionBean(String ejbName) throws EJBRegistrationException; - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHostExtensionPoint.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHostExtensionPoint.java deleted file mode 100644 index 75912dcc45..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBHostExtensionPoint.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.host.ejb; - -import java.util.List; - -/** - * An extension point for EJB hosts. - * - * @version $Rev$ $Date$ - */ -public interface EJBHostExtensionPoint { - - /** - * Adds an EJB host extension. - * - * @param ejbHost - */ - void addEJBHost(EJBHost ejbHost); - - /** - * Removes an EJB host extension. - * - * @param ejbHost - */ - void removeEJBHost(EJBHost ejbHost); - - /** - * Returns a list of EJB host extensions. - * - * @return - */ - List<EJBHost> getEJBHosts(); - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBRegistrationException.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBRegistrationException.java deleted file mode 100644 index a50e701766..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBRegistrationException.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.host.ejb; - -/** - * Indicates an exception while registering an EJB. - * - * @version $Rev$ $Date$ - */ -public class EJBRegistrationException extends RuntimeException { - private static final long serialVersionUID = 1L; - - public EJBRegistrationException() { - super(); - } - - public EJBRegistrationException(String message) { - super(message); - } - - public EJBRegistrationException(String message, Throwable cause) { - super(message, cause); - } - - public EJBRegistrationException(Throwable cause) { - super(cause); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBSessionBean.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBSessionBean.java deleted file mode 100644 index f9967bdd8a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/EJBSessionBean.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.host.ejb; - -/** - * Represents an EJB session bean. - * - * @version $Rev: $ $Date: $ - */ -public class EJBSessionBean { - - private Class<?> implementationClass; - private Class<?> remoteInterface; - - public EJBSessionBean(Class<?> implementationClass, Class<?> remoteInterface) { - this.implementationClass = implementationClass; - this.remoteInterface = remoteInterface; - } - - public Class<?> getImplementationClass() { - return implementationClass; - } - - public Class<?> getRemoteInterface() { - return remoteInterface; - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/ExtensibleEJBHost.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/ExtensibleEJBHost.java deleted file mode 100644 index fab408c7c0..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/java/org/apache/tuscany/sca/host/ejb/ExtensibleEJBHost.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.host.ejb; - - -/** - * Default implementation of an extensible EJB host. - * - * @version $Rev$ $Date$ - */ -public class ExtensibleEJBHost implements EJBHost { - - private EJBHostExtensionPoint ejbHosts; - - public ExtensibleEJBHost(EJBHostExtensionPoint ejbHosts) { - this.ejbHosts = ejbHosts; - } - - public void addSessionBean(String ejbName, EJBSessionBean ejbClass) throws EJBRegistrationException { - if (ejbHosts.getEJBHosts().isEmpty()) { - throw new EJBRegistrationException("No EJB host available"); - } - - // TODO implement selection of the correct EJB host based on the mapping - // For now just select the first one - getDefaultEJBHost().addSessionBean(ejbName, ejbClass); - } - - public EJBSessionBean removeSessionBean(String ejbName) throws EJBRegistrationException { - if (ejbHosts.getEJBHosts().isEmpty()) { - throw new EJBRegistrationException("No EJB host available"); - } - - // TODO implement selection of the correct EJB host based on the mapping - // For now just select the first one - return getDefaultEJBHost().removeSessionBean(ejbName); - } - - public EJBSessionBean getSessionBean(String ejbName) throws EJBRegistrationException { - if (ejbHosts.getEJBHosts().isEmpty()) { - throw new EJBRegistrationException("No EJB host available"); - } - - // TODO implement selection of the correct EJB host based on the mapping - // For now just select the first one - return getDefaultEJBHost().getSessionBean(ejbName); - } - - private EJBHost getDefaultEJBHost() { - return ejbHosts.getEJBHosts().get(0); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.ejb.EJBHostExtensionPoint b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.ejb.EJBHostExtensionPoint deleted file mode 100644 index c42791f598..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.ejb.EJBHostExtensionPoint +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.host.ejb.DefaultEJBHostExtensionPoint
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/LICENSE b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/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/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/NOTICE b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/NOTICE deleted file mode 100644 index ad2ba40961..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/pom.xml deleted file mode 100644 index ceeee505e6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/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.6.1-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-host-openejb</artifactId>
- <name>Apache Tuscany SCA OpenEJB Host Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-ejb</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-openejb</artifactId>
- <version>2.1.4</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/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBRuntimeModuleActivator.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBRuntimeModuleActivator.java deleted file mode 100644 index 70bba08789..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/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/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBServer.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/src/main/java/org/apache/tuscany/sca/host/openejb/OpenEJBServer.java deleted file mode 100644 index 82e619ddbe..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/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/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index 9247f40913..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/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/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/src/test/java/org/apache/tuscany/sca/host/openejb/OpenEJBServerTestCase.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/host-openejb/src/test/java/org/apache/tuscany/sca/host/openejb/OpenEJBServerTestCase.java deleted file mode 100644 index 7d2301a770..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6.1/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/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-jee/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-jee/pom.xml index 87a6be3a45..ba75f3ff97 100644 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-jee/pom.xml +++ b/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-jee/pom.xml @@ -51,14 +51,14 @@ <artifactId>tuscany-contribution-jee</artifactId> <version>1.6.1-SNAPSHOT</version> </dependency> - +<!-- <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-contribution-jee-impl</artifactId> <version>1.6.1-SNAPSHOT</version> <scope>test</scope> </dependency> - +--> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-host-embedded</artifactId> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/modules/pom.xml index 23c5c938c8..f8e4fb94a0 100644 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/pom.xml +++ b/sca-java-1.x/branches/sca-java-1.6.1/modules/pom.xml @@ -50,7 +50,6 @@ <module>binding-ejb-runtime</module> <module>binding-erlang</module> <module>binding-erlang-runtime</module> - <!-- new bindings --> <module>binding-atom</module> <module>binding-atom-js</module> <module>binding-atom-js-dojo</module> @@ -76,7 +75,6 @@ <module>binding-sca</module> <module>binding-sca-axis2</module> <module>binding-sca-corba</module> - <module>binding-sca-jms</module> <module>binding-sca-xml</module> <module>binding-ws</module> <module>binding-ws-axis2</module> @@ -92,7 +90,6 @@ <module>contribution-resource</module> <module>contribution-xml</module> <module>contribution-jee</module> - <module>contribution-jee-impl</module> <module>core</module> <module>core-databinding</module> <module>core-spi</module> @@ -106,8 +103,6 @@ <module>databinding-json</module> <module>databinding-saxon</module> <module>databinding-xmlbeans</module> - <module>databinding-fastinfoset</module> - <module>databinding-xstream</module> <module>definitions</module> <module>definitions-xml</module> <module>domain-manager</module> @@ -115,19 +110,16 @@ <module>endpoint</module> <module>extensibility</module> <module>extensibility-osgi</module> - <module>extensibility-equinox</module> <module>extension-helper</module> <module>host-corba</module> <module>host-corba-jee</module> <module>host-corba-jse</module> <module>host-corba-jse-tns</module> - <module>host-ejb</module> <module>host-embedded</module> <module>host-http</module> <module>host-jetty</module> <module>host-jms</module> <module>host-jms-asf</module> - <module>host-openejb</module> <module>host-rmi</module> <module>host-tomcat</module> <module>host-webapp</module> @@ -152,7 +144,7 @@ <module>implementation-resource-runtime</module> <module>implementation-script</module> <module>implementation-spring</module> - <module>implementation-spring-runtime</module> + <module>implementation-spring-runtime</module> <module>implementation-web</module> <module>implementation-web-runtime</module> <module>implementation-widget</module> |