| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- package xin.glue.nui.G.G02;
- import java.io.*;
- import java.net.*;
- import com.posdata.glue.context.PosContext;
- import org.quartz.JobExecutionContext;
- import xin.glue.nui.Test.TcGenerator;
- import com.posdata.glue.dao.PosGenericDao;
- import com.posdata.glue.dao.vo.PosParameter;
- import com.posdata.glue.dao.vo.PosRow;
- import com.posdata.glue.dao.vo.PosRowSet;
- import com.posdata.glue.scheduling.PosQuartzJobBean;
- import com.posdata.glue.transaction.PosTransactionManager;
- import com.posdata.glue.util.log.PosLog;
- import com.posdata.glue.util.log.PosLogFactory;
-
- public class TCPCLIENT extends PosQuartzJobBean {
- static PosLog logger = PosLogFactory.getLogger(PosQuartzJobBean.class);
- protected PosGenericDao dao = (PosGenericDao)
- PosContext.getBeanFactory().getBeanObject("mesdao");
-
- private PosTransactionManager transaction =
- (PosTransactionManager) PosContext.getBeanFactory().getBeanObject("tx2");
- protected void executeJob(JobExecutionContext arg0) {
- {
- try {
-
-
- logger.logInfo("TCPCLIENT start ...");
-
- PosParameter param = new PosParameter();
-
- // ip-address , port
- ServerSocket serverSock = new ServerSocket(5001);
- while(true) {
- logger.logInfo("TCPCLIENT 1 ...");
-
- Socket sock = serverSock.accept();
-
- PrintWriter writer = new PrintWriter(sock.getOutputStream());
-
- logger.logInfo("TCPCLIENT 2 ...");
-
- param.setWhereClauseParameter(0, "");
-
- PosRowSet TcSendVo = dao.find("NIG060100_TC_SEND.select", param);
-
- while(TcSendVo.hasNext()) {
- PosRow TcSendROW = TcSendVo.next();
- logger.logInfo("TcSendVo START ...");
-
- TcSendROW.getAttributes();
-
- writer.println(TcSendROW.getAttributes());
- writer.close();
-
- Number PA_SEQ_NO = (Number)TcSendROW.getAttribute("SEQ_NO");
-
- logger.logInfo("TcSendVo PA_SEQ_NO:"+PA_SEQ_NO);
-
- PosParameter param1 = new PosParameter();
- param1.setValueParamter(0, PA_SEQ_NO );
-
- dao.update("NIG060100_TC_SEND.update",param1);
-
-
- }
-
- transaction.commit();
- logger.logInfo("TCPCLIENT END ...");
-
-
- }
-
-
- } catch (Exception ex) {
- transaction.rollback();
- logger.logError(ex.getMessage(),ex);
- }
- }
-
- }
- }
|