From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001 From: dims Date: Tue, 17 Jun 2008 00:23:01 +0000 Subject: Move Tuscany from Incubator to top level. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/contribution/impl/ArtifactImpl.java | 71 +++++++++++++++++++++ .../contribution/impl/ContributionFactoryImpl.java | 41 ++++++++++++ .../sca/contribution/impl/ContributionImpl.java | 74 ++++++++++++++++++++++ .../contribution/impl/DeployedArtifactImpl.java | 43 +++++++++++++ 4 files changed, 229 insertions(+) create mode 100644 branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java create mode 100644 branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java create mode 100644 branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java create mode 100644 branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java (limited to 'branches/sca-java-1.0.1/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl') 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 exports = new ArrayList(); + private List imports = new ArrayList(); + private List deployables = new ArrayList(); + private ModelResolver modelResolver; + + /** + * A list of artifacts in the contribution + */ + private List artifacts = new ArrayList(); + + protected ContributionImpl() { + } + + public List getExports() { + return exports; + } + + public List getImports() { + return imports; + } + + public List getDeployables() { + return deployables; + } + + public List 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; + } +} -- cgit v1.2.3