From f8f83de56b315cdc00de50deb42adca6e0cd6a2c Mon Sep 17 00:00:00 2001 From: "Eric J. Bowersox" Date: Wed, 21 Nov 2001 19:57:29 +0000 Subject: [PATCH] attempting to fix a problem with the known_monitors map (by removing it) --- .../venice/core/impl/VeniceEngineImpl.java | 4 +++- .../venice/security/StaticSecurityMonitor.java | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java b/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java index a448d4b..a1189d7 100644 --- a/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java +++ b/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java @@ -666,13 +666,14 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend sect = loader.configGetSubSection(root_h,"security"); // Load the security monitors. + HashMap known_monitors = new HashMap(); NodeList nl = sect.getChildNodes(); for (i=0; i<security-definition/> element. + * @param previous A mapping of all previously-known security monitors. This one will be added to + * it on success. * @exception com.silverwrist.venice.except.ConfigException The XML configuration data was incorrect in * some fashion. */ - public StaticSecurityMonitor(Element cfg) throws ConfigException + public StaticSecurityMonitor(Element cfg, Map previous) throws ConfigException { boolean set_root_monitor = false; @@ -138,7 +139,7 @@ public class StaticSecurityMonitor implements SecurityMonitor if (logger.isDebugEnabled()) logger.debug("defining new StaticSecurityMonitor with id=" + id); - if (known_monitors.containsKey(id)) + if (previous.containsKey(id)) { // the monitor with this ID has already been defined! logger.fatal("security monitor with id=" + id + " is already defined!"); throw new ConfigException("security monitor id=" + id + " is already defined!"); @@ -148,7 +149,7 @@ public class StaticSecurityMonitor implements SecurityMonitor if (root_h.hasAttribute("parent")) { // find our parent String parent_id = cfg.getAttribute("parent"); - parent = (SecurityMonitor)(known_monitors.get(parent_id)); + parent = (SecurityMonitor)(previous.get(parent_id)); if (parent==null) { // no parent! that's bogus! logger.fatal("parent security monitor with id=" + parent_id + " does not exist!"); @@ -344,7 +345,7 @@ public class StaticSecurityMonitor implements SecurityMonitor dynamic_permissions = Collections.EMPTY_SET; // Finish up by adding ourselves to the known monitors list. - known_monitors.put(id,this); + previous.put(id,this); if (set_root_monitor) root_monitor = this;