1 24 25 package com.rift.coad.lib.bean; 27 28 import org.apache.log4j.Logger; 30 31 import com.rift.coad.lib.thread.BasicThread; 33 34 40 public class BeanThread extends BasicThread { 41 42 protected Logger log = 44 Logger.getLogger(BasicThread.class.getName()); 45 46 private BeanRunnable bean = null; 48 49 54 public BeanThread(BeanRunnable bean) throws Exception 55 { 56 this.bean = bean; 57 } 58 59 60 65 public void process() throws Exception { 66 try { 67 bean.process(); 68 } catch (Exception ex) { 69 log.error("Failed to process with this thread : " + ex.getMessage(), 70 ex); 71 } 72 } 73 74 75 79 public void terminate() { 80 try { 81 bean.terminate(); 82 } catch (Exception ex) { 83 log.error("Failed to terminate this thread : " + ex.getMessage(), 84 ex); 85 } 86 } 87 } 88 | Popular Tags |