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