Package de.osshangar.plugin
Class Plugin<T,C extends Class<T>>
- java.lang.Object
-
- de.osshangar.plugin.Plugin<T,C>
-
-
Constructor Summary
Constructors Constructor Description Plugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tload(JarInputStream jarInputStream)This loads the plugin from the provided JarInputStream.Tload(JarInputStream jarInputStream, Arguments constructorArguments)This loads the plugin from the provided JarInputStream and provides the given arguments to its constructor
-
-
-
Method Detail
-
load
public T load(JarInputStream jarInputStream) throws FileFormatException, IOException, ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException
This loads the plugin from the provided JarInputStream.- Parameters:
jarInputStream- The input stream to a JAR package to load the plugin from- Returns:
- The instantiated plugin instance
- Throws:
FileFormatException- when the structure of the plugin JAR is wrongIOException- when an I/O operation failsClassNotFoundException- when the PluginClassLoader does not find a requested classInvocationTargetException- when the provided constructor arguments does not match the signature of the requested constructorNoSuchMethodException- when then plugin does not have a constructor that matches the requested signatureInstantiationException- when the class of the plugin which implements the required plugin interface is an abstract classIllegalAccessException- when the requested constructor of the plugin is inaccessible due to an enforced Java language access control
-
load
public T load(JarInputStream jarInputStream, Arguments constructorArguments) throws FileFormatException, IOException, ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException
This loads the plugin from the provided JarInputStream and provides the given arguments to its constructor- Parameters:
jarInputStream- The input stream to a JAR package to load the plugin fromconstructorArguments- The arguments to be provided to the constructor of the plugin on its instantiation- Returns:
- The instance of the loaded plugin
- Throws:
FileFormatException- when the structure of the plugin JAR is wrongIOException- when an I/O operation failsClassNotFoundException- when the PluginClassLoader does not find a requested classInvocationTargetException- when the provided constructor arguments does not match the signature of the requested constructorNoSuchMethodException- when then plugin does not have a constructor that matches the requested signatureInstantiationException- when the class of the plugin which implements the required plugin interface is an abstract classIllegalAccessException- when the requested constructor of the plugin is inaccessible due to an enforced Java language access control
-
-