
pluginloader.PluginLoader Maven / Gradle / Ivy
package pluginloader;
import pluginloader.load.PluginClassLoader;
import pluginloader.load.PluginCompiler;
import pluginloader.load.SourceCodeParser;
import java.lang.reflect.InvocationTargetException;
/**
* This class loads plugins and instantiates them
*/
public class PluginLoader {
public static class LoadingException extends Exception{
public LoadingException(String message) {
super(message);
}
public LoadingException(Throwable cause) {
super(cause);
}
}
/**
* Compiles a plugin given as a java class in source code form and loads it into the Java Runtime.
* It only loads classes that extend the given java class.
* After successfully loading it, an instance of each found class that extends the given class
* will be returned to the caller.
* If a class already exists, it will be updated if its code has changed. If the code has
* not changed, the loading is skipped and a new instance of the class is returned.
* @param plugin The string containing the source code of the plugin class
* @param pluginInterface The interface/class the plugin class has to implement/extend
* @param
© 2015 - 2025 Weber Informatics LLC | Privacy Policy