public interface ProcessEnvironment
Implementations are not thread-safe.
| Modifier and Type | Method and Description |
|---|---|
Long |
getPid()
Returns the OS level PID for the current process.
|
File |
getProcessDir()
Returns the working directory of the current process.
|
Long |
maybeGetPid()
Returns the OS level PID for the current process, or null if not available.
|
boolean |
maybeRemoveEnvironmentVariable(String name)
Removes the given environment variable, if possible.
|
boolean |
maybeSetEnvironment(Map<String,String> source)
Sets the environment of this process, if possible.
|
boolean |
maybeSetEnvironmentVariable(String name,
String value)
Sets the given environment variable, if possible.
|
boolean |
maybeSetProcessDir(File processDir)
Sets the process working directory, if possible
|
void |
removeEnvironmentVariable(String name)
Removes the given environment variable.
|
void |
setEnvironmentVariable(String name,
String value)
Sets the given environment variable.
|
void |
setProcessDir(File processDir)
Sets the process working directory.
|
boolean maybeSetEnvironment(Map<String,String> source)
source - The environmentvoid removeEnvironmentVariable(String name) throws NativeIntegrationException
name - The name of the environment variable.NativeIntegrationException - If the environment variable cannot be removed.boolean maybeRemoveEnvironmentVariable(String name)
name - The name of the environment variable.void setEnvironmentVariable(String name, String value) throws NativeIntegrationException
name - The namevalue - The value. Can be null, which removes the environment variable.NativeIntegrationException - If the environment variable cannot be set.boolean maybeSetEnvironmentVariable(String name, String value)
name - The namevalue - The valueFile getProcessDir() throws NativeIntegrationException
NativeIntegrationException - If the process directory is not available.void setProcessDir(File processDir) throws NativeIntegrationException
processDir - The directory.NativeIntegrationException - If process directory cannot be set.boolean maybeSetProcessDir(File processDir)
processDir - The directory.Long getPid() throws NativeIntegrationException
NativeIntegrationException - If the pid is not available.Long maybeGetPid()
Copyright © 2013. All rights reserved