Package de.uni_kiel.rz.fdr.repl
Class REPLBreakpoint
java.lang.Object
de.uni_kiel.rz.fdr.repl.REPLBreakpoint
This class represents a single triggered Breakpoint instance in your code. It also provides static methods
to manage all current instances of triggered breakpoints.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
A request to eval a Groovy statement in the breakpoint's thread.static final record
The result of anEval
request. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int
More than this many simultaneously triggered breakpoint instances will be dropped. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Disables all future breakpoint instances matching this pattern.static void
Re-enables a previously disabled breakpoint pattern.static boolean
eval
(long key, REPLBreakpoint.Eval eval) Queues a Groovy statement for evaluation in the Thread of a triggered breakpointvoid
eval
(REPLBreakpoint.Eval eval) Enqueues a request to evaluate a Groovy statement while the breakpoint is waitingstatic REPLBreakpoint
get
(long key) Retrieve a single breakpoint instance by key.Get a list of all currently disabled breakpoint patternsGet the last eval request's result.getExtra()
Gets any extra data that was passed to the REPL.Gets the last feedback value thaqt was passed from the REPL.long
getKey()
Get this breakpoint instance's key.getName()
Gets the name of this breakpoint.getOwner()
Get's the context in which this breakpoint was triggered.Get this instance's signature, against which the disable-patterns will be matched.Gets this breakpoint's timeout in milliseconds.static List<REPLBreakpoint>
list()
Get all waiting breakpoints.static Object
Pauses the current thread and triggers a breakpoint in the REPL.static Object
replbreakpoint
(String name) Pauses the current thread and triggers a breakpoint in the REPL.static Object
replbreakpoint
(String name, Object extra) Pauses the current thread and triggers a breakpoint in the REPL.static Object
replbreakpoint
(String name, Object extra, Long timeoutMillis) Pauses the current thread and triggers a breakpoint in the REPL.void
resume()
Resumes this breakpoint.static boolean
resume
(long key) Resumes a breakpoint instance.static boolean
Resumes a breakpoint instance.void
Resumes this breakpoint, returning a result.toString()
-
Field Details
-
MAX_BREAKPOINTS
public static int MAX_BREAKPOINTSMore than this many simultaneously triggered breakpoint instances will be dropped.
-
-
Method Details
-
replbreakpoint
Pauses the current thread and triggers a breakpoint in the REPL.- Returns:
- An optional feedback value passed from the REPL
-
replbreakpoint
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
Pauses the current thread and triggers a breakpoint in the REPL.- Parameters:
name
- An informative name for this instanceextra
- Any extra data you would like to make available in the REPL context- Returns:
- An optional feedback value passed from the REPL
-
replbreakpoint
Pauses the current thread and triggers a breakpoint in the REPL.- Parameters:
name
- An informative name for this instanceextra
- Any extra data you would like to make available in the REPL contexttimeoutMillis
- Auto-continue the breakpoint after this many milliseonds- Returns:
- An optional feedback value passed from the REPL
-
disable
Disables all future breakpoint instances matching this pattern.- Parameters:
filter
- The filter pattern in Java regular expression syntax.
-
enable
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
Resumes a breakpoint instance.- Parameters:
key
- The instance's keyfeedback
- The feedback value that the associatedreplbreakpoint()
call will return- Returns:
- Whether the breakpoint was resumed
-
eval
Queues a Groovy statement for evaluation in the Thread of a triggered breakpoint- Parameters:
key
- The breakpoint instance's keyeval
- The Groovy statement to evaluate- Returns:
- Whether the statement was enqueued
-
list
Get all waiting breakpoints.- Returns:
- A list of all currently triggered breakpoint instances
-
get
Retrieve a single breakpoint instance by key.- Parameters:
key
- The instance's key- Returns:
- The breakpoint instance with the given key
-
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
Resumes this breakpoint, returning a result.- Parameters:
feedback
- The return value of the correspondingreplbreakpoint()
call.
-
eval
Enqueues a request to evaluate a Groovy statement while the breakpoint is waiting- Parameters:
eval
- The Groovy statement to eval.
-
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
Gets the last feedback value thaqt was passed from the REPL.- Returns:
- The last feedback value thaqt was passed from the REPL.
-
getOwner
Get's the context in which this breakpoint was triggered.- Returns:
- The context in which this breakpoint was triggered
-
getName
Gets the name of this breakpoint.- Returns:
- The name of this breakpoint
-
getExtra
Gets any extra data that was passed to the REPL.- Returns:
- The extra data that was passed to the REPL.
-
getTimeoutMillis
Gets this breakpoint's timeout in milliseconds.- Returns:
- This breakpoint's timeout in milliseconds.
-
getSignature
Get this instance's signature, against which the disable-patterns will be matched.- Returns:
- This instance's signature
-
toString
-