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 object factory builder creates an object factory, and an object factory
25: * creates objects of a specified type. A variety of different objects may be
26: * used by a JNDI application; these objects are meaningful to the application
27: * and can be manipulated according to the methods available to the class of the
28: * object, such as a printer object. The application uses
29: * <code>NamingManager.setObjectFactoryBuilder()</code> to specify its own or
30: * its preferred builder to override JNDI default policies; any such builder
31: * must implement the <code>ObjectFactoryBuilder</code> interface.
32: */
33: public interface ObjectFactoryBuilder {
34:
35: /**
36: * Returns an <code>ObjectFactory</code> customized by the
37: * <code>envmt</code> parameter that is capable of creating instances of
38: * the object <code>o</code>.
39: *
40: * @param o
41: * may be null
42: * @param envmt
43: * may be null
44: * @return an <code>ObjectFactory</code> customized by the
45: * <code>envmt</code> parameter that is capable of creating
46: * instances of the object <code>o</code>.
47: * @throws NamingException
48: * if an object factory could not be created.
49: */
50: ObjectFactory createObjectFactory(Object o, Hashtable<?, ?> envmt)
51: throws NamingException;
52:
53: }
|