JDK-8159855 : Create an SPI for tools
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-06-17
  • Updated: 2017-05-17
  • Resolved: 2016-10-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b140Fixed
Related Reports
Blocks :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
It would be good to create an SPI for simple command line tools, for simple use of JDK tools and others.

Proposed package java.util.spi
Following the existing naming convention the proposed name is ToolProvider

API should include the following methods:
    String getName();
    int run(PrintWriter pw, String... args)

Possible additional methods
    default int run(PrintStream ps, String... args) // creates a PrintWriter and calls other method

    static ToolProvider lookup(String name) // use ServiceLoader to locate first instance of named service

Comments
Webrev: http://cr.openjdk.java.net/~jjg/8159855/webrev.03/
04-10-2016

Yes, maybe next week.
30-09-2016

Jon - is this planned for JDK 9?
30-09-2016