org.portico.lrc
Class LRCPluginLoader
java.lang.Object
org.portico.lrc.LRCPluginLoader
public class LRCPluginLoader
- extends Object
This class is responsible for checking a directory that will contain LRC plugins. It will cause
the contained jar files to be added to the system classpath and will load any configuration
information contained within those jar files. If the plugins have dependencies, the jar files
for those classes can be dropped in that directory and will be added to the classpath also. This
class leans on the PluginLocator
to find the files, manage and extend the classpath
as required. This class is a singleton (so that it is shared by all LRCs in the given runtime).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
private static final LRCPluginLoader INSTANCE
logger
private org.apache.log4j.Logger logger
LRCPluginLoader
private LRCPluginLoader()
process
public void process(LRC lrc)
throws JException
- This method will search for any plugins and configure the given LRC with them. To determine
the location of the plugin folder, the system property
LRCProperties.PROP_PLUGIN_DIR
will first be checked for a value. If there is a value, it will be used, if there is not,
the value in PorticoConstants.DEFAULT_PLUGIN_DIR
will be used.
The scanning and locating of plugin configuration files within jar files is managed by the
PluginLocator
, see its javadoc for more details.
- Throws:
JException
findPluginDirectory
private String findPluginDirectory()
- Return the value of
LRCProperties.PROP_PLUGIN_DIR
if it exists, or
PorticoConstants.DEFAULT_PLUGIN_DIR
if it does not.
getLoadedPlugins
public Set<LoadedLibrary> getLoadedPlugins()
- Returns a set of all the jar files from which LRC plugins have been loaded. If there are
none, an empty set is returned.
instance
public static LRCPluginLoader instance()