Class ProcessFactory.ForJava9CompatibleVM

  • All Implemented Interfaces:
    ProcessFactory
    Enclosing interface:
    ProcessFactory

    @IgnoreJRERequirement
    public static class ProcessFactory.ForJava9CompatibleVM
    extends java.lang.Object
    implements ProcessFactory
    A ProcessFactory for a Java 9+ VMs that reads process information from the current ProcessHandle.
    • Method Detail

      • getProcessInformation

        public ProcessInfo getProcessInformation()
        Ideally, this would only reflectively invoke the Java 9 introduced process API. But this is quite a hassle, especially when handling the Optional return types of the process API. As we are directly referring to APIs introduced in Java 9, this project can only be compiled with a JDK 9+.
        Specified by:
        getProcessInformation in interface ProcessFactory
        Returns:
        the ProcessInfo information about the current process