Class REPLBreakpoint

java.lang.Object
de.uni_kiel.rz.fdr.repl.REPLBreakpoint

public class REPLBreakpoint extends Object
This class represents a single triggered Breakpoint instance in your code. It also provides static methods to manage all current instances of triggered breakpoints.
  • Field Details

    • MAX_BREAKPOINTS

      public static int MAX_BREAKPOINTS
      More than this many simultaneously triggered breakpoint instances will be dropped.
  • Method Details

    • replbreakpoint

      public static Object replbreakpoint()
      Pauses the current thread and triggers a breakpoint in the REPL.
      Returns:
      An optional feedback value passed from the REPL
    • replbreakpoint

      public static Object replbreakpoint(String name)
      Pauses the current thread and triggers a breakpoint in the REPL.
      Parameters:
      name - An informative name for this instance
      Returns:
      An optional feedback value passed from the REPL
    • replbreakpoint

      public static Object replbreakpoint(String name, Object extra)
      Pauses the current thread and triggers a breakpoint in the REPL.
      Parameters:
      name - An informative name for this instance
      extra - Any extra data you would like to make available in the REPL context
      Returns:
      An optional feedback value passed from the REPL
    • replbreakpoint

      public static Object replbreakpoint(String name, Object extra, Long timeoutMillis)
      Pauses the current thread and triggers a breakpoint in the REPL.
      Parameters:
      name - An informative name for this instance
      extra - Any extra data you would like to make available in the REPL context
      timeoutMillis - Auto-continue the breakpoint after this many milliseonds
      Returns:
      An optional feedback value passed from the REPL
    • disable

      public static void disable(String filter)
      Disables all future breakpoint instances matching this pattern.
      Parameters:
      filter - The filter pattern in Java regular expression syntax.
    • enable

      public static void enable(String filter)
      Re-enables a previously disabled breakpoint pattern.
      Parameters:
      filter - The filter pattern in Java regular expression syntax.
    • resume

      public static boolean resume(long key)
      Resumes a breakpoint instance.
      Parameters:
      key - The instance's key
      Returns:
      Whether the breakpoint was resumed
    • resume

      public static boolean resume(long key, Object feedback)
      Resumes a breakpoint instance.
      Parameters:
      key - The instance's key
      feedback - The feedback value that the associated replbreakpoint() call will return
      Returns:
      Whether the breakpoint was resumed
    • eval

      public static boolean eval(long key, REPLBreakpoint.Eval eval)
      Queues a Groovy statement for evaluation in the Thread of a triggered breakpoint
      Parameters:
      key - The breakpoint instance's key
      eval - The Groovy statement to evaluate
      Returns:
      Whether the statement was enqueued
    • list

      public static List<REPLBreakpoint> list()
      Get all waiting breakpoints.
      Returns:
      A list of all currently triggered breakpoint instances
    • get

      public static REPLBreakpoint get(long key)
      Retrieve a single breakpoint instance by key.
      Parameters:
      key - The instance's key
      Returns:
      The breakpoint instance with the given key
    • getDisabledPatterns

      public static List<String> getDisabledPatterns()
      Get a list of all currently disabled breakpoint patterns
      Returns:
      The list of all currently disabled breakpoint patterns
    • resume

      public void resume()
      Resumes this breakpoint.
    • resume

      public void resume(Object feedback)
      Resumes this breakpoint, returning a result.
      Parameters:
      feedback - The return value of the corresponding replbreakpoint() call.
    • eval

      public void eval(REPLBreakpoint.Eval eval)
      Enqueues a request to evaluate a Groovy statement while the breakpoint is waiting
      Parameters:
      eval - The Groovy statement to eval.
    • getEvalResult

      public REPLBreakpoint.EvalResult getEvalResult()
      Get the last eval request's result.
      Returns:
      The las eval request's result.
    • getKey

      public long getKey()
      Get this breakpoint instance's key.
      Returns:
      This breakpoint instance's key.
    • getFeedback

      public Object getFeedback()
      Gets the last feedback value thaqt was passed from the REPL.
      Returns:
      The last feedback value thaqt was passed from the REPL.
    • getOwner

      public StackTraceElement getOwner()
      Get's the context in which this breakpoint was triggered.
      Returns:
      The context in which this breakpoint was triggered
    • getName

      public String getName()
      Gets the name of this breakpoint.
      Returns:
      The name of this breakpoint
    • getExtra

      public Object getExtra()
      Gets any extra data that was passed to the REPL.
      Returns:
      The extra data that was passed to the REPL.
    • getTimeoutMillis

      public Long getTimeoutMillis()
      Gets this breakpoint's timeout in milliseconds.
      Returns:
      This breakpoint's timeout in milliseconds.
    • getSignature

      public String getSignature()
      Get this instance's signature, against which the disable-patterns will be matched.
      Returns:
      This instance's signature
    • toString

      public String toString()
      Overrides:
      toString in class Object