Class InitHandler
- java.lang.Object
-
- org.hotswap.agent.annotation.handler.InitHandler
-
- All Implemented Interfaces:
PluginHandler<Init>
public class InitHandler extends Object implements PluginHandler<Init>
Annotation handler - handle @Init annotation on fields/methods. The {org.hotswap.agent.annotation.Init} annotation can be set on field or method and static or non static. See the annotation description for usage info.- Author:
- Jiri Bubnik
- See Also:
Init
-
-
Field Summary
Fields Modifier and Type Field Description protected PluginManagerpluginManager
-
Constructor Summary
Constructors Constructor Description InitHandler(PluginManager pluginManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleaninitField(PluginAnnotation pluginAnnotation)Initialization for field annotations.booleaninitMethod(PluginAnnotation pluginAnnotation)Initialization for method annotations.protected booleanregisterClassLoaderInit(PluginAnnotation pluginAnnotation)Register on classloader init event - call the @Init static method.protected ObjectresolveType(ClassLoader classLoader, Class pluginClass, Class type)Support for autowiring of agent services - resolve instance by class.
-
-
-
Field Detail
-
pluginManager
protected PluginManager pluginManager
-
-
Constructor Detail
-
InitHandler
public InitHandler(PluginManager pluginManager)
-
-
Method Detail
-
initField
public boolean initField(PluginAnnotation pluginAnnotation)
Description copied from interface:PluginHandlerInitialization for field annotations.- Specified by:
initFieldin interfacePluginHandler<Init>- Parameters:
pluginAnnotation- annotation values- Returns:
- true if initialized.
-
initMethod
public boolean initMethod(PluginAnnotation pluginAnnotation)
Description copied from interface:PluginHandlerInitialization for method annotations.- Specified by:
initMethodin interfacePluginHandler<Init>- Parameters:
pluginAnnotation- annotation values- Returns:
- true if initialized.
-
registerClassLoaderInit
protected boolean registerClassLoaderInit(PluginAnnotation pluginAnnotation)
Register on classloader init event - call the @Init static method.- Parameters:
pluginAnnotation- description of plugin method to call- Returns:
- true if ok
-
resolveType
protected Object resolveType(ClassLoader classLoader, Class pluginClass, Class type)
Support for autowiring of agent services - resolve instance by class.- Parameters:
classLoader- application classloaderpluginClass- used only for debugging messagestype- requested type- Returns:
- resolved instance or null (error is logged)
-
-