package com.dy.rtuMw.server.rtuData; 
 | 
  
 | 
import com.dy.rtuMw.web.comResult.CommandResultDeal; 
 | 
import com.dy.common.mw.protocol.Data; 
 | 
import com.dy.common.queue.NodeObj; 
 | 
import com.dy.common.springUtil.SpringContextUtil; 
 | 
import com.dy.common.threadPool.ThreadPool; 
 | 
import com.dy.common.threadPool.TreadPoolFactory; 
 | 
import org.apache.logging.log4j.LogManager; 
 | 
import org.apache.logging.log4j.Logger; 
 | 
  
 | 
public class RtuComResultNode implements NodeObj { 
 | 
  
 | 
    private static final Logger log = LogManager.getLogger(RtuComResultNode.class.getName()); 
 | 
  
 | 
    public Object obj ;//数据 
 | 
  
 | 
    public RtuComResultNode(Object obj){ 
 | 
        this.obj = obj ; 
 | 
    } 
 | 
    /** 
 | 
     * 自己处理自己 
 | 
     * @return 
 | 
     */ 
 | 
    public boolean dealSelf(){ 
 | 
        try { 
 | 
            ThreadPool.Pool pool = TreadPoolFactory.getThreadPoolLong() ; 
 | 
            pool.putJob(new ThreadPool.Job() { 
 | 
                public void execute() { 
 | 
                    if(obj != null){ 
 | 
                        if(obj instanceof Data){ 
 | 
                            CommandResultDeal deal = (CommandResultDeal) SpringContextUtil.getBean(CommandResultDeal.class) ; 
 | 
                            deal.deal((Data)obj); 
 | 
                        } 
 | 
                    } 
 | 
                } 
 | 
                @Override 
 | 
                public void destroy(){ 
 | 
                } 
 | 
                @Override 
 | 
                public boolean isDestroy(){ 
 | 
                    return false ; 
 | 
                } 
 | 
  
 | 
            }); 
 | 
        } catch (Exception e) { 
 | 
            log.error("在RtuComResultNode内发生异常", e); 
 | 
        } 
 | 
        return true ; 
 | 
    } 
 | 
  
 | 
  
 | 
} 
 |