public abstract ObjectFactory createObjectFactory (Object obj, Hashtable<?, ?> environment) throws 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.

Exceptions:
NamingException    If an object factory cannot be created.