Represents the running virtual machine. All VM specific API are implemented on this class.
Note that all methods in VM are static. There is no singleton instance which represents the actively running VM.
Static Public Member Functions | |
static final ClassLoader | getNonBootstrapClassLoader () |
This method must be provided by the vm vendor, as it is used by other provided class implementations. | |
static final void | initializeClassLoader (ClassLoader loader, boolean bootLoader) |
Initialize the classloader. | |
static ClassLoader | callerClassLoader () |
This method must be included, as it is used by ResourceBundle.getBundle(), and other places as well. | |
static void | dumpString (String str) |
Native used to dump a string to the system console for debugging. | |
static void | addShutdownHook (Thread hook) |
Registers a new virtual-machine shutdown hook. | |
static boolean | removeShutdownHook (Thread hook) |
De-registers a previously-registered virtual-machine shutdown hook. | |
static void | closeJars () |
This method must be provided by the vm vendor. | |
static void | deleteOnExit () |
This method must be provided by the vm vendor. | |
static String[] | getVMArgs () |
Returns command line arguments passed to the VM. | |
Static Package Functions | |
static final ClassLoader | getStackClassLoader (int depth) |
This method must be provided by the vm vendor, as it is used by com.ibm.oti.vm.MsgHelp.setLocale() to get the bootstrap ClassLoader. | |
static Class | findClassOrNull (String className, ClassLoader classLoader) |
Native used to find and load a class using the VM. | |
static int | getCPIndexImpl (Class targetClass) |
Get the classpath entry that was used to load the class that is the arg. | |
static void | initializeVM () |
Does internal initializaion required by VM. | |
static final int | getClassPathEntryType (Object classLoader, int cpIndex) |
Return the type of the specified entry on the class path for a ClassLoader. | |
static int | getClassPathCount () |
Return the number of entries on the bootclasspath. | |
static byte[] | getPathFromClassPath (int index) |
Return the specified bootclasspath entry. | |
Static Package Attributes | |
static final int | CPE_TYPE_UNKNOWN = 0 |
static final int | CPE_TYPE_DIRECTORY = 1 |
static final int | CPE_TYPE_JAR = 2 |
static final int | CPE_TYPE_TCP = 3 |
static final int | CPE_TYPE_UNUSABLE = 5 |
|
This method must be provided by the vm vendor, as it is used by com.ibm.oti.vm.MsgHelp.setLocale() to get the bootstrap ClassLoader. MsgHelp uses the bootstrap ClassLoader to find the resource bundle of messages packaged with the bootstrap classes. Returns the ClassLoader of the method (including natives) at the specified depth on the stack of the calling thread. Frames representing the VM implementation of java.lang.reflect are not included in the list. This is not a public method as it can return the bootstrap class loader, which should not be accessed by non-bootstrap classes. Notes:
|
|
This method must be provided by the vm vendor, as it is used by other provided class implementations. For example, java.io.ObjectInputStream.readObject() and java.io.ObjectInputStream.resolveProxyClass(). It is also useful for other classes, such as java.rmi.server.RMIClassLoader. Walk the stack and answer the most recent non-null and non-bootstrap ClassLoader on the stack of the calling thread. If no such ClassLoader is found, null is returned. Notes: 1) This method operates on the defining classes of methods on stack. NOT the classes of receivers.
|
|
Initialize the classloader.
|
|
Native used to find and load a class using the VM.
|
|
This method must be included, as it is used by ResourceBundle.getBundle(), and other places as well. The reference implementation of this method uses the getStackClassLoader() method. Returns the ClassLoader of the method that called the caller. i.e. A.x() calls B.y() calls callerClassLoader(), A's ClassLoader will be returned. Returns null for the bootstrap ClassLoader.
|
|
Native used to dump a string to the system console for debugging.
|
|
Get the classpath entry that was used to load the class that is the arg. This method is for internal use only.
|
|
Does internal initializaion required by VM.
|
|
Registers a new virtual-machine shutdown hook. This is equivalent to the 1.3 API of the same name.
|
|
De-registers a previously-registered virtual-machine shutdown hook. This is equivalent to the 1.3 API of the same name.
|
|
This method must be provided by the vm vendor. Called to signal that the com.ibm.oti.net.www.protocol.jar.JarURLConnection class has been loaded and JarURLConnection.closeCachedFiles() should be called on VM shutdown.
|
|
This method must be provided by the vm vendor. Called to signal that the com.ibm.oti.util.DeleteOnExit class has been loaded and DeleteOnExit.deleteOnExit() should be called on VM shutdown.
|
|
Return the type of the specified entry on the class path for a ClassLoader. Valid tyes are: CPE_TYPE_UNKNOWN CPE_TYPE_DIRECTORY CPE_TYPE_JAR CPE_TYPE_TCP - this is obsolete CPE_TYPE_UNUSABLE
|
|
Returns command line arguments passed to the VM. Internally these are broken into optionString and extraInfo. This only returns the optionString part.
|
|
Return the number of entries on the bootclasspath.
|
|
Return the specified bootclasspath entry.
|