cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r219199 - /cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java
Date Fri, 15 Jul 2005 13:21:59 GMT
Author: michi
Date: Fri Jul 15 06:21:57 2005
New Revision: 219199

URL: http://svn.apache.org/viewcvs?rev=219199&view=rev
Log:
set jaas

Modified:
    cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java

Modified: cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java?rev=219199&r1=219198&r2=219199&view=diff
==============================================================================
--- cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java (original)
+++ cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java Fri Jul 15
06:21:57 2005
@@ -36,6 +36,9 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceResolver;
+import org.apache.excalibur.source.impl.FileSource;
 // import org.apache.cocoon.components.variables.VariableResolver;
 // import org.apache.cocoon.components.variables.VariableResolverFactory;
 import org.apache.cocoon.components.ContextHelper;
@@ -107,6 +110,25 @@
     }
 
     public void configure(Configuration config) throws ConfigurationException {
+        Configuration jaas = config.getChild("jaas", false);
+        if (jaas != null) {
+            String jaasURI = jaas.getAttribute("src");
+            FileSource jaasSrc = null;
+            try {
+                SourceResolver resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
+                jaasSrc = (FileSource) resolver.resolveURI(jaasURI);
+            } catch (Exception e) {
+                throw new ConfigurationException("Cannot resolve jaas URI: " + jaasURI);
+            }
+            if (System.getProperty("java.security.auth.login.config") == null) {
+                System.setProperty("java.security.auth.login.config", jaasSrc.getFile().getAbsolutePath());
+            } else {
+                // WARNING: java.security.auth.login.config has already been set
+            }
+        } else {
+            throw new ConfigurationException("Path of jaas.config has not been configured");
+        }
+
         Configuration credentials = config.getChild("credentials", false);
         if (credentials != null) {
             String login = credentials.getAttribute("login");



Mime
View raw message