Interface JDBCConnectionProviderFactory
-
@ProviderType public interface JDBCConnectionProviderFactory
A factory for creating JDBCConnectionProvider instancesThis factory can be used if the
JDBCConnectionProvider
should not be a public service, for example to protect a username/password.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONNECTION_LIFETIME
The property used to set the maximum amount of time that connections in the pool should remain openstatic java.lang.String
CONNECTION_POOLING_ENABLED
The property used to determine whether connection pooling is enabled for this resource providerstatic java.lang.String
CONNECTION_TIMEOUT
The property used to set the maximum amount of time that the pool should wait for a connectionstatic 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 closedstatic java.lang.String
LOCAL_ENLISTMENT_ENABLED
The property used to determine whether local enlistment is enabled for this resource providerstatic java.lang.String
MAX_CONNECTIONS
The property used to set the maximum number of connections that should be held in the poolstatic java.lang.String
MIN_CONNECTIONS
The property used to set the minimum number of connections that should be held in the poolstatic java.lang.String
OSGI_RECOVERY_IDENTIFIER
The property used to set the recovery identifier that should be used by this resourcestatic java.lang.String
USE_DRIVER
The property used to set the maximum number of connections that should be held in the poolstatic java.lang.String
XA_ENLISTMENT_ENABLED
The property used to determine whether XA enlistment is enabled for this resource providerstatic java.lang.String
XA_RECOVERY_ENABLED
The property used to determine whether XA recovery is enabled for this resource provider
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JDBCConnectionProvider
getProviderFor(java.sql.Driver driver, java.util.Properties jdbcProperties, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a privateJDBCConnectionProvider
using an existingDriver
.JDBCConnectionProvider
getProviderFor(javax.sql.DataSource ds, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a privateJDBCConnectionProvider
using an existingDataSource
.JDBCConnectionProvider
getProviderFor(javax.sql.XADataSource ds, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a privateJDBCConnectionProvider
using an existingXADataSource
.JDBCConnectionProvider
getProviderFor(DataSourceFactory dsf, java.util.Properties jdbcProperties, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a privateJDBCConnectionProvider
using a DataSourceFactory.void
releaseProvider(JDBCConnectionProvider provider)
Release aJDBCConnectionProvider
instance that has been created by this factory.
-
-
-
Field Detail
-
XA_ENLISTMENT_ENABLED
static final java.lang.String XA_ENLISTMENT_ENABLED
The property used to determine whether XA enlistment is enabled for this resource provider- See Also:
- Constant Field Values
-
LOCAL_ENLISTMENT_ENABLED
static final java.lang.String LOCAL_ENLISTMENT_ENABLED
The property used to determine whether local enlistment is enabled for this resource provider- See Also:
- Constant Field Values
-
XA_RECOVERY_ENABLED
static final java.lang.String XA_RECOVERY_ENABLED
The property used to determine whether XA recovery is enabled for this resource provider- See Also:
- Constant Field Values
-
CONNECTION_POOLING_ENABLED
static final java.lang.String CONNECTION_POOLING_ENABLED
The property used to determine whether connection pooling is enabled for this resource provider- See Also:
- Constant Field Values
-
CONNECTION_TIMEOUT
static final java.lang.String CONNECTION_TIMEOUT
The property used to set the maximum amount of time that the pool should wait for a connection- See Also:
- Constant Field Values
-
IDLE_TIMEOUT
static final 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- See Also:
- Constant Field Values
-
CONNECTION_LIFETIME
static final java.lang.String CONNECTION_LIFETIME
The property used to set the maximum amount of time that connections in the pool should remain open- See Also:
- Constant Field Values
-
MIN_CONNECTIONS
static final java.lang.String MIN_CONNECTIONS
The property used to set the minimum number of connections that should be held in the pool- See Also:
- Constant Field Values
-
MAX_CONNECTIONS
static final java.lang.String MAX_CONNECTIONS
The property used to set the maximum number of connections that should be held in the pool- See Also:
- Constant Field Values
-
USE_DRIVER
static final java.lang.String USE_DRIVER
The property used to set the maximum number of connections that should be held in the pool- See Also:
- Constant Field Values
-
OSGI_RECOVERY_IDENTIFIER
static final java.lang.String OSGI_RECOVERY_IDENTIFIER
The property used to set the recovery identifier that should be used by this resource- See Also:
- Constant Field Values
-
-
Method Detail
-
getProviderFor
JDBCConnectionProvider getProviderFor(DataSourceFactory dsf, java.util.Properties jdbcProperties, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a privateJDBCConnectionProvider
using a DataSourceFactory. This call may fail with aTransactionException
if the supplied configuration is invalid. Examples of invalid configuration include:- The properties request XA enlistment, but the provider implementation only supports local enlistment
- The properties attempt to set a recovery alias, but the provider does not support recovery.
- Parameters:
dsf
-jdbcProperties
- The properties to pass to theDataSourceFactory
in order to create the underlyingDataSource
resourceProviderProperties
- Configuration properties to pass to the JDBC Resource Provider runtime- Returns:
- A
JDBCConnectionProvider
that can be used in transactions
-
getProviderFor
JDBCConnectionProvider getProviderFor(javax.sql.DataSource ds, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a privateJDBCConnectionProvider
using an existingDataSource
. This call may fail with aTransactionException
if the supplied configuration is invalid. Examples of invalid configuration include:- The properties request XA enlistment, but the provider implementation only supports local enlistment
- The properties attempt to set a recovery alias, but the provider does not support recovery.
- Parameters:
ds
-resourceProviderProperties
- Configuration properties to pass to the JDBC Resource Provider runtime- Returns:
- A
JDBCConnectionProvider
that can be used in transactions
-
getProviderFor
JDBCConnectionProvider getProviderFor(java.sql.Driver driver, java.util.Properties jdbcProperties, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a privateJDBCConnectionProvider
using an existingDriver
. This call may fail with aTransactionException
if the supplied configuration is invalid. Examples of invalid configuration include:- The properties request XA enlistment, but the provider implementation only supports local enlistment
- The properties attempt to set a recovery alias, but the provider does not support recovery.
- Parameters:
driver
-jdbcProperties
- The properties to pass to theDriver
in order to create aConnection
resourceProviderProperties
- Configuration properties to pass to the JDBC Resource Provider runtime- Returns:
- A
JDBCConnectionProvider
that can be used in transactions
-
getProviderFor
JDBCConnectionProvider getProviderFor(javax.sql.XADataSource ds, java.util.Map<java.lang.String,java.lang.Object> resourceProviderProperties)
Create a privateJDBCConnectionProvider
using an existingXADataSource
. This call may fail with aTransactionException
if the supplied configuration is invalid. Examples of invalid configuration include:- The properties request XA enlistment, but the provider implementation only supports local enlistment
- The properties attempt to set a recovery alias, but the provider does not support recovery.
- Parameters:
ds
-resourceProviderProperties
- Configuration properties to pass to the JDBC Resource Provider runtime- Returns:
- A
JDBCConnectionProvider
that can be used in transactions
-
releaseProvider
void releaseProvider(JDBCConnectionProvider provider)
Release aJDBCConnectionProvider
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.- Parameters:
provider
-- Throws:
java.lang.IllegalArgumentException
- if the supplied resource was not created by this factory service instance.
-
-