Interface NonTransactionalJobHandler<Output>

All Superinterfaces:
JobHandler

public interface NonTransactionalJobHandler<Output> extends JobHandler
Internal interface for non-transactional job handler implementations. This interface extends from the regular JobHandler, however the 'normal' execute method should not be called, because there's no VariableScope or CommandContext available as no transaction is currently ongoing when the job is executed.
Author:
Joram Barrez
  • Method Details

    • execute

      default void execute(JobEntity job, String configuration, VariableScope variableScope, CommandContext commandContext)
      Specified by:
      execute in interface JobHandler
    • executeNonTransactionally

      Output executeNonTransactionally(JobEntity job, String configuration)
      Execute the job handler logic outside a transaction. If the handler needs to execute certain login transactionally, it can return some output and that use that in the afterExecute(JobEntity, String, Object, CommandContext) (which gets executed in a transaction).
      Parameters:
      job - the job that is being executed
      configuration - the job handler configuration
      Returns:
      the result of the non-transactional execution
    • afterExecute

      default void afterExecute(JobEntity job, String configuration, Output output, CommandContext commandContext)
      Method invoked with the result from executeNonTransactionally(JobEntity, String). This should be used when the result of the non-transactional execution should be executed in a transaction.
      Parameters:
      job - The job that is being executed
      configuration - the job configuration
      output - the output from the non-transactional execution
      commandContext - the command context of the current transaction