Top Description Fields Methods
org.osgi.service.transaction.control.jdbc

public Interface JDBCConnectionProviderFactory

Annotations
@ProviderType
Imports
java.sql.Connection, .Driver, java.util.Map, .Properties, javax.sql.DataSource, .XADataSource, org.osgi.annotation.versioning.ProviderType, org.osgi.service.jdbc.DataSourceFactory, org.osgi.service.transaction.control.TransactionException

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

Modifier and TypeField and Description
public static final String
CONNECTION_LIFETIME

The property used to set the maximum amount of time that connections in the pool should remain open

public static final String
CONNECTION_POOLING_ENABLED

The property used to determine whether connection pooling is enabled for this resource provider

public static final String
CONNECTION_TIMEOUT

The property used to set the maximum amount of time that the pool should wait for a connection

public static final String
IDLE_TIMEOUT

The property used to set the maximum amount of time that connections in the pool should remain idle before being closed

public static final String
LOCAL_ENLISTMENT_ENABLED

The property used to determine whether local enlistment is enabled for this resource provider

public static final String
MAX_CONNECTIONS

The property used to set the maximum number of connections that should be held in the pool

public static final String
MIN_CONNECTIONS

The property used to set the minimum number of connections that should be held in the pool

public static final String
OSGI_RECOVERY_IDENTIFIER

The property used to set the recovery identifier that should be used by this resource

public static final String
USE_DRIVER

The property used to set the maximum number of connections that should be held in the pool

public static final String
XA_ENLISTMENT_ENABLED

The property used to determine whether XA enlistment is enabled for this resource provider

public static final String
XA_RECOVERY_ENABLED

The property used to determine whether XA recovery is enabled for this resource provider

Method Summary

Modifier and TypeMethod and Description
public JDBCConnectionProvider

Returns:

A JDBCConnectionProvider that can be used in transactions
getProviderFor
(DataSourceFactory dsf, Properties
The properties to pass to the DataSourceFactory in order to create the underlying DataSource
jdbcProperties
,
Map<String, Object>
Configuration properties to pass to the JDBC Resource Provider runtime
resourceProviderProperties
)

Create a private JDBCConnectionProvider using a DataSourceFactory.

public JDBCConnectionProvider

Returns:

A JDBCConnectionProvider that can be used in transactions
getProviderFor
(DataSource ds, Map<String, Object>
Configuration properties to pass to the JDBC Resource Provider runtime
resourceProviderProperties
)

Create a private JDBCConnectionProvider using an existing DataSource.

public JDBCConnectionProvider

Returns:

A JDBCConnectionProvider that can be used in transactions
getProviderFor
(Driver driver, Properties
The properties to pass to the Driver in order to create a Connection
jdbcProperties
,
Map<String, Object>
Configuration properties to pass to the JDBC Resource Provider runtime
resourceProviderProperties
)

Create a private JDBCConnectionProvider using an existing Driver.

public JDBCConnectionProvider

Returns:

A JDBCConnectionProvider that can be used in transactions
getProviderFor
(XADataSource ds, Map<String, Object>
Configuration properties to pass to the JDBC Resource Provider runtime
resourceProviderProperties
)

Create a private JDBCConnectionProvider using an existing XADataSource.

public void
releaseProvider(JDBCConnectionProvider provider)

Release a JDBCConnectionProvider instance that has been created by this factory.

Field Detail

CONNECTION_LIFETIMEback to summary
public static final String CONNECTION_LIFETIME

The property used to set the maximum amount of time that connections in the pool should remain open

CONNECTION_POOLING_ENABLEDback to summary
public static final String CONNECTION_POOLING_ENABLED

The property used to determine whether connection pooling is enabled for this resource provider

CONNECTION_TIMEOUTback to summary
public static final String CONNECTION_TIMEOUT

The property used to set the maximum amount of time that the pool should wait for a connection

IDLE_TIMEOUTback to summary
public static final String IDLE_TIMEOUT

The property used to set the maximum amount of time that connections in the pool should remain idle before being closed

LOCAL_ENLISTMENT_ENABLEDback to summary
public static final String LOCAL_ENLISTMENT_ENABLED

The property used to determine whether local enlistment is enabled for this resource provider

MAX_CONNECTIONSback to summary
public static final String MAX_CONNECTIONS

The property used to set the maximum number of connections that should be held in the pool

MIN_CONNECTIONSback to summary
public static final String MIN_CONNECTIONS

The property used to set the minimum number of connections that should be held in the pool

OSGI_RECOVERY_IDENTIFIERback to summary
public static final String OSGI_RECOVERY_IDENTIFIER

The property used to set the recovery identifier that should be used by this resource

USE_DRIVERback to summary
public static final String USE_DRIVER

The property used to set the maximum number of connections that should be held in the pool

XA_ENLISTMENT_ENABLEDback to summary
public static final String XA_ENLISTMENT_ENABLED

The property used to determine whether XA enlistment is enabled for this resource provider

XA_RECOVERY_ENABLEDback to summary
public static final String XA_RECOVERY_ENABLED

The property used to determine whether XA recovery is enabled for this resource provider

Method Detail

getProviderForback to summary
public JDBCConnectionProvider getProviderFor(DataSourceFactory dsf, Properties jdbcProperties, Map<String, Object> resourceProviderProperties)

Create a private JDBCConnectionProvider using a DataSourceFactory. This call may fail with a TransactionException 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
jdbcProperties:Properties

The properties to pass to the DataSourceFactory in order to create the underlying DataSource

resourceProviderProperties:Map<String, Object>

Configuration properties to pass to the JDBC Resource Provider runtime

Returns:JDBCConnectionProvider

A JDBCConnectionProvider that can be used in transactions

getProviderForback to summary
public JDBCConnectionProvider getProviderFor(DataSource ds, Map<String, Object> resourceProviderProperties)

Create a private JDBCConnectionProvider using an existing DataSource. This call may fail with a TransactionException 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
resourceProviderProperties:Map<String, Object>

Configuration properties to pass to the JDBC Resource Provider runtime

Returns:JDBCConnectionProvider

A JDBCConnectionProvider that can be used in transactions

getProviderForback to summary
public JDBCConnectionProvider getProviderFor(Driver driver, Properties jdbcProperties, Map<String, Object> resourceProviderProperties)

Create a private JDBCConnectionProvider using an existing Driver. This call may fail with a TransactionException 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
jdbcProperties:Properties

The properties to pass to the Driver in order to create a Connection

resourceProviderProperties:Map<String, Object>

Configuration properties to pass to the JDBC Resource Provider runtime

Returns:JDBCConnectionProvider

A JDBCConnectionProvider that can be used in transactions

getProviderForback to summary
public JDBCConnectionProvider getProviderFor(XADataSource ds, Map<String, Object> resourceProviderProperties)

Create a private JDBCConnectionProvider using an existing XADataSource. This call may fail with a TransactionException 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
resourceProviderProperties:Map<String, Object>

Configuration properties to pass to the JDBC Resource Provider runtime

Returns:JDBCConnectionProvider

A JDBCConnectionProvider that can be used in transactions

releaseProviderback to summary
public void releaseProvider(JDBCConnectionProvider provider)

Release a 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.

Exceptions
IllegalArgumentException:
if the supplied resource was not created by this factory service instance.