public abstract class AbstractProcessEnvironment extends Object implements ProcessEnvironment
| Constructor and Description |
|---|
AbstractProcessEnvironment() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected abstract void |
removeNativeEnvironmentVariable(String name) |
void |
setEnvironmentVariable(String name,
String value)
Sets the given environment variable.
|
protected abstract void |
setNativeEnvironmentVariable(String name,
String value) |
protected abstract void |
setNativeProcessDir(File processDir) |
void |
setProcessDir(File processDir)
Sets the process working directory.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPid, getProcessDirpublic boolean maybeSetEnvironment(Map<String,String> source)
ProcessEnvironmentmaybeSetEnvironment in interface ProcessEnvironmentsource - The environmentpublic void removeEnvironmentVariable(String name) throws NativeIntegrationException
ProcessEnvironmentremoveEnvironmentVariable in interface ProcessEnvironmentname - The name of the environment variable.NativeIntegrationException - If the environment variable cannot be removed.protected abstract void removeNativeEnvironmentVariable(String name)
public boolean maybeRemoveEnvironmentVariable(String name)
ProcessEnvironmentmaybeRemoveEnvironmentVariable in interface ProcessEnvironmentname - The name of the environment variable.public void setEnvironmentVariable(String name, String value) throws NativeIntegrationException
ProcessEnvironmentsetEnvironmentVariable in interface ProcessEnvironmentname - The namevalue - The value. Can be null, which removes the environment variable.NativeIntegrationException - If the environment variable cannot be set.protected abstract void setNativeEnvironmentVariable(String name, String value)
public boolean maybeSetEnvironmentVariable(String name, String value)
ProcessEnvironmentmaybeSetEnvironmentVariable in interface ProcessEnvironmentname - The namevalue - The valuepublic void setProcessDir(File processDir) throws NativeIntegrationException
ProcessEnvironmentsetProcessDir in interface ProcessEnvironmentprocessDir - The directory.NativeIntegrationException - If process directory cannot be set.protected abstract void setNativeProcessDir(File processDir)
public boolean maybeSetProcessDir(File processDir)
ProcessEnvironmentmaybeSetProcessDir in interface ProcessEnvironmentprocessDir - The directory.public Long maybeGetPid()
ProcessEnvironmentmaybeGetPid in interface ProcessEnvironmentCopyright © 2013. All rights reserved