com.google.testing.threadtester
Interface BreakpointHandler


public interface BreakpointHandler

A handler that can be added to a Breakpoint. When the breakpoint is reached, the handler is invoked. The handler may simply be used as a logger, but it also has the option of replacing the breakpoint logic entirely, by returning true from handleBreakpoint(Breakpoint).

Author:
alasdair.mackintosh@gmail.com (Alasdair Mackintosh)

Method Summary
 boolean handleBreakpoint(Breakpoint breakpoint)
          Invoked when the breakpoint is reached.
 

Method Detail

handleBreakpoint

boolean handleBreakpoint(Breakpoint breakpoint)
Invoked when the breakpoint is reached. This method will be called in the thread that executed the code that triggered the breakpoint.

Implementations of this method should return true if the breakpoint has been entirely processed by this handler. Returning true means that no further action will be taken, and the thread that hit the Breakpoint will not stop. Returning false means that normal Breakpoint processing should continue, and that the thread that hit the Breakpoint should block. Note that if another thread is blocked waiting on this breakpoint (via a call to Breakpoint.await() that that blocked thread will not be woken.

Note that a handler may set up its own internal blocking mechanism, waiting for a particular signal before continuing. In such a setup, the handler will normally return false when it continues, in order to avoid the Breakpoint's own blocking mechanism from being used.

Returns:
true if the breakpoint has been entirely processed by this handler, and no further action should be taken.


Copyright © 2013. All Rights Reserved.