Class CloudDebuggerAgent


  • public final class CloudDebuggerAgent
    extends Object
    Native methods exposed by Java Cloud Debugger agent.

    These methods should only be called if the Cloud Debugger is enabled. Otherwise these calls will throw exception. The debugger agent is loaded very early, so these methods can be used at any time.

    • Method Detail

      • bind

        public static void bind​(ClassLoader debuggerInternalsClassLoader)
        Starts the initialization sequence of the Java Cloud Debugger agent.
        Parameters:
        debuggerInternalsClassLoader - ClassLoader object to use to load internal debugger Java classes.
      • setApplication

        public static void setApplication​(String[] classPath,
                                          CloudDebuggerCallback callback)
        Hooks up Cloud Debugger to the application.

        Multiple paths in classPath are separated with File.pathSeparator. The debugger is exploring all the paths recursively opening .JAR files as they are encountered.

        This function must be called after bind but before the first breakpoint is set. Setting breakpoints will fail until this method is called.

        Parameters:
        classPath - paths to application classes
        callback - Callback interface used by Cloud Debugger to query AppEngine Classic runtime
      • setActiveBreakpoints

        public static void setActiveBreakpoints​(byte[][] breakpoints)
        Updates the list of active breakpoints in the debugger.
        Parameters:
        breakpoints - list of currently active breakpoints, where each breakpoint is a serialized "com.google.protos.google.cloud.debugger.v1.CloudDebuggerData.Breakpoint" message.
      • hasBreakpointUpdates

        public static boolean hasBreakpointUpdates()
        Verifies if there are breakpoint updates to send to the Cloud Debugger service.
        Returns:
        true if there are breakpoint updates available, false otherwise.
      • dequeueBreakpointUpdates

        public static byte[][] dequeueBreakpointUpdates()
        Pulls breakpoint updates to send to the Cloud Debugger service through AppServer.
        Returns:
        serialized com.google.protos.google.cloud.debugger.v1.CloudDebuggerData.Breakpoint messages or null if no breakpoint updates available.