Name

ObjectFactory

Synopsis

This interface represents a factory for creating objects. JNDI supports the dynamic loading of object implementations with object factories. For example, say you have a naming system that binds file objects to names in the namespace. If the filesystem service provider binds filenames to Reference objects, a Reference object can create a file object through an object factory. This means that a call to lookup() a filename (in the appropriate Context) returns an actual file object the programmer can manipulate as necessary. An ObjectFactory is responsible for creating objects of a specific type.

public interface ObjectFactory {
// Public Instance Methods
   public abstract Object getObjectInstance(Object obj, 
        javax.naming.Name name, 
        javax.naming.Context nameCtx, 
        java.util.Hashtable environment) throws Exception;  
}

Implementations

DirObjectFactory

Returned By

ObjectFactoryBuilder.createObjectFactory()

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.