org.prevayler.contrib.facade
Class TransactionType

java.lang.Object
  extended by org.prevayler.contrib.facade.TransactionType

public abstract class TransactionType
extends Object

A "smart" enumerated type enumerating the three kinds of transactions that Prevayler supports plus one that is, effectively, "no transaction". Also includes the transaction type Determiner interface and two of the most basic implementations.

Since:
0_1
Author:
Jay Sachs [jay@contravariant.org], Jacob Kjome [hoju@visi.com]

Nested Class Summary
static interface TransactionType.Determiner
          An interface describing a strategy for choosing a TransactionType for a given method.
 
Field Summary
static TransactionType NOOP
           
static TransactionType QUERY
           
static TransactionType.Determiner RETURN_TYPE_DETERMINER
          A basic transaction type determiner which bases the transaction type on the return type of methods: TRANSACTION for void methods and QUERY otherwise.
static TransactionType.Determiner SIMPLE_DETERMINER
          A minimal transaction type determiner which uses no heuristics.
static TransactionType TRANSACTION
           
static TransactionType TRANSACTION_WITH_QUERY
           
 
Method Summary
abstract  Object execute(Prevayler p_prevayler, Method p_method, Object[] p_args, TransactionHint p_hint)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIMPLE_DETERMINER

public static final TransactionType.Determiner SIMPLE_DETERMINER
A minimal transaction type determiner which uses no heuristics. It always returns a transaction type of TRANSACTION_WITH_QUERY.


RETURN_TYPE_DETERMINER

public static final TransactionType.Determiner RETURN_TYPE_DETERMINER
A basic transaction type determiner which bases the transaction type on the return type of methods: TRANSACTION for void methods and QUERY otherwise.


QUERY

public static final TransactionType QUERY

TRANSACTION_WITH_QUERY

public static final TransactionType TRANSACTION_WITH_QUERY

TRANSACTION

public static final TransactionType TRANSACTION

NOOP

public static final TransactionType NOOP
Since:
0_2
Method Detail

execute

public abstract Object execute(Prevayler p_prevayler,
                               Method p_method,
                               Object[] p_args,
                               TransactionHint p_hint)
                        throws Exception
Throws:
Exception
Since:
0_2

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2013. All Rights Reserved.