tyrex.resource
Class ReuseOptions

java.lang.Object
  extended bytyrex.resource.ReuseOptions

public final class ReuseOptions
extends java.lang.Object

This class defines the reuse options.

Author:
Riad Mohammed

Field Summary
static 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.
static java.lang.String REUSE_NO_TRANSACTION_OFF_NAME
          The name of the REUSE_NO_TRANSACTION_OFF option.
static int REUSE_OFF
          The reuse option that states the resources are not to be reused.
static java.lang.String REUSE_OFF_NAME
          The name of the REUSE_OFF option.
static int REUSE_ON
          The reuse option that states the resources are to be reused after they are currently used.
static java.lang.String REUSE_ON_NAME
          The name of the REUSE_ON option.
static 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.
static java.lang.String REUSE_TRANSACTION_NAME
          The name of the REUSE_TRANSACTION option.
static 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.
static java.lang.String REUSE_TRANSACTION_OFF_NAME
          The name of the REUSE_TRANSACTION_OFF option.
 
Method Summary
static int fromString(java.lang.String string)
          Convert the specified string to the reuse option.
static boolean isValid(int option)
          Return true if the reuse option is valid.
static java.lang.String toString(int option)
          Convert the specified option to the reuse option name.
static void validate(int option)
          Validate that the option is recognized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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.

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

REUSE_ON_NAME

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

See Also:
Constant Field Values

REUSE_OFF_NAME

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

See Also:
Constant Field Values

REUSE_TRANSACTION_NAME

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

See Also:
Constant Field Values

REUSE_TRANSACTION_OFF_NAME

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

See Also:
Constant Field Values

REUSE_NO_TRANSACTION_OFF_NAME

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

See Also:
Constant Field Values
Method Detail

fromString

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

Returns:
One of REUSE_ON, REUSE_OFF, REUSE_TRANSACTION or REUSE_TRANSACTION_OFF.
Throws:
java.lang.IllegalArgumentException - if the string is not recognised or if it's null.

toString

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

Returns:
One of REUSE_ON_NAME, REUSE_OFF_NAME, REUSE_TRANSACTION_NAME or REUSE_TRANSACTION_OFF_NAME.
Throws:
java.lang.IllegalArgumentException - if the option is not recognised.

validate

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

Throws:
java.lang.IllegalArgumentException - if the option is not recognised.

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.


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.