package WEB-INF.classes.wenrgise.common.utility;

import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class ContextProvider {
  private Context ctx = null;
  
  public static InitialContext localContext;
  
  static {
    try {
      localContext = new InitialContext();
    } catch (NamingException oNx) {
      oNx.printStackTrace();
    } 
  }
  
  private static wenrgise.common.utility.ContextProvider objContextProvider = new wenrgise.common.utility.ContextProvider();
  
  private ContextProvider() {
    try {
      Hashtable env = new Hashtable();
      this.ctx = new InitialContext();
    } catch (Throwable e) {
      e.printStackTrace();
    } 
  }
  
  public static Context getContext() {
    return objContextProvider.ctx;
  }
  
  public static InitialContext getLocalContext() {
    return localContext;
  }
}
