package com.generation.batch;

import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.spi.InitialContextFactory;

/**
 * バッチ用のコンテキストファクトリクラス。
 *
 * @author 松川 徹
 */
public class BatchContextFactory implements InitialContextFactory {

	private static BatchContext instance;

	/**
	 * Method getInitialContext Returns the SimpleContext for use.
	 *
	 *
	 * @param environment
	 *
	 * @return
	 *
	 */
	@SuppressWarnings("unchecked")
	public Context getInitialContext(Hashtable environment) {

		if (instance == null) {
			instance = new BatchContext();
		}
		return instance;
	}
}
