Interface Plugin


  • public interface Plugin
    Represents a JRebel plugin that can be used by a third-party to configure or integrate with JRebel. Will be called before the first class is loaded in the host classloader. There are two ways to register a JRebel plugin. One is by creating a JAR file with a custom manifest entry MANIFEST_ATTRIBUTE_PLUGIN and putting it in the classpath. The other is by setting a system property SYSPROP_PLUGIN to the plugin class.
    Since:
    1.2
    Author:
    Jevgeni Kabanov (ekabanov@zeroturnaround.com)
    See Also:
    Integration, Configuration, Reloader, Logger
    • Field Detail

      • SYSPROP_PLUGIN

        static final String SYSPROP_PLUGIN
        This system property should point to a class name that implements this interface. It can be used by applications to enable additional JRebel configuration.
        For example -Drebel.plugin=com.mycompany.mypackage.MyJRebelPlugin.
        See Also:
        Constant Field Values
      • MANIFEST_ATTRIBUTE_PLUGIN

        static final String MANIFEST_ATTRIBUTE_PLUGIN
        This JAR MANIFEST.MF attribute should point to a class name that implements this interface. It can be used by third-party libraries to enable additional JRebel configuration or integration and also to create standalone JRebel plugin JARs.
        See Also:
        Constant Field Values
    • Method Detail

      • preinit

        void preinit()
        Called before the first class in the host classloader is loaded.
      • checkDependencies

        boolean checkDependencies​(ClassLoader cl,
                                  ClassResourceSource crs)
        Check that the plugin dependencies are present in the tested classloader. Please don't try to load classes as this will cause them to be loaded and your postprocessing won't take place. Instead use ClassResourceSource.getClassResource(String) to test for class presence, e.g. return crs.getClassResourceSource("org.myframework.MyClass") != null;. To test whether the implementation is correct add your plugin jar to -Drebel.plugins. If your plugin is found it will be initialized by JRebel in correct classloader.
        Since:
        2.0
      • getId

        String getId()
        A Unix-like id, e.g. "spring_plugin". Mainly used for internal handling and creating the system property. Cannot be null for embedded plugins!
        Since:
        2.0
      • getName

        String getName()
        Name of the plugin, optionally with a version, e.g. "Spring Framework Plugin 1.0 M4". Can be null if you don't want the plugin to be visible to the user.
        Since:
        2.0
      • getDescription

        String getDescription()
        Description of the plugin, a few lines about purpose and functionality of the plugin. Can be null if you don't want the plugin to be visible to the user. Can contain some basic XHTML, as described here: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2Fforms%2Fwidgets%2FFormText.html Additionally, and tags will use italic variant of the main font. Use these tags exactly as written here -- no upper-case, no spaces.
        Since:
        2.0
      • getAuthor

        String getAuthor()
        The name of the person/entity that contributed the plugin. Please include contact e-mail if possible. Can be null if you don't want the plugin to be visible to the user.
        Since:
        2.0
      • getWebsite

        String getWebsite()
        The URL to the website with information about the plugin. Can be null if you don't want the plugin to be visible to the user.
        Since:
        2.0
      • getSupportedVersions

        String getSupportedVersions()
        Text description of supported versions of the framework the plug-in is for. Can be null.
        Since:
        5.0
      • getTestedVersions

        String getTestedVersions()
        Text description of tested versions of the framework the plug-in is for. Can be null.
        Since:
        5.0