|
Openfire 3.3.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.container.PluginClassLoader
public class PluginClassLoader
ClassLoader for plugins. It searches the plugin directory for classes and JAR files, then constructs a class loader for the resources found. Resources are loaded as follows:
Constructor Summary | |
---|---|
PluginClassLoader()
Constructs a plugin loader for the given plugin directory. |
Method Summary | |
---|---|
void |
addDirectory(File directory,
boolean developmentMode)
Adds a directory to the class loader. |
void |
addURL(URL url)
Adds a URL to the class loader. |
void |
destroy()
Destroys this class loader. |
ClassLoader |
getClassLoader()
Returns the URLClassloader used. |
Collection<URL> |
getURLS()
|
void |
initialize()
Initializes the class loader with all configured classpath URLs. |
Class |
loadClass(String name)
Load a class using this plugin class loader. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PluginClassLoader() throws SecurityException
SecurityException
- if the created class loader violates
existing security constraints.Method Detail |
---|
public void addDirectory(File directory, boolean developmentMode)
initialize()
method should be called
after adding the directory to make the change take effect.
directory
- the directory.developmentMode
- true if the plugin is running in development mode. This
resolves classloader conflicts between the deployed plugin
and development classes.public Collection<URL> getURLS()
public void addURL(URL url)
initialize()
method should be called
after adding the URL to make the change take effect.
url
- the url.public void initialize()
public Class loadClass(String name) throws ClassNotFoundException, IllegalAccessException, InstantiationException, SecurityException
name
- the fully qualified name of the class to load.
ClassNotFoundException
- if the class could not be loaded by this class loader.
IllegalAccessException
- if the class constructor was private or protected.
InstantiationException
- if the class could not be instantiated (initialization error).
SecurityException
- if the custom class loader not allowed.public void destroy()
public ClassLoader getClassLoader()
|
Openfire 3.3.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |