|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.Configuration
public class Configuration
Configuration repository of the transaction manager. You can set configurable values either via the properties file
or by setting properties of the Configuration
object.
Once the transaction manager has started it is not possible to change the configuration: all calls to setters will
throw a IllegalStateException
.
The configuration filename must be specified with the bitronix.tm.configuration
system property.
The default settings are good enough for running in a test environment but certainly not for production usage. Also, all properties are reset to their default value after the transaction manager has shut down.
All those properties can refer to other defined ones or to system properties using the Ant notation:
${some.property.name}
.
Constructor Summary | |
---|---|
protected |
Configuration()
|
Method Summary | |
---|---|
byte[] |
buildServerIdArray()
Build the server ID byte array that will be prepended in generated UIDs. |
int |
getBackgroundRecoveryInterval()
Deprecated. superceded by #getBackgroundRecoveryIntervalSeconds(). |
int |
getBackgroundRecoveryIntervalSeconds()
Interval in seconds at which to run the recovery process in the background. |
int |
getDefaultTransactionTimeout()
Default transaction timeout in seconds. |
String |
getExceptionAnalyzer()
Get the exception analyzer implementation. |
int |
getGracefulShutdownInterval()
Maximum amount of seconds the TM will wait for transactions to get done before aborting them at shutdown time. |
String |
getJndiTransactionSynchronizationRegistryName()
Get the name the TransactionSynchronizationRegistry should be bound under in the
BitronixContext . |
String |
getJndiUserTransactionName()
Get the name the UserTransaction should be bound under in the
BitronixContext . |
String |
getJournal()
Get the journal implementation. |
String |
getLogPart1Filename()
Get the journal fragment file 1 name. |
String |
getLogPart2Filename()
Get the journal fragment file 2 name. |
int |
getMaxLogSizeInMb()
Maximum size in megabytes of the journal fragments. |
String |
getResourceConfigurationFilename()
ResourceLoader configuration file name. |
String |
getServerId()
ASCII ID that must uniquely identify this TM instance. |
boolean |
isAllowMultipleLrc()
Should the transaction manager allow enlistment of multiple LRC resources in a single transaction? This is highly unsafe but could be useful for testing. |
boolean |
isAsynchronous2Pc()
Should two phase commit be executed asynchronously? Asynchronous two phase commit can improve performance when there are many resources enlisted in transactions but is more CPU intensive due to the dynamic thread spawning requirements. |
boolean |
isCurrentNodeOnlyRecovery()
Should the recovery process not recover XIDs generated with another JVM unique ID? Setting this property to true is useful in clustered environments where multiple instances of BTM are running on different nodes. |
boolean |
isDebugZeroResourceTransaction()
Should creation and commit call stacks of transactions executed without a single enlisted tracked and logged or not? |
boolean |
isDisableJmx()
Should JMX Mbeans not be registered even if a JMX MBean server is detected? |
boolean |
isFilterLogStatus()
Should only mandatory logs be written? Enabling this parameter lowers space usage of the fragments but makes debugging more complex. |
boolean |
isForceBatchingEnabled()
Are disk forces batched? Disabling batching can seriously lower the transaction manager's throughput. |
boolean |
isForcedWriteEnabled()
Are logs forced to disk? Do not set to false in production since without disk force, integrity is not guaranteed. |
boolean |
isSkipCorruptedLogs()
Should corrupted logs be skipped? |
boolean |
isWarnAboutZeroResourceTransaction()
Should transactions executed without a single enlisted resource result in a warning or not? Most of the time transactions executed with no enlisted resource reflect a bug or a mis-configuration somewhere. |
Configuration |
setAllowMultipleLrc(boolean allowMultipleLrc)
Set to true if the transaction manager should allow enlistment of multiple LRC resources in a single transaction. |
Configuration |
setAsynchronous2Pc(boolean asynchronous2Pc)
Set if two phase commit should be executed asynchronously. |
Configuration |
setBackgroundRecoveryInterval(int backgroundRecoveryInterval)
Deprecated. superceded by #setBackgroundRecoveryIntervalSeconds(int). |
Configuration |
setBackgroundRecoveryIntervalSeconds(int backgroundRecoveryIntervalSeconds)
Set the interval in seconds at which to run the recovery process in the background. |
Configuration |
setCurrentNodeOnlyRecovery(boolean currentNodeOnlyRecovery)
Set to true if recovery should filter out recovered XIDs that do not contain this JVM's unique ID, false otherwise. |
Configuration |
setDebugZeroResourceTransaction(boolean debugZeroResourceTransaction)
Set if creation and commit call stacks of transactions executed without a single enlisted resource should be tracked and logged. |
Configuration |
setDefaultTransactionTimeout(int defaultTransactionTimeout)
Set the default transaction timeout in seconds. |
Configuration |
setDisableJmx(boolean disableJmx)
Set to true if JMX Mbeans should not be registered even if a JMX MBean server is detected. |
Configuration |
setExceptionAnalyzer(String exceptionAnalyzer)
Set the exception analyzer implementation. |
Configuration |
setFilterLogStatus(boolean filterLogStatus)
Set if only mandatory logs should be written. |
Configuration |
setForceBatchingEnabled(boolean forceBatchingEnabled)
Set if disk forces are batched. |
Configuration |
setForcedWriteEnabled(boolean forcedWriteEnabled)
Set if logs are forced to disk. |
Configuration |
setGracefulShutdownInterval(int gracefulShutdownInterval)
Set the maximum amount of seconds the TM will wait for transactions to get done before aborting them at shutdown time. |
Configuration |
setJndiTransactionSynchronizationRegistryName(String jndiTransactionSynchronizationRegistryName)
Set the name the TransactionSynchronizationRegistry should be bound under in the
BitronixContext . |
Configuration |
setJndiUserTransactionName(String jndiUserTransactionName)
Set the name the UserTransaction should be bound under in the
BitronixContext . |
Configuration |
setJournal(String journal)
Set the journal name. |
Configuration |
setLogPart1Filename(String logPart1Filename)
Set the journal fragment file 1 name. |
Configuration |
setLogPart2Filename(String logPart2Filename)
Set the journal fragment file 2 name. |
Configuration |
setMaxLogSizeInMb(int maxLogSizeInMb)
Set the Maximum size in megabytes of the journal fragments. |
Configuration |
setResourceConfigurationFilename(String resourceConfigurationFilename)
Set the ResourceLoader configuration file name. |
Configuration |
setServerId(String serverId)
Set the ASCII ID that must uniquely identify this TM instance. |
Configuration |
setSkipCorruptedLogs(boolean skipCorruptedLogs)
Set if corrupted logs should be skipped. |
Configuration |
setWarnAboutZeroResourceTransaction(boolean warnAboutZeroResourceTransaction)
Set if transactions executed without a single enlisted resource should result in a warning or not. |
void |
shutdown()
Shutdown the service and free all held resources. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Configuration()
Method Detail |
---|
public String getServerId()
Property name:
bitronix.tm.serverId - (defaults to server's IP address but that's unsafe for
production use)
public Configuration setServerId(String serverId)
serverId
- the unique ID of this TM instance.
getServerId()
public String getLogPart1Filename()
Property name:
bitronix.tm.journal.disk.logPart1Filename - (defaults to btm1.tlog)
public Configuration setLogPart1Filename(String logPart1Filename)
logPart1Filename
- the journal fragment file 1 name.
getLogPart1Filename()
public String getLogPart2Filename()
Property name:
bitronix.tm.journal.disk.logPart2Filename - (defaults to btm2.tlog)
public Configuration setLogPart2Filename(String logPart2Filename)
logPart2Filename
- the journal fragment file 2 name.
getLogPart2Filename()
public boolean isForcedWriteEnabled()
Property name:
bitronix.tm.journal.disk.forcedWriteEnabled - (defaults to true)
public Configuration setForcedWriteEnabled(boolean forcedWriteEnabled)
forcedWriteEnabled
- true if logs should be forced to disk, false otherwise.
isForcedWriteEnabled()
public boolean isForceBatchingEnabled()
Property name:
bitronix.tm.journal.disk.forceBatchingEnabled - (defaults to true)
public Configuration setForceBatchingEnabled(boolean forceBatchingEnabled)
forceBatchingEnabled
- true if disk forces are batched, false otherwise.
isForceBatchingEnabled()
public int getMaxLogSizeInMb()
Property name:
bitronix.tm.journal.disk.maxLogSize - (defaults to 2)
public Configuration setMaxLogSizeInMb(int maxLogSizeInMb)
maxLogSizeInMb
- the maximum size in megabytes of the journal fragments.
getMaxLogSizeInMb()
public boolean isFilterLogStatus()
Property name:
bitronix.tm.journal.disk.filterLogStatus - (defaults to false)
public Configuration setFilterLogStatus(boolean filterLogStatus)
filterLogStatus
- true if only mandatory logs should be written.
isFilterLogStatus()
public boolean isSkipCorruptedLogs()
Property name:
bitronix.tm.journal.disk.skipCorruptedLogs - (defaults to false)
public Configuration setSkipCorruptedLogs(boolean skipCorruptedLogs)
skipCorruptedLogs
- true if corrupted logs should be skipped.
isSkipCorruptedLogs()
public boolean isAsynchronous2Pc()
Property name:
bitronix.tm.2pc.async - (defaults to false)
public Configuration setAsynchronous2Pc(boolean asynchronous2Pc)
asynchronous2Pc
- true if two phase commit should be executed asynchronously.
isAsynchronous2Pc()
public boolean isWarnAboutZeroResourceTransaction()
Property name:
bitronix.tm.2pc.warnAboutZeroResourceTransactions - (defaults to true)
public Configuration setWarnAboutZeroResourceTransaction(boolean warnAboutZeroResourceTransaction)
warnAboutZeroResourceTransaction
- true if transactions executed without a single enlisted resource should
result in a warning.
isWarnAboutZeroResourceTransaction()
public boolean isDebugZeroResourceTransaction()
Property name:
bitronix.tm.2pc.debugZeroResourceTransactions - (defaults to false)
public Configuration setDebugZeroResourceTransaction(boolean debugZeroResourceTransaction)
debugZeroResourceTransaction
- true if the creation and commit call stacks of transaction executed without
a single enlisted resource should be tracked and logged.
isDebugZeroResourceTransaction()
,
isWarnAboutZeroResourceTransaction()
public int getDefaultTransactionTimeout()
Property name:
bitronix.tm.timer.defaultTransactionTimeout - (defaults to 60)
public Configuration setDefaultTransactionTimeout(int defaultTransactionTimeout)
defaultTransactionTimeout
- the default transaction timeout in seconds.
getDefaultTransactionTimeout()
public int getGracefulShutdownInterval()
Property name:
bitronix.tm.timer.gracefulShutdownInterval - (defaults to 60)
public Configuration setGracefulShutdownInterval(int gracefulShutdownInterval)
gracefulShutdownInterval
- the maximum amount of time in seconds.
getGracefulShutdownInterval()
public int getBackgroundRecoveryInterval()
Property name:
bitronix.tm.timer.backgroundRecoveryInterval - (defaults to 0)
public Configuration setBackgroundRecoveryInterval(int backgroundRecoveryInterval)
backgroundRecoveryInterval
- the interval in minutes.
getBackgroundRecoveryInterval()
public int getBackgroundRecoveryIntervalSeconds()
Property name:
bitronix.tm.timer.backgroundRecoveryIntervalSeconds - (defaults to 60)
public Configuration setBackgroundRecoveryIntervalSeconds(int backgroundRecoveryIntervalSeconds)
backgroundRecoveryIntervalSeconds
- the interval in minutes.
getBackgroundRecoveryIntervalSeconds()
public boolean isDisableJmx()
Property name:
bitronix.tm.disableJmx - (defaults to false)
public Configuration setDisableJmx(boolean disableJmx)
disableJmx
- true if JMX MBeans should never be registered.
isDisableJmx()
public String getJndiUserTransactionName()
UserTransaction
should be bound under in the
BitronixContext
.
UserTransaction
should
be bound under in the BitronixContext
.public Configuration setJndiUserTransactionName(String jndiUserTransactionName)
UserTransaction
should be bound under in the
BitronixContext
.
jndiUserTransactionName
- the name the UserTransaction
should
be bound under in the BitronixContext
.
getJndiUserTransactionName()
public String getJndiTransactionSynchronizationRegistryName()
TransactionSynchronizationRegistry
should be bound under in the
BitronixContext
.
TransactionSynchronizationRegistry
should
be bound under in the BitronixContext
.public Configuration setJndiTransactionSynchronizationRegistryName(String jndiTransactionSynchronizationRegistryName)
TransactionSynchronizationRegistry
should be bound under in the
BitronixContext
.
jndiTransactionSynchronizationRegistryName
- the name the TransactionSynchronizationRegistry
should
be bound under in the BitronixContext
.
getJndiUserTransactionName()
public String getJournal()
disk
, null
or a class name.
public Configuration setJournal(String journal)
disk
, null
or a class name.
journal
- the journal name.
getJournal()
public String getExceptionAnalyzer()
null
for the default one or a class name.
public Configuration setExceptionAnalyzer(String exceptionAnalyzer)
null
for the default one or a class name.
exceptionAnalyzer
- the exception analyzer name.
getExceptionAnalyzer()
public boolean isCurrentNodeOnlyRecovery()
contains the value used as the JVM unique ID.
public Configuration setCurrentNodeOnlyRecovery(boolean currentNodeOnlyRecovery)
currentNodeOnlyRecovery
- true if recovery should filter out recovered XIDs that do not contain this JVM's unique ID, false otherwise.
isCurrentNodeOnlyRecovery()
public boolean isAllowMultipleLrc()
public Configuration setAllowMultipleLrc(boolean allowMultipleLrc)
allowMultipleLrc
- true if the transaction manager should allow enlistment of multiple LRC resources in a single transaction, false otherwise.
public String getResourceConfigurationFilename()
ResourceLoader
configuration file name. ResourceLoader
will be disabled if this value is null.
Property name:
bitronix.tm.resource.configuration - (defaults to null)
public Configuration setResourceConfigurationFilename(String resourceConfigurationFilename)
ResourceLoader
configuration file name.
resourceConfigurationFilename
- the filename of the resources configuration file or null you do not want to
use the ResourceLoader
.
getResourceConfigurationFilename()
public byte[] buildServerIdArray()
public void shutdown()
Service
shutdown
in interface Service
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |