Provides methods for dynamic bytecode redefinition and other class-related operations.
A version for JDK 1.5
author: Tomas Hurka author: Misha Dmitriev
Inner Class :public static class RedefineException extends Exception
enableClassLoadHook() When the class load hook is enabled, it will call the ProfilerInterface.classLoadHook(Class) method every time
a class is load and prepared.
notifyAboutClassLoaderUnloading() This notifies the underlying native code about the fact that some classloader (we don't know which one since
we use PhantomReferences for them) is unloaded.
native public static void cacheLoadedClasses(Class[] nonSystemClasses, int nonSystemIndex)(Code)
disableClassLoadHook
native public static void disableClassLoadHook()(Code)
Disables the above class load hook
enableClassLoadHook
native public static void enableClassLoadHook()(Code)
When the class load hook is enabled, it will call the ProfilerInterface.classLoadHook(Class) method every time
a class is load and prepared.
getAllLoadedClasses
native public static Class[] getAllLoadedClasses()(Code)
Returns all currently loaded *and linked* classes.
On JDK 1.5, it returns just a Class[] array of all loaded classes
getCachedClassFileBytes
native public static byte[] getCachedClassFileBytes(Class clazz)(Code)
Returns the cached class file bytes for the given class. Currently
agent (on JDK 1.5) caches these bytes only for classes loaded with custom classloaders (that is, not
bootstrap (null) and not system classloader). If this method is called for a class loaded using bootstrap or
system classloader, it just returns null.
native public static void notifyAboutClassLoaderUnloading()(Code)
This notifies the underlying native code about the fact that some classloader (we don't know which one since
we use PhantomReferences for them) is unloaded. Thus the native code that could have cached the class file
bytes for classes loaded with this loader, may release these bytes now. Really needed only in 1.5.
redefineClasses
public static void redefineClasses(Class[] classes, byte[][] newClassFileBytes) throws RedefineException(Code)
RedefineClasses() as provided starting from JDK 1.5
setSleepTrackingEnabled
native public static boolean setSleepTrackingEnabled(boolean value)(Code)
setVMObjectAllocEnabled
native public static boolean setVMObjectAllocEnabled(boolean value)(Code)
setWaitTrackingEnabled
native public static boolean setWaitTrackingEnabled(boolean value)(Code)