cziegeler 2002/10/04 05:40:02 Modified: src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components AuthenticationManager.java Handler.java Log: Adding module configuration to handler Revision Changes Path 1.3 +3 -0 xml-cocoon2/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/AuthenticationManager.java Index: AuthenticationManager.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/AuthenticationManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AuthenticationManager.java 4 Oct 2002 12:00:38 -0000 1.2 +++ AuthenticationManager.java 4 Oct 2002 12:40:01 -0000 1.3 @@ -738,6 +738,9 @@ if (this.handler != null && this.application != null) { conf = this.application.getConfiguration(name); } + if (this.handler != null && conf == null) { + conf = this.handler.getConfiguration(name); + } if (this.getLogger().isDebugEnabled() == true) { this.getLogger().debug("END getModuleConfiguration conf="+conf); 1.3 +25 -0 xml-cocoon2/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/Handler.java Index: Handler.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/Handler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Handler.java 4 Oct 2002 12:00:38 -0000 1.2 +++ Handler.java 4 Oct 2002 12:40:01 -0000 1.3 @@ -100,11 +100,15 @@ /** Are all apps loaded? */ private boolean appsLoaded = false; + /** The configuration fragments */ + private Map configurations; + /** * Create a new handler object. */ public Handler(String name) { this.name = name; + this.configurations = new HashMap(3, 2); } /** @@ -117,6 +121,7 @@ copy.authenticationResource = this.authenticationResource; copy.loadResource = this.loadResource; copy.saveResource = this.saveResource; + copy.configurations = this.configurations; Iterator iter = this.applications.keySet().iterator(); while (iter.hasNext()) { final String name = (String)iter.next(); @@ -202,6 +207,19 @@ } } + // get configurations (optional) + Configuration[] configurations = conf.getChildren("configuration"); + if (configurations != null) { + for(int i = 0; i < configurations.length; i++) { + child = configurations[i]; + String value = child.getAttribute("name"); + if (this.getConfiguration(value) != null) { + throw new ConfigurationException("Configuration names must be unique for application " + this.name + ": " + value); + } + this.configurations.put(value, child); + } + } + } @@ -275,6 +293,13 @@ */ public void clearHandlerContexts() { this.handlerContexts.clear(); + } + + /** + * Get the configuration + */ + public Configuration getConfiguration(String name) { + return (Configuration)this.configurations.get(name); } /**
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]