public final class ResourceRegistrar extends Object
XAResourceProducers. All resources must be registered in the ResourceRegistrar
before they can be used by the transaction manager.
Note: The implementation is based on a thread safe, read-optimized list (copy-on-write) assuming that the number of registered resources is around 1 to 16 entries and does not change often. If this assumption is not-true it may be required to re-implement this with a ConcurrentMap instead.
| Modifier and Type | Field and Description |
|---|---|
static Charset |
UNIQUE_NAME_CHARSET
Specifies the charset that unique names of resources must be encodable with to be storeable in a TX journal.
|
| Modifier and Type | Method and Description |
|---|---|
static XAResourceHolder |
findXAResourceHolder(XAResource xaResource)
Find in the registered
XAResourceProducers the XAResourceHolder from which the specified XAResource comes from. |
static XAResourceProducer |
get(String uniqueName)
Get a registered
XAResourceProducer. |
static Set<String> |
getResourcesUniqueNames()
Get all
XAResourceProducers unique names. |
static void |
register(XAResourceProducer producer)
Register a
XAResourceProducer. |
static void |
unregister(XAResourceProducer producer)
Unregister a previously registered
XAResourceProducer. |
public static final Charset UNIQUE_NAME_CHARSET
public static XAResourceProducer get(String uniqueName)
XAResourceProducer.uniqueName - the name of the recoverable resource producer.XAResourceProducer or null if there was none registered under that name.public static Set<String> getResourcesUniqueNames()
XAResourceProducers unique names.XAResourceProducers unique names.public static void register(XAResourceProducer producer) throws RecoveryException
XAResourceProducer. If registration happens after the transaction manager started, incremental
recovery is run on that resource.producer - the XAResourceProducer.RecoveryException - When an error happens during recovery.public static void unregister(XAResourceProducer producer)
XAResourceProducer.producer - the XAResourceProducer.public static XAResourceHolder findXAResourceHolder(XAResource xaResource)
XAResourceProducers the XAResourceHolder from which the specified XAResource comes from.xaResource - the XAResource to look forXAResourceHolder or null if it cannot be found.Copyright © 2006-2016 Bitronix Software. All Rights Reserved.