Class 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
    • Constructor Detail

      • InitHandler

        public InitHandler​(PluginManager pluginManager)
    • Method Detail

      • initField

        public boolean initField​(PluginAnnotation pluginAnnotation)
        Description copied from interface: PluginHandler
        Initialization for field annotations.
        Specified by:
        initField in interface PluginHandler<Init>
        Parameters:
        pluginAnnotation - annotation values
        Returns:
        true if initialized.
      • initMethod

        public boolean initMethod​(PluginAnnotation pluginAnnotation)
        Description copied from interface: PluginHandler
        Initialization for method annotations.
        Specified by:
        initMethod in interface PluginHandler<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 classloader
        pluginClass - used only for debugging messages
        type - requested type
        Returns:
        resolved instance or null (error is logged)