-
- All Known Implementing Classes:
DefaultPOSIXHandler
public interface POSIXHandlerThe 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
Nested Classes Modifier and Type Interface Description static classPOSIXHandler.WARNING_ID
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiderror(jnr.constants.platform.Errno error, String extraData)voiderror(jnr.constants.platform.Errno error, String methodName, String extraData)FilegetCurrentWorkingDirectory()String[]getEnv()PrintStreamgetErrorStream()Get your runtime's current ErrorStreamInputStreamgetInputStream()PrintStreamgetOutputStream()intgetPID()Get your runtime's process ID.booleanisVerbose()voidunimplementedError(String methodName)Specify that posix method is unimplemented.voidwarn(POSIXHandler.WARNING_ID id, String message, Object... data)
-
-
-
Method Detail
-
error
void error(jnr.constants.platform.Errno error, String extraData)
-
unimplementedError
void unimplementedError(String methodName)
Specify that posix method is unimplemented. In JRuby we generate an exception with this.- Parameters:
methodName- the POSIX method that failed
-
warn
void warn(POSIXHandler.WARNING_ID id, String message, Object... data)
-
isVerbose
boolean isVerbose()
- Returns:
- should we provide verbose output about POSIX activities
-
getCurrentWorkingDirectory
File getCurrentWorkingDirectory()
- Returns:
- current working directory of your runtime.
-
getEnv
String[] getEnv()
- Returns:
- current set of environment variables of your runtime.
-
getInputStream
InputStream getInputStream()
- Returns:
- your runtime's current input stream
-
getOutputStream
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 callunimplementedError(String).- Returns:
- your runtime's process ID
-
getErrorStream
PrintStream getErrorStream()
Get your runtime's current ErrorStream- Returns:
- your runtime's current error stream
-
-