bitronix.tm.resource
Class ResourceRegistrar

java.lang.Object
  extended by bitronix.tm.resource.ResourceRegistrar

public class ResourceRegistrar
extends Object

Collection of initialized XAResourceProducers. All resources must be registered in the ResourceRegistrar before they can be used by the transaction manager.

Author:
lorban

Constructor Summary
ResourceRegistrar()
           
 
Method Summary
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 getResourcesUniqueNames()
          Get all XAResourceProducers unique names.
static void register(XAResourceProducer producer)
          Register a XAResourceProducer.
static void unregister(XAResourceProducer producer)
          Unregister a previously registered XAResourceProducer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceRegistrar

public ResourceRegistrar()
Method Detail

get

public static XAResourceProducer get(String uniqueName)
Get a registered XAResourceProducer.

Parameters:
uniqueName - the name of the recoverable resource producer.
Returns:
the XAResourceProducer or null if there was none registered under that name.

getResourcesUniqueNames

public static Set getResourcesUniqueNames()
Get all XAResourceProducers unique names.

Returns:
a Set containing all XAResourceProducers unique names.

register

public static void register(XAResourceProducer producer)
                     throws RecoveryException
Register a XAResourceProducer. If registration happens after the transaction manager started, incremental recovery is run on that resource.

Parameters:
producer - the XAResourceProducer.
Throws:
RecoveryException - when an error happens during recovery.

unregister

public static void unregister(XAResourceProducer producer)
Unregister a previously registered XAResourceProducer.

Parameters:
producer - the XAResourceProducer.

findXAResourceHolder

public static XAResourceHolder findXAResourceHolder(XAResource xaResource)
Find in the registered XAResourceProducers the XAResourceHolder from which the specified XAResource comes from.

Parameters:
xaResource - the XAResource to look for
Returns:
the associated XAResourceHolder or null if it cannot be found.


Copyright © 2006-2011 Bitronix Software. All Rights Reserved.