码迷,mamicode.com
首页 > 其他好文 > 详细

staf

时间:2016-03-28 23:20:51      阅读:475      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!