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