首页 > 其他 > 详细

staf

时间:2016-03-28 23:17:37      阅读:392      评论:0      收藏:0      [点我收藏+]

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

原文:http://www.cnblogs.com/season-xie/p/5330997.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!