package com.eactive.eai.control;

import java.util.Properties;

import com.eactive.eai.common.exception.ExceptionUtil;
import com.eactive.eai.common.logger.EAILogSender;
import com.eactive.eai.common.message.EAIMessage;

public class LogSender {
	
	static final String LS_CONTROL_ERROR = "RECEAIOLC001";
	
	public static void send(int logPssSno, EAIMessage eaiMsg, Properties altKeyProp)
    throws java.lang.Exception
    {
		// DBLogTransactionLogger 로 로직 이동함
		//        Transaction tx = null;
        try {
//            tx = TxHelper.getTransactionManager().suspend();
            eaiMsg.setLogPssSno(logPssSno);
            EAILogSender.send(eaiMsg, altKeyProp);
        }
        catch(Exception e) {
            throw new Exception(ExceptionUtil.getErrorCode(e, LS_CONTROL_ERROR));            
        } finally {
//            if(tx!=null) {
//                try {
//                    TxHelper.getTransactionManager().resume(tx);
//                } catch(Exception e) {   
//                }   
//            }   
        }
    }
}
