Path: blob/master/src/java.naming/share/classes/javax/naming/spi/InitialContextFactoryBuilder.java
41159 views
/*1* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.naming.spi;2627import java.util.Hashtable;28import javax.naming.NamingException;2930/**31* This interface represents a builder that creates initial context factories.32*<p>33* The JNDI framework allows for different initial context implementations34* to be specified at runtime. An initial context is created using35* an initial context factory. A program can install its own builder36* that creates initial context factories, thereby overriding the37* default policies used by the framework, by calling38* NamingManager.setInitialContextFactoryBuilder().39* The InitialContextFactoryBuilder interface must be implemented by40* such a builder.41*42* @author Rosanna Lee43* @author Scott Seligman44*45* @see InitialContextFactory46* @see NamingManager#getInitialContext47* @see NamingManager#setInitialContextFactoryBuilder48* @see NamingManager#hasInitialContextFactoryBuilder49* @see javax.naming.InitialContext50* @see javax.naming.directory.InitialDirContext51* @since 1.352*/53public interface InitialContextFactoryBuilder {54/**55* Creates an initial context factory using the specified56* environment.57*<p>58* The environment parameter is owned by the caller.59* The implementation will not modify the object or keep a reference60* to it, although it may keep a reference to a clone or copy.61*62* @param environment Environment used in creating an initial63* context implementation. Can be null.64* @return A non-null initial context factory.65* @throws NamingException If an initial context factory could not be created.66*/67public InitialContextFactory68createInitialContextFactory(Hashtable<?,?> environment)69throws NamingException;70}717273