code: @Override
      public ThreadContext captureThreadContext(Map<String, String> execProps, Map<String, ?> threadContextConfig) {
          String value = execProps == null ? null : execProps.get(ManagedTask.TRANSACTION);
          if (value == null || ManagedTask.SUSPEND.equals(value))
              return new TransactionContextImpl(true);
          else if (ManagedTask.USE_TRANSACTION_OF_EXECUTION_THREAD.equals(value))
              return new TransactionContextImpl(false);
          else if ("PROPAGATE".equals(value)) {
              UOWCurrent uowCurrent = (UOWCurrent) transactionManager;
              if (uowCurrent.getUOWType() == UOWCurrent.UOW_GLOBAL) {
                  // TODO raise IllegalStateException here to reject all propagation of transactions
                  // TODO remove the following temporary code once the transaction manager provides a proper mechanism to prevent a transaction on multiple threads at once
                  SuspendCount suspendCount = suspendCountRef.get();
                  if (suspendCount == null) {
                      uowCurrent.setUOWEventListener(suspendCount = new SuspendCount());
                      if (!suspendCountRef.compareAndSet(null, suspendCount)) {
                          uowCurrent.unsetUOWEventListener(suspendCount);
                          suspendCount = suspendCountRef.get();
                      }
                  }
                  return new SerialTransactionContextImpl(suspendCount);
              } else
                  return new TransactionContextImpl(true);
          } else
              throw new IllegalArgumentException(ManagedTask.TRANSACTION + '=' + value);
      }
docs: {@inheritDoc}