diff options
Diffstat (limited to 'sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl')
6 files changed, 352 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java b/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java new file mode 100644 index 0000000000..38920fcb19 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.91/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/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionExportImpl.java b/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionExportImpl.java new file mode 100644 index 0000000000..90bde0f67e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionExportImpl.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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.ContributionExport; +import org.apache.tuscany.sca.contribution.resolver.ModelResolver; + +/** + * The representation of an export for the contribution + * + * @version $Rev$ $Date$ + */ +public class ContributionExportImpl implements ContributionExport { + private String namespace; // The namespace to be imported + private ModelResolver modelResolver; + + protected ContributionExportImpl() { + } + + public String getNamespace() { + return namespace; + } + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + public ModelResolver getModelResolver() { + return modelResolver; + } + + public void setModelResolver(ModelResolver modelResolver) { + this.modelResolver = modelResolver; + } +} diff --git a/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java b/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java new file mode 100644 index 0000000000..a349939a0e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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.ContributionExport; +import org.apache.tuscany.sca.contribution.ContributionFactory; +import org.apache.tuscany.sca.contribution.ContributionImport; +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(); + } + + public ContributionImport createContributionImport() { + return new ContributionImportImpl(); + } + + public ContributionExport createContributionExport() { + return new ContributionExportImpl(); + } +} diff --git a/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java b/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java new file mode 100644 index 0000000000..8d246eaf1c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.91/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.ContributionExport;
+import org.apache.tuscany.sca.contribution.ContributionImport;
+import org.apache.tuscany.sca.contribution.DeployedArtifact;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+
+/**
+ * The representation of a deployed contribution
+ *
+ * @version $Rev: 531146 $ $Date: 2007-04-21 22:40:50 -0700 (Sat, 21 Apr 2007) $
+ */
+public class ContributionImpl extends ArtifactImpl implements Contribution {
+ private List<ContributionExport> exports = new ArrayList<ContributionExport>();
+ private List<ContributionImport> imports = new ArrayList<ContributionImport>();
+ 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<ContributionExport> getExports() {
+ return exports;
+ }
+
+ public List<ContributionImport> 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/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImportImpl.java b/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImportImpl.java new file mode 100644 index 0000000000..3f241ff3d0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImportImpl.java @@ -0,0 +1,61 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.ContributionImport;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+
+/**
+ * The representation of an import for the contribution
+ *
+ * @version $Rev: 527398 $ $Date: 2007-04-10 23:43:31 -0700 (Tue, 10 Apr 2007) $
+ */
+public class ContributionImportImpl implements ContributionImport {
+ private String namespace; // The namespace to be imported
+ private String location; // Optional location to hint the where it should be imported
+ private ModelResolver modelResolver;
+
+ protected ContributionImportImpl() {
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ public ModelResolver getModelResolver() {
+ return modelResolver;
+ }
+
+ public void setModelResolver(ModelResolver modelResolver) {
+ this.modelResolver = modelResolver;
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java b/sca-java-1.x/branches/sca-java-0.91/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java new file mode 100644 index 0000000000..1d9bb04114 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.91/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: 527398 $ $Date: 2007-04-10 23:43:31 -0700 (Tue, 10 Apr 2007) $
+ */
+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;
+ }
+}
|