javax.naming.spi
Interface ObjectFactory
- All Known Subinterfaces:
- DirObjectFactory
public interface ObjectFactory
Represents a factory for creating the object. ObjectFactory performs the
operation, that is the opposite to the operation, performed by the
StateFactory
. Classes, implementing this interface, must be public
and have public parameterless constructor.
getObjectInstance
Object getObjectInstance(Object refObj,
Name name,
Context nameCtx,
Hashtable<?,?> environment)
throws Exception
- Creates the object, using the specified name and location information. The
call of this method must be thread safe.
- Parameters:
refObj
- may provide the reference and location information. Can be null.name
- the name of the new object in the scope of the specified naming
context. Can be null if the name is not specified.nameCtx
- the context, in which the object name is specified. Can be
null if the name is specified in the scope of the default initial
context.environment
- the properties, providing additional information on how
to create an object. Can be null if not additional information is
provided.
- Returns:
- the newly created object or null if the object cannot be created
- Throws:
Exception
- if this factory suggest not to try creating of this
object by other alternative factories- See Also:
NamingManager.getObjectInstance(Object, Name, Context, Hashtable)