Top Description Inners Methods
jnr.posix

public Interface POSIXHandler

Known Direct Implementers
jnr.posix.util.DefaultPOSIXHandler
Imports
jnr.constants.platform.Errno, java.io.File, .InputStream, .PrintStream

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 and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Method Summary

Modifier and TypeMethod and Description
public void
error(Errno error, String extraData)

public void
error(Errno error, String methodName, String extraData)

public File

Returns:

current working directory of your runtime.
getCurrentWorkingDirectory
()

public String[]

Returns:

current set of environment variables of your runtime.
getEnv
()

public PrintStream

Returns:

your runtime's current error stream
getErrorStream
()

Get your runtime's current ErrorStream

public InputStream

Returns:

your runtime's current input stream
getInputStream
()

public PrintStream

Returns:

your runtime's current output stream
getOutputStream
()

public int

Returns:

your runtime's process ID
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).

public boolean

Returns:

should we provide verbose output about POSIX activities
isVerbose
()

public void
unimplementedError(String
the POSIX method that failed
methodName
)

Specify that posix method is unimplemented.

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

Method Detail

errorback to summary
public void error(Errno error, String extraData)
errorback to summary
public void error(Errno error, String methodName, String extraData)
getCurrentWorkingDirectoryback to summary
public File getCurrentWorkingDirectory()
Returns:File

current working directory of your runtime.

getEnvback to summary
public String[] getEnv()
Returns:String[]

current set of environment variables of your runtime.

getErrorStreamback to summary
public PrintStream getErrorStream()

Get your runtime's current ErrorStream

Returns:PrintStream

your runtime's current error stream

getInputStreamback to summary
public InputStream getInputStream()
Returns:InputStream

your runtime's current input stream

getOutputStreamback to summary
public PrintStream getOutputStream()
Returns:PrintStream

your runtime's current output stream

getPIDback to summary
public 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:int

your runtime's process ID

isVerboseback to summary
public boolean isVerbose()
Returns:boolean

should we provide verbose output about POSIX activities

unimplementedErrorback to summary
public void unimplementedError(String methodName)

Specify that posix method is unimplemented. In JRuby we generate an exception with this.

Parameters
methodName:String

the POSIX method that failed

warnback to summary
public void warn(POSIXHandler.WARNING_ID id, String message, Object... data)
jnr.posix back to summary

public final Enum POSIXHandler.WARNING_ID

extends Enum<POSIXHandler.WARNING_ID>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final POSIXHandler.WARNING_ID
private String

Constructor Summary

AccessConstructor and Description
private
WARNING_ID(String messageID)

Method Summary

Modifier and TypeMethod and Description
public static POSIXHandler.WARNING_ID
public static POSIXHandler.WARNING_ID[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DUMMY_VALUE_USEDback to summary
public static final POSIXHandler.WARNING_ID DUMMY_VALUE_USED
messageIDback to summary
private String messageID

Constructor Detail

WARNING_IDback to summary
private WARNING_ID(String messageID)

Method Detail

valueOfback to summary
public static POSIXHandler.WARNING_ID valueOf(String name)
valuesback to summary
public static POSIXHandler.WARNING_ID[] values()