tyrex.resource

Class ReuseOptions

public final class ReuseOptions extends Object

This class defines the reuse options.

Author: Riad Mohammed

Field Summary
static intREUSE_NO_TRANSACTION_OFF
The reuse option that states if the resources are enlisted in a transaction then resources are reused after the transaction commits or rolls back.
static StringREUSE_NO_TRANSACTION_OFF_NAME
The name of the REUSE_NO_TRANSACTION_OFF option.
static intREUSE_OFF
The reuse option that states the resources are not to be reused.
static StringREUSE_OFF_NAME
The name of the REUSE_OFF option.
static intREUSE_ON
The reuse option that states the resources are to be reused after they are currently used.
static StringREUSE_ON_NAME
The name of the REUSE_ON option.
static intREUSE_TRANSACTION
The reuse option that states the if resources are enlisted in a transaction then resources can be reused only after the transaction commits or rolls back.
static StringREUSE_TRANSACTION_NAME
The name of the REUSE_TRANSACTION option.
static intREUSE_TRANSACTION_OFF
The reuse option that states if the resources are enlisted in a transaction then resources are destroyed after the transaction commits or rolls back.
static StringREUSE_TRANSACTION_OFF_NAME
The name of the REUSE_TRANSACTION_OFF option.
Method Summary
static intfromString(String string)
Convert the specified string to the reuse option.
static booleanisValid(int option)
Return true if the reuse option is valid.
static StringtoString(int option)
Convert the specified option to the reuse option name.
static voidvalidate(int option)
Validate that the option is recognized

Field Detail

REUSE_NO_TRANSACTION_OFF

public static final int REUSE_NO_TRANSACTION_OFF
The reuse option that states if the resources are enlisted in a transaction then resources are reused after the transaction commits or rolls back. Otherwise if the resources are not enlisted in a transaction then the resource is destroyed after the resource is used.

REUSE_NO_TRANSACTION_OFF_NAME

public static final String REUSE_NO_TRANSACTION_OFF_NAME
The name of the REUSE_NO_TRANSACTION_OFF option. The value is "no_transaction_off".

REUSE_OFF

public static final int REUSE_OFF
The reuse option that states the resources are not to be reused. If the resource is enlisted in a transaction then the resource is destroyed after the transaction commits or rolls back and the resource is finished being used. If the resource is not enlisted in a transaction then the resource is destroyed after it is used.

REUSE_OFF_NAME

public static final String REUSE_OFF_NAME
The name of the REUSE_OFF option. The value is "off".

REUSE_ON

public static final int REUSE_ON
The reuse option that states the resources are to be reused after they are currently used. The value is 0.

REUSE_ON_NAME

public static final String REUSE_ON_NAME
The name of the REUSE_ON option. The value is "on".

REUSE_TRANSACTION

public static final int REUSE_TRANSACTION
The reuse option that states the if resources are enlisted in a transaction then resources can be reused only after the transaction commits or rolls back. Otherwise if the resources are not enlisted in a transaction then the resource can be reused after it is used.

REUSE_TRANSACTION_NAME

public static final String REUSE_TRANSACTION_NAME
The name of the REUSE_TRANSACTION option. The value is "transaction".

REUSE_TRANSACTION_OFF

public static final int REUSE_TRANSACTION_OFF
The reuse option that states if the resources are enlisted in a transaction then resources are destroyed after the transaction commits or rolls back. Otherwise if the resources are not enlisted in a transaction then the resource can be reused after it is used.

REUSE_TRANSACTION_OFF_NAME

public static final String REUSE_TRANSACTION_OFF_NAME
The name of the REUSE_TRANSACTION_OFF option. The value is "transaction_off".

Method Detail

fromString

public static int fromString(String string)
Convert the specified string to the reuse option.

Parameters: string. One of REUSE_ON_NAME, REUSE_OFF_NAME, REUSE_TRANSACTION_NAME or REUSE_TRANSACTION_OFF_NAME.

Returns: One of REUSE_ON, REUSE_OFF, REUSE_TRANSACTION or REUSE_TRANSACTION_OFF.

Throws: IllegalArgumentException if the string is not recognised or if it's null.

isValid

public static boolean isValid(int option)
Return true if the reuse option is valid. Return false if the reuse option is invalid.

Parameters: option the option

Returns: true if the reuse option is valid. Return false if the reuse option is invalid.

toString

public static String toString(int option)
Convert the specified option to the reuse option name.

Parameters: option. One of REUSE_ON, REUSE_OFF, REUSE_TRANSACTION or REUSE_TRANSACTION_OFF.

Returns: One of REUSE_ON_NAME, REUSE_OFF_NAME, REUSE_TRANSACTION_NAME or REUSE_TRANSACTION_OFF_NAME.

Throws: IllegalArgumentException if the option is not recognised.

validate

public static void validate(int option)
Validate that the option is recognized

Parameters: option. One of REUSE_ON, REUSE_OFF, REUSE_TRANSACTION or REUSE_TRANSACTION_OFF.

Throws: IllegalArgumentException if the option is not recognised.

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.