HandlerExecutor


@UnstableApi
public final class HandlerExecutor implements Executor


An Executor that posts commands to a Handler or HandlerWrapper and forwards uncaught runtime exceptions to a Listener.

Summary

Nested types

public interface HandlerExecutor.Listener

Listener for uncaught exceptions thrown during command execution.

Public constructors

Creates an instance that posts commands to the specified Handler.

HandlerExecutor(
    HandlerWrapper handler,
    HandlerExecutor.Listener listener
)

Creates an instance that posts commands to the specified HandlerWrapper.

Public methods

void
execute(Runnable command)

Public constructors

HandlerExecutor

public HandlerExecutor(Handler handler, HandlerExecutor.Listener listener)

Creates an instance that posts commands to the specified Handler.

Parameters
Handler handler

The Handler to post commands to.

HandlerExecutor.Listener listener

The Listener to notify of uncaught runtime exceptions.

HandlerExecutor

public HandlerExecutor(
    HandlerWrapper handler,
    HandlerExecutor.Listener listener
)

Creates an instance that posts commands to the specified HandlerWrapper.

Parameters
HandlerWrapper handler

The HandlerWrapper to post commands to.

HandlerExecutor.Listener listener

The Listener to notify of uncaught runtime exceptions.

Public methods

execute

public void execute(Runnable command)