org.nakedobjects.runtime.transaction
Enum NakedObjectTransaction.State

java.lang.Object
  extended by java.lang.Enum<NakedObjectTransaction.State>
      extended by org.nakedobjects.runtime.transaction.NakedObjectTransaction.State
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<NakedObjectTransaction.State>
Enclosing interface:
NakedObjectTransaction

public static enum NakedObjectTransaction.State
extends java.lang.Enum<NakedObjectTransaction.State>


Enum Constant Summary
ABORTED
          Completed, having aborted.
COMMITTED
          Completed, having successfully committed.
IN_PROGRESS
          Started, still in progress.
MUST_ABORT
          Started, but has hit an exception.
 
Method Summary
 boolean canAbort()
          Whether it is valid to abort this transaction.
 boolean canCommit()
          Whether it is valid to commit this transaction.
 boolean canFlush()
          Whether it is valid to flush this transaction.
 boolean isComplete()
          Whether the transaction is complete (and so a new one can be started).
static NakedObjectTransaction.State valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static NakedObjectTransaction.State[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

IN_PROGRESS

public static final NakedObjectTransaction.State IN_PROGRESS
Started, still in progress.

May flush, commit or abort.


MUST_ABORT

public static final NakedObjectTransaction.State MUST_ABORT
Started, but has hit an exception.

May not NakedObjectTransaction#flush() or commit (will throw an IllegalStateException), but can only abort.

Similar to setRollbackOnly in EJBs.


COMMITTED

public static final NakedObjectTransaction.State COMMITTED
Completed, having successfully committed.

May not NakedObjectTransaction#flush() or abort or commit (will throw IllegalStateException).


ABORTED

public static final NakedObjectTransaction.State ABORTED
Completed, having aborted.

May not NakedObjectTransaction#flush(), commit or abort (will throw IllegalStateException).

Method Detail

values

public static NakedObjectTransaction.State[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (NakedObjectTransaction.State c : NakedObjectTransaction.State.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static NakedObjectTransaction.State valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

canFlush

public boolean canFlush()
Whether it is valid to flush this transaction.


canCommit

public boolean canCommit()
Whether it is valid to commit this transaction.


canAbort

public boolean canAbort()
Whether it is valid to abort this transaction.


isComplete

public boolean isComplete()
Whether the transaction is complete (and so a new one can be started).



Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.