org.castor.transactionmanager
Class TransactionManagerRegistry

java.lang.Object
  extended by org.castor.transactionmanager.TransactionManagerRegistry

public final class TransactionManagerRegistry
extends java.lang.Object

Registry for TransactionManager instances obtained by their name.

Since:
1.0
Version:
$Revision: 8104 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
Author:
Ralf Joachim

Constructor Summary
TransactionManagerRegistry(AbstractProperties properties)
          Construct an instance of TransactionManagerRegistry that uses given LocalConfiguration to get required configuration properties.
 
Method Summary
 void deregisterTransactionManager(java.lang.String managerName)
          Deregister TransactionManager with given name.
 javax.transaction.TransactionManager getTransactionManager(java.lang.String managerName)
          Get the TransactionManager with given name.
 java.lang.String[] getTransactionManagerNames()
          Returns the names of all the registered TransactionManager's.
 void registerTransactionManager(java.lang.String managerName, java.lang.String factoryName, java.util.Properties properties)
          Register TransactionManager with given name.
 void registerTransactionManager(java.lang.String managerName, javax.transaction.TransactionManager managerInstance)
          Register given TransactionManager with given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionManagerRegistry

public TransactionManagerRegistry(AbstractProperties properties)
Construct an instance of TransactionManagerRegistry that uses given LocalConfiguration to get required configuration properties.

Parameters:
properties - The properties.
Method Detail

registerTransactionManager

public void registerTransactionManager(java.lang.String managerName,
                                       java.lang.String factoryName,
                                       java.util.Properties properties)
                                throws TransactionManagerAcquireException
Register TransactionManager with given name. The method requires the name of the TransactionManagerFactory and properties to initialize the manager to be passed as parameters. Depending on the value of configuration property org.castor.jdo.TransactionManagerInitializeAtRegistration the manager will be initialized at registration or lazily when requested.

Parameters:
managerName - The name of the TransactionManager to register.
factoryName - The name of the TransactionManagerFactory used to get the factory from TransactionManagerFactoryRegistry.
properties - The properties passed to the TransactionManager at initialization.
Throws:
TransactionManagerAcquireException - If a TransactionManager with the same name has already been registered or if any failure occured at initialization of the TransactionManager.

registerTransactionManager

public void registerTransactionManager(java.lang.String managerName,
                                       javax.transaction.TransactionManager managerInstance)
                                throws TransactionManagerAcquireException
Register given TransactionManager with given name.

Parameters:
managerName - The name of the TransactionManager to register.
managerInstance - The TransactionManager instance.
Throws:
TransactionManagerAcquireException - If a TransactionManager with the same name has already been registered.

deregisterTransactionManager

public void deregisterTransactionManager(java.lang.String managerName)
Deregister TransactionManager with given name.

Parameters:
managerName - The name of the TransactionManager to deregister.

getTransactionManagerNames

public java.lang.String[] getTransactionManagerNames()
Returns the names of all the registered TransactionManager's.

Returns:
Names of TransactionManager's.

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager(java.lang.String managerName)
                                                           throws TransactionManagerAcquireException
Get the TransactionManager with given name.

Parameters:
managerName - The name of the TransactionManager to return.
Returns:
The TransactionManager.
Throws:
TransactionManagerAcquireException - If a TransactionManager with name has not been registered or if any failure occured at initialization of the TransactionManager.


Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com