diff options
Diffstat (limited to 'tags/java/sca/1.0-RC1b/modules/contribution-java')
21 files changed, 0 insertions, 1432 deletions
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/.checkstyle b/tags/java/sca/1.0-RC1b/modules/contribution-java/.checkstyle deleted file mode 100644 index ace5fe6f53..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/.checkstyle +++ /dev/null @@ -1,25 +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.
--->
-
-<fileset-config file-format-version="1.2.0" simple-config="true">
- <fileset name="all" enabled="true" check-config-name="Sun Checks" local="false">
- <file-match-pattern match-pattern="." include-pattern="true"/>
- </fileset>
-</fileset-config>
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/.pmd b/tags/java/sca/1.0-RC1b/modules/contribution-java/.pmd deleted file mode 100644 index 84af2f4d5d..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/.pmd +++ /dev/null @@ -1,20 +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.
--->
-<pmd><useProjectRuleSet>true</useProjectRuleSet><rules/></pmd>
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/.ruleset b/tags/java/sca/1.0-RC1b/modules/contribution-java/.ruleset deleted file mode 100644 index ac8671859d..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/.ruleset +++ /dev/null @@ -1,190 +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.
--->
-<ruleset name="pmd-eclipse">
- <description>PMD Plugin preferences rule set</description>
-
-
- <rule ref="rulesets/basic.xml/BooleanInstantiation"/>
- <rule ref="rulesets/basic.xml/CollapsibleIfStatements"/>
- <rule ref="rulesets/basic.xml/DoubleCheckedLocking"/>
-<!--<rule ref="rulesets/basic.xml/EmptyCatchBlock"/>-->
-<!--<rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>-->
-<!--<rule ref="rulesets/basic.xml/EmptyIfStmt"/>-->
- <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/>
-<!--<rule ref="rulesets/basic.xml/EmptyStaticInitializer"/>-->
-<!--<rule ref="rulesets/basic.xml/EmptySwitchStatements"/>-->
-<!--<rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>-->
-<!--<rule ref="rulesets/basic.xml/EmptyTryBlock"/>-->
-<!--<rule ref="rulesets/basic.xml/EmptyWhileStmt"/>-->
- <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"/>
- <rule ref="rulesets/basic.xml/JumbledIncrementer"/>
-<!--<rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"/>-->
- <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/>
- <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/>
- <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/>
- <rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"/>
- <rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
-<!--<rule ref="rulesets/basic.xml/UselessOverridingMethod"/>-->
-
-<!--<rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"/>-->
-<!--<rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"/>-->
-<!--<rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"/>-->
-<!--<rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"/>-->
-
-<!--<rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"/>-->
-<!--<rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"/>-->
-<!--<rule ref="rulesets/clone.xml/ProperCloneImplementation"/>-->
-
-<!--<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/>-->
-<!--<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>-->
-<!--<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>-->
-<!--<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>-->
-<!--<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>-->
-<!--<rule ref="rulesets/codesize.xml/TooManyFields"/>-->
-
-<rule ref="rulesets/controversial.xml/AssignmentInOperand"/>
-<!--<rule ref="rulesets/controversial.xml/AtLeastOneConstructor"/>-->
-<!--<rule ref="rulesets/controversial.xml/CallSuperInConstructor"/>-->
-<!--<rule ref="rulesets/controversial.xml/DontImportSun"/>-->
-<!--<rule ref="rulesets/controversial.xml/NullAssignment"/>-->
-<!--<rule ref="rulesets/controversial.xml/OnlyOneReturn"/>-->
-<!--<rule ref="rulesets/controversial.xml/SingularField"/>-->
-<!--<rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"/>-->
-<!--<rule ref="rulesets/controversial.xml/UnnecessaryConstructor"/>-->
-<rule ref="rulesets/controversial.xml/UnnecessaryParentheses"/>
-<!--<rule ref="rulesets/controversial.xml/UnusedModifier"/>-->
-
-<!--<rule ref="rulesets/coupling.xml/CouplingBetweenObjects"/>-->
-<!--<rule ref="rulesets/coupling.xml/ExcessiveImports"/>-->
-<!--<rule ref="rulesets/coupling.xml/LooseCoupling"/>-->
-
-<!--<rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"/>-->
-<!--<rule ref="rulesets/design.xml/AccessorClassGeneration"/>-->
-<!--<rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"/>-->
-<!--<rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/>-->
-<!--<rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"/>-->
-<rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"/>
-<!--<rule ref="rulesets/design.xml/AvoidReassigningParameters"/>-->
-<!--<rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"/>-->
-<!--<rule ref="rulesets/design.xml/BadComparison"/>-->
-<!--<rule ref="rulesets/design.xml/CloseConnection"/>-->
-<!--<rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>-->
-<!--<rule ref="rulesets/design.xml/ConfusingTernary"/>-->
-<rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/>
-<!--<rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>-->
-<!--<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>-->
-<rule ref="rulesets/design.xml/IdempotentOperations"/>
-<!--<rule ref="rulesets/design.xml/ImmutableField"/>-->
-<!--<rule ref="rulesets/design.xml/InstantiationToGetClass"/>-->
-<!--<rule ref="rulesets/design.xml/MissingBreakInSwitch"/>-->
-<!--<rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"/>-->
-<!--<rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>-->
-<!--<rule ref="rulesets/design.xml/NonStaticInitializer"/>-->
-<rule ref="rulesets/design.xml/OptimizableToArrayCall"/>
-<rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"/>
-<rule ref="rulesets/design.xml/SimplifyBooleanExpressions"/>
-<rule ref="rulesets/design.xml/SimplifyBooleanReturns"/>
-<rule ref="rulesets/design.xml/SimplifyConditional"/>
-<!--<rule ref="rulesets/design.xml/SwitchDensity"/>-->
-<!--<rule ref="rulesets/design.xml/SwitchStmtsShouldHaveDefault"/>-->
-<rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"/>
-<!--<rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"/>-->
-<!--<rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"/>-->
-<!--<rule ref="rulesets/design.xml/UseSingleton"/>-->
-
-<!--<rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>-->
-<!--<rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>-->
-<!--<rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>-->
-<!--<rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>-->
-<!--<rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"/>-->
-<!--<rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"/>-->
-
-<!--<rule ref="rulesets/imports.xml/DuplicateImports"/>-->
-<!--<rule ref="rulesets/imports.xml/DontImportJavaLang"/>-->
-<!--<rule ref="rulesets/imports.xml/UnusedImports"/>-->
-<!--<rule ref="rulesets/imports.xml/ImportFromSamePackage"/>-->
-
-<!--<rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"/>-->
-<!--<rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"/>-->
-
-<!--<rule ref="rulesets/junit.xml/JUnitStaticSuite"/>-->
-<!--<rule ref="rulesets/junit.xml/JUnitSpelling"/>-->
-<!--<rule ref="rulesets/junit.xml/JUnitAssertionsShouldIncludeMessage"/>-->
-<!--<rule ref="rulesets/junit.xml/JUnitTestsShouldIncludeAssert"/>-->
-<!--<rule ref="rulesets/junit.xml/TestClassWithoutTestCases"/>-->
-<!--<rule ref="rulesets/junit.xml/UnnecessaryBooleanAssertion"/>-->
-<!--<rule ref="rulesets/junit.xml/UseAssertEqualsInsteadOfAssertTrue"/>-->
-<!--<rule ref="rulesets/junit.xml/UseAssertSameInsteadOfAssertTrue"/>-->
-
- <!--<rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"/>-->
- <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
- <!--<rule ref="rulesets/logging-java.xml/MoreThanOneLogger"/>-->
- <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
- <!--<rule ref="rulesets/logging-java.xml/LogBlockWithoutIf"/>-->
- <!--<rule ref="rulesets/logging-java.xml/SystemPrintln"/>-->
- <!--<rule ref="rulesets/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>-->
- <!--<rule ref="rulesets/logging-jakarta-commons.xml/ProperLogger"/>-->
-
- <!--<rule ref="rulesets/naming.xml/ShortVariable"/>-->
- <!--<rule ref="rulesets/naming.xml/LongVariable"/>-->
- <!--<rule ref="rulesets/naming.xml/ShortMethodName"/>-->
- <!--<rule ref="rulesets/naming.xml/VariableNamingConventions"/>-->
- <!--<rule ref="rulesets/naming.xml/MethodNamingConventions"/>-->
- <!--<rule ref="rulesets/naming.xml/ClassNamingConventions"/>-->
- <!--<rule ref="rulesets/naming.xml/AbstractNaming"/>-->
- <!--<rule ref="rulesets/naming.xml/AvoidDollarSigns"/>-->
- <!--<rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"/>-->
- <!--<rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>-->
- <!--<rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"/>-->
- <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"/>-->
- <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"/>-->
- <!--<rule ref="rulesets/naming.xml/AvoidNonConstructorMethodsWithClassName"/>-->
- <!--<rule ref="rulesets/naming.xml/NoPackage"/>-->
- <!--<rule ref="rulesets/naming.xml/PackageCase"/>-->
-
- <!--<rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"/>-->
- <!--<rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"/>-->
- <!--<rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"/>-->
- <!--<rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"/>-->
- <!--<rule ref="rulesets/optimizations.xml/SimplifyStartsWith"/>-->
- <!--<rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"/>-->
-
- <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"/>-->
- <!--<rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"/>-->
- <!--<rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"/>-->
- <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"/>-->
- <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"/>-->
- <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"/>-->
-
- <!--<rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/>-->
- <!--<rule ref="rulesets/strings.xml/StringInstantiation"/>-->
- <!--<rule ref="rulesets/strings.xml/StringToString"/>-->
- <!--<rule ref="rulesets/strings.xml/AvoidConcatenatingNonLiteralsInStringBuffer"/>-->
- <!--<rule ref="rulesets/strings.xml/UnnecessaryCaseChange"/>-->
-
- <!--<rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"/>-->
- <!--<rule ref="rulesets/sunsecure.xml/ArrayIsStoredDirectly"/>-->
-
- <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
- <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
- <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
- <!--<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>-->
-
-</ruleset>
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/pom.xml b/tags/java/sca/1.0-RC1b/modules/contribution-java/pom.xml deleted file mode 100644 index 21b02e1895..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/pom.xml +++ /dev/null @@ -1,51 +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.0-incubating</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-contribution-java</artifactId> - <name>Apache Tuscany SCA Java Import/Export Model</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution</artifactId> - <version>1.0-incubating</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-core-spi</artifactId> - <version>1.0-incubating</version> - </dependency> - - <dependency> - <groupId>org.codehaus.woodstox</groupId> - <artifactId>wstx-asl</artifactId> - <version>3.2.1</version> - <scope>runtime</scope> - </dependency> - </dependencies> -</project> diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaExport.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaExport.java deleted file mode 100644 index 41e93ec148..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaExport.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.java; - -import org.apache.tuscany.sca.contribution.Export; - -/** - * Base Java Export model interface - * - * @version $Rev$ $Date$ - */ -public interface JavaExport extends Export { - /** - * Get java package that identifies the import - * - * @return The package name - */ - String getPackage(); - - /** - * Set java package that identifies the import - * - * @param packageName The package name - */ - void setPackage(String packageName); -} diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImport.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImport.java deleted file mode 100644 index d3568f6283..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImport.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * 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.java; - -import org.apache.tuscany.sca.contribution.Import; - -/** - * Base Java Import model interface - * - * @version $Rev$ $Date$ - */ -public interface JavaImport extends Import { - - /** - * Get the location used to resolve the definitions for this import - * - * @return The import location - */ - String getLocation(); - - /** - * Set the location used to resolve the definitions for this import - * - * @param location The import location - */ - void setLocation(String location); - - /** - * Get java package that identifies the import - * - * @return The package name - */ - String getPackage(); - - /** - * Set java package that identifies the import - * - * @param packageName The package name - */ - void setPackage(String packageName); -} diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java deleted file mode 100644 index af2ca9cd57..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java;
-
-/**
- * Base Java Import/Export model factory
- *
- * @version $Rev$ $Date$
- */
-public interface JavaImportExportFactory {
-
- /**
- * Create a java import model object
- *
- * @return The new JavaImport model object
- */
- JavaImport createJavaImport();
-
- /**
- * Create a java export model object
- *
- * @return The new JavaExport model object
- */
- JavaExport createJavaExport();
-}
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java deleted file mode 100644 index 1a3978d352..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java +++ /dev/null @@ -1,144 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Constructor;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * A Model Resolver for ClassReferences.
- *
- * @version $Rev: 557916 $ $Date: 2007-07-20 01:04:40 -0700 (Fri, 20 Jul 2007) $
- */
-public class ClassReferenceModelResolver implements ModelResolver {
- private Contribution contribution;
- protected WeakReference<ClassLoader> classLoader;
- private Map<String, ClassReference> map = new HashMap<String, ClassReference>();
-
- private ModelResolver osgiResolver;
-
- public ClassReferenceModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- //FIXME The classloader should be passed in
- this.classLoader = new WeakReference<ClassLoader>(Thread.currentThread().getContextClassLoader());
-
- try {
- Class osgiResolverClass = Class.forName("org.apache.tuscany.sca.contribution.osgi.impl.OSGiClassReferenceModelResolver");
- if (osgiResolverClass != null) {
- Constructor constructor = osgiResolverClass.getConstructor(Contribution.class, ModelFactoryExtensionPoint.class);
- this.osgiResolver = (ModelResolver)constructor.newInstance(contribution, modelFactories);
- }
- } catch (Exception e) {
- }
- }
-
- public void addModel(Object resolved) {
- ClassReference clazz = (ClassReference)resolved;
- map.put(clazz.getClassName(), clazz);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(((ClassReference)resolved).getClassName());
- }
-
- /**
- * Handle artifact resolution when the specific class reference is imported from another contribution
- * @param unresolved
- * @return
- */
- private ClassReference resolveImportedModel(ClassReference unresolved) {
- ClassReference resolved = unresolved;
-
- if( this.contribution != null) {
- for (Import import_ : this.contribution.getImports()) {
- if (import_ instanceof JavaImport) {
- JavaImport javaImport = (JavaImport) import_;
- String packageName = javaImport.getPackage();
- if (javaImport.getPackage().equals(packageName)) {
- // Delegate the resolution to the import resolver
- resolved = import_.getModelResolver().resolveModel(ClassReference.class, unresolved);
- }
- }
- }
-
- }
- return resolved;
- }
-
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- Object resolved = map.get(unresolved);
-
- if (resolved != null ){
- return modelClass.cast(resolved);
- }
-
- //Load a class on demand
- Class clazz = null;
-
- if (osgiResolver != null)
- resolved = osgiResolver.resolveModel(modelClass, unresolved);
-
- if (unresolved == resolved || resolved == null) {
- try {
- clazz = Class.forName(((ClassReference)unresolved).getClassName(), true, classLoader.get());
- } catch (ClassNotFoundException e) {
- //we will later try to delegate to imported model resolvers
- }
- }
- else
- clazz = ((ClassReference)resolved).getJavaClass();
-
-
- if (clazz != null) {
- //if we load the class
- // Store a new ClassReference wrappering the loaded class
- ClassReference classReference = new ClassReference(clazz);
- map.put(getPackageName(classReference), classReference);
-
- // Return the resolved ClassReference
- return modelClass.cast(classReference);
- } else {
- //delegate resolution of the class
- resolved = this.resolveImportedModel((ClassReference)unresolved);
- return modelClass.cast(resolved);
- }
-
-
- }
-
- /***************
- * Helper methods
- ***************/
-
- private String getPackageName(ClassReference clazz) {
- int pos = clazz.getClassName().lastIndexOf(".");
- return clazz.getClassName().substring(0, pos - 1 );
- }
-}
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportImpl.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportImpl.java deleted file mode 100644 index 3139dbcaec..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.java.impl; - -import org.apache.tuscany.sca.contribution.java.JavaExport; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - -/** - * Implementation of a Java Import model - * - * @version $Rev$ $Date$ - */ -public class JavaExportImpl implements JavaExport { - private ModelResolver modelResolver; - /** - * Java package being exported - */ - private String packageName; - - public JavaExportImpl() { - super(); - } - - public String getPackage() { - return this.packageName; - } - - public void setPackage(String packageName) { - this.packageName = packageName; - } - - public ModelResolver getModelResolver() { - return modelResolver; - } - - public void setModelResolver(ModelResolver modelResolver) { - this.modelResolver = modelResolver; - } - -} diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessor.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessor.java deleted file mode 100644 index 840c4e2f02..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessor.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.java.impl; - -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.java.JavaExport; -import org.apache.tuscany.sca.contribution.java.JavaImportExportFactory; -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; - -/** - * Artifact processor for Java Export - * - * @version $Rev$ $Date$ - */ -public class JavaExportProcessor implements StAXArtifactProcessor<JavaExport> { - private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0"; - - private static final QName EXPORT_JAVA = new QName(SCA10_NS, "export.java"); - - private static final String PACKAGE = "package"; - - private final JavaImportExportFactory factory; - - public JavaExportProcessor(ModelFactoryExtensionPoint modelFactories) { - super(); - this.factory = modelFactories.getFactory(JavaImportExportFactory.class); - } - - public QName getArtifactType() { - return EXPORT_JAVA; - } - - public Class<JavaExport> getModelType() { - return JavaExport.class; - } - - /** - * Process <export package=""/> - */ - public JavaExport read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException { - JavaExport javaExport = this.factory.createJavaExport(); - QName element = null; - - while (reader.hasNext()) { - int event = reader.getEventType(); - switch (event) { - case START_ELEMENT: - element = reader.getName(); - - // Read <export.java> - if (EXPORT_JAVA.equals(element)) { - String packageName = reader.getAttributeValue(null, PACKAGE); - if (packageName == null) { - throw new ContributionReadException("Attribute 'package' is missing"); - } - - javaExport.setPackage(packageName); - } - break; - case XMLStreamConstants.END_ELEMENT: - if (EXPORT_JAVA.equals(reader.getName())) { - return javaExport; - } - break; - } - - //Read the next element - if (reader.hasNext()) { - reader.next(); - } - } - - return javaExport; - } - - public void write(JavaExport javaExport, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException { - - // Write <export.java> - writer.writeStartElement(EXPORT_JAVA.getNamespaceURI(), EXPORT_JAVA.getLocalPart()); - - if (javaExport.getPackage() != null) { - writer.writeAttribute(PACKAGE, javaExport.getPackage()); - } - - writer.writeEndElement(); - } - - public void resolve(JavaExport model, ModelResolver resolver) throws ContributionResolveException { - - } -} diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java deleted file mode 100644 index e5dc397f4e..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import org.apache.tuscany.sca.contribution.java.JavaExport;
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-import org.apache.tuscany.sca.contribution.java.JavaImportExportFactory;
-
-/**
- * Java Import/Export Factory implementation
- *
- * @version $Rev$ $Date$
- */
-public class JavaImportExportFactoryImpl implements JavaImportExportFactory {
-
- public JavaImport createJavaImport() {
- return new JavaImportImpl();
- }
-
- public JavaExport createJavaExport() {
- return new JavaExportImpl();
- }
-
-}
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportListener.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportListener.java deleted file mode 100644 index 8f12bf994c..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportListener.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.contribution.java.impl;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.java.JavaExport;
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-import org.apache.tuscany.sca.contribution.resolver.DefaultImportAllModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionListener;
-import org.apache.tuscany.sca.contribution.service.ContributionRepository;
-
-/**
- * Java Import/Export contribution listener
- * The listener would process all import/export from a given contribution
- * and initialize the model resolvers properly
- *
- * @version $Rev$ $Date$
- */
-public class JavaImportExportListener implements ContributionListener {
-
- /**
- * Initialize the import/export model resolvers
- * Export model resolvers are same as Contribution model resolver
- * Import model resolvers are matched to a specific contribution if a location uri is specified,
- * otherwise it try to resolve agains all the other contributions
- */
- public void contributionAdded(ContributionRepository repository, Contribution contribution) {
- // Initialize the contribution exports
- for (Export export: contribution.getExports()) {
- export.setModelResolver(contribution.getModelResolver());
- }
-
- // Initialize the contribution imports
- for (Import import_: contribution.getImports()) {
- boolean initialized = false;
- if(import_ instanceof JavaImport) {
- JavaImport javaImport = (JavaImport) import_;
-
- //Find a matching contribution
- if(javaImport.getLocation() != null) {
- Contribution targetContribution = repository.getContribution(javaImport.getLocation());
- if (targetContribution != null) {
-
- // Find a matching contribution export
- for (Export export: targetContribution.getExports()) {
- if (export instanceof JavaExport) {
- JavaExport javaExport = (JavaExport)export;
- if (javaImport.getPackage().equals(javaExport.getPackage())) {
- javaImport.setModelResolver(javaExport.getModelResolver());
- initialized = true;
- break;
- }
- }
- }
- }
- }
-
- //if no location was specified, try to resolve with any contribution
- if (!initialized) {
- //Use a resolver that will consider all contributions
- import_.setModelResolver(new DefaultImportAllModelResolver(import_, repository.getContributions()));
- }
- }
- }
- }
-
- public void contributionRemoved(ContributionRepository repository, Contribution contribution) {
-
- }
-
- public void contributionUpdated(ContributionRepository repository, Contribution oldContribution, Contribution contribution) {
-
- }
-
-}
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportImpl.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportImpl.java deleted file mode 100644 index d461574b2b..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportImpl.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.contribution.java.impl; - -import org.apache.tuscany.sca.contribution.Export; -import org.apache.tuscany.sca.contribution.java.JavaExport; -import org.apache.tuscany.sca.contribution.java.JavaImport; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - -/** - * Implementation of a Java Import model - * - * @version $Rev$ $Date$ - */ -public class JavaImportImpl implements JavaImport { - private ModelResolver modelResolver; - /** - * Java package name being imported - */ - private String packageName; - /** - * Contribution URI where the artifact is imported from - */ - private String location; - - public JavaImportImpl() { - super(); - } - - public String getLocation() { - return this.location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getPackage() { - return this.packageName; - } - - public void setPackage(String packageName) { - this.packageName = packageName; - } - - public ModelResolver getModelResolver() { - return this.modelResolver; - } - - public void setModelResolver(ModelResolver modelResolver) { - this.modelResolver = modelResolver; - } - - /** - * Match a JavaImport to a given JavaExport based on : - * location is not provided - * import and export packages match - */ - public boolean match(Export export) { - if(export instanceof JavaExport) { - if(this.getLocation() == null || this.getLocation().length() == 0) { - if (this.getPackage().equals(((JavaExport)export).getPackage())) { - return true; - } - } - } - - return false; - } -} diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java deleted file mode 100644 index 24612b0450..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.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.contribution.java.impl; - -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.java.JavaImport; -import org.apache.tuscany.sca.contribution.java.JavaImportExportFactory; -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; - -/** - * Artifact Processor for Java Imports - * - * @version $Rev$ $Date$ - */ -public class JavaImportProcessor implements StAXArtifactProcessor<JavaImport> { - private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0"; - - private static final QName IMPORT_JAVA = new QName(SCA10_NS, "import.java"); - - private static final String PACKAGE = "package"; - private static final String LOCATION = "location"; - - private final JavaImportExportFactory factory; - - public JavaImportProcessor(ModelFactoryExtensionPoint modelFactories) { - super(); - this.factory = modelFactories.getFactory(JavaImportExportFactory.class); - } - - public QName getArtifactType() { - return IMPORT_JAVA; - } - - public Class<JavaImport> getModelType() { - return JavaImport.class; - } - - /** - * Process <import.java package="" location=""/> - */ - public JavaImport read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException { - JavaImport javaImport = this.factory.createJavaImport(); - QName element = null; - - while (reader.hasNext()) { - int event = reader.getEventType(); - switch (event) { - case START_ELEMENT: - element = reader.getName(); - - // Read <import.java> - if (IMPORT_JAVA.equals(element)) { - String packageName = reader.getAttributeValue(null, PACKAGE); - if (packageName == null) { - throw new ContributionReadException("Attribute 'package' is missing"); - } - - String location = reader.getAttributeValue(null, LOCATION); - javaImport.setPackage(packageName); - javaImport.setLocation(location); - } - break; - case XMLStreamConstants.END_ELEMENT: - if (IMPORT_JAVA.equals(reader.getName())) { - return javaImport; - } - break; - } - - // Read the next element - if (reader.hasNext()) { - reader.next(); - } - } - - return javaImport; - } - - public void write(JavaImport javaImport, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException { - - // Write <import.java> - writer.writeStartElement(IMPORT_JAVA.getNamespaceURI(), IMPORT_JAVA.getLocalPart()); - - if (javaImport.getPackage() != null) { - writer.writeAttribute(PACKAGE, javaImport.getPackage()); - } - if (javaImport.getLocation() != null) { - writer.writeAttribute(LOCATION, javaImport.getLocation()); - } - - writer.writeEndElement(); - } - - - public void resolve(JavaImport model, ModelResolver resolver) throws ContributionResolveException { - - } -} diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.java.JavaImportExportFactory b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.java.JavaImportExportFactory deleted file mode 100644 index a293330a57..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.java.JavaImportExportFactory +++ /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.java.impl.JavaImportExportFactoryImpl
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index ac1fa9aade..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/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. - -org.apache.tuscany.sca.contribution.java.impl.JavaImportProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#import.java,model=org.apache.tuscany.sca.contribution.java.JavaImport -org.apache.tuscany.sca.contribution.java.impl.JavaExportProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#export.java,model=org.apache.tuscany.sca.contribution.java.JavaExport diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver deleted file mode 100644 index c69eb40636..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver +++ /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.java.impl.ClassReferenceModelResolver;model=org.apache.tuscany.sca.contribution.resolver.ClassReference
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener deleted file mode 100644 index 7debb3d3c6..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener +++ /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.java.impl.JavaImportExportListener
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java deleted file mode 100644 index f0e74b363a..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java +++ /dev/null @@ -1,75 +0,0 @@ - /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.DefaultModelResolverExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
-
-/**
- * Test ClassReferenceArtifactResolver.
- *
- * @version $Rev: 560435 $ $Date: 2007-07-27 18:26:55 -0700 (Fri, 27 Jul 2007) $
- */
-public class ClassReferenceArtifactResolverTestCase extends TestCase {
- private ExtensibleModelResolver resolver;
-
- @Override
- protected void setUp() throws Exception {
-
- ModelResolverExtensionPoint resolvers = new DefaultModelResolverExtensionPoint();
- resolvers.addResolver(ClassReference.class, ClassReferenceModelResolver.class);
-
- ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint();
-
- resolver = new ExtensibleModelResolver(null, resolvers, factories);
- }
-
- @Override
- protected void tearDown() throws Exception {
- }
-
- /**
- * Test ClassReference resolution
- *
- */
- public void testResolveClass() {
- ClassReference ref = new ClassReference(getClass().getName());
- ClassReference clazz = resolver.resolveModel(ClassReference.class, ref);
- assertFalse(clazz.isUnresolved());
- assertTrue(clazz.getJavaClass() == getClass());
- }
-
- /**
- * Test ClassReference resolution of inexistent class
- *
- */
- public void testUnresolvedClass() {
- ClassReference ref = new ClassReference("NonExistentClass");
- ClassReference clazz = resolver.resolveModel(ClassReference.class, ref);
- assertTrue(clazz.isUnresolved());
- assertTrue(clazz.getJavaClass() == null);
- }
-}
diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessorTestCase.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessorTestCase.java deleted file mode 100644 index 81c7ee525a..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessorTestCase.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * 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.java.impl; - -import java.io.StringReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.java.JavaExport; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; - -/** - * Test JavaExportProcessorTestCase - * - * @version $Rev$ $Date$ - */ -public class JavaExportProcessorTestCase extends TestCase { - - private static final String VALID_XML = - "<?xml version=\"1.0\" encoding=\"ASCII\"?>" - + "<contribution xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\">" - + "<export.java package=\"org.apache.tuscany.sca.contribution.java\"/>" - + "</contribution>"; - - private static final String INVALID_XML = - "<?xml version=\"1.0\" encoding=\"ASCII\"?>" - + "<contribution xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\">" - + "<export.java/>" - + "</contribution>"; - - private XMLInputFactory xmlFactory; - - @Override - protected void setUp() throws Exception { - xmlFactory = XMLInputFactory.newInstance(); - } - - /** - * Test loading a valid export element from a contribution metadata stream - * @throws Exception - */ - public void testLoad() throws Exception { - XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(VALID_XML)); - - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(new JavaImportExportFactoryImpl()); - JavaExportProcessor exportProcessor = new JavaExportProcessor(factories); - JavaExport javaExport = exportProcessor.read(reader); - - assertEquals("org.apache.tuscany.sca.contribution.java", javaExport.getPackage()); - } - - /** - * Test loading an INVALID export element from a contribution metadata stream - * @throws Exception - */ - public void testLoadInvalid() throws Exception { - XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(INVALID_XML)); - - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(new JavaImportExportFactoryImpl()); - JavaExportProcessor exportProcessor = new JavaExportProcessor(factories); - try { - exportProcessor.read(reader); - fail("readerException should have been thrown"); - } catch (ContributionReadException e) { - assertTrue(true); - } - } -} diff --git a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessorTestCase.java b/tags/java/sca/1.0-RC1b/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessorTestCase.java deleted file mode 100644 index 7f342c2278..0000000000 --- a/tags/java/sca/1.0-RC1b/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessorTestCase.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * 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.java.impl; - -import java.io.StringReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.java.JavaImport; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; - -/** - * Test JavaImportProcessorTestCase - * - * @version $Rev$ $Date$ - */ -public class JavaImportProcessorTestCase extends TestCase { - - private static final String VALID_XML = - "<?xml version=\"1.0\" encoding=\"ASCII\"?>" - + "<contribution xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\">" - + "<import.java package=\"org.apache.tuscany.sca.contribution.java\" location=\"sca://contributions/001\"/>" - + "</contribution>"; - - private static final String INVALID_XML = - "<?xml version=\"1.0\" encoding=\"ASCII\"?>" - + "<contribution xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\">" - + "<import.java location=\"sca://contributions/001\"/>" - + "</contribution>"; - - private XMLInputFactory xmlFactory; - - @Override - protected void setUp() throws Exception { - xmlFactory = XMLInputFactory.newInstance(); - } - - /** - * Test loading a valid import element from a contribution metadata stream - * @throws Exception - */ - public void testLoad() throws Exception { - XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(VALID_XML)); - - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(new JavaImportExportFactoryImpl()); - JavaImportProcessor importProcessor = new JavaImportProcessor(factories); - JavaImport javaImport = importProcessor.read(reader); - - assertEquals("org.apache.tuscany.sca.contribution.java", javaImport.getPackage()); - assertEquals("sca://contributions/001", javaImport.getLocation()); - } - - /** - * Test loading a INVALID import element from a contribution metadata stream - * @throws Exception - */ - public void testLoadInvalid() throws Exception { - XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(INVALID_XML)); - - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(new JavaImportExportFactoryImpl()); - JavaImportProcessor importProcessor = new JavaImportProcessor(factories); - try { - importProcessor.read(reader); - fail("readerException should have been thrown"); - } catch (ContributionReadException e) { - assertTrue(true); - } - } -} |