You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2009/04/10 02:11:49 UTC

svn commit: r763837 - in /tuscany/java/sca/modules: contribution/src/main/java/org/apache/tuscany/sca/contribution/ contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/

Author: rfeng
Date: Fri Apr 10 00:11:48 2009
New Revision: 763837

URL: http://svn.apache.org/viewvc?rev=763837&view=rev
Log:
Remove deprecated classes and use generic type for getModel

Removed:
    tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DeployedArtifact.java
Modified:
    tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java
    tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java
    tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java
    tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java
    tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java
    tuscany/java/sca/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java

Modified: tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java?rev=763837&r1=763836&r2=763837&view=diff
==============================================================================
--- tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java (original)
+++ tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java Fri Apr 10 00:11:48 2009
@@ -6,15 +6,15 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.tuscany.sca.contribution;
@@ -24,50 +24,50 @@
 
 /**
  * Represents an artifact in an SCA contribution.
- * 
+ *
  * @version $Rev$ $Date$
  */
 public interface Artifact extends Base {
-    
+
     /**
      * Returns the URI that unique identifies the artifact inside the contribution.
-     * 
+     *
      * @return The artifact URI
      */
     String getURI();
-    
+
     /**
      * Sets the URI that uniquely identifies the artifact inside the contribution.
-     * 
+     *
      * @param uri The artifact URI
      */
     void setURI(String uri);
 
     /**
      * Returns the location of the artifact.
-     * 
+     *
      * @return The artifact location
      */
     String getLocation();
-    
+
     /**
      * Set the location of the artifact.
-     * 
+     *
      * @param location The artifact location
      */
     void setLocation(String location);
 
-    
+
     /**
      * Returns the in-memory model representing the artifact.
-     * 
+     *
      * @return The model object
      */
-    Object getModel();
-    
+    <T> T getModel();
+
     /**
      * Sets the in-memory model representing the artifact.
-     * 
+     *
      * @param model The model object
      */
     void setModel(Object model);
@@ -77,7 +77,7 @@
      * @return the contents of the artifact
      */
     byte[] getContents();
-    
+
     /**
      * Sets the contents of the artifact.
      * @param contents the contents of the artifact

Modified: tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java?rev=763837&r1=763836&r2=763837&view=diff
==============================================================================
--- tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java (original)
+++ tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java Fri Apr 10 00:11:48 2009
@@ -6,15 +6,15 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.tuscany.sca.contribution;
@@ -22,52 +22,44 @@
 
 /**
  * A factory for the contribution model.
- * 
+ *
  * @version $Rev$ $Date$
  */
 public interface ContributionFactory {
-    
+
     /**
      * Create a contribution model object
-     * 
+     *
      * @return The new contribution model object
      */
     Contribution createContribution();
-        
+
     /**
      * Create a contribution metadata model object
-     * 
+     *
      * @return The new contribution metadata model object
      */
     ContributionMetadata createContributionMetadata();
-        
-    /**
-     * Create a deployedArtifact model object
-     * 
-     * @return The new deployedArtifact model object
-     */
-    @Deprecated
-    DeployedArtifact createDeployedArtifact();   
 
     /**
      * Create an artifact model object
-     * 
+     *
      * @return The new artifact model object
      */
     Artifact createArtifact();
 
     /**
      * Create a default import model object.
-     * 
+     *
      * @return the new default import model object
      */
     DefaultImport createDefaultImport();
 
     /**
      * Create a default export model object.
-     * 
+     *
      * @return the new default export model object
      */
     DefaultExport createDefaultExport();
-    
+
 }
\ No newline at end of file

Modified: tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java?rev=763837&r1=763836&r2=763837&view=diff
==============================================================================
--- tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java (original)
+++ tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java Fri Apr 10 00:11:48 2009
@@ -6,15 +6,15 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.tuscany.sca.contribution.impl;
@@ -24,7 +24,7 @@
 
 /**
  * The model representing an artifact in a contribution.
- * 
+ *
  * @version $Rev$ $Date$
  */
 class ArtifactImpl implements Artifact {
@@ -36,7 +36,7 @@
 
     ArtifactImpl() {
     }
-    
+
     public String getLocation() {
         return location;
     }
@@ -44,19 +44,19 @@
     public void setLocation(String location) {
         this.location = location;
     }
-    
+
     public String getURI() {
         return uri;
     }
-    
+
     public void setURI(String uri) {
         this.uri = uri;
     }
-    
-    public Object getModel() {
-        return model;
+
+    public <T> T getModel() {
+        return (T) model;
     }
-    
+
     public void setModel(Object model) {
         this.model = model;
     }
@@ -64,15 +64,15 @@
     public byte[] getContents() {
         return contents;
     }
-    
+
     public void setContents(byte[] contents) {
         this.contents = contents;
     }
-    
+
     public boolean isUnresolved() {
         return unresolved;
     }
-    
+
     public void setUnresolved(boolean unresolved) {
         this.unresolved = unresolved;
     }
@@ -81,7 +81,7 @@
     public int hashCode() {
         return uri.hashCode();
     }
-    
+
     @Override
     public boolean equals(Object obj) {
         if (obj == this) {

Modified: tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java?rev=763837&r1=763836&r2=763837&view=diff
==============================================================================
--- tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java (original)
+++ tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java Fri Apr 10 00:11:48 2009
@@ -6,15 +6,15 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.tuscany.sca.contribution.impl;
@@ -25,23 +25,22 @@
 import org.apache.tuscany.sca.contribution.ContributionMetadata;
 import org.apache.tuscany.sca.contribution.DefaultExport;
 import org.apache.tuscany.sca.contribution.DefaultImport;
-import org.apache.tuscany.sca.contribution.DeployedArtifact;
 
 
 /**
  * Default implementation of a contribution model factory.
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class ContributionFactoryImpl implements ContributionFactory {
-    
+
     protected ContributionFactoryImpl() {
     }
-    
+
     public Contribution createContribution() {
         return new ContributionImpl();
     }
-    
+
     public ContributionMetadata createContributionMetadata() {
         return new ContributionMetadataImpl();
     }
@@ -49,19 +48,13 @@
     public Artifact createArtifact() {
         return new ArtifactImpl();
     }
-    
+
     public DefaultExport createDefaultExport() {
         return new DefaultExportImpl();
     }
-    
+
     public DefaultImport createDefaultImport() {
         return new DefaultImportImpl();
     }
-    
-    @Deprecated
-    public DeployedArtifact createDeployedArtifact() {
-        class DeployedArtifactImpl extends ArtifactImpl implements DeployedArtifact {
-        }
-        return new DeployedArtifactImpl();
-    }
+
 }

Modified: tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java?rev=763837&r1=763836&r2=763837&view=diff
==============================================================================
--- tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java (original)
+++ tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java Fri Apr 10 00:11:48 2009
@@ -6,15 +6,15 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.tuscany.sca.contribution.impl;
@@ -46,13 +46,13 @@
     private List<Artifact> artifacts = new ArrayList<Artifact>();
     private List<Contribution> dependencies = new ArrayList<Contribution>();
     private ModelResolver modelResolver;
-    
+
     // FIXME remove this dependency on Java ClassLoaders
     private ClassLoader classLoader;
 
     ContributionImpl() {
     }
-    
+
     public String getLocation() {
         return this.location;
     }
@@ -65,45 +65,45 @@
     public ClassLoader getClassLoader() {
         return classLoader;
     }
-    
+
     //FIXME Remove dependency on Java ClassLoaders
     public void setClassLoader(ClassLoader classLoader) {
         this.classLoader = classLoader;
     }
-    
-    
+
+
     public String getURI() {
         return this.uri;
     }
-    
+
     public void setURI(String uri) {
         this.uri = uri;
     }
 
-    public Object getModel() {
-        return model;
+    public <T> T getModel() {
+        return (T) model;
     }
-    
+
     public void setModel(Object model) {
         this.model = model;
     }
-    
+
     public byte[] getContents() {
         return contents;
     }
-    
+
     public void setContents(byte[] contents) {
         this.contents = contents;
     }
-    
+
     public boolean isUnresolved() {
         return unresolved;
     }
-    
+
     public void setUnresolved(boolean unresolved) {
         this.unresolved = unresolved;
     }
-    
+
     public ModelResolver getModelResolver() {
         return modelResolver;
     }
@@ -111,11 +111,11 @@
     public void setModelResolver(ModelResolver modelResolver) {
         this.modelResolver = modelResolver;
     }
-    
+
     public List<Contribution> getDependencies() {
         return dependencies;
     }
-    
+
     public List<Export> getExports() {
         return exports;
     }
@@ -136,7 +136,7 @@
     public int hashCode() {
         return uri.hashCode();
     }
-    
+
     @Override
     public boolean equals(Object obj) {
         if (obj == this) {

Modified: tuscany/java/sca/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java?rev=763837&r1=763836&r2=763837&view=diff
==============================================================================
--- tuscany/java/sca/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java (original)
+++ tuscany/java/sca/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java Fri Apr 10 00:11:48 2009
@@ -6,15 +6,15 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.tuscany.sca.workspace.impl;
@@ -43,21 +43,21 @@
     private Object model;
     private byte[] contents;
     private boolean unresolved;
-    private ModelResolver modelResolver; 
+    private ModelResolver modelResolver;
     private List<Contribution> dependencies = new ArrayList<Contribution>();
-    
+
     /**
-     * Constructs a new workspace. 
+     * Constructs a new workspace.
      */
     WorkspaceImpl() {
     }
-    
+
     public String getLocation() {
         return location;
     }
 
-    public Object getModel() {
-        return model;
+    public <T> T getModel() {
+        return (T) model;
     }
 
     public String getURI() {
@@ -75,11 +75,11 @@
     public byte[] getContents() {
         return contents;
     }
-    
+
     public void setContents(byte[] contents) {
         this.contents = contents;
     }
-    
+
     public void setURI(String uri) {
         this.uri = uri;
     }
@@ -95,11 +95,11 @@
     public List<Contribution> getContributions() {
         return contributions;
     }
-    
+
     public List<Artifact> getArtifacts() {
         return (List<Artifact>)(Object)contributions;
     }
-    
+
     public List<Contribution> getDependencies() {
         return dependencies;
     }
@@ -108,11 +108,11 @@
         //FIXME Remove later
         return null;
     }
-    
+
     public void setClassLoader(ClassLoader classLoader) {
         //FIXME Remove later
     }
-    
+
     public List<Composite> getDeployables() {
         List<Composite> deployables = new ArrayList<Composite>();
         for (Contribution contribution: contributions) {
@@ -120,7 +120,7 @@
         }
         return deployables;
     }
-    
+
     public List<Export> getExports() {
         List<Export> exports = new ArrayList<Export>();
         for (Contribution contribution: contributions) {
@@ -128,7 +128,7 @@
         }
         return exports;
     }
-    
+
     public List<Import> getImports() {
         List<Import> imports = new ArrayList<Import>();
         for (Contribution contribution: contributions) {
@@ -136,11 +136,11 @@
         }
         return imports;
     }
-    
+
     public ModelResolver getModelResolver() {
         return modelResolver;
     }
-    
+
     public void setModelResolver(ModelResolver modelResolver) {
         this.modelResolver = modelResolver;
     }