transactionconfig.java~3~

来自「JFrame-----java系统通用框架 可以研究一下哦」· JAVA~3~ 代码 · 共 53 行

JAVA~3~
53
字号
package com.corp.bisc.ebiz.base;

/**
 * 此处插入类型描述。
 * 创建日期:(2002-5-16 22:39:07)
 * @author:Administrator
 */
import javax.transaction.*;
import java.util.*;
import org.w3c.dom.*;
import com.corp.bisc.ebiz.util.*;
import javax.naming.*;
import com.corp.bisc.ebiz.exception.*;

public class TransactionConfig extends ObjectBase
{
	protected UserTransaction trans = null;

	/**
	 * TransactionConfig 构造子注解。
	 */

	public TransactionConfig()
	{
		super();
	}
	public UserTransaction getUserTransaction()
	{
		return trans;
	}
	public void init(Node node) throws InvalidConfigException
	{
		enter("init(Node)");

		Node initNode = XMLUtil.selectSingleNode2(node , "init");
		String ctxId = XMLUtil.selectSingleValue2(node , "transaction/@jndiname");
		Hashtable props = XMLToHashtable(initNode);

		try
		{
			InitialContext ctx = new InitialContext(props);
			trans = (UserTransaction)ctx.lookup(ctxId);
		}
		catch(NamingException e)
		{
			log.error("Can't get the usertransaction" , e);
			throw new InvalidConfigException("ServiceManager/ServiceProvider[@name=TRANSACTION]/database");
		}

		leave("init(Node)");
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?