tyrex.tm.impl

Class DomainConfig

public final class DomainConfig extends Object

Domain configuration object read from the domain configuration file and used to construct a new transaction domain.

Version: $Revision: 1.9 $ $Date: 2002/04/17 00:53:22 $

Author: Assaf Arkin

Field Summary
static intDEFAULT_TIMEOUT
The default timeout for all transactions.
static intDEFAULT_WAIT_NEW
The default timeout waiting to begin a new transaction when maximum limit exceeded.
static intMAXIMUM_TIMEOUT
The maximum possible timeout for a transaction.
static intNO_LIMIT
Value indicating no limit on the maximum number of concurrent top-level transactions allowed.
Method Summary
TransactionDomaingetDomain()
Returns a transaction domain based on this configuration.
intgetMaximum()
Returns the maximum number of concurrent top-level transactions supported.
StringgetName()
Return the name of the transaction domain.
ResourcesgetResources()
Returns the resources list associated with this transaction domain.
intgetTimeout()
Returns the default transaction timeout in seconds.
intgetWaitNew()
Returns the time to wait for a new transaction when limit exceeded, specified in seconds.
voidsetMaximum(int maximum)
Sets the maximum number of concurrent top-level transactions supported.
voidsetName(String name)
Sets the name of the transaction domain.
voidsetResources(Resources resources)
Sets the resources list associated with this transaction domain.
voidsetTimeout(int timeout)
Returns the default transaction timeout in seconds.
voidsetWaitNew(int timeout)
Sets the time to wait for a new transaction when limit exceeded, specified in seconds.

Field Detail

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
The default timeout for all transactions. This value is used unless the transaction transaction manager has been requested to use a different value. The default value is 120 seconds.

DEFAULT_WAIT_NEW

public static final int DEFAULT_WAIT_NEW
The default timeout waiting to begin a new transaction when maximum limit exceeded. The default value is 5 seconds.

MAXIMUM_TIMEOUT

public static final int MAXIMUM_TIMEOUT
The maximum possible timeout for a transaction. This is ten minutes, specified as seconds.

NO_LIMIT

public static final int NO_LIMIT
Value indicating no limit on the maximum number of concurrent top-level transactions allowed. This value is zero.

Method Detail

getDomain

public TransactionDomain getDomain()
Returns a transaction domain based on this configuration. This method attempts to create a new transaction domain using the configuration. The same transaction domain will be returned if this method is called multiple times.

Returns: A transaction domain based on this configuration

Throws: DomainConfigurationException The transaction domain configuration is invalid

getMaximum

public int getMaximum()
Returns the maximum number of concurrent top-level transactions supported. The value NO_LIMIT indicates unlimited number of transactions.

Returns: The maximum number of concurrent top-level transactions

getName

public String getName()
Return the name of the transaction domain.

Returns: Name of transaction domain

getResources

public Resources getResources()
Returns the resources list associated with this transaction domain.

Returns: The resources list

getTimeout

public int getTimeout()
Returns the default transaction timeout in seconds. This value applies to all new transactions created in this domain, unless overridden by the transaction manager.

The actual value is kept in the range one to MAXIMUM_TIMEOUT. The value zero is understood to be the default value, or DEFAULT_TIMEOUT.

Returns: The default transaction timeout in seconds

getWaitNew

public int getWaitNew()
Returns the time to wait for a new transaction when limit exceeded, specified in seconds.

When the maximum number of concurrent transactions have exceeded, any attempt to create a new transaction will block until a new transaction can be created or this timeout has been reached.

Returns: The time to wait to begin a new transaction when limit exceeded, specified in seconds

setMaximum

public void setMaximum(int maximum)
Sets the maximum number of concurrent top-level transactions supported. The value NO_LIMIT indicates unlimited number of transactions.

Parameters: maximum The maximum number of concurrent top-level transactions

setName

public void setName(String name)
Sets the name of the transaction domain.

Parameters: name Name of transaction domain

setResources

public void setResources(Resources resources)
Sets the resources list associated with this transaction domain.

Parameters: resources The resources list

setTimeout

public void setTimeout(int timeout)
Returns the default transaction timeout in seconds. This value applies to all new transactions created in this domain, unless overridden by the transaction manager.

The actual value is kept in the range one to MAXIMUM_TIMEOUT. The value zero is understood to be the default value, or DEFAULT_TIMEOUT.

Parameters: timeout The default transaction timeout in seconds

setWaitNew

public void setWaitNew(int timeout)
Sets the time to wait for a new transaction when limit exceeded, specified in seconds.

When the maximum number of concurrent transactions have exceeded, any attempt to create a new transaction will block until a new transaction can be created or this timeout has been reached.

Parameters: timeout The time to wait to begin a new transaction when limit exceeded, specified in seconds

Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.