public static class NativeCalls.NativeCallsGeneric extends NativeCalls
NativeCalls when no JNA based
implementation could be initialized (e.g. if JNA itself does not provide an
implementation for the platform, or JNA is not found).NativeCalls.NativeCallsGeneric, NativeCalls.RehashServerOnSIGHUPCLOCKID_MONOTONIC, CLOCKID_MONOTONIC_RAW, CLOCKID_PROCESS_CPUTIME_ID, CLOCKID_REALTIME, CLOCKID_THREAD_CPUTIME_ID, OPT_IPPROTO_TCP, TEST_CHK_FALLOC_DIRS, TEST_NO_FALLOC_DIRS, UNSUPPORTED_OPTION| Constructor and Description |
|---|
NativeCallsGeneric() |
| Modifier and Type | Method and Description |
|---|---|
String |
getEnvironment(String name)
Get the value of given environment variable.
|
OSType |
getOSType()
Get the
OSType of current system. |
int |
getProcessId()
Get the process ID of the current process.
|
boolean |
isProcessActive(int processId)
Check whether a process with given ID is still running.
|
boolean |
killProcess(int processId)
Kill the process with given process ID immediately (i.e.
|
void |
setCurrentWorkingDirectory(String path)
Set the current working directory to the given path.
|
void |
setEnvironment(String name,
String value)
Set the value of an environment variable.
|
Map<TCPSocketOptions,Throwable> |
setSocketOptions(Socket sock,
InputStream sockStream,
Map<TCPSocketOptions,Object> optValueMap)
Set given extended socket options on a Java
Socket. |
clockResolution, daemonize, getInstance, getModifiableJavaEnv, getModifiableJavaEnvWIN, getPlatformOption, getSessionThreadLimit, getSocketKernelDescriptor, getUnsupportedSocketOptionMessage, isNativeTimerEnabled, isNoProtocolOptionCode, isOnLocalFileSystem, isTTY, loadNativeLibrary, lockCurrentMemory, nanoTime, preBlow, setGenericSocketOptions, setPlatformSocketOptionpublic OSType getOSType()
NativeCallsOSType of current system.getOSType in class NativeCallsNativeCalls.getOSType()public String getEnvironment(String name)
NativeCallsSystem.getenv(String) in that it returns the current value of the
environment variable in the process rather than from a static unmodifiable
map created on the first call.getEnvironment in class NativeCallsname - the name of the environment variable to be modifiedNativeCalls.getEnvironment(String)public void setEnvironment(String name, String value)
NativeCallsSystem.getenv(String) will also return the
modified value.setEnvironment in class NativeCallsname - the name of the environment variable to be modifiedvalue - the new value of the environment variable; a value of null clears
the existing valueNativeCalls.setEnvironment(String, String)public void setCurrentWorkingDirectory(String path)
NativeCallssetCurrentWorkingDirectory in class NativeCallspath - new working directory (preferably a full absolute path)NativeCalls.setCurrentWorkingDirectory(String)public int getProcessId()
NativeCallsgetProcessId in class NativeCallsNativeCalls.getProcessId()public boolean isProcessActive(int processId)
throws UnsupportedOperationException
NativeCallsisProcessActive in class NativeCallsUnsupportedOperationException - if no native API to determine the process status could be invokedNativeCalls.isProcessActive(int)public boolean killProcess(int processId)
throws UnsupportedOperationException
NativeCallskillProcess in class NativeCallsprocessId - the PID of the process to be killUnsupportedOperationException - if no native API to kill the process could be invokedNativeCalls.killProcess(int)public Map<TCPSocketOptions,Throwable> setSocketOptions(Socket sock, InputStream sockStream, Map<TCPSocketOptions,Object> optValueMap) throws UnsupportedOperationException
Socket.setSocketOptions in class NativeCallsTCPSocketOptions for the current platform
and the underlying exceptionUnsupportedOperationException - if the native API to set the option could not be found or invokedTCPSocketOptionsCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.