package callbak;
/**
*
* @see http://my.oschina.net/u/2358780
*/
public interface XCallBack {
/**
* 执行回调方法
* @param objects 将处理后的结果作为参数返回给回调方法
*/
public String executeCallBack(String s);
}
**************************************************************
package callbak;
/**
*
* @see http://my.oschina.net/u/2358780
*/
public class XExecuteRequest implements Runnable{
private XExecuteResponse remote;
private String url;
private String param;
private XCallBack callBack;
private String requestType;
public XExecuteRequest(XExecuteResponse remote, String url, String param,XCallBack callBack) {
super();
this.remote = remote;
this.url = url;
this.param = param;
this.callBack=callBack;
}
/**
* 发送消息
*/
public void start(String msg)
{
requestType=msg;
Thread thread = new Thread(this);
thread.start();
System.out.println("XExecuteRequest.start>>>");
}
public void run() {
if("POST".equals(requestType)){
remote.executePost(url, param,callBack);
}else if("GET".equals(requ