package flymestory;
import java.util.Map;
import com.ibm.staf.STAFException;
import com.ibm.staf.STAFHandle;
import com.ibm.staf.STAFMarshallingContext;
public class staf {
public static void runSTAFProcess() {
// System.load(System.getProperty("user.dir")+"\\lib\\JSTAF.dll");
System.out.println("-------java.library.path:"+System.getProperty("java.library.path"));
STAFHandle handle = null;
try {
handle = new STAFHandle("MyApp/Test");
} catch (STAFException e) {
System.out.println("Error registering with STAF, RC: " + e.rc);
}
// String service = "PROCESS";
// String request = "START SHELL COMMAND e: && cd config && ant";
String service = "FS";
String request = "COPY Directory D:\\json\\ TODIRECTORY D:\\ TOMACHINE 172.16.152.109 RECURSE KEEPEMPTYDIRECTORIES";
try {
//String result = handle.submit("172.29.48.90", service,request);
String result = handle.submit("172.29.48.90", service,request);
STAFMarshallingContext mc = STAFMarshallingContext
.unmarshall(result);
System.out.println(mc.getRootObject());
/*Map mcMap = (Map) mc.getRootObject();
handle.unRegister();*/
} catch (STAFException e) {
System.out.println(e);
System.out.println("run process error");
}
}
public static void main(String[] args) {
runSTAFProcess();
}
}