public abstract class AbstractTransactionExecutor extends AbstractEventSource<TransactionEvent,TransactionEventListener> implements TransactionExecutor
TransactionExecutor
interface.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractTransactionExecutor.AbstractTransactionAdapter<TRANSACTION>
This is the abstract base implementation of the
TransactionAdapter interface. |
Modifier and Type | Field and Description |
---|---|
private TransactionSettings |
defaultSettings |
CDI_NAME
Constructor and Description |
---|
AbstractTransactionExecutor()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected TransactionContext |
createTransactionContext()
This method create the
TransactionContext instances. |
protected void |
doInitialize()
This method performs the actual
initialization . |
<RESULT> RESULT |
doInTransaction(Callable<RESULT> callable)
This method executes the given
callable in the context of a transaction. |
<RESULT> RESULT |
doInTransaction(Callable<RESULT> callable,
TransactionSettings settings)
This method executes the given
callable in the context of a transaction. |
<RESULT> RESULT |
doInTransaction(TransactionCallable<RESULT> callable)
This method executes the given
callable in the context of a transaction. |
<RESULT> RESULT |
doInTransaction(TransactionCallable<RESULT> callable,
TransactionSettings settings)
This method executes the given
callable in the context of a transaction. |
protected TransactionSettings |
getDefaultSettings()
This method gets the default used if no
TransactionSettings are specified explicitly on a call of
doInTransaction . |
protected abstract AbstractTransactionExecutor.AbstractTransactionAdapter<?> |
openTransactionAdapter(TransactionSettings settings)
This method opens a new
TransactionAdapter . |
void |
setDefaultSettings(TransactionSettings settings)
This method sets the
default settings . |
addListener, fireEvent, fireEvent, handleListenerError, removeListener
createLogger, getLogger
doInitialized, getInitializationState, initialize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, removeListener
private TransactionSettings defaultSettings
getDefaultSettings()
public AbstractTransactionExecutor()
protected TransactionSettings getDefaultSettings()
TransactionSettings
are specified explicitly on a call of
doInTransaction
.public void setDefaultSettings(TransactionSettings settings)
default settings
.settings
- are the settings to set.protected void doInitialize()
initialization
. It is called when AbstractComponent.initialize()
is
invoked for the first time. super.
AbstractComponent.doInitialize()
.doInitialize
in class AbstractLoggableComponent
protected abstract AbstractTransactionExecutor.AbstractTransactionAdapter<?> openTransactionAdapter(TransactionSettings settings)
TransactionAdapter
.settings
- are the according TransactionSettings
.TransactionAdapter
.protected TransactionContext createTransactionContext()
TransactionContext
instances. Override to change fabrication.TransactionContext
instance.public <RESULT> RESULT doInTransaction(Callable<RESULT> callable) throws Exception
callable
in the context of a transaction. invokes
the callable
in a surrounding try-statement so that the transaction is automatically committed if your
callable
succeeds while a rollback is performed in case it fails (throws anything).doInTransaction
in interface TransactionExecutor
RESULT
- is the generic type returned from your callable
.callable
- is the Callable
to be executed
within a transaction.callable
.Exception
- if the callable
failed.public <RESULT> RESULT doInTransaction(Callable<RESULT> callable, TransactionSettings settings) throws Exception
callable
in the context of a transaction. invokes
the callable
in a surrounding try-statement so that the transaction is automatically committed if your
callable
succeeds while a rollback is performed in case it fails (throws anything).doInTransaction
in interface TransactionExecutor
RESULT
- is the generic type returned from your callable
.callable
- is the Callable
to be executed
within a transaction.settings
- are the settings to configure transactions.callable
.Exception
- if the callable
failed.public <RESULT> RESULT doInTransaction(TransactionCallable<RESULT> callable)
callable
in the context of a transaction. invokes
the callable
in a surrounding try-statement so that the transaction is
automatically committed if your callable
succeeds while a rollback is performed in case it
fails (throws anything).doInTransaction
in interface TransactionExecutor
RESULT
- is the generic type returned from your callable
.callable
- is the Callable
to be executed
within a transaction.callable
.public <RESULT> RESULT doInTransaction(TransactionCallable<RESULT> callable, TransactionSettings settings)
callable
in the context of a transaction. invokes
the callable
in a surrounding try-statement so that the transaction is
automatically committed if your callable
succeeds while a rollback is performed in case it
fails (throws anything).doInTransaction
in interface TransactionExecutor
RESULT
- is the generic type returned from your callable
.callable
- is the Callable
to be executed
within a transaction.settings
- are the settings to configure transactions.callable
.Copyright © 2001–2016 mmm-Team. All rights reserved.