javax.naming.spi
Interface ObjectFactoryBuilder


public interface ObjectFactoryBuilder

This interface represents a builder that creates object factories.

The JNDI framework allows for object implementations to be loaded in dynamically via object factories. For example, when looking up a printer bound in the name space, if the print service binds printer names to References, the printer Reference could be used to create a printer object, so that the caller of lookup can directly operate on the printer object after the lookup. An ObjectFactory is responsible for creating objects of a specific type. JNDI uses a default policy for using and loading object factories. You can override this default policy by calling NamingManager.setObjectFactoryBuilder() with an ObjectFactoryBuilder, which contains the program-defined way of creating/loading object factories. Any ObjectFactoryBuilder implementation must implement this interface that for creating object factories.

Since:
1.3
See Also:
ObjectFactory sample code for javax.naming.spi.ObjectFactory definition code for javax.naming.spi.ObjectFactory , NamingManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable) sample code for javax.naming.spi.NamingManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable) definition code for javax.naming.spi.NamingManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable) , NamingManager.setObjectFactoryBuilder(javax.naming.spi.ObjectFactoryBuilder) sample code for javax.naming.spi.NamingManager.setObjectFactoryBuilder(javax.naming.spi.ObjectFactoryBuilder) definition code for javax.naming.spi.NamingManager.setObjectFactoryBuilder(javax.naming.spi.ObjectFactoryBuilder)

Method Summary
 ObjectFactory sample code for javax.naming.spi.ObjectFactory definition code for javax.naming.spi.ObjectFactory createObjectFactory sample code for javax.naming.spi.ObjectFactoryBuilder.createObjectFactory(java.lang.Object, java.util.Hashtable) definition code for javax.naming.spi.ObjectFactoryBuilder.createObjectFactory(java.lang.Object, java.util.Hashtable) (Object sample code for java.lang.Object definition code for java.lang.Object  obj, Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> environment)
          Creates a new object factory using the environment supplied.
 

Method Detail

createObjectFactory sample code for javax.naming.spi.ObjectFactoryBuilder.createObjectFactory(java.lang.Object, java.util.Hashtable<?, ?>) definition code for javax.naming.spi.ObjectFactoryBuilder.createObjectFactory(java.lang.Object, java.util.Hashtable<?, ?>)

ObjectFactory sample code for javax.naming.spi.ObjectFactory definition code for javax.naming.spi.ObjectFactory  createObjectFactory(Object sample code for java.lang.Object definition code for java.lang.Object  obj,
                                  Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> environment)
                                  throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Creates a new object factory using the environment supplied.

The environment parameter is owned by the caller. The implementation will not modify the object or keep a reference to it, although it may keep a reference to a clone or copy.

Parameters:
obj - The possibly null object for which to create a factory.
environment - Environment to use when creating the factory. Can be null.
Returns:
A non-null new instance of an ObjectFactory.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If an object factory cannot be created.