Package org.hotswap.agent.annotation
Annotation Type OnClassLoadEvent
-
@Target(METHOD) @Retention(RUNTIME) @Documented public @interface OnClassLoadEvent
Define plugin callback method on class load by classloader (application class is loaded or reloaded by hotswap). Method attribute types:- byte[] - the input byte buffer in class file format - must not be modified
- ClassLoader - the defining loader of the class to be transformed,
may be
nullif the bootstrap loader - String - classname - the name of the class in the internal form of fully
qualified class and interface names. For example,
"java/util/List". - Class - classBeingRedefined - if this is triggered by a redefine or retransform,
the class being redefined or retransformed; if this is a class load,
null - ProtectionDomain - the protection domain of the class being defined or redefined
- ClassPool - javassist default ClassPool
- CtClass - javassist class created from byte[] source. If the method returns null/void, this class is used as transformation result. You can modify this class directly.
- AppClassLoaderExecutor - executor to run code in app classloader
- LoadEvent - originating load event. If classBeingRedefined is null, this is DEFINE, otherwise REDEFINE.
- Author:
- Jiri Bubnik
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description StringclassNameRegexpRegexp of class name.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description LoadEvent[]eventsSpecify list of events to watch for (class is loaded by the ClassLoader / redefined by hotswap mechanism).booleanskipAnonymousAnonymous classes (e.g.booleanskipSyntheticClasses created at runtime are usually skipped
-
-
-
Element Detail
-
classNameRegexp
String classNameRegexp
Regexp of class name.
-
-
-
events
LoadEvent[] events
Specify list of events to watch for (class is loaded by the ClassLoader / redefined by hotswap mechanism). By default are both DEFINE and REDEFINE events enabled.- Returns:
- list of class load events
- Default:
- {org.hotswap.agent.annotation.LoadEvent.DEFINE, org.hotswap.agent.annotation.LoadEvent.REDEFINE}
-
-