jnr.posix.util
Class DefaultPOSIXHandler

java.lang.Object
  extended by jnr.posix.util.DefaultPOSIXHandler
All Implemented Interfaces:
POSIXHandler

public class DefaultPOSIXHandler
extends Object
implements POSIXHandler

A POSIXHandler with reasonable default behavior.


Nested Class Summary
 
Nested classes/interfaces inherited from interface jnr.posix.POSIXHandler
POSIXHandler.WARNING_ID
 
Constructor Summary
DefaultPOSIXHandler()
           
 
Method Summary
 void error(jnr.constants.platform.Errno error, String extraData)
           
 File getCurrentWorkingDirectory()
          Get current working directory of your runtime.
 String[] getEnv()
          Get current set of environment variables of your runtime.
 PrintStream getErrorStream()
          Get your runtime's current ErrorStream
 InputStream getInputStream()
          Get your runtime's current InputStream
 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(String methodName)
          Specify that posix method is unimplemented.
 void warn(POSIXHandler.WARNING_ID id, String message, Object... data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPOSIXHandler

public DefaultPOSIXHandler()
Method Detail

error

public void error(jnr.constants.platform.Errno error,
                  String extraData)
Specified by:
error in interface POSIXHandler

unimplementedError

public void unimplementedError(String methodName)
Description copied from interface: POSIXHandler
Specify that posix method is unimplemented. In JRuby we generate an exception with this.

Specified by:
unimplementedError in interface POSIXHandler

warn

public void warn(POSIXHandler.WARNING_ID id,
                 String message,
                 Object... data)
Specified by:
warn in interface POSIXHandler

isVerbose

public boolean isVerbose()
Description copied from interface: POSIXHandler
Should we provide verbose output about POSIX activities

Specified by:
isVerbose in interface POSIXHandler

getCurrentWorkingDirectory

public File getCurrentWorkingDirectory()
Description copied from interface: POSIXHandler
Get current working directory of your runtime.

Specified by:
getCurrentWorkingDirectory in interface POSIXHandler

getEnv

public String[] getEnv()
Description copied from interface: POSIXHandler
Get current set of environment variables of your runtime.

Specified by:
getEnv in interface POSIXHandler

getInputStream

public InputStream getInputStream()
Description copied from interface: POSIXHandler
Get your runtime's current InputStream

Specified by:
getInputStream in interface POSIXHandler

getOutputStream

public PrintStream getOutputStream()
Description copied from interface: POSIXHandler
Get your runtime's current OutputStream

Specified by:
getOutputStream in interface POSIXHandler

getPID

public int getPID()
Description copied from interface: POSIXHandler
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).

Specified by:
getPID in interface POSIXHandler

getErrorStream

public PrintStream getErrorStream()
Description copied from interface: POSIXHandler
Get your runtime's current ErrorStream

Specified by:
getErrorStream in interface POSIXHandler


Copyright © 2012. All Rights Reserved.