public class URLPluginLoader extends java.lang.Object implements IPluginLoader
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.net.URL> |
classloaderUrls |
protected boolean |
running |
protected java.net.URL[] |
urls |
| Constructor and Description |
|---|
URLPluginLoader(java.util.List<java.net.URL> classloaderUrls,
java.net.URL... urls) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.net.URL> |
getClassloaderUrls() |
protected Plugin |
getPlugin(java.net.URL url)
Make a connection to the
urls and load the classes from the connection's input stream. |
java.net.URL[] |
getUrls() |
boolean |
isRunning() |
java.util.Set<PluginContainer> |
loadPlugins() |
protected java.util.Set<PluginContainer> |
loadPlugins(java.net.URL... urls) |
protected Plugin |
readBuffer(byte[] buffer)
https://stackoverflow.com/questions/28964450/loading-a-jar-dynamically-from-memory
|
protected final java.net.URL[] urls
protected boolean running
protected java.util.List<java.net.URL> classloaderUrls
public URLPluginLoader(java.util.List<java.net.URL> classloaderUrls,
java.net.URL... urls)
public java.util.Set<PluginContainer> loadPlugins()
loadPlugins in interface IPluginLoaderprotected java.util.Set<PluginContainer> loadPlugins(java.net.URL... urls)
protected Plugin getPlugin(java.net.URL url) throws java.io.IOException
urls and load the classes from the connection's input stream.url - the URL from which to downloadPluginjava.io.IOException - hence, hopefullyprotected Plugin readBuffer(byte[] buffer) throws java.io.IOException
buffer - the byte buffer from which to load JarEntriesjava.io.IOException - if not everything goes rightpublic java.net.URL[] getUrls()
public java.util.List<java.net.URL> getClassloaderUrls()
getClassloaderUrls in interface IPluginLoaderpublic boolean isRunning()
isRunning in interface IPluginLoader