Bukkit/src/main/java/org/bukkit/plugin/PluginLoader.java
2011-05-15 14:06:02 +02:00

67 lines
2.1 KiB
Java

package org.bukkit.plugin;
import java.io.File;
import java.util.regex.Pattern;
import org.bukkit.event.Event;
import org.bukkit.event.Listener;
/**
* Represents a plugin loader, which handles direct access to specific types
* of plugins
*/
public interface PluginLoader {
/**
* Loads the plugin contained in the specified file
*
* @param file File to attempt to load
* @return Plugin that was contained in the specified file, or null if
* unsuccessful
* @throws InvalidPluginException Thrown when the specified file is not a plugin
*/
public Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException;
/**
* Loads the plugin contained in the specified file
*
* @param file File to attempt to load
* @param ignoreSoftDependencies Loader will ignore soft dependencies if this flag is set to true
* @return Plugin that was contained in the specified file, or null if
* unsuccessful
* @throws InvalidPluginException Thrown when the specified file is not a plugin
*/
public Plugin loadPlugin(File file, boolean ignoreSoftDependencies) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException;
/**
* Returns a list of all filename filters expected by this PluginLoader
*/
public Pattern[] getPluginFileFilters();
/**
* Creates and returns an event executor
*
* @param type Type of the event executor to create
* @param listener the object that will handle the eventual call back
*/
public EventExecutor createExecutor(Event.Type type, Listener listener);
/**
* Enables the specified plugin
*
* Attempting to enable a plugin that is already enabled will have no effect
*
* @param plugin Plugin to enable
*/
public void enablePlugin(Plugin plugin);
/**
* Disables the specified plugin
*
* Attempting to disable a plugin that is not enabled will have no effect
*
* @param plugin Plugin to disable
*/
public void disablePlugin(Plugin plugin);
}