GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

SoftwareDescription.java

Go to the documentation of this file.
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 
00043 public class SoftwareDescription implements java.io.Serializable {
00044     private URI location;
00045     private String[] arguments;
00046     private Map environment;
00047     private File stdin;
00048     private File stdout;
00049     private File stderr;
00050     private File[] preStaged;
00051     private File[] postStaged;
00052     private Map attributes; 
00053     
00054     public SoftwareDescription(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      */
00072     public boolean equals(Object o) {
00073         if (!(o instanceof SoftwareDescription)) return false;
00074         SoftwareDescription other = (SoftwareDescription) o;
00075         return other.attributes.equals(attributes);
00076     }
00077 }