|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gridlab.gat.resources.SoftwareDescription
org.gridlab.gat.resources.JavaSoftwareDescription
public class JavaSoftwareDescription
An instance of this class is a description of a piece of java software (component) which is to be submitted as a job.
The JavaSoftwareDescription
is tailored to Java jobs. Although, it is
possible to submit a java job with the regular SoftwareDescription
,
the JavaSoftwareDescription
is a convenience object that makes it
easier and more straight forward to describe a java job. Besides the
JavaSoftwareDescription
being a convenience object, some JavaGAT
adaptors may only accept SoftwareDescription
s of the type
JavaSoftwareDescription
.
The following example shows the relation between the
SoftwareDescription
and the JavaSoftwareDescription
.
Consider the command line:
/path/to/java -classpath a:b:c/d -Xoption1 -Dmykey=myvalue my.package.Main arg1 arg2
The SoftwareDescription
needs this invocations to construct this
command line:
setExecutable("/path/to/java");
setArguments(new String[]{"-classpath", "a:b:c/d", "-Xoption1", "-Dmykey=myvalue", "my.package.Main",
"arg1", "arg2"});
The JavaSoftwareDescription
needs the following invocations for the
same command line:
setExecutable("/path/to/java");
setJavaClassPath("a:b:c/d");
setJavaOptions(new String[]{"-Xoption1});
Map
systemProperties.put("mykey", "myvalue");
setJavaSystemProperties(systemProperties);
setJavaMain("my.package.Main");
setJavaArguments(new String[]{"arg1", "arg2"});
Field Summary | |
---|---|
static String |
JAVA_ARGUMENTS
Attribute name: indicates the java arguments for the main class of the java application. |
static String |
JAVA_MAIN
Attribute name: indicates the main class that should be executed. |
static String |
JAVA_OPTIONS
Attribute name: indicates the jvm options for this java application. |
static String |
JAVA_SYSTEM_PROPERTIES
Attribute name: indicates the java system properties. |
Fields inherited from class org.gridlab.gat.resources.SoftwareDescription |
---|
CPUTIME_MAX, DIRECTORY, DRY_RUN, HOST_COUNT, JOB_QUEUE, JOB_TYPE, MEMORY_MAX, MEMORY_MIN, PROJECT, RESTART, SANDBOX_DELETE, SANDBOX_POSTSTAGE_STDERR, SANDBOX_POSTSTAGE_STDOUT, SANDBOX_PRESTAGE_STDIN, SANDBOX_ROOT, SANDBOX_USEROOT, SAVE_STATE, STOP_ON_EXIT, TIME_MAX, WALLTIME_MAX |
Constructor Summary | |
---|---|
JavaSoftwareDescription()
Create a JavaSoftwareDescription , which describes the java
application. |
|
JavaSoftwareDescription(Map<String,Object> attributes)
Create a JavaSoftwareDescription with the provided
attributes , which describes the java application. |
Method Summary | |
---|---|
void |
addJavaSystemProperty(String key,
String value)
Adds a system property to the current set of system properties. |
Object |
clone()
|
String[] |
getArguments()
Constructs the command line arguments from the class path, the jvm options, the system properties, the main and the java arguments of this SoftwareDescription . |
String |
getExecutable()
Returns the executable. |
String[] |
getJavaArguments()
Returns the arguments for the main class. |
String |
getJavaClassPath()
Returns the java class path. |
String |
getJavaMain()
Returns the main class of the java application. |
String[] |
getJavaOptions()
Returns the jvm options. |
Map<String,String> |
getJavaSystemProperties()
Returns the java system properties. |
void |
setArguments(String... arguments)
This method should not be used. |
void |
setJavaArguments(String... javaArguments)
Sets the arguments of the java main class. |
void |
setJavaClassPath(String javaClassPath)
Sets the java class path. |
void |
setJavaMain(String main)
Sets the main class. |
void |
setJavaOptions(String... options)
Sets the jvm options. |
void |
setJavaSystemProperties(Map<String,String> systemProperties)
Sets the system properties. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String JAVA_MAIN
JavaSoftwareDescription(Map)
.
public static final String JAVA_OPTIONS
JavaSoftwareDescription(Map)
.
public static final String JAVA_SYSTEM_PROPERTIES
JavaSoftwareDescription(Map)
.
public static final String JAVA_ARGUMENTS
JavaSoftwareDescription(Map)
.
Constructor Detail |
---|
public JavaSoftwareDescription()
JavaSoftwareDescription
, which describes the java
application.
public JavaSoftwareDescription(Map<String,Object> attributes)
JavaSoftwareDescription
with the provided
attributes
, which describes the java application. See
SoftwareDescription
for a list of well known attributes. Besides
this list the JavaSoftwareDescription
knows these attributes:
Name | Type | Description |
---|---|---|
java.main | String
| the main class that should be executed |
java.options | String []
| the jvm options for this java application |
java.system.properties | Map <String , String >
| the java system properties |
java.arguments | String []
| the java arguments for the main class of the java application |
attributes
- the attributes belonging to this
JavaSoftwareDescription
.Method Detail |
---|
public Object clone()
clone
in class SoftwareDescription
public String[] getJavaOptions()
public void setJavaOptions(String... options)
options
- the jvm options.public Map<String,String> getJavaSystemProperties()
public void setJavaSystemProperties(Map<String,String> systemProperties)
systemProperties
- the system properties.public void addJavaSystemProperty(String key, String value)
key
- the key of the system property to be addedvalue
- the value belonging to the key of the system property to
be addedpublic String getJavaMain()
public void setJavaMain(String main)
main
- the main class.public String[] getJavaArguments()
public void setJavaArguments(String... javaArguments)
javaArguments
- the arguments of the java main class.public void setArguments(String... arguments)
setJavaClassPath(String)
,
setJavaOptions(String[])
, setJavaSystemProperties(Map)
,
setJavaMain(String)
and setJavaArguments(String[])
should be used to construct the command line arguments.
setArguments
in class SoftwareDescription
arguments
- public String[] getArguments()
SoftwareDescription
.
getArguments
in class SoftwareDescription
public String getExecutable()
getExecutable
in class SoftwareDescription
public String getJavaClassPath()
public void setJavaClassPath(String javaClassPath)
javaClassPath
- the class path to be set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |