|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Runtime
public class Runtime
This class, with the exception of the exec() APIs, must be implemented by the VM vendor. The exec() APIs must first do any required security checks, and then call org.apache.harmony.luni.internal.process.SystemProcess.create(). The Runtime interface.
| Method Summary | |
|---|---|
void |
addShutdownHook(Thread hook)
Registers a new virtual-machine shutdown hook. |
int |
availableProcessors()
Return the number of processors, always at least one. |
Process |
exec(String prog)
Execute program in a separate platform process The new process inherits the environment of the caller. |
Process |
exec(String[] progArray)
Execute progArray[0] in a separate platform process The new process inherits the environment of the caller. |
Process |
exec(String[] progArray,
String[] envp)
Execute progArray[0] in a separate platform process The new process uses the environment provided in envp |
Process |
exec(String[] progArray,
String[] envp,
File directory)
Execute progArray[0] in a separate platform process. |
Process |
exec(String prog,
String[] envp)
Execute prog in a separate platform process The new process uses the environment provided in envp |
Process |
exec(String prog,
String[] envp,
File directory)
Execute prog in a separate platform process The new process uses the environment provided in envp |
void |
exit(int code)
Causes the virtual machine to stop running, and the program to exit. |
long |
freeMemory()
Returns the amount of free memory resources which are available to the running program. |
void |
gc()
Indicates to the virtual machine that it would be a good time to collect available memory. |
InputStream |
getLocalizedInputStream(InputStream stream)
Deprecated. Use InputStreamReader |
OutputStream |
getLocalizedOutputStream(OutputStream stream)
Deprecated. Use OutputStreamWriter |
static Runtime |
getRuntime()
Return the single Runtime instance |
void |
halt(int code)
Causes the virtual machine to stop running, and the program to exit. |
void |
load(String pathName)
Loads and links the library specified by the argument. |
(package private) void |
load(String filename,
ClassLoader loader)
|
void |
loadLibrary(String libName)
Loads and links the library specified by the argument. |
(package private) void |
loadLibrary(String libname,
ClassLoader loader)
|
long |
maxMemory()
Return the maximum memory that will be used by the virtual machine, or Long.MAX_VALUE. |
boolean |
removeShutdownHook(Thread hook)
De-registers a previously-registered virtual-machine shutdown hook. |
void |
runFinalization()
Provides a hint to the virtual machine that it would be useful to attempt to perform any outstanding object finalizations. |
static void |
runFinalizersOnExit(boolean run)
Deprecated. This method is unsafe. |
long |
totalMemory()
Returns the total amount of memory resources which is available to (or in use by) the running program. |
void |
traceInstructions(boolean enable)
Turns the output of debug information for instructions on or off. |
void |
traceMethodCalls(boolean enable)
Turns the output of debug information for methods on or off. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Process exec(String[] progArray)
throws IOException
progArray - the array containing the program to execute as well as
any arguments to the program.
IOException - if the program cannot be executed
SecurityException - if the current SecurityManager disallows
program executionSecurityManager.checkExec(java.lang.String)
public Process exec(String[] progArray,
String[] envp)
throws IOException
progArray - the array containing the program to execute a well as
any arguments to the program.envp - the array containing the environment to start the new process
in.
IOException - if the program cannot be executed
SecurityException - if the current SecurityManager disallows
program executionSecurityManager.checkExec(java.lang.String)
public Process exec(String[] progArray,
String[] envp,
File directory)
throws IOException
progArray - the array containing the program to execute a well as
any arguments to the program.envp - the array containing the environment to start the new process
in.directory - the directory in which to execute progArray[0]. If null,
execute in same directory as parent process.
IOException - if the program cannot be executed
SecurityException - if the current SecurityManager disallows
program executionSecurityManager.checkExec(java.lang.String)
public Process exec(String prog)
throws IOException
prog - the name of the program to execute
IOException - if the program cannot be executed
SecurityException - if the current SecurityManager disallows
program executionSecurityManager.checkExec(java.lang.String)
public Process exec(String prog,
String[] envp)
throws IOException
prog - the name of the program to executeenvp - the array containing the environment to start the new process
in.
IOException - if the program cannot be executed
SecurityException - if the current SecurityManager disallows
program executionSecurityManager.checkExec(java.lang.String)
public Process exec(String prog,
String[] envp,
File directory)
throws IOException
prog - the name of the program to executeenvp - the array containing the environment to start the new process
in.directory - the initial directory for the subprocess, or null to use
the directory of the current process
IOException - if the program cannot be executed
SecurityException - if the current SecurityManager disallows
program executionSecurityManager.checkExec(java.lang.String)public void exit(int code)
code - the return code.
SecurityException - if the running thread is not allowed to cause
the vm to exit.SecurityManager.checkExit(int)public long freeMemory()
public void gc()
public static Runtime getRuntime()
public void load(String pathName)
pathName - the absolute (ie: platform dependent) path to the library
to load
UnsatisfiedLinkError - if the library could not be loaded
SecurityException - if the library was not allowed to be loaded
void load(String filename,
ClassLoader loader)
public void loadLibrary(String libName)
libName - the name of the library to load
UnsatisfiedLinkError - if the library could not be loaded
SecurityException - if the library was not allowed to be loaded
void loadLibrary(String libname,
ClassLoader loader)
public void runFinalization()
@Deprecated public static void runFinalizersOnExit(boolean run)
run - true means finalize all on exit.public long totalMemory()
public void traceInstructions(boolean enable)
enable - if true, turn trace on. false turns trace off.public void traceMethodCalls(boolean enable)
enable - if true, turn trace on. false turns trace off.@Deprecated public InputStream getLocalizedInputStream(InputStream stream)
InputStreamReader
@Deprecated public OutputStream getLocalizedOutputStream(OutputStream stream)
OutputStreamWriter
public void addShutdownHook(Thread hook)
hook - the hook (a Thread) to registerpublic boolean removeShutdownHook(Thread hook)
hook - the hook (a Thread) to de-register
public void halt(int code)
code - the return code.
SecurityException - if the running thread is not allowed to cause the vm to
exit.SecurityManager.checkExit(int)public int availableProcessors()
public long maxMemory()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||