01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package javax.naming.spi;
19:
20: import java.util.Hashtable;
21: import javax.naming.NamingException;
22:
23: /**
24: * An initial context factory builder creates an initial context factory, and an
25: * initial context factory creates initial contexts. A variety of different
26: * initial context implementations may be used by a JNDI application. The
27: * application uses <code>NamingManager.setInitialContextFactoryBuilder()</code>
28: * to specify its own or its preferred builder to override JNDI default
29: * policies. Any such builder must implement the
30: * <code>InitialContextFactoryBuilder</code> interface.
31: */
32: public interface InitialContextFactoryBuilder {
33:
34: /**
35: * Uses the environment properties in the specified <code>envmt</code>
36: * parameter to create an initial context factory. If the implementation
37: * needs to keep a copy of <code>envmt</code> or to change it, it will
38: * clone or copy the specified object and use that instead. The
39: * <code>envmt</code> parameter may be null.
40: *
41: * @param envmt
42: * the context environment as a <code>Hashtable</code>
43: * @return an initial context factory - cannot be null.
44: * @throws NamingException
45: * if an initial context factory could not be created.
46: */
47: InitialContextFactory createInitialContextFactory(
48: Hashtable<?, ?> envmt) throws NamingException;
49:
50: }
|