01: /*
02: * This file or a portion of this file is licensed under the terms of
03: * the Globus Toolkit Public License, found in file GTPL, or at
04: * http://www.globus.org/toolkit/download/license.html. This notice must
05: * appear in redistributions of this file, with or without modification.
06: *
07: * Redistributions of this Software, with or without modification, must
08: * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
09: * some other similar material which is provided with the Software (if
10: * any).
11: *
12: * Copyright 1999-2004 University of Chicago and The University of
13: * Southern California. All rights reserved.
14: */
15: package org.griphyn.vdl.invocation;
16:
17: import java.util.*;
18: import java.io.Writer;
19: import java.io.IOException;
20:
21: /**
22: * This class maintains the application that was run, and the
23: * arguments to the commandline that were actually passed on to
24: * the application.
25: *
26: * @author Jens-S. Vöckler
27: * @author Yong Zhao
28: * @version $Revision: 50 $
29: * @see Job
30: */
31: public abstract class Arguments extends Invocation {
32: /**
33: * This is the executable that was run.
34: */
35: protected String m_executable;
36:
37: /**
38: * This abstract method is called by higher-level functions to
39: * obtain a single string representation of the arguments.
40: *
41: * @return string representing arguments, or <code>null</code>
42: * if there is no such string. The empty string is also possible.
43: */
44: public abstract String getValue();
45:
46: /**
47: * Default c'tor: Construct a hollow shell and allow further
48: * information to be added later.
49: */
50: public Arguments() {
51: m_executable = null;
52: }
53:
54: /**
55: * Constructs an applications without arguments.
56: * @param executable is the name of the application.
57: */
58: public Arguments(String executable) {
59: m_executable = executable;
60: }
61:
62: /**
63: * Accessor
64: *
65: * @see #setExecutable(String)
66: */
67: public String getExecutable() {
68: return this .m_executable;
69: }
70:
71: /**
72: * Accessor.
73: *
74: * @param executable
75: * @see #getExecutable()
76: */
77: public void setExecutable(String executable) {
78: this .m_executable = executable;
79: }
80:
81: /**
82: * Converts the active state into something meant for human consumption.
83: * The method will be called when recursively traversing the instance
84: * tree.
85: *
86: * @param stream is a stream opened and ready for writing. This can also
87: * be a string stream for efficient output.
88: */
89: public void toString(Writer stream) throws IOException {
90: throw new IOException(
91: "method not implemented, please contact vds-support@griphyn.org");
92: }
93: }
|