首页>
外国专利>
Method and system for determining the defining classLoader of a Java class as it is being defined
Method and system for determining the defining classLoader of a Java class as it is being defined
展开▼
机译:确定正在定义的Java类的定义classLoader的方法和系统
展开▼
页面导航
摘要
著录项
相似文献
摘要
A technique is presented for determining the defining ClassLoader class of a Java class as it is being defined within a Java Virtual Machine (JVM) by instrumenting the “java.lang.ClassLoader” class. Within a JVM, all ClassLoader instances call one of the “defineClass” methods of class “java.lang.ClassLoader” in order to pass the raw bytes for loaded a class to the JVM to have it defined as a Java class. Therefore, instrumentation code is inserted into the “defineClass” methods of class “java.lang.ClassLoader”; the instrumentation code stores an identity of the defining ClassLoader prior to the invocation of the class load hook by the JVM, which can use the identity of the defining ClassLoader for various purposes.
展开▼