Environment.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package bible.rmi.example4;
- import javax.naming.*;
- import java.util.*;
- /**
- * Class Environment
- *
- *
- * @author
- * @version %I%, %G%
- */
- public class Environment {
- /** Field JNDI_FACTORY */
- public final static String JNDI_FACTORY =
- "weblogic.jndi.WLInitialContextFactory";
- /** Field WEBLOGIC_URL */
- public final static String WEBLOGIC_URL = "t3://localhost:7001";
- /**
- * Method getInitialContext
- *
- *
- * @return
- *
- * @throws NamingException
- *
- */
- public static InitialContext getInitialContext() throws NamingException {
- Hashtable env = new Hashtable();
- env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
- env.put(Context.PROVIDER_URL, WEBLOGIC_URL);
- return new InitialContext(env);
- }
- }