code: private ThreadContextDescriptor captureThreadContext(Executor executor) {
          WSManagedExecutorService managedExecutor = defaultExecutor instanceof WSManagedExecutorService //
                          ? (WSManagedExecutorService) defaultExecutor //
                          : executor != defaultExecutor && executor instanceof WSManagedExecutorService //
                                          ? (WSManagedExecutorService) executor //
                                          : null;
  
          if (managedExecutor == null)
              return null;
  
          @SuppressWarnings("unchecked")
          ThreadContextDescriptor contextDescriptor = managedExecutor.getContextService().captureThreadContext(XPROPS_SUSPEND_TRAN);
          return contextDescriptor;
      }
docs: Captures thread context, if possible, first based on the default asynchronous execution facility,
  otherwise based on the specified executor. If neither of these executors are a managed executor,
  then thread context is not captured.
  
  @param executor executor argument that is supplied when creating a dependent stage.
  @return captured thread context. NULL neither the default asynchronous execution facility nor the
  specified executor support capturing context.