Class Callback
- java.lang.Object
-
- com.intergral.deep.agent.tracepoint.handler.Callback
-
public final class Callback extends Object
This type is the main entry point that is used to callback from injected code.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
callBack(List<String> bpIds, String filename, int lineNo, Map<String,Object> variables)
The main entry point for non CF ASM injected breakpoints.static void
callBackCF(List<String> bpIds, String filename, int lineNo, Map<String,Object> variables)
The main entry point for CF ASM injected breakpoints.static void
callBackException(Throwable t)
This is called when an exception is captured on the visited line.static void
callBackFinally(List<String> bpIds, String filename, int lineNo, Map<String,Object> variables)
This is called when the visited line is completed.static void
init(Settings settings, TracepointConfigService tracepointConfigService, PushService pushService)
Initialise the callback with the deep services.static void
methodEnd(String methodName, String filename, int lineNo, List<String> bpIds, Map<String,Object> variables)
This method is called when a wrapped method has completed.static void
methodEntry(String methodName, String filename, int lineNo, List<String> bpIds, Map<String,Object> variables, String spanOnlyIds)
This method is called when a tracepoint has triggered a method entry type.static void
methodException(Throwable t)
This is called when an exception is captured from a wrapped method.static void
methodRet(Object value)
This is called when the returned value from the wrapped method is captured.static Closeable
span(String name, String bps)
Create a span using the tracepoint callback.
-
-
-
Method Detail
-
init
public static void init(Settings settings, TracepointConfigService tracepointConfigService, PushService pushService)
Initialise the callback with the deep services.- Parameters:
settings
- the deep settingstracepointConfigService
- the tracepoint servicepushService
- the push service
-
callBackCF
public static void callBackCF(List<String> bpIds, String filename, int lineNo, Map<String,Object> variables)
The main entry point for CF ASM injected breakpoints.- Parameters:
bpIds
- the bp ids to triggerfilename
- the filename of the breakpoint hitlineNo
- the line number of the breakpoint hitvariables
- the map of local variables.
-
callBack
public static void callBack(List<String> bpIds, String filename, int lineNo, Map<String,Object> variables)
The main entry point for non CF ASM injected breakpoints.- Parameters:
bpIds
- the bp ids to triggerfilename
- the filename of the breakpoint hitlineNo
- the line number of the breakpoint hitvariables
- the map of local variables.
-
callBackException
public static void callBackException(Throwable t)
This is called when an exception is captured on the visited line.- Parameters:
t
- the exception that was captured.
-
callBackFinally
public static void callBackFinally(List<String> bpIds, String filename, int lineNo, Map<String,Object> variables)
This is called when the visited line is completed.- Parameters:
bpIds
- the tracepoint ids that triggered thisfilename
- the source file namelineNo
- the line number we are onvariables
- the captured local variables
-
span
public static Closeable span(String name, String bps)
Create a span using the tracepoint callback.This method will Always return a closable. This way the injected code never deals with anything but calling close. Even if close doesn't do anything.
We use
Closeable
here, so we can stick to java types in the injected code. This makes testing and injected code simpler.- Parameters:
name
- the name of the spanbps
- the tracepoints that triggered this span- Returns:
- a
Closeable
to close the span
-
methodEntry
public static void methodEntry(String methodName, String filename, int lineNo, List<String> bpIds, Map<String,Object> variables, String spanOnlyIds)
This method is called when a tracepoint has triggered a method entry type.This method will Always return a closable. This way the injected code never deals with anything but calling close. Even if close doesn't do anything.
We use
Closeable
here, so we can stick to java types in the injected code. This makes testing and injected code simpler.- Parameters:
methodName
- the method name we have enteredfilename
- the file name the method is inlineNo
- the line number the method is onbpIds
- the tracepoint ids that have been triggered by this entryvariables
- the map of variables capturedspanOnlyIds
- the CSV of the tracepoints ids that just want a span
-
methodException
public static void methodException(Throwable t)
This is called when an exception is captured from a wrapped method.- Parameters:
t
- the captured throwable
-
methodRet
public static void methodRet(Object value)
This is called when the returned value from the wrapped method is captured.This method is not called on void methods.
- Parameters:
value
- the captured return value.
-
methodEnd
public static void methodEnd(String methodName, String filename, int lineNo, List<String> bpIds, Map<String,Object> variables)
This method is called when a wrapped method has completed.- Parameters:
methodName
- the method namefilename
- the source file namelineNo
- the line numberbpIds
- the triggering tracepoints idsvariables
- the captured local variables
-
-