memoryinitialcontextfactory.java
来自「实现了Jms的服务器源码,支持多种适配器,DB,FTP,支持多种数据库」· Java 代码 · 共 36 行
JAVA
36 行
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.avalon.excalibur.naming.memory;
import java.util.Hashtable;
import java.util.NoSuchElementException;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;
import org.apache.avalon.excalibur.naming.DefaultNameParser;
import org.apache.avalon.excalibur.naming.DefaultNamespace;
/**
* Initial context factory for memorycontext.
*
* @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
* @version $Revision: 1.2 $
*/
public class MemoryInitialContextFactory
implements InitialContextFactory
{
public Context getInitialContext( final Hashtable environment )
throws NamingException
{
final DefaultNameParser parser = new DefaultNameParser();
final DefaultNamespace namespace = new DefaultNamespace( parser );
return new MemoryContext( namespace, environment, null );
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?