Class JavaPluginLoader

  • All Implemented Interfaces:
    PluginLoader

    public final class JavaPluginLoader
    extends Object
    implements PluginLoader
    Represents a Java plugin loader, allowing plugins in the form of .jar
    • Constructor Detail

      • JavaPluginLoader

        @Deprecated
        public JavaPluginLoader​(@NotNull
                                Server instance)
        Deprecated.
        This class was not meant to be constructed explicitly
        Parameters:
        instance - the server instance
    • Method Detail

      • loadPlugin

        @NotNull
        public Plugin loadPlugin​(@NotNull
                                 File file)
                          throws InvalidPluginException
        Description copied from interface: PluginLoader
        Loads the plugin contained in the specified file
        Specified by:
        loadPlugin in interface PluginLoader
        Parameters:
        file - File to attempt to load
        Returns:
        Plugin that was contained in the specified file, or null if unsuccessful
        Throws:
        InvalidPluginException - Thrown when the specified file is not a plugin
      • getPluginFileFilters

        @NotNull
        public Pattern[] getPluginFileFilters()
        Description copied from interface: PluginLoader
        Returns a list of all filename filters expected by this PluginLoader
        Specified by:
        getPluginFileFilters in interface PluginLoader
        Returns:
        The filters
      • createRegisteredListeners

        @NotNull
        public Map<Class<? extends Event>,​Set<RegisteredListener>> createRegisteredListeners​(@NotNull
                                                                                                   Listener listener,
                                                                                                   @NotNull
                                                                                                   Plugin plugin)
        Description copied from interface: PluginLoader
        Creates and returns registered listeners for the event classes used in this listener
        Specified by:
        createRegisteredListeners in interface PluginLoader
        Parameters:
        listener - The object that will handle the eventual call back
        plugin - The plugin to use when creating registered listeners
        Returns:
        The registered listeners.
      • enablePlugin

        public void enablePlugin​(@NotNull
                                 Plugin plugin)
        Description copied from interface: PluginLoader
        Enables the specified plugin

        Attempting to enable a plugin that is already enabled will have no effect

        Specified by:
        enablePlugin in interface PluginLoader
        Parameters:
        plugin - Plugin to enable
      • disablePlugin

        public void disablePlugin​(@NotNull
                                  Plugin plugin)
        Description copied from interface: PluginLoader
        Disables the specified plugin

        Attempting to disable a plugin that is not enabled will have no effect

        Specified by:
        disablePlugin in interface PluginLoader
        Parameters:
        plugin - Plugin to disable