staf
Posted q55091
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了staf相关的知识,希望对你有一定的参考价值。
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();
}
}
以上是关于staf的主要内容,如果未能解决你的问题,请参考以下文章
STAF no JSTAF in java.library.path 的终极解决办法