Annotation Type Init


  • @Target({FIELD,METHOD})
    @Retention(RUNTIME)
    @Documented
    public @interface Init
    Initialize plugin fields and methods.

    Non static fields and methods are set after the plugin instance is created and before any other method is invoked. You can use this annotation to autowire agent services.

    Special use is @Init annotation on static method - then the method works as a callback after new classloader is initialized in the plugin manager. @Init on static field just sets the service if applicable.

    Available method argument types:

    • PluginManager - the single instance of plugin manager
    • Watcher - watcher service to register resource change listeners
    • Scheduler - schedule a command to run
    • HotswapTransformer - register class transformation
    • PluginConfiguration - access plugin configuration properties
    • ClassLoader - current application classloader (for static method on a field, this is the plugin classloader)
    Author:
    Jiri Bubnik