Package org.postgresql.ds.common
Class PGObjectFactory
java.lang.Object
org.postgresql.ds.common.PGObjectFactory
- All Implemented Interfaces:
ObjectFactory
- Direct Known Subclasses:
PGXADataSourceFactory
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
-
Method Summary
Modifier and TypeMethodDescription@Nullable Object
getObjectInstance
(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) Dereferences a PostgreSQL DataSource.protected @Nullable String
getProperty
(Reference ref, String s) protected Object
loadBaseDataSource
(BaseDataSource ds, Reference ref)
-
Constructor Details
-
PGObjectFactory
public PGObjectFactory()
-
-
Method Details
-
getObjectInstance
public @Nullable Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws ExceptionDereferences a PostgreSQL DataSource. Other types of references are ignored.- Specified by:
getObjectInstance
in interfaceObjectFactory
- Throws:
Exception
-
loadBaseDataSource
-
getProperty
-