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.


Nested Class Summary
static class POSIXHandler.WARNING_ID
           
 
Method Summary
 void error(jnr.constants.platform.Errno error, java.lang.String extraData)
           
 void error(jnr.constants.platform.Errno error, java.lang.String methodName, java.lang.String extraData)
           
 java.io.File getCurrentWorkingDirectory()
          Get current working directory of your runtime.
 java.lang.String[] getEnv()
          Get current set of environment variables of your runtime.
 java.io.PrintStream getErrorStream()
          Get your runtime's current ErrorStream
 java.io.InputStream getInputStream()
          Get your runtime's current InputStream
 java.io.PrintStream getOutputStream()
          Get your runtime's current OutputStream
 int getPID()
          Get your runtimes process ID.
 boolean isVerbose()
          Should we provide verbose output about POSIX activities
 void unimplementedError(java.lang.String methodName)
          Specify that posix method is unimplemented.
 void warn(POSIXHandler.WARNING_ID id, java.lang.String message, java.lang.Object... data)
           
 

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.


warn

void warn(POSIXHandler.WARNING_ID id,
          java.lang.String message,
          java.lang.Object... data)

isVerbose

boolean isVerbose()
Should we provide verbose output about POSIX activities


getCurrentWorkingDirectory

java.io.File getCurrentWorkingDirectory()
Get current working directory of your runtime.


getEnv

java.lang.String[] getEnv()
Get current set of environment variables of your runtime.


getInputStream

java.io.InputStream getInputStream()
Get your runtime's current InputStream


getOutputStream

java.io.PrintStream getOutputStream()
Get your runtime's current OutputStream


getPID

int getPID()
Get your runtimes 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).


getErrorStream

java.io.PrintStream getErrorStream()
Get your runtime's current ErrorStream



Copyright © 2013. All Rights Reserved.