public interface ITransactional
ITransactional policy consists of an initialization part (
init()) and a commit part (commit()). The policy can be
used to manipulate its host in-between those calls. The policy returns an
ITransactionalOperation upon commit() which performs the
manipulations.
Note, that an ITransactional policy is safe against multiple
initialization/commitment in sequence. However, only the first
commit() call will return an operation (subsequent calls will return
null).
If an ITransactional policy is not initialized, it should throw an
IllegalStateException if any of its "work" methods are called.
| Modifier and Type | Interface and Description |
|---|---|
static class |
ITransactional.NoOperation
The
ITransactional.NoOperation does not have an effect. |
static class |
ITransactional.UnexecutableOperation
The
ITransactional.UnexecutableOperation cannot be executed. |
| Modifier and Type | Field and Description |
|---|---|
static ITransactionalOperation |
NOOP
This
ITransactionalOperation does not have an effect. |
static ITransactionalOperation |
UNEXECUTABLE
This
ITransactionalOperation cannot be executed. |
| Modifier and Type | Method and Description |
|---|---|
ITransactionalOperation |
commit()
Returns an
ITransactionalOperation that performs all
manipulations applied by the policy since the last init() call. |
void |
init()
Initializes the policy, so that the policy's "work" methods can be used.
|
static final ITransactionalOperation NOOP
ITransactionalOperation does not have an effect. It can be
returned by commit() if no changes have to be
applied.static final ITransactionalOperation UNEXECUTABLE
ITransactionalOperation cannot be executed.ITransactionalOperation commit()
ITransactionalOperation that performs all
manipulations applied by the policy since the last init() call.
When called multiple times in sequence, only the first call will yield an
operation, the subsequent calls will yield null.
You can return NOOP if no changes have to be applied. The domain
will filter out all NOOPs before their execution.
You can return UNEXECUTABLE to prevent any composite operation
that contains the UNEXECUTABLE from execution.
ITransactionalOperation that performs all
manipulations applied by the policy since the last
init() call.void init()
IllegalStateException. It is safe to call init()
multiple times in sequence.Copyright (c) 2014 itemis AG and others. All rights reserved.