public class LookupTransactionManagerProvider extends java.lang.Object implements TransactionManagerProvider
TransactionManagerProvider
implementation that resolves the TransactionManagerWrapper
through the
lookup class
provided through its LookupTransactionManagerProviderConfiguration
.
The lifecycle this implementation will honour is as follows:
start
the service will ask the lookup instance for a TransactionManagerWrapper
which it will then cache and serve to service users.stop
the service will forget about the known TransactionManagerWrapper
start
, the service will ask the lookup instance for a new
TransactionManagerWrapper
TransactionManagerWrapper
unless it can be considered a singleton.Constructor and Description |
---|
LookupTransactionManagerProvider(LookupTransactionManagerProviderConfiguration config)
Creates a new instance with the provided configuration.
|
Modifier and Type | Method and Description |
---|---|
TransactionManagerWrapper |
getTransactionManagerWrapper()
Return an instance of
TransactionManagerWrapper . |
void |
start(ServiceProvider<Service> serviceProvider)
Start this service using the provided configuration and
ServiceProvider . |
void |
stop()
Stops this service.
|
public LookupTransactionManagerProvider(LookupTransactionManagerProviderConfiguration config)
config
- the service creation configurationjava.lang.NullPointerException
- if the config is null
public TransactionManagerWrapper getTransactionManagerWrapper()
TransactionManagerWrapper
.getTransactionManagerWrapper
in interface TransactionManagerProvider
TransactionManagerWrapper
.public void start(ServiceProvider<Service> serviceProvider)
ServiceProvider
.
The service provider allows a service to retrieve and use other services.
A Service
retrieved at this stage may not yet be started. The recommended usage pattern therefore, is to keep a
reference to the dependent Service
but use it only when specific methods are invoked on subtypes.