if (appClassLoader.getClass().getName().equals("org.apache.catalina.loader.WebappClassLoader")) {
registeredResourcesMap.put(resource, appClassLoader);
// create plugin configuration in advance to get extraClasspath and watchResources properties
PluginConfiguration pluginConfiguration = new PluginConfiguration(appClassLoader);
WatchResourcesClassLoader watchResourcesClassLoader = new WatchResourcesClassLoader(false);
URL[] extraClasspath = pluginConfiguration.getExtraClasspath();
if (extraClasspath.length > 0) {
if (majorVersion > 7)
watchResourcesClassLoader.initExtraPath(extraClasspath);
else
addRepositoriesAtStart(appClassLoader, extraClasspath, false);
}
URL[] watchResources = pluginConfiguration.getWatchResources();
if (watchResources.length > 0) {
if (majorVersion > 7)
watchResourcesClassLoader.initWatchResources(watchResources, PluginManager.getInstance().getWatcher());
else
addRepositoriesAtStart(appClassLoader, watchResources, true);
}
// register special repo
getExtraRepositories(appClassLoader).put(WEB_INF_CLASSES, watchResourcesClassLoader);
// register special repo for webappDir
URL webappDir = pluginConfiguration.getWebappDir();
if (webappDir != null) {
WatchResourcesClassLoader webappDirClassLoader = new WatchResourcesClassLoader(false);
webappDirClassLoader.initExtraPath(new URL[] {webappDir});
getExtraRepositories(appClassLoader).put("/", webappDirClassLoader);