org.objectweb.easybeans.dbpool
Class DataSourceFactory

java.lang.Object
  extended by org.objectweb.easybeans.dbpool.DataSourceFactory
All Implemented Interfaces:
javax.naming.spi.ObjectFactory

public class DataSourceFactory
extends java.lang.Object
implements javax.naming.spi.ObjectFactory

Class which is used for binding the ConnectionManager object. getReference() method of ConnectionManager redirect to this class. The getObjectInstance() method will be called for the JNDI lookup

Author:
Florent Benoit

Field Summary
private static JLog logger
          Logger.
 
Constructor Summary
DataSourceFactory()
           
 
Method Summary
 java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable environment)
          Creates an object using the location or reference information specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static JLog logger
Logger.

Constructor Detail

DataSourceFactory

public DataSourceFactory()
Method Detail

getObjectInstance

public java.lang.Object getObjectInstance(java.lang.Object obj,
                                          javax.naming.Name name,
                                          javax.naming.Context nameCtx,
                                          java.util.Hashtable environment)
                                   throws java.lang.Exception
Creates an object using the location or reference information specified. It gets a connection manager of this server.

Specified by:
getObjectInstance in interface javax.naming.spi.ObjectFactory
Parameters:
obj - The possibly null object containing location or reference information that can be used in creating an object.
name - The name of this object relative to nameCtx, or null if no name is specified.
nameCtx - The context relative to which the name parameter is specified, or null if name is relative to the default initial context.
environment - The possibly null environment that is used in creating the object.
Returns:
The object created; null if an object cannot be created.
Throws:
java.lang.Exception - if this object factory encountered an exception while attempting to create an object, and no other object factories are to be tried.