Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8319923

JShell Process Builder should be configurable

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P4
    • 22
    • tools
    • None
    • source
    • minimal
    • Java API
    • JDK

    Description

      Summary

      JShell has a two parts: the main process, which compiles the user's snippets, and possibly interacts with the user, and an "agent" that executes the executable code produced from the snippets. Then "agent" is typically (although not necessarily) a separate process. The clients of the JShell API are free to override the agent behavior, selecting either from the list of existing agents, or creating their own.

      There is, however, a desire to use agent that is mostly equivalent to the default JDI-based agent, but with some adjustments.

      This patch proposes to limit the amount of code needed to create an agent derived from the default agent.

      Problem

      API clients sometimes desire to provide their own way to start the agent process/JVM. Doing this currently means copying of non-trivial amount of code from the JDK.

      Solution

      The solution has two parts:

      • a new interface, JdiStarter is created, which the API client can use to provide code that starts the external JVM for snippet execution
      • the existing JdiInitiator is enhanced so that the user can override the process creation itself.

      Using these two components, the API clients can reuse a lot of the code for the default agent, while still overriding the process creation itself.

      Specification

      The proposed changes are attached as specdiff.00.zip, and are also available for convenience here: https://cr.openjdk.org/~jlahoda/8319311/specdiff.00/overview-summary.html

      Attachments

        Issue Links

          Activity

            People

              jlahoda Jan Lahoda
              ddelabassee David Delabassee
              Adam Sotona
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: