Package boofcv.gui

Class JavaRuntimeLauncher


  • public class JavaRuntimeLauncher
    extends java.lang.Object
    Class for launching JVMs. Monitors the status and kills frozen threads. Keeps track of execution time and sets up class path. Output and error stream can be changed at any time and is designed to be thread safe.
    • Constructor Detail

      • JavaRuntimeLauncher

        public JavaRuntimeLauncher​(java.util.List<java.lang.String> pathJars)
        Constructor. Configures which library it is to be launching a class from/related to
        Parameters:
        pathJars - List of paths to all the jars
    • Method Detail

      • setFrozenTime

        public void setFrozenTime​(long frozenTime)
        Specifies the amount of time the process has to complete. After which it is considered frozen and will be killed
        Parameters:
        frozenTime - time in milliseconds
      • setMemoryInMB

        public void setMemoryInMB​(long memoryInMB)
        Specifies the amount of memory the process will be allocated in megabytes
        Parameters:
        memoryInMB - megabytes
      • getDurationMilli

        public long getDurationMilli()
        Returns how long the operation took to complete. In milliseconds
      • launch

        public JavaRuntimeLauncher.Exit launch​(java.lang.Class mainClass,
                                               java.lang.String... args)
        Launches the class with the provided arguments. Blocks until the process stops.
        Parameters:
        mainClass - Class
        args - it's arguments
        Returns:
        true if successful or false if it ended on error
      • printBuffer

        protected void printBuffer​(java.io.BufferedReader input,
                                   java.io.PrintStream output)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • getClassPath

        public java.lang.String getClassPath()
      • getAllocatedMemoryInMB

        public long getAllocatedMemoryInMB()
      • getFrozenTime

        public long getFrozenTime()
      • getArguments

        public java.lang.String[] getArguments()
      • requestKill

        public void requestKill()
      • isKillRequested

        public boolean isKillRequested()
      • getPrintOut

        public java.io.PrintStream getPrintOut()
      • setPrintOut

        public void setPrintOut​(java.io.PrintStream out)
      • getPrintErr

        public java.io.PrintStream getPrintErr()
      • setPrintErr

        public void setPrintErr​(java.io.PrintStream err)