Interface JDBCConnectionProviderFactory
@ProviderType
public interface JDBCConnectionProviderFactory
A factory for creating JDBCConnectionProvider instances
This factory can be used if the JDBCConnectionProvider should not be
a public service, for example to protect a username/password.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe property used to set the maximum amount of time that connections in the pool should remain openstatic final StringThe property used to determine whether connection pooling is enabled for this resource providerstatic final StringThe property used to set the maximum amount of time that the pool should wait for a connectionstatic final StringThe property used to set the maximum amount of time that connections in the pool should remain idle before being closedstatic final StringThe property used to determine whether local enlistment is enabled for this resource providerstatic final StringThe property used to set the maximum number of connections that should be held in the poolstatic final StringThe property used to set the minimum number of connections that should be held in the poolstatic final StringThe property used to set the recovery identifier that should be used by this resourcestatic final StringThe property used to set the maximum number of connections that should be held in the poolstatic final StringThe property used to determine whether XA enlistment is enabled for this resource providerstatic final StringThe property used to determine whether XA recovery is enabled for this resource provider -
Method Summary
Modifier and TypeMethodDescriptiongetProviderFor(Driver driver, Properties jdbcProperties, Map<String, Object> resourceProviderProperties) Create a privateJDBCConnectionProviderusing an existingDriver.getProviderFor(DataSource ds, Map<String, Object> resourceProviderProperties) Create a privateJDBCConnectionProviderusing an existingDataSource.getProviderFor(XADataSource ds, Map<String, Object> resourceProviderProperties) Create a privateJDBCConnectionProviderusing an existingXADataSource.getProviderFor(DataSourceFactory dsf, Properties jdbcProperties, Map<String, Object> resourceProviderProperties) Create a privateJDBCConnectionProviderusing a DataSourceFactory.voidreleaseProvider(JDBCConnectionProvider provider) Release aJDBCConnectionProviderinstance that has been created by this factory.
-
Field Details
-
XA_ENLISTMENT_ENABLED
The property used to determine whether XA enlistment is enabled for this resource provider- See Also:
-
LOCAL_ENLISTMENT_ENABLED
The property used to determine whether local enlistment is enabled for this resource provider- See Also:
-
XA_RECOVERY_ENABLED
The property used to determine whether XA recovery is enabled for this resource provider- See Also:
-
CONNECTION_POOLING_ENABLED
The property used to determine whether connection pooling is enabled for this resource provider- See Also:
-
CONNECTION_TIMEOUT
The property used to set the maximum amount of time that the pool should wait for a connection- See Also:
-
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:
-
CONNECTION_LIFETIME
The property used to set the maximum amount of time that connections in the pool should remain open- See Also:
-
MIN_CONNECTIONS
The property used to set the minimum number of connections that should be held in the pool- See Also:
-
MAX_CONNECTIONS
The property used to set the maximum number of connections that should be held in the pool- See Also:
-
USE_DRIVER
The property used to set the maximum number of connections that should be held in the pool- See Also:
-
OSGI_RECOVERY_IDENTIFIER
The property used to set the recovery identifier that should be used by this resource- See Also:
-
-
Method Details
-
getProviderFor
JDBCConnectionProvider getProviderFor(DataSourceFactory dsf, Properties jdbcProperties, Map<String, Object> resourceProviderProperties) Create a privateJDBCConnectionProviderusing a DataSourceFactory. This call may fail with aTransactionExceptionif 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 theDataSourceFactoryin order to create the underlyingDataSourceresourceProviderProperties- Configuration properties to pass to the JDBC Resource Provider runtime- Returns:
- A
JDBCConnectionProviderthat can be used in transactions
-
getProviderFor
Create a privateJDBCConnectionProviderusing an existingDataSource. This call may fail with aTransactionExceptionif 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
JDBCConnectionProviderthat can be used in transactions
-
getProviderFor
JDBCConnectionProvider getProviderFor(Driver driver, Properties jdbcProperties, Map<String, Object> resourceProviderProperties) Create a privateJDBCConnectionProviderusing an existingDriver. This call may fail with aTransactionExceptionif 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 theDriverin order to create aConnectionresourceProviderProperties- Configuration properties to pass to the JDBC Resource Provider runtime- Returns:
- A
JDBCConnectionProviderthat can be used in transactions
-
getProviderFor
JDBCConnectionProvider getProviderFor(XADataSource ds, Map<String, Object> resourceProviderProperties) Create a privateJDBCConnectionProviderusing an existingXADataSource. This call may fail with aTransactionExceptionif 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
JDBCConnectionProviderthat can be used in transactions
-
releaseProvider
Release aJDBCConnectionProviderinstance 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
JDBCConnectionProviderinstances created by this factory service are implicitly released when the factory service is released by this bundle.- Parameters:
provider-- Throws:
IllegalArgumentException- if the supplied resource was not created by this factory service instance.
-