00001 /*
00002 * Created on Apr 22, 2004
00003 *
00004 */
00005 package org.gridlab.gat.resources;
00006
00007 import java.net.URI;
00008 import java.util.Map;
00009
00010 import org.gridlab.gat.io.File;
00011
00012
00013 /**
00014 * @author rob
00015 *
00016 * An instance of this class is a description of a piece of software
00017 * (component) which is to be submitted as a job. It currently takes
00018 * a table describing this piece of software's attributes to any
00019 * underlying job submission system.
00020
00021 * The GAT-API defines a minimum set of supported name/value pairs to
00022 * be included in the Map used to construct a
00023 * SoftwareDescription instance, as listed in table
00024 * below.
00025 *
00026 * Name Type Description
00027 * location Location Software location
00028 * arguments array of Strings Software arguments.
00029 * environment Map Software environment,
00030 * names/values are Strings.
00031 * stdin File Stdin from which the component reads.
00032 * stdout File Stdout to which the component writes.
00033 * stderr File Stderr to which the component writes.
00034 * pre-staged files array of Files Files which should be staged to the
00035 * resource before the component
00036 * is invoked.
00037 * post-staged files array of Files Files which should be staged from the
00038 * resource after the component
00039 * is finished.
00040 *
00041 */
00042
00043publicclass SoftwareDescriptionimplements java.io.Serializable {
00044private URI location;
00045private String[] arguments;
00046private Map environment;
00047private File stdin;
00048private File stdout;
00049private File stderr;
00050private File[] preStaged;
00051private File[] postStaged;
00052private Map attributes;
00053
00054publicSoftwareDescription(Map attributes) {
00055 this.attributes = attributes;
00056
00057 location = (URI) attributes.get("location");
00058 arguments = (String[]) attributes.get("arguments");
00059 environment = (Map) attributes.get("environment");
00060 stdin = (File) attributes.get("stdin");
00061 stdout = (File) attributes.get("stdout");
00062 stderr = (File) attributes.get("stderr");
00063 preStaged = (File[]) attributes.get("pre-staged files");
00064 postStaged = (File[]) attributes.get("post-staged files");
00065 }
00066
00067 /** Tests this GATSoftwareDescription for equality with the passed
00068 * GATObject. GATSoftwareDescription are equal if they have
00069 * equivalent entries in the description table.
00070 * @see java.lang.Object#equals(java.lang.Object)
00071 */00072publicbooleanequals(Object o) {
00073 if (!(o instanceof SoftwareDescription)) returnfalse;
00074 SoftwareDescription other = (SoftwareDescription) o;
00075 return other.attributes.equals(attributes);
00076 }
00077 }