*/
public void loadPlugins(String fn) throws ResultException, DmcValueException, DmcRuleExceptionSet {
File pluginFile = new File(fn);
if (!pluginFile.exists()){
ResultException ex = new ResultException();
ex.addError("Could not open DMP Servlet configuration file: " + fn);
throw(ex);
}
configParser.parseFile(fn);
for(PluginConfig sp: pluginConfigs.values()){
DmpServletPlugin plugin = instantiatePlugin(sp);
if (plugin instanceof RequestTrackerIF){
if (requestTracker == null){
requestTracker = (RequestTrackerIF) plugin;
requestTrackerPlugin = plugin;
}
else{
ResultException ex = new ResultException("Multiple request tracker plugins specified.");
throw(ex);
}
}
else if (plugin instanceof CacheIF){
if (cache == null){
cache = (CacheIF) plugin;
cachePlugin = plugin;
}
else{
ResultException ex = new ResultException("Multiple cache plugins specified.");
throw(ex);
}
}
else if (plugin instanceof SecurityManagerIF){
if (securityManager == null){
securityManager = (SecurityManagerIF) plugin;
securityPlugin = plugin;
}
else{
ResultException ex = new ResultException("Multiple security manager plugins specified.");
throw(ex);
}
}
else{
startOrder.put(sp.getStartOrder(), plugin);
}
}
if (requestTracker == null){
ResultException ex = new ResultException();
ex.addError("No plugin has been specified that implements the org.dmd.dmp.server.servlet.base.interfaces.RequestTrackerIF interface");
throw(ex);
}
if (cache == null){
ResultException ex = new ResultException();
ex.addError("No plugin has been specified that implements the org.dmd.dmp.server.servlet.base.interfaces.CacheIF interface");
throw(ex);
}
if (securityManager == null){
ResultException ex = new ResultException();
ex.addError("No plugin has been specified that implements the org.dmd.dmp.server.servlet.base.interfaces.SecurityManagerIF interface");
throw(ex);
}
}