SimpleFlow s = null;
s = new CreditPrintFlow();
if (s != null) {
Thread t = new Thread(s);
t.start();
return "SUCCESS";
} else
return "FALSE";
public abstract class SimpleFlow implements Runnable { IObserver ob = PageObserver.getInstance(); JobResource jr = JobResource.getInstance(); public IObserver getOb() {
return ob;
} public JobResource getJr() {
return jr;
} static HashMap<String, JobNode> nodeMap = new HashMap<String, JobNode>(); public abstract HashMap<String, JobNode> getNodeMap(); public SimpleFlow(String batchFiler, String brnoFilter, String preFlag, String priFlag, String operator) {
jr.setBatchFiler(batchFiler);
jr.setBrnoFilter(brnoFilter);
jr.setPreFlag(preFlag);
jr.setPriFlag(priFlag);
jr.setOperator(operator);
} public void startup() {
JobDispatch.runFlow(this);
}
}
启动线程后正常会调用SimpleFlow 复写的run()方法,但是SimpleFlow 只有基本的构造函数,请问该线程启动后会如何调用?

解决方案 »

  1.   

    继承Runnable接口,居然不写run方法,会让你编译成功?
      

  2.   

    s = new CreditPrintFlow();Thread t = new Thread(s);这里s是一个CreditPrintFlow的实例。Thread.start()是调用的CreditPrintFlow的run方法。
    如果SimpleFlow 是CreditPrintFlow的父类。那,SimpleFlow 没有run方法,CreditPrintFlow就要有了
      

  3.   

    抽象类,CreditPrintFlow继承SimpleFlow 而且有run方法的复写,thank you