org.jruby.ext.posix

Interface POSIXHandler

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 classPOSIXHandler.WARNING_ID
Method Summary
voiderror(Errno error, String extraData)
FilegetCurrentWorkingDirectory()
Get current working directory of your runtime.
String[]getEnv()
Get current set of environment variables of your runtime.
PrintStreamgetErrorStream()
Get your runtime's current ErrorStream
InputStreamgetInputStream()
Get your runtime's current InputStream
PrintStreamgetOutputStream()
Get your runtime's current OutputStream
intgetPID()
Get your runtimes process ID.
booleanisVerbose()
Should we provide verbose output about POSIX activities
voidunimplementedError(String methodName)
Specify that posix method is unimplemented.
voidwarn(POSIXHandler.WARNING_ID id, String message, Object... data)

Method Detail

error

public void error(Errno error, String extraData)

getCurrentWorkingDirectory

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

getEnv

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

getErrorStream

public PrintStream getErrorStream()
Get your runtime's current ErrorStream

getInputStream

public InputStream getInputStream()
Get your runtime's current InputStream

getOutputStream

public PrintStream getOutputStream()
Get your runtime's current OutputStream

getPID

public 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).

isVerbose

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

unimplementedError

public void unimplementedError(String methodName)
Specify that posix method is unimplemented. In JRuby we generate an exception with this.

warn

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