1.51.2

interbase.interclient
Class ObjectFactory

java.lang.Object
  |
  +--interbase.interclient.ObjectFactory

public class ObjectFactory
extends Object
implements javax.naming.spi.ObjectFactory

The component that actually reconstructs a data source object when it is retrieved from JNDI. References are needed since many naming services don’t have the ability to store Java objects in their serialized form. When a data source object is bound in this type of naming service the Reference for that object is actually stored by the JNDI implementation, not the data source object itself.

A JNDI administrator is responsible for making sure that both the object factory and data source implementation classes provided by a JDBC driver vendor are accessible to the JNDI service provider at runtime.

An object factory implements the javax.naming.spi.ObjectFactory interface. This interface contains a single method, getObjectInstance, which is called by a JNDI service provider to reconstruct an object when that object is retrieved from JNDI. A JDBC driver vendor should provide an object factory as part of their JDBC 2.0 product.

Since:
JDBC 2 Standard Extension, proposed for InterClient 2.0
Version:
JNDI 1.1.1
See Also:
DataSource

Constructor Summary
ObjectFactory()
           
 
Method Summary
 Object getObjectInstance(Object refObj, javax.naming.Name name, javax.naming.Context nameCtx, Hashtable env)
          Reconstructs an InterClient data source object from a JNDI data source reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFactory

public ObjectFactory()
Method Detail

getObjectInstance

public Object getObjectInstance(Object refObj,
                                javax.naming.Name name,
                                javax.naming.Context nameCtx,
                                Hashtable env)
                         throws Exception
Reconstructs an InterClient data source object from a JNDI data source reference.

The getObjectInstance() method is passed a reference that corresponds to the object being retrieved as its first parameter. The other parameters are optional in the case of JDBC data source objects. The object factory should use the information contained in the reference to reconstruct the data source. If for some reason, a data source object cannot be reconstructed from the reference, a value of null may be returned. This allows other object factories that may be registered in JNDI to be tried. If an exception is thrown then no other object factories are tried.

Specified by:
getObjectInstance in interface javax.naming.spi.ObjectFactory
Since:
JDBC 2 Standard Extension, proposed for InterClient 2.0

1.51.2

Send comments or suggestions to interclient@interbase.com