| java.lang.Object org.netbeans.lib.profiler.classfile.ClassRepository
ClassRepository | abstract public class ClassRepository implements CommonConstants(Code) | | A collection of several static methods for general class file reading functionality. Allows to set
a class path, read a class from class path, generate a class that does not have a .class file (such
as an array class), etc. It also keeps track of classes ever loaded by it, and allows one to iterate
over these classes.
author: Tomas Hurka author: Misha Dmitirev |
Inner Class :public static class CodeRegionBCI | |
Method Summary | |
public static void | addPlaceholder(PlaceholderClassInfo pci) | public static void | addVMSuppliedClassFile(String className, int classLoaderId, byte[] buf) Adds a VM-supplied class file to the class file cache, but not to this repository's hashtable yet. | public static ClassInfo | classInfoForFile(File f) Utility method - read .class file and return class name stored in it. | public static void | cleanup() Should be called after profiling finishes to cleanup any static data, close opened files, etc. | public static void | clearCache() | public static ArrayList | getAllClassVersions(String className) | public static Enumeration | getClassEnumerationWithAllVersions() | public static ClassPath | getClassPath() | public static ArrayList | getClassesOnClasspath(ArrayList classPathElementList) Returns names of all classes that can be located on the given classpath. | static int | getDefiningClassLoaderId(String className, int classLoaderId) | public static CodeRegionBCI | getMethodForSourceRegion(ClassInfo clazz, int startLine, int endLine) | public static CodeRegionBCI | getMethodMinAndMaxBCI(ClassInfo clazz, String methodName, String methodSignature) | public static void | initClassPaths(String workingDir, String[] classPaths) This is the ClassRepository internal class path initialization method. | public static DynamicClassInfo | lookupClass(String className, int classLoaderId) Lookup a class in the class repository. | public static BaseClassInfo | lookupClassOrCreatePlaceholder(String className, int classLoaderId) Lookup a class in the class repository. | public static BaseClassInfo | lookupLoadedClass(String className, int classLoaderId, boolean allowExistingPlaceholder) Lookup a class in the class repository, only among those currently loaded by the VM. | public static BaseClassInfo | lookupSpecialClass(String className) Used only for special classes, such as array classes, that don't have a .class file on the class path. |
LOCATION_VMSUPPLIED | final static String LOCATION_VMSUPPLIED(Code) | | |
addVMSuppliedClassFile | public static void addVMSuppliedClassFile(String className, int classLoaderId, byte[] buf)(Code) | | Adds a VM-supplied class file to the class file cache, but not to this repository's hashtable yet.
|
cleanup | public static void cleanup()(Code) | | Should be called after profiling finishes to cleanup any static data, close opened files, etc.
|
clearCache | public static void clearCache()(Code) | | Will reset any cached data, will not reset data pertinent to session in progress
|
getClassEnumerationWithAllVersions | public static Enumeration getClassEnumerationWithAllVersions()(Code) | | |
getClassesOnClasspath | public static ArrayList getClassesOnClasspath(ArrayList classPathElementList)(Code) | | Returns names of all classes that can be located on the given classpath.
Since this method performs directory scanning, it is recommended to call it once and cache the results.
|
getDefiningClassLoaderId | static int getDefiningClassLoaderId(String className, int classLoaderId)(Code) | | |
getMethodMinAndMaxBCI | public static CodeRegionBCI getMethodMinAndMaxBCI(ClassInfo clazz, String methodName, String methodSignature)(Code) | | |
initClassPaths | public static void initClassPaths(String workingDir, String[] classPaths)(Code) | | This is the ClassRepository internal class path initialization method. The class path is initialized to the
combination of the running VM's boot, extension and main class paths (if they are available; otherwise only
the main path is obtained from the tool's settings), plus the secondary class path from the settings.
Parameters: workingDir - working directory, needed in case the given paths are in the local form Parameters: classPaths - the 3 elements should be the user, extension, and boot class paths, respectively |
lookupClass | public static DynamicClassInfo lookupClass(String className, int classLoaderId) throws IOException, ClassFormatError(Code) | | Lookup a class in the class repository. If it's not there, look it up on the classpath (for classes with 0 loader)
or in the cache of VM-supplied classes. If the class is not found anywhere, reports this and returns null.
Guaranteed to return a real class or null, but not a placeholder. Should not be called for special (array)
classes - there is lookupSpecialClass() for that.
|
lookupClassOrCreatePlaceholder | public static BaseClassInfo lookupClassOrCreatePlaceholder(String className, int classLoaderId)(Code) | | Lookup a class in the class repository. If it's not there, don't bother checking the classpath etc. - just
return an instance of PlaceholderClassInfo. The rationale is that we may not ever need the real class for
className; and when we need it, lookupClass() above will deliver it.
|
lookupLoadedClass | public static BaseClassInfo lookupLoadedClass(String className, int classLoaderId, boolean allowExistingPlaceholder)(Code) | | Lookup a class in the class repository, only among those currently loaded by the VM.
If there is no loaded class and allowExistingPlaceholder is true, also check for an existing placeholders.
Returns either a loaded class, or if allowed an existing placeholder, or null, but not a new placeholder.
|
lookupSpecialClass | public static BaseClassInfo lookupSpecialClass(String className)(Code) | | Used only for special classes, such as array classes, that don't have a .class file on the class path. If a class
with the given name does not exist, a BaseClassInfo is created for it immediately.
|
|
|