Hi,

Forgive me if my question seems really tivial but I am relatively new
to using STAF and Java. I have a Java Class called AllUpgrades that
calls another class called SpUpgrade. There is a bunch of code
executed in SpUpgrade. For example one of the methods in SpUpgrade
executes the following:

String machine = "local";
String command = "/data/STAF/src/scripts/upgrade.sh " + "QUERY" + " "
+ fProduct;
String service = "PROCESS";
String request = "START SHELL COMMAND " +  STAFUtil.wrapData(command)
+ " WAIT RETURNSTDOUT STDERRTOSTDOUT";
STAFResult result = handle.submit2(machine, service, request);

I need to print the result of the above request, so I parse the
request as follows:

STAFMarshallingContext mc = STAFMarshallingContext.unmarshall(result.result);
Map processCompletionMap = (Map)mc.getRootObject();
String processRC = (String)processCompletionMap.get("rc");
if (!processRC.equals("0"))
         {
                System.out.println("ERROR: STAF " + machine + " " + service + " 
" +
request + " RC: " + result.rc + ", Result: " + result.result);
                System.exit(1);

         }

List returnedFileList = (List)processCompletionMap.get("fileList");
Map stdoutMap = (Map)returnedFileList.get(0);
String stdoutRC = (String)stdoutMap.get("rc");
if (!stdoutRC.equals("0"))
        {

            System.out.println("ERROR retrieving process Stdout data.
RC=" + stdoutRC);
            System.exit(1);

        }

stdoutData = (String)stdoutMap.get("data");
String[] reslines =stdoutData.split(System.getProperty("line.separator"));
for (int i = 0; i < reslines.length; i++)
{
System.out.println("line" + i + ": " + reslines[i]);
return("line" + i + ": " + reslines[i]);
}


But the parsed result is not printed to stdout, it goes to the JVMLog
file. How do I get the above parsed data to be printed on the console?

Thanks
Anna

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to