com.hammurapi.common.concurrent.transactions

## Interface ExecutionContext<KP>

- Type Parameters:
    `KP` -
  All Superinterfaces:
    Context, ProgressMonitorFactory

      public interface ExecutionContext<KP>
      extends Context, ProgressMonitorFactory

  Transactional execution context.

- - ### Field Summary

    - ### Fields inherited from interface com.hammurapi.common.Context

      `INSTANCE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addUndo(Runnable undoCommand)` Adds a command to be executed on transaction rollback.
    `MutableContext` | `createContext()` Creates a mutable context chained with this executor.
    `PropertySet<KP>` | `createPropertySet(PropertySet<KP>... chain)`
    `<V> Future<V>` | `execute(Command<KP,V> command, Context context, PropertySet<KP> properties, Object... args)` Executes command either in the same thread on in a background thread but in the context of the same transaction.
    `Logger` | `getLogger()`
    `Transaction` | `getTransaction()`
    `void` | `registerXAResource(XAResource xaResource)` Resources shall be registered before it can be used - Bitronix idiosyncrasy.
    `void` | `yield()` By invoking this method command indicates that it cannot complete because of pending dependencies and shall be executed later.

    - ### Methods inherited from interface com.hammurapi.common.Context

      `lookup, lookup, lookupAll`

    - ### Methods inherited from interface com.hammurapi.common.concurrent.transactions.ProgressMonitorFactory

      `createProgressMonitor`

- - ### Method Detail

    - #### getTransaction

          Transaction getTransaction()

    - #### registerXAResource

          void registerXAResource(XAResource xaResource)

      Resources shall be registered before it can be used - Bitronix idiosyncrasy. Resources are automatically unregistered upon transaction completion.
      Parameters:
        `xaResource` -

    - #### addUndo

          void addUndo(Runnable undoCommand)

      Adds a command to be executed on transaction rollback. Use it to rollback modifications done on non-XA resources.
      Parameters:
        `undoCommand` -

    - #### execute

          <V> Future<V> execute(Command<KP,V> command,
                              Context context,
                              PropertySet<KP> properties,
                              Object... args)

      Executes command either in the same thread on in a background thread but in the context of the same transaction.
      Parameters:
        `command` -
        `properties` -
        `args` -
      Returns:

    - #### createPropertySet

          PropertySet<KP> createPropertySet(PropertySet<KP>... chain)

    - #### createContext

          MutableContext createContext()

      Creates a mutable context chained with this executor. This method is used for passing bindings and services to subtasks.
      Returns:

    - #### yield

          void yield()

      By invoking this method command indicates that it cannot complete because of pending dependencies and shall be executed later.

    - #### getLogger

          Logger getLogger()