com.atomikos.icatch.system
Class Configuration

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

public final class Configuration
extends Object

Copyright © 2001, Atomikos. All rights reserved. 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.


Field Summary
static String VERSION
          The version number of this release.
 
Method Summary
static void addConsole(Console console)
          Add a console for the configuration.
static void addLogAdministrator(LogAdministrator admin)
          Add a log administrator.
static void addResource(RecoverableResource resource)
          Add a resource to the transaction manager domain.
static void addTSListener(TSListener l)
          Add a transaction service listener.
static CompositeTransactionManager getCompositeTransactionManager()
          Get the composite transaction manager.
static Console getConsole()
          Get the console for the configuration.
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 logDebug(String msg)
          Write a debug message to the log.
static void logDebug(String msg, Exception error)
          Write a debug msg and error to the log.
static void logInfo(String msg)
          Write a log entry for the INFO level.
static void logInfo(String msg, Exception error)
          Write an info message and error to the log.
static void logWarning(String msg)
          Write a message to the installed console.
static void logWarning(String msg, Exception error)
          Write a message and associated exception to the console.
static void removeConsoles()
          Remove all consoles added so far.
static void removeLogAdministrator(LogAdministrator admin)
          Remove a log administrator.
static RecoverableResource removeResource(String name)
          Removes a resource from the config.
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
 

Field Detail

VERSION

public static final String VERSION
The version number of this release. The same version number is used for all products derived from the same icatch core.

See Also:
Constant Field Values
Method Detail

installTransactionService

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

Parameters:
service - The service.

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.

addConsole

public static void addConsole(Console console)
Add a console for the configuration. More than one console can be set; if so then all of them will receive the output.

Parameters:
console - The console to add.

getConsole

public static Console getConsole()
Get the console for the configuration. If more than one console was installed, then the returned console will cascade to all of them.

Returns:
Console The console for the configuration.

removeConsoles

public static void removeConsoles()
Remove all consoles added so far. Needed for restart within same VM.


logWarning

public static void logWarning(String msg)
Write a message to the installed console.

Parameters:
msg - The message to write.

logWarning

public static void logWarning(String msg,
                              Exception error)
Write a message and associated exception to the console.

Parameters:
msg -
error -

logInfo

public static void logInfo(String msg)
Write a log entry for the INFO level.

Parameters:
msg -

logInfo

public static void logInfo(String msg,
                           Exception error)
Write an info message and error to the log.

Parameters:
msg -
error -

logDebug

public static void logDebug(String msg)
Write a debug message to the log.

Parameters:
msg -

logDebug

public static void logDebug(String msg,
                            Exception error)
Write a debug msg and error to the log.

Parameters:
msg -
error -