|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface to query and monitor the JVM's set of currently loaded classes and their classloaders.
Method Summary | |
void |
addClassLoadListener(java.lang.ClassLoader loader,
ClassLoadListener listener)
Add a listener to receive event notification of Class load/unload. |
void |
addClassLoadListener(ClassLoadListener listener)
Adds a listener to receive event notification of any Class load/unload. |
java.util.Collection |
getAllClasses(java.lang.ClassLoader loader)
Find all (loaded) classes in this loader (will _not_ include parent loaders). |
java.util.Collection |
getAllClasses(java.lang.String className)
Find all classes with this name in the JVM (will search through all class loaders, but will not load the Class if not found.) |
java.util.Collection |
getAllClassLoaders()
Returns all the ClassLoaders currently in use. |
java.lang.Class |
getClass(java.lang.String className,
java.lang.ClassLoader loader)
Find an already loaded class in the JVM. |
java.lang.Class |
getClass(java.lang.String className,
java.lang.ClassLoader loader,
boolean load)
Find a named class in the JVM. |
ClassPreProcessor |
getClassPreProcessor()
Returns the ClassPreProcessor currently in use. |
void |
redefineClass(java.lang.Class cl,
byte[] buffer,
int offset,
int length)
Redefines the specified class. |
void |
removeClassLoadListener(ClassLoadListener listener)
Removes the specified ClassLoadListener. |
void |
setClassPreProcessor(ClassPreProcessor preProcessor)
Registers a class preprocessor. |
Methods inherited from interface com.bea.jvm.Describable |
getDescription |
Method Detail |
public java.util.Collection getAllClassLoaders() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.ClassLoader
public java.lang.Class getClass(java.lang.String className, java.lang.ClassLoader loader, boolean load) throws NotAvailableException, java.lang.ClassNotFoundException
className
- the fully qualified name of the class.loader
- the ClassLoader to search in (will include all parent
loaders also).load
- whether to initiate a Class load if the class is not already
loaded.
NotAvailableException
- if this functionality isn't available in
this JVM.
java.lang.ClassNotFoundException
- if the class can't be found using the
specified ClassLoader, or if either the loader or name is null.Class
public java.lang.Class getClass(java.lang.String className, java.lang.ClassLoader loader) throws NotAvailableException, java.lang.ClassNotFoundException
className
- the fully qualified name of the class.loader
- the ClassLoader to search in (will include all parent
loaders also).
NotAvailableException
- if this functionality isn't available in
this JVM.
java.lang.ClassNotFoundException
- if either the name or the loader is null.Class
public java.util.Collection getAllClasses(java.lang.String className) throws NotAvailableException, java.lang.ClassNotFoundException
className
- the fully qualified name of the class.
NotAvailableException
- if this functionality isn't available in
this JVM.
java.lang.ClassNotFoundException
- if the argument is null, or if the class
can't be found.Class
public java.util.Collection getAllClasses(java.lang.ClassLoader loader) throws NotAvailableException
loader
- the ClassLoader to search.
NotAvailableException
- if this functionality isn't available in
this JVM.Class
,
ClassLoader
public void addClassLoadListener(java.lang.ClassLoader loader, ClassLoadListener listener) throws NotAvailableException
loader
- the ClassLoader on which we want to listen.listener
- the event listener to add.
NotAvailableException
- if this functionality isn't available in
this JVM.public void addClassLoadListener(ClassLoadListener listener) throws NotAvailableException
listener
- the listener to add.
NotAvailableException
- if this functionality isn't available in
this JVM.public void removeClassLoadListener(ClassLoadListener listener) throws NotAvailableException
listener
- the ClassLoadListener to stop receiving class load
events.
NotAvailableException
- if this functionality isn't available in
this JVM.public void redefineClass(java.lang.Class cl, byte[] buffer, int offset, int length) throws NotAvailableException, ClassRedefinitionException
cl
- the class to be redefined.buffer
- the byte buffer containing the bytecode for the new
version of the class.offset
- the offset to start reading from.length
- the length to read.
ClassRedefinitionException
- if the transform could not be completed due
to an illegal transform (error in the supplied bytecode). Note
that this is an unchecked (Runtime) exception; it will not be
verified by the compiler!NotAvailableException
public void setClassPreProcessor(ClassPreProcessor preProcessor) throws NotAvailableException
NOTE: Only one (1) preprocessor can be active in the system at any time. If a client needs to chain preprocessors, this should be done by wrapping, i.e. getting the previous preprocessor and explicitly calling it either before or after the preprocessing is done.
If preProcessor is null, any previously registered preprocessor is removed.
preProcessor
- a ClassPreProcessor to recieve callbacks on class
definitions.
NotAvailableException
- if this functionality isn't available in
this JVM.getClassPreProcessor()
,
ClassPreProcessor
public ClassPreProcessor getClassPreProcessor() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.ClassPreProcessor
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |