Package jnr.posix

Interface POSIXHandler

  • All Known Implementing Classes:
    DefaultPOSIXHandler

    public interface POSIXHandler
    The POSIXHandler class allows you do implement the runtime-specific behavior you need in such a way that it is insulated from the implementation of the POSIX library. Implementing each of the methods in this interface should give you are working POSIX implementation.
    • Method Detail

      • error

        void error​(jnr.constants.platform.Errno error,
                   java.lang.String extraData)
      • error

        void error​(jnr.constants.platform.Errno error,
                   java.lang.String methodName,
                   java.lang.String extraData)
      • unimplementedError

        void unimplementedError​(java.lang.String methodName)
        Specify that posix method is unimplemented. In JRuby we generate an exception with this.
        Parameters:
        methodName - the POSIX method that failed
      • isVerbose

        boolean isVerbose()
        Returns:
        should we provide verbose output about POSIX activities
      • getCurrentWorkingDirectory

        java.io.File getCurrentWorkingDirectory()
        Returns:
        current working directory of your runtime.
      • getEnv

        java.lang.String[] getEnv()
        Returns:
        current set of environment variables of your runtime.
      • getInputStream

        java.io.InputStream getInputStream()
        Returns:
        your runtime's current input stream
      • getOutputStream

        java.io.PrintStream getOutputStream()
        Returns:
        your runtime's current output stream
      • getPID

        int getPID()
        Get your runtime's process ID. This is only intended for non-native POSIX support (e.g. environments where JNA cannot load or security restricted environments). In JRuby we found a number of packages which would rather have some identity for the runtime than nothing. Note: If you do not want this to work you impl can just call unimplementedError(String).
        Returns:
        your runtime's process ID
      • getErrorStream

        java.io.PrintStream getErrorStream()
        Get your runtime's current ErrorStream
        Returns:
        your runtime's current error stream