Hi Shuaijie Wang,
 
In order to add arguments to a jsdl document you can use the folowing: 
 
jsdl.getApplication().getPosixApplication().addArgument(arg);
 
You may find the following documentation on GRIA JSDL support helpful
 
http://www.gria.org/documentation/5.2/manual/basic-application-services-
user-guide/the-job-service/jsdl-job-submission
<blocked::http://www.gria.org/documentation/5.2/manual/basic-application
-services-user-guide/the-job-service/jsdl-job-submission> 
 
In order to create a valid JSDL document for submission this snippet of
code may be of use
It uses the defaults for the application you are trying to submit.
 
ApplicationMetadata metadata = new ApplicationMetadata(metaDataDoc);
 
JobDescription jsdl = new
JobDescription(jobName,metadata.getInfo().getUri());
        
// Add the stagers to the JSDL
for (DataStager stager : metadata.getInputs()){
    addStagers(jsdl, stager, stager.getDefaultSize());
}
for (DataStager stager : metadata.getOutputs()){
    addStagers(jsdl, stager, stager.getDefaultSize());
}
        
// Parse the arguments string and add them to the JSDL
String[] args = {};
for (String arg : args){
    jsdl.getApplication().getPosixApplication().addArgument(arg);
}
 

Mark McArdle

IT Innovation Centre
2 Venture Road
Chilworth Science Park
Southampton, SO16 7NP, UK
tel: +44 23 8076 0834
fax: +44 23 8076 0833
mailto:[EMAIL PROTECTED]
<blocked::mailto:[EMAIL PROTECTED]> 
http://www.it-innovation.soton.ac.uk
<blocked::http://www.it-innovation.soton.ac.uk/> 


 


________________________________

        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
shuaijie wang
        Sent: 09 July 2008 03:38
        To: gria-general@lists.sourceforge.net
        Subject: [gria] how to add application argument via code
        
        
         I am writing client code with gria client api, I know that the
procedure for creating a new job is like this:
                    RemoteJobService jobService =
repository.getOrCreateObject(
                            RemoteJobService.class, ConversationID
                                    .getEPR(jobserviceEPR));
                    Document metadataDoc = jobService
        
.getApplicationMetadataDetailed(applicationURI);
                    ApplicationMetadata metadata = new
ApplicationMetadata(metadataDoc);
                    JobDescription jsdl = new JobDescription("Job Name",
metadata
                            .getInfo().getUri());
                    ...
            but now I have some application argument that need to be
passed to the job created, and I don't know how to,
            could you please send me a sample code illustrating how to
do this? thank you
        

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
gria-general mailing list
gria-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gria-general

Reply via email to