Package org.postgresql.ds.common
Class PGObjectFactory
- java.lang.Object
-
- org.postgresql.ds.common.PGObjectFactory
-
- All Implemented Interfaces:
javax.naming.spi.ObjectFactory
- Direct Known Subclasses:
PGXADataSourceFactory
public class PGObjectFactory extends java.lang.Object implements javax.naming.spi.ObjectFactory
Returns a DataSource-ish thing based on a JNDI reference. In the case of a SimpleDataSource or ConnectionPool, a new instance is created each time, as there is no connection state to maintain. In the case of a PoolingDataSource, the same DataSource will be returned for every invocation within the same VM/ClassLoader, so that the state of the connections in the pool will be consistent.
-
-
Constructor Summary
Constructors Constructor Description PGObjectFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable<?,?> environment)
Dereferences a PostgreSQL DataSource.protected java.lang.String
getProperty(javax.naming.Reference ref, java.lang.String s)
protected java.lang.Object
loadBaseDataSource(BaseDataSource ds, javax.naming.Reference ref)
private java.lang.Object
loadConnectionPool(javax.naming.Reference ref)
private java.lang.Object
loadPoolingDataSource(javax.naming.Reference ref)
private java.lang.Object
loadSimpleDataSource(javax.naming.Reference ref)
-
-
-
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
Dereferences a PostgreSQL DataSource. Other types of references are ignored.- Specified by:
getObjectInstance
in interfacejavax.naming.spi.ObjectFactory
- Throws:
java.lang.Exception
-
loadPoolingDataSource
private java.lang.Object loadPoolingDataSource(javax.naming.Reference ref)
-
loadSimpleDataSource
private java.lang.Object loadSimpleDataSource(javax.naming.Reference ref)
-
loadConnectionPool
private java.lang.Object loadConnectionPool(javax.naming.Reference ref)
-
loadBaseDataSource
protected java.lang.Object loadBaseDataSource(BaseDataSource ds, javax.naming.Reference ref)
-
getProperty
protected java.lang.String getProperty(javax.naming.Reference ref, java.lang.String s)
-
-