@ProviderType public interface JPAEntityManagerProviderFactory
This factory can be used if the JPAEntityManagerProvider
should not
be a public service, for example to protect a username/password.
Modifier and Type | Field and Description |
---|---|
static String |
CONNECTION_LIFETIME
The property used to set the maximum amount of time that connections in
the pool should remain open
|
static String |
CONNECTION_POOLING_ENABLED
The property used to determine whether connection pooling is enabled for
this resource provider
|
static String |
CONNECTION_TIMEOUT
The property used to set the maximum amount of time that the pool should
wait for a connection
|
static 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 String |
LOCAL_ENLISTMENT_ENABLED
The property used to determine whether local enlistment is enabled for
this resource provider
|
static String |
MAX_CONNECTIONS
The property used to set the maximum number of connections that should be
held in the pool
|
static String |
MIN_CONNECTIONS
The property used to set the minimum number of connections that should be
held in the pool
|
static String |
OSGI_RECOVERY_IDENTIFIER
The property used to set the recovery identifier that should be used by
this resource
|
static String |
PRE_ENLISTED_DB_CONNECTION
The property used to indicate that database connections will be
automatically enlisted in ongoing transactions without intervention from
the JPA resource provider
|
static String |
TRANSACTIONAL_DB_CONNECTION
The property used to provide a
JDBCConnectionProvider to the
resource provider. |
static String |
XA_ENLISTMENT_ENABLED
The property used to determine whether XA enlistment is enabled for this
resource provider
|
static String |
XA_RECOVERY_ENABLED
The property used to determine whether XA recovery is enabled for this
resource provider
|
Modifier and Type | Method and Description |
---|---|
JPAEntityManagerProvider |
getProviderFor(EntityManagerFactoryBuilder emfb,
Map<String,Object> jpaProperties,
Map<String,Object> resourceProviderProperties)
Create a private
JPAEntityManagerProvider using an
EntityManagerFactoryBuilder . |
JPAEntityManagerProvider |
getProviderFor(javax.persistence.EntityManagerFactory emf,
Map<String,Object> resourceProviderProperties)
Create a private
JPAEntityManagerProvider using an existing
EntityManagerFactory . |
void |
releaseProvider(JPAEntityManagerProvider provider)
Release a
JPAEntityManagerProvider instance that has been created
by this factory. |
static final String XA_ENLISTMENT_ENABLED
static final String LOCAL_ENLISTMENT_ENABLED
static final String XA_RECOVERY_ENABLED
static final String CONNECTION_POOLING_ENABLED
static final String CONNECTION_TIMEOUT
static final String IDLE_TIMEOUT
static final String CONNECTION_LIFETIME
static final String MIN_CONNECTIONS
static final String MAX_CONNECTIONS
static final String TRANSACTIONAL_DB_CONNECTION
JDBCConnectionProvider
to the
resource provider. This will be converted into a DataSource by the
factory, and passed to the EntityManagerFactoryBuilder
using the
javax.persistence.jtaDataSource propertystatic final String PRE_ENLISTED_DB_CONNECTION
static final String OSGI_RECOVERY_IDENTIFIER
JPAEntityManagerProvider getProviderFor(EntityManagerFactoryBuilder emfb, Map<String,Object> jpaProperties, Map<String,Object> resourceProviderProperties)
JPAEntityManagerProvider
using an
EntityManagerFactoryBuilder
. This call may fail with a
TransactionException
if the supplied configuration is invalid.
Examples of invalid configuration include:
If XA transactions are used then this factory will provide configuration to ensure that the JPA Provider can participate correctly in ongoing transactions.
emfb
- jpaProperties
- The properties to pass to the
EntityManagerFactoryBuilder
in order to create the
underlying EntityManagerFactory
and
EntityManager
instancesresourceProviderProperties
- Configuration properties to pass to the
JPA Resource Provider runtimeJPAEntityManagerProvider
that can be used in
transactionsJPAEntityManagerProvider getProviderFor(javax.persistence.EntityManagerFactory emf, Map<String,Object> resourceProviderProperties)
JPAEntityManagerProvider
using an existing
EntityManagerFactory
. This call may fail with a
TransactionException
if the supplied configuration is invalid.
Examples of invalid configuration include:
When using this method the client is responsible for all configuration of
the EntityManagerFactory
. This includes setting any relevant
integration plugins for ensuring that the JPA provider can participate in
the ongoing transaction context.
emf
- resourceProviderProperties
- Configuration properties to pass to the
JDBC Resource Provider runtimeJPAEntityManagerProvider
that can be used in
transactionsvoid releaseProvider(JPAEntityManagerProvider provider)
JPAEntityManagerProvider
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 JPAEntityManagerProvider
instances created by this
factory service are implicitly released when the factory service is
released by this bundle.
provider
- IllegalArgumentException
- if the supplied resource was not created
by this factory service instance.Copyright © Contributors to the Eclipse Foundation Licensed under the Eclipse Foundation Specification License – v1.0