com.atomikos.icatch.system
Class Configuration

java.lang.Object
  extended by com.atomikos.icatch.system.Configuration

public final class Configuration
extends Object

Configuration is a facade for the icatch transaction management facilities. Allows the application server code to find the transaction manager, even if the actual implementation varies over time.


Method Summary
static void addLogAdministrator(LogAdministrator admin)
          Add a log administrator.
static void addResource(RecoverableResource resource)
          Add a resource to the transaction manager domain.
static void addShutdownHook(Thread hook)
          Adds a shutdown hook to the configuration.
static void addTSListener(TSListener l)
          Add a transaction service listener.
static CompositeTransactionManager getCompositeTransactionManager()
          Get the composite transaction manager.
static ExportingTransactionManager getExportingTransactionManager()
          Get the exporting transaction manager.
static ImportingTransactionManager getImportingTransactionManager()
          Get the importing transaction manager.
static Enumeration getLogAdministrators()
          Get all registered logadministrators.
static RecoverableResource getResource(String name)
          Get the resource with the given name.
static Enumeration getResources()
          Get all resources added so far, in the order that they were added.
static TransactionService getTransactionService()
          Retrieves the transaction service being used.
static void installCompositeTransactionManager(CompositeTransactionManager compositeTransactionManager)
          Installs a composite transaction manager as a Singleton.
static void installExportingTransactionManager(ExportingTransactionManager exportingTransactionManager)
          Installs an exporting transaction manager as a Singleton.
static void installImportingTransactionManager(ImportingTransactionManager importingTransactionManager)
          Installs an importing transaction manager as a Singleton.
static void installLogControl(LogControl control)
          Installs the log control interface to use.
static void installRecoveryService(RecoveryService service)
          Installs a recovery service as a Singleton.
static void installTransactionService(TransactionService service)
          Installs the transaction service in use.
static void removeLogAdministrator(LogAdministrator admin)
          Remove a log administrator.
static RecoverableResource removeResource(String name)
          Removes a resource from the config.
static void removeShutdownHooks()
          Removes all shutdown hooks from the system.
static void removeTSListener(TSListener l)
          Remove a transaction service listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

installTransactionService

public static void installTransactionService(TransactionService service)
Installs the transaction service in use.

Parameters:
service - The service.

addShutdownHook

public static void addShutdownHook(Thread hook)
Adds a shutdown hook to the configuration. Shutdown hooks are managed here, since regular shutdown of the transaction core should remove hooks (cf case 21519).

Parameters:
hook -

removeShutdownHooks

public static void removeShutdownHooks()
Removes all shutdown hooks from the system. This method should be called on shutdown of the core.


getTransactionService

public static TransactionService getTransactionService()
Retrieves the transaction service being used.

Returns:
TransactionService The transaction service.

addTSListener

public static void addTSListener(TSListener l)
Add a transaction service listener.

Parameters:
l - The listener.

removeTSListener

public static void removeTSListener(TSListener l)
Remove a transaction service listener.

Parameters:
l - The listener.

installCompositeTransactionManager

public static void installCompositeTransactionManager(CompositeTransactionManager compositeTransactionManager)
Installs a composite transaction manager as a Singleton.

Parameters:
compositeTransactionManager - The instance to install.

installRecoveryService

public static void installRecoveryService(RecoveryService service)
Installs a recovery service as a Singleton.

Parameters:
service - The recovery service.

installLogControl

public static void installLogControl(LogControl control)
Installs the log control interface to use.

Parameters:
control -

installImportingTransactionManager

public static void installImportingTransactionManager(ImportingTransactionManager importingTransactionManager)
Installs an importing transaction manager as a Singleton.

Parameters:
importingTransactionManager - The instance to install.

installExportingTransactionManager

public static void installExportingTransactionManager(ExportingTransactionManager exportingTransactionManager)
Installs an exporting transaction manager as a Singleton.

Parameters:
exportingTransactionManager - The instance to install.

getCompositeTransactionManager

public static CompositeTransactionManager getCompositeTransactionManager()
Get the composite transaction manager.

Returns:
CompositeTransactionManager The instance, or null if none.

getImportingTransactionManager

public static ImportingTransactionManager getImportingTransactionManager()
Get the importing transaction manager.

Returns:
ImportingTransactionManager The instance, or null if none.

getExportingTransactionManager

public static ExportingTransactionManager getExportingTransactionManager()
Get the exporting transaction manager.

Returns:
ExportingTransactionManager The instance, or null if none.

addResource

public static void addResource(RecoverableResource resource)
                        throws IllegalStateException
Add a resource to the transaction manager domain. Should be called for all resources that have to be recovered, BEFORE initializing the transaction manager! The purpose of registering resources is mainly to be able the recovery the ResourceTransaction context for each prepared ResourceTransction. This is needed for those ResourceTransaction instances that do not encapsulate the full state themselves, as in the XAResource case.

Parameters:
resource - The resource to add.
Throws:
IllegalStateException - If the name of the resource is already in use.

addLogAdministrator

public static void addLogAdministrator(LogAdministrator admin)
Add a log administrator.

Parameters:
admin -

removeLogAdministrator

public static void removeLogAdministrator(LogAdministrator admin)
Remove a log administrator.

Parameters:
admin -

getLogAdministrators

public static Enumeration getLogAdministrators()
Get all registered logadministrators.

Returns:
Enumeration The logadministrators.

removeResource

public static RecoverableResource removeResource(String name)
Removes a resource from the config.

Parameters:
name - The resource's name.
Returns:
RecoverableResource The removed object.

getResource

public static RecoverableResource getResource(String name)
Get the resource with the given name.

Parameters:
name - The name to find.
Returns:
RecoverableResource The resource.

getResources

public static Enumeration getResources()
Get all resources added so far, in the order that they were added.

Returns:
Enumeration The resources.


Copyright © 2012. All Rights Reserved.