Class ThreadedTaskListener<T>

  • Type Parameters:
    T - The type of item accepted by the task

    public abstract class ThreadedTaskListener<T>
    extends Object
    An interface allowing AbstractThreadedTask jobs to communicate with their threads without exposing the entire task model.

    The thread runner can override any or all of the methods.

    • Method Detail

      • defaultThreadedTaskContext

        public static <X> ThreadedTaskListener<X> defaultThreadedTaskContext()
        Returns a default no-op threaded task context
        Type Parameters:
        X - The expected type (usually inferred)
        Returns:
        The resulting no-op threaded task context
      • afterBatch

        public void afterBatch​(sailpoint.api.SailPointContext threadContext)
                        throws sailpoint.tools.GeneralException
        Invoked by the default worker thread after each batch is completed.

        This can be overridden by a subclass to do arbitrary cleanup.

        Parameters:
        threadContext - The context for this thread
        Throws:
        sailpoint.tools.GeneralException - if anything goes wrong
      • beforeBatch

        public void beforeBatch​(sailpoint.api.SailPointContext threadContext)
                         throws sailpoint.tools.GeneralException
        Invoked by the default worker thread before each batch is begun.

        If this method throws an exception, the batch worker ought to prevent the batch from being executed.

        Parameters:
        threadContext - The context for this thread
        Throws:
        sailpoint.tools.GeneralException - if any failures occur
      • beforeExecution

        public void beforeExecution​(Thread theThread,
                                    T input)
        A hook that can be invoked by a worker before the action takes place
        Parameters:
        theThread - The currently executing thread
        input - The input record being processed
      • handleException

        public void handleException​(Exception e)
        Handles an exception during execution
        Parameters:
        e - the exception
      • handleFailure

        public void handleFailure​(T input)
        Handles a failure during execution on the given item
        Parameters:
        input - The input
      • handleSuccess

        public void handleSuccess​(T input)
        Handles successful completion of execution on the given item
        Parameters:
        input - The input
      • isTerminated

        public boolean isTerminated()
        Returns true if the parent task has been terminated
        Returns:
        Terminated status