BackendTransaction

public abstract class BackendTransaction implements Undoable

Abstract class for backend transactions.

This class is the glue between the Transaction layer and the actual implementation of the communication with the back end.

This class also acts as a registry which stores which implementation is being used for which backend transaction interface.

Author:

Timm Fitschen

See also: {@linkTransaction}

Methods

addMeasurement

public void addMeasurement(Object o, long time)

cleanUp

public final void cleanUp()

execute

protected abstract void execute()

execute

protected <K extends BackendTransaction> K execute(K t)

Execute this BackendTransaction, using the implementation given as an argument.

The implementation’s benchmark is set to the corresponding sub-benchmark of this object’s benchmark.

Parameters:
  • t – This BackendTransaction’s execute() method will be called.

Returns:

The BackendTransaction which was passed as an argument.

executeTransaction

public final void executeTransaction()

Like execute(), but with benchmarking measurement.

getImplementation

protected <T extends BackendTransactionImpl> T getImplementation(Class<T> clz)

getUndoHandler

protected UndoHandler getUndoHandler()

init

public static void init()

Initialize the adapters to the database backend.

Currently this is hard-coded to the MySQL-Backend but the architecture of this class is designed to make it easy in the future to choose other implementations (i.e. other back-ends)

setAccess

public void setAccess(Access access)

setImpl

public static <K extends BackendTransactionImpl, L extends K> void setImpl(Class<K> k, Class<L> l)

setTransactionBenchmark

public void setTransactionBenchmark(TransactionBenchmark b)

Set the benchmark object for this AbstractTransaction.

toString

public String toString()

undo

public final void undo()

useCache

boolean useCache()