Object/Class

org.scaladebugger.api.utils

JDITools

Related Docs: class JDITools | package utils

Permalink

object JDITools extends JDITools

Exposes utility methods related to the Java Debugger Interface.

Linear Supertypes
JDITools, JDILoader, Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JDITools
  2. JDITools
  3. JDILoader
  4. Logging
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit class LoggerExtras extends AnyRef

    Permalink
    Definition Classes
    Logging

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def classForName(name: String, initialize: Boolean = true, classLoader: ClassLoader = getSystemClassLoader): Class[_]

    Permalink

    Attempts to load the specified class.

    Attempts to load the specified class.

    name

    The full name of the class to load

    initialize

    If true, initializes the class

    classLoader

    The class loader to use for loading the class, defaults to the system class loader

    returns

    The class loaded by the class loader

    Attributes
    protected
    Definition Classes
    JDILoader
    Annotations
    @throws( classOf[ClassNotFoundException] )
    Exceptions thrown

    ClassNotFoundException If the class was not found using the class loader or any of its parents

    Note

    Exposed for testing!

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def findOpenPort(): Option[Int]

    Permalink

    Returns a random port that is currently open.

    Returns a random port that is currently open. Note that there is no safety condition preventing this port from being taken later.

    returns

    The number of the port

    Definition Classes
    JDITools
  11. def findPotentialJdkJarPaths(jarPath: String): Seq[String]

    Permalink

    Attempts to find potential paths for a jar in the JDK.

    Attempts to find potential paths for a jar in the JDK.

    jarPath

    The path to the jar relative to the JDK

    returns

    The sequence of potential paths

    Attributes
    protected
    Definition Classes
    JDILoader
  12. def generateJdwpString(port: Int, transport: String = "dt_socket", server: Boolean = true, suspend: Boolean = false, hostname: String = ""): String

    Permalink

    Generates a JDWP string for use when launching JVMs.

    Generates a JDWP string for use when launching JVMs.

    port

    The port used to connect to a debugger or listen for debugger connections

    transport

    The means of communication (defaults to dt_socket)

    server

    If true, indicates that the target JVM should run as a server listening on the provided port for debugger connections; if false, indicates that the target JVM should connect to a debugger using the provided port

    suspend

    If true, indicates that the target JVM should start up suspended until a connection with a debugger has been established

    hostname

    If provided, used as the hostname to connect or bind to depending on the server flag

    returns

    The string representing the JDWP settings

    Definition Classes
    JDITools
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def getJavaClassPath: String

    Permalink

    Retrieves the system property for java.class.path.

    Retrieves the system property for java.class.path.

    returns

    The string representing the 'java.class.path' system property

    Attributes
    protected
    Definition Classes
    JDITools
  15. def getPathSeparator: String

    Permalink

    Retrieves the system property for path.separator.

    Retrieves the system property for path.separator.

    returns

    The string representing the 'path.separator' system property

    Attributes
    protected
    Definition Classes
    JDITools
  16. def getSystemClassLoader: ClassLoader

    Permalink

    Retrieves the system classloader.

    Retrieves the system classloader.

    returns

    The system classloader instance

    Attributes
    protected
    Definition Classes
    JDIToolsJDILoader
  17. def getUserDir: String

    Permalink

    Retrieves the system property for user.dir.

    Retrieves the system property for user.dir.

    returns

    The string representing the 'user.dir' system property

    Attributes
    protected
    Definition Classes
    JDITools
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def isJdiAvailable(classLoader: ClassLoader = _classLoader): Boolean

    Permalink

    Checks if it is possible to use the JDI using either the given class loader or by using a jar located in the JDK (if possible).

    Checks if it is possible to use the JDI using either the given class loader or by using a jar located in the JDK (if possible).

    classLoader

    The class loader to use to check for JDI (default is this class's class loader)

    returns

    True if JDI is able to be loaded, otherwise false

    Definition Classes
    JDILoader
  21. def javaProcesses(javaProcessFunc: (String) ⇒ Option[JavaProcess] = ...): Seq[JavaProcess]

    Permalink

    Collects a list of active Java processes using the JPS tool.

    Collects a list of active Java processes using the JPS tool.

    javaProcessFunc

    Optional function to convert line of text into a Java process instance

    returns

    The collection of active Java processes

    Definition Classes
    JDITools
    Note

    Will fail if the JPS tool is not on PATH.

  22. def jvmClassPath: String

    Permalink

    Retrieves a JVM classpath string that contains the current classpath.

    Retrieves a JVM classpath string that contains the current classpath.

    returns

    The classpath as a string

    Definition Classes
    JDITools
  23. val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. def newJDIProcess(): JDIProcess

    Permalink

    Creates a new JDI process instance.

    Creates a new JDI process instance.

    returns

    The new JDI process instance

    Attributes
    protected
    Definition Classes
    JDITools
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. def scalaClassStringToFileString(classString: String): String

    Permalink

    Converts a class string to a file string.

    Converts a class string to a file string.

    classString

    The class string to convert

    returns

    The resulting file string

    Definition Classes
    JDITools
    Example:
    1. org.senkbeil.MyClass becomes org/senkbeil/MyClass.scala

  29. def spawn(className: String, port: Int, hostname: String = "", server: Boolean = true, suspend: Boolean = false, args: Seq[String] = Nil, options: Seq[String] = Nil): Process

    Permalink

    Spawns a new Scala process using the provided class name as the entrypoint.

    Spawns a new Scala process using the provided class name as the entrypoint.

    className

    The name of the class to use as the entrypoint for the Scala process

    port

    The port to use for the Scala process to listen on

    hostname

    Optional hostname to use for the Scala process to listen on

    server

    Whether or not to launch the process as a server waiting for a debugger connection or a client connecting to a listening debugger

    suspend

    Whether or not to start the process suspended until a debugger attaches to it or it attaches to a debugger

    args

    The collection of arguments to pass to the Scala process

    options

    Any additional JVM options to pass to the Scala process

    returns

    The created Scala process

    Definition Classes
    JDITools
    Note

    Assumes that Scala is available on the path!

  30. def spawnAndGetPid(className: String, port: Int, hostname: String = "", server: Boolean = true, args: Seq[String] = Nil, options: Seq[String] = Nil): (Int, Process)

    Permalink

    Spawns a new Scala process using the provided class name as the entrypoint.

    Spawns a new Scala process using the provided class name as the entrypoint. Retrieves the PID of the process. The spawned JVM cannot start suspended.

    className

    The name of the class to use as the entrypoint for the Scala process

    port

    The port to use for the Scala process to listen on

    hostname

    Optional hostname to use for the Scala process to listen on

    server

    Whether or not to launch the process as a server waiting for a debugger connection or a client connecting to a listening debugger

    args

    The collection of arguments to pass to the Scala process

    options

    Any additional JVM options to pass to the Scala process

    returns

    The tuple containing the PID (or 0 if failed to retrieve) and the Scala process

    Definition Classes
    JDITools
    Note

    Assumes that Scala is available on the path!

  31. def spawnJavaProcessRetrieval(): Process

    Permalink

    Spawns a new process to retrieve the list of Java processes.

    Spawns a new process to retrieve the list of Java processes.

    returns

    The process instance

    Attributes
    protected
    Definition Classes
    JDITools
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  33. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  34. def tryLoadJdi(classLoader: ClassLoader = _classLoader): Boolean

    Permalink

    Attempts to ensure that the JDI is loaded.

    Attempts to ensure that the JDI is loaded. First, checks if the JDI is already available. If not, attempts to find a JDK path and load it.

    classLoader

    The class loader to use to check for JDI (default is this class's class loader)

    returns

    True if successful, otherwise false

    Definition Classes
    JDILoader
  35. def usingOpenPort[T](f: (Int) ⇒ T): T

    Permalink

    Finds an open port and provides it to the specified function.

    Finds an open port and provides it to the specified function. This method is synchronized to prevent other threads within the same application from accidentally taking the same port when using this method; however, this does not prevent external applications from consuming the provided port.

    T

    The return value from the function to evaluate

    f

    The function to evaluate, taking the open port as its argument

    returns

    The result of the evaluated function

    Definition Classes
    JDITools
    Annotations
    @throws( ... )
    Exceptions thrown

    IOException When no port is available

  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from JDITools

Inherited from JDILoader

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped