@ProviderType public interface JDBCConnectionProviderFactory
This factory can be used if the JDBCConnectionProvider
should not be
a public service, for example to protect a username/password.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONNECTION_LIFETIME
The property used to set the maximum amount of time that connections in
the pool should remain open
|
static java.lang.String |
CONNECTION_POOLING_ENABLED
The property used to determine whether connection pooling is enabled for
this resource provider
|
static java.lang.String |
CONNECTION_TIMEOUT
The property used to set the maximum amount of time that the pool should
wait for a connection
|
static java.lang.String |
IDLE_TIMEOUT
The property used to set the maximum amount of time that connections in
the pool should remain idle before being closed
|
static java.lang.String |
LOCAL_ENLISTMENT_ENABLED
The property used to determine whether local enlistment is enabled for
this resource provider
|
static java.lang.String |
MAX_CONNECTIONS
The property used to set the maximum number of connections that should be
held in the pool
|
static java.lang.String |
MIN_CONNECTIONS
The property used to set the minimum number of connections that should be
held in the pool
|
static java.lang.String |
OSGI_RECOVERY_IDENTIFIER
The property used to set the recovery identifier that should be used by
this resource
|
static java.lang.String |
USE_DRIVER
The property used to set the maximum number of connections that should be
held in the pool
|
static java.lang.String |
XA_ENLISTMENT_ENABLED
The property used to determine whether XA enlistment is enabled for this
resource provider
|
static java.lang.String |
XA_RECOVERY_ENABLED
The property used to determine whether XA recovery is enabled for this
resource provider
|
Modifier and Type | Method and Description |
---|---|
JDBCConnectionProvider |
getProviderFor(DataSourceFactory dsf,
java.util.Properties jdbcProperties,
java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a private
JDBCConnectionProvider using a
DataSourceFactory. |
JDBCConnectionProvider |
getProviderFor(javax.sql.DataSource ds,
java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a private
JDBCConnectionProvider using an existing
DataSource . |
JDBCConnectionProvider |
getProviderFor(java.sql.Driver driver,
java.util.Properties jdbcProperties,
java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a private
JDBCConnectionProvider using an existing
Driver . |
JDBCConnectionProvider |
getProviderFor(javax.sql.XADataSource ds,
java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a private
JDBCConnectionProvider using an existing
XADataSource . |
void |
releaseProvider(JDBCConnectionProvider provider)
Release a
JDBCConnectionProvider instance that has been created
by this factory. |
static final java.lang.String XA_ENLISTMENT_ENABLED
static final java.lang.String LOCAL_ENLISTMENT_ENABLED
static final java.lang.String XA_RECOVERY_ENABLED
static final java.lang.String CONNECTION_POOLING_ENABLED
static final java.lang.String CONNECTION_TIMEOUT
static final java.lang.String IDLE_TIMEOUT
static final java.lang.String CONNECTION_LIFETIME
static final java.lang.String MIN_CONNECTIONS
static final java.lang.String MAX_CONNECTIONS
static final java.lang.String USE_DRIVER
static final java.lang.String OSGI_RECOVERY_IDENTIFIER
JDBCConnectionProvider getProviderFor(DataSourceFactory dsf, java.util.Properties jdbcProperties, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
JDBCConnectionProvider
using a
DataSourceFactory. This call may fail with a TransactionException
if the supplied configuration is invalid. Examples of invalid
configuration include:
dsf
- jdbcProperties
- The properties to pass to the
DataSourceFactory
in order to create the underlying
DataSource
resourceProviderProperties
- Configuration properties to pass to the
JDBC Resource Provider runtimeJDBCConnectionProvider
that can be used in transactionsJDBCConnectionProvider getProviderFor(javax.sql.DataSource ds, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
JDBCConnectionProvider
using an existing
DataSource
. This call may fail with a
TransactionException
if the supplied configuration is invalid.
Examples of invalid configuration include:
ds
- resourceProviderProperties
- Configuration properties to pass to the
JDBC Resource Provider runtimeJDBCConnectionProvider
that can be used in transactionsJDBCConnectionProvider getProviderFor(java.sql.Driver driver, java.util.Properties jdbcProperties, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
JDBCConnectionProvider
using an existing
Driver
. This call may fail with a TransactionException
if
the supplied configuration is invalid. Examples of invalid configuration
include:
driver
- jdbcProperties
- The properties to pass to the Driver
in
order to create a Connection
resourceProviderProperties
- Configuration properties to pass to the
JDBC Resource Provider runtimeJDBCConnectionProvider
that can be used in transactionsJDBCConnectionProvider getProviderFor(javax.sql.XADataSource ds, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
JDBCConnectionProvider
using an existing
XADataSource
. This call may fail with a
TransactionException
if the supplied configuration is invalid.
Examples of invalid configuration include:
ds
- resourceProviderProperties
- Configuration properties to pass to the
JDBC Resource Provider runtimeJDBCConnectionProvider
that can be used in transactionsvoid releaseProvider(JDBCConnectionProvider provider)
JDBCConnectionProvider
instance that has been created
by this factory. Released instances are eligible to be shut down and have
any remaining open connections closed.
Note that all JDBCConnectionProvider
instances created by this
factory service are implicitly released when the factory service is
released by this bundle.
provider
- java.lang.IllegalArgumentException
- if the supplied resource was not created
by this factory service instance.Copyright © OSGi Alliance (2000, 2018). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0