summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl
diff options
context:
space:
mode:
authordims <dims@13f79535-47bb-0310-9956-ffa450edef68>2008-06-17 00:23:01 +0000
committerdims <dims@13f79535-47bb-0310-9956-ffa450edef68>2008-06-17 00:23:01 +0000
commitbdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch)
tree38a92061c0793434c4be189f1d70c3458b6bc41d /branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl')
-rw-r--r--branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java71
-rw-r--r--branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java41
-rw-r--r--branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java74
-rw-r--r--branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java43
4 files changed, 229 insertions, 0 deletions
diff --git a/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java b/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java
new file mode 100644
index 0000000000..f7600e5a83
--- /dev/null
+++ b/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.impl;
+
+import org.apache.tuscany.sca.contribution.Artifact;
+
+
+/**
+ * Base Artifact interface to accomodate common properties between Contribution and Deployed Artifact
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class ArtifactImpl implements Artifact {
+ private String uri;
+ private String location;
+
+ protected ArtifactImpl() {
+ }
+
+ public String getLocation() {
+ return this.location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public String getURI() {
+ return this.uri;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ @Override
+ public int hashCode() {
+ return uri.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ } else {
+ if (obj instanceof Artifact) {
+ return uri.equals(((Artifact)obj).getURI());
+ } else {
+ return false;
+ }
+ }
+ }
+
+}
diff --git a/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java b/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java
new file mode 100644
index 0000000000..1ef7a98f9e
--- /dev/null
+++ b/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.impl;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.DeployedArtifact;
+
+
+/**
+ * Contribution model object factory
+ *
+ * @version $Rev$ $Date$
+ */
+public class ContributionFactoryImpl implements ContributionFactory {
+
+ public Contribution createContribution() {
+ return new ContributionImpl();
+ }
+
+ public DeployedArtifact createDeployedArtifact() {
+ return new DeployedArtifactImpl();
+ }
+}
diff --git a/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java b/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java
new file mode 100644
index 0000000000..e4160ba73b
--- /dev/null
+++ b/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.DeployedArtifact;
+import org.apache.tuscany.sca.contribution.Export;
+import org.apache.tuscany.sca.contribution.Import;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+
+/**
+ * The representation of a deployed contribution
+ *
+ * @version $Rev$ $Date$
+ */
+public class ContributionImpl extends ArtifactImpl implements Contribution {
+ private List<Export> exports = new ArrayList<Export>();
+ private List<Import> imports = new ArrayList<Import>();
+ private List<Composite> deployables = new ArrayList<Composite>();
+ private ModelResolver modelResolver;
+
+ /**
+ * A list of artifacts in the contribution
+ */
+ private List<DeployedArtifact> artifacts = new ArrayList<DeployedArtifact>();
+
+ protected ContributionImpl() {
+ }
+
+ public List<Export> getExports() {
+ return exports;
+ }
+
+ public List<Import> getImports() {
+ return imports;
+ }
+
+ public List<Composite> getDeployables() {
+ return deployables;
+ }
+
+ public List<DeployedArtifact> getArtifacts() {
+ return artifacts;
+ }
+
+ public ModelResolver getModelResolver() {
+ return modelResolver;
+ }
+
+ public void setModelResolver(ModelResolver modelResolver) {
+ this.modelResolver = modelResolver;
+ }
+}
diff --git a/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java b/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java
new file mode 100644
index 0000000000..f3a688140c
--- /dev/null
+++ b/branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.impl;
+
+import org.apache.tuscany.sca.contribution.DeployedArtifact;
+
+/**
+ * Representation of a deployed artifact
+ *
+ * @version $Rev$ $Date$
+ */
+public class DeployedArtifactImpl extends ArtifactImpl implements DeployedArtifact {
+ private Object modelObject;
+
+ protected DeployedArtifactImpl() {
+ super();
+ }
+
+ public Object getModel() {
+ return modelObject;
+ }
+
+ public void setModel(Object modelObject) {
+ this.modelObject = modelObject;
+ }
+}