Package icyllis.modernui.core

# Interface Looper.Observer

Enclosing class:
  `Looper`

public static interface Looper.Observer

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `dispatchingThrewException(Object token, Message msg, Exception exception)`
  Called when an exception was thrown while processing a message.
  `void`
  `messageDispatched(Object token, Message msg)`
  Called when a message was processed by a Handler.
  `Object`
  `messageDispatchStarting()`
  Called right before a message is dispatched.

- ## Method Details

  - ### messageDispatchStarting

    Object messageDispatchStarting()
    Called right before a message is dispatched.

    The token type is not specified to allow the implementation to specify its own type. The token must be passed back exactly once to either `messageDispatched(java.lang.Object, icyllis.modernui.core.Message)` or `dispatchingThrewException(java.lang.Object, icyllis.modernui.core.Message, java.lang.Exception)` and must not be reused again.

    Returns:
      a token used for collecting telemetry when dispatching a single message.

  - ### messageDispatched

    void messageDispatched(Object token, Message msg)
    Called when a message was processed by a Handler.
    Parameters:
      `token` - Token obtained by previously calling `messageDispatchStarting()` on the same Observer instance.
      `msg` - The message that was dispatched.

  - ### dispatchingThrewException

    void dispatchingThrewException(Object token, Message msg, Exception exception)
    Called when an exception was thrown while processing a message.
    Parameters:
      `token` - Token obtained by previously calling `messageDispatchStarting()` on the same Observer instance.
      `msg` - The message that was dispatched and caused an exception.
      `exception` - The exception that was thrown.