Class LoggingTaskListener<Response>

  • All Implemented Interfaces:
    TaskListener<Response>

    public final class LoggingTaskListener<Response>
    extends java.lang.Object
    implements TaskListener<Response>
    A TaskListener that just logs the response at the info level. Used when we need a listener but aren't returning the result to the user.
    • Method Summary

      Modifier and Type Method Description
      static <Response> TaskListener<Response> instance()
      Get the instance of NoopActionListener cast appropriately.
      void onFailure​(Task task, java.lang.Throwable e)
      A failure caused by an exception at some phase of the task.
      void onResponse​(Task task, Response response)
      Handle task response.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • instance

        public static <Response> TaskListener<Response> instance()
        Get the instance of NoopActionListener cast appropriately.
      • onResponse

        public void onResponse​(Task task,
                               Response response)
        Description copied from interface: TaskListener
        Handle task response. This response may constitute a failure or a success but it is up to the listener to make that decision.
        Specified by:
        onResponse in interface TaskListener<Response>
        Parameters:
        task - the task being executed. May be null if the action doesn't create a task
        response - the response from the action that executed the task
      • onFailure

        public void onFailure​(Task task,
                              java.lang.Throwable e)
        Description copied from interface: TaskListener
        A failure caused by an exception at some phase of the task.
        Specified by:
        onFailure in interface TaskListener<Response>
        Parameters:
        task - the task being executed. May be null if the action doesn't create a task
        e - the failure