Top Inners Fields Constructors Methods
jnr.posix

public Class POSIXFactory

extends Object
Class Inheritance
Imports
jnr.ffi.Library, .LibraryLoader, .LibraryOption, .Struct, java.util.Collections, .HashMap, .Map, jnr.ffi.mapper.FunctionMapper, jnr.posix.util.DefaultPOSIXHandler, .Platform

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final Class<Struct>
public static final Platform
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static FunctionMapper
public static POSIX

Returns:

a pure-Java POSIX implementation
getJavaPOSIX
(POSIXHandler
a POSIXHandler implementation
handler
)

Get a pure-Java POSIX instance.

public static POSIX

Returns:

a pure-Java POSIX implementation
getJavaPOSIX
()

Get a pure-Java POSIX instance.

public static POSIX

Returns:

a native POSIX implementation, raising errors if the native version can't load
getNativePOSIX
(POSIXHandler
a POSIXHandler implementation
handler
)

Get a POSIX instance.

public static POSIX

Returns:

a native POSIX implementation, raising errors if the native version can't load
getNativePOSIX
()

Get a POSIX instance.

public static POSIX

Returns:

a POSIX implementation, attempting to use native code if useNativePosix is true
getPOSIX
(POSIXHandler
a POSIXHandler implementation
handler
,
boolean
whether to attempt to use native code for better functionality
useNativePOSIX
)

Get a POSIX instance.

public static POSIX

Returns:

a POSIX implementation, native if possible and pure-Java otherwise.
getPOSIX
()

This will use DefaultPOSIXHandler and the native POSIX implementation, falling back on the pure-Java implementation if native support is not available.

private static String[]
private static Class<? extends LibC>
public static POSIX
public static POSIX
public static POSIX
public static POSIX
public static POSIX
private static POSIX
public static POSIX
pack-priv static POSIX
loadPOSIX(POSIXHandler handler, boolean useNativePOSIX)

public static POSIX
public static POSIX
private static Map<LibraryOption, Object>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BOGUS_HACKback to summary
private static final Class<Struct> BOGUS_HACK
NATIVE_PLATFORMback to summary
public static final Platform NATIVE_PLATFORM
STANDARD_C_LIBRARY_NAMEback to summary
public static final String STANDARD_C_LIBRARY_NAME

Constructor Detail

POSIXFactoryback to summary
public POSIXFactory()

Method Detail

functionMapperback to summary
private static FunctionMapper functionMapper()
getJavaPOSIXback to summary
public static POSIX getJavaPOSIX(POSIXHandler handler)

Get a pure-Java POSIX instance. Functionality will be limited to that which can be provided by pure-Java/JDK features or shelling out to external commands.

Parameters
handler:POSIXHandler

a POSIXHandler implementation

Returns:POSIX

a pure-Java POSIX implementation

getJavaPOSIXback to summary
public static POSIX getJavaPOSIX()

Get a pure-Java POSIX instance. Functionality will be limited to that which can be provided by pure-Java/JDK features or shelling out to external commands.

Returns:POSIX

a pure-Java POSIX implementation

getNativePOSIXback to summary
public static POSIX getNativePOSIX(POSIXHandler handler)

Get a POSIX instance. If a true native implementation can't be loaded, allow that error to propagate rather than falling back on the pure-Java version.

Parameters
handler:POSIXHandler

a POSIXHandler implementation

Returns:POSIX

a native POSIX implementation, raising errors if the native version can't load

getNativePOSIXback to summary
public static POSIX getNativePOSIX()

Get a POSIX instance. If a true native implementation can't be loaded, allow that error to propagate rather than falling back on the pure-Java version.

Returns:POSIX

a native POSIX implementation, raising errors if the native version can't load

getPOSIXback to summary
public static POSIX getPOSIX(POSIXHandler handler, boolean useNativePOSIX)

Get a POSIX instance. If useNativePosix is true, this works just like POSIXFactory#getPOSIX(). If useNativePosix is false, this works like POSIXFactory#getJavaPOSIX()

Parameters
handler:POSIXHandler

a POSIXHandler implementation

useNativePOSIX:boolean

whether to attempt to use native code for better functionality

Returns:POSIX

a POSIX implementation, attempting to use native code if useNativePosix is true

getPOSIXback to summary
public static POSIX getPOSIX()

This will use DefaultPOSIXHandler and the native POSIX implementation, falling back on the pure-Java implementation if native support is not available.

Returns:POSIX

a POSIX implementation, native if possible and pure-Java otherwise.

librariesback to summary
private static String[] libraries()
libraryInterfaceback to summary
private static Class<? extends LibC> libraryInterface()
loadAixPOSIXback to summary
public static POSIX loadAixPOSIX(POSIXHandler handler)
loadDragonFlyPOSIXback to summary
public static POSIX loadDragonFlyPOSIX(POSIXHandler handler)
loadFreeBSDPOSIXback to summary
public static POSIX loadFreeBSDPOSIX(POSIXHandler handler)
loadLinuxPOSIXback to summary
public static POSIX loadLinuxPOSIX(POSIXHandler handler)
loadMacOSPOSIXback to summary
public static POSIX loadMacOSPOSIX(POSIXHandler handler)
loadNativePOSIXback to summary
private static POSIX loadNativePOSIX(POSIXHandler handler)
loadOpenBSDPOSIXback to summary
public static POSIX loadOpenBSDPOSIX(POSIXHandler handler)
loadPOSIXback to summary
pack-priv static POSIX loadPOSIX(POSIXHandler handler, boolean useNativePOSIX)
loadSolarisPOSIXback to summary
public static POSIX loadSolarisPOSIX(POSIXHandler handler)
loadWindowsPOSIXback to summary
public static POSIX loadWindowsPOSIX(POSIXHandler handler)
optionsback to summary
private static Map<LibraryOption, Object> options()
jnr.posix back to summary

private final Class POSIXFactory.DefaultLibCProvider

extends Object
implements LibCProvider
Class Inheritance
All Implemented Interfaces
jnr.posix.LibCProvider

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final LibCProvider

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public final Crypt
public final LibC
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final LibCProvider INSTANCE

Constructor Detail

DefaultLibCProviderback to summary
private DefaultLibCProvider()

Method Detail

getCryptback to summary
public final Crypt getCrypt()

Implements jnr.posix.LibCProvider.getCrypt.

getLibCback to summary
public final LibC getLibC()

Implements jnr.posix.LibCProvider.getLibC.

jnr.posix back to summary

private final Class POSIXFactory.DefaultLibCProvider.SingletonHolder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static Crypt
public static LibC

Constructor Summary

AccessConstructor and Description
private

Field Detail

cryptback to summary
public static Crypt crypt
libcback to summary
public static LibC libc

Constructor Detail

SingletonHolderback to summary
private SingletonHolder()