Class PluginLoader


  • class PluginLoader
    extends java.lang.Object
    • Constructor Detail

      • PluginLoader

        @Deprecated
        PluginLoader​(PluginSwitch pluginSwitch,
                     java.lang.String alias)
        Deprecated.
        Let's avoid adding more aliases. It complicates the API. Instead of an alias, we can use fully qualified class name of the alternative implementation.

        Adds an alias for a class name to this plugin loader. Instead of the fully qualified type name, the alias can be used as a convenience name for a known plugin.

    • Method Detail

      • loadPlugin

        <T> T loadPlugin​(java.lang.Class<T> pluginType)
        Scans the classpath for given pluginType. If not found, default class is used.
      • loadPlugin

        <PreferredType,​AlternateType> java.lang.Object loadPlugin​(java.lang.Class<PreferredType> preferredPluginType,
                                                                        java.lang.Class<AlternateType> alternatePluginType)
        Scans the classpath for given preferredPluginType. If not found scan for alternatePluginType. If neither a preferred or alternate plugin is found, default to default class of preferredPluginType.
        Returns:
        An object of either preferredPluginType or alternatePluginType