[jboss-cvs] JBossAS SVN: r58201 - trunk/tomcat/src/main/org/jboss/web/tomcat/security/config
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Nov 8 13:21:16 EST 2006
Author: anil.saldhana at jboss.com
Date: 2006-11-08 13:21:15 -0500 (Wed, 08 Nov 2006)
New Revision: 58201
Modified:
trunk/tomcat/src/main/org/jboss/web/tomcat/security/config/JBossContextConfig.java
Log:
Pick up the authenticators configured on the war deployer from jndi rather than the previous jmx way
Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/security/config/JBossContextConfig.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/security/config/JBossContextConfig.java 2006-11-08 18:20:05 UTC (rev 58200)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/security/config/JBossContextConfig.java 2006-11-08 18:21:15 UTC (rev 58201)
@@ -28,15 +28,13 @@
import java.util.Map;
import java.util.Properties;
import java.util.Set;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
import org.apache.catalina.Authenticator;
import org.apache.catalina.startup.ContextConfig;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.logging.Logger;
/**
* Extension of Catalina ContextConfig that will allow
@@ -80,7 +78,7 @@
Map cmap = new HashMap();
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
- Properties authProps = this.getAuthenticatorsFromJMX();
+ Properties authProps = this.getAuthenticatorsFromJndi();
if(authProps != null)
{
Set keys = authProps.keySet();
@@ -96,22 +94,18 @@
if(isTrace)
log.trace("Authenticators plugged in::"+cmap);
return cmap;
- }
+ }
/**
* Get the key-pair of authenticators from the
- * TomcatAuthenticatorConfig MBean
+ * JNDI (set up by the Tomcat Deployer)
* TODO: the authenticators need to be injected
*
* @return
- * @throws JMException
+ * @throws NamingException
*/
- private Properties getAuthenticatorsFromJMX() throws JMException
- {
- Properties props = null;
- MBeanServer server = MBeanServerLocator.locateJBoss();
- props = (Properties)server.getAttribute(new ObjectName("jboss.web:service=WebServer"),
- "Authenticators");
- return props;
+ private Properties getAuthenticatorsFromJndi() throws NamingException
+ {
+ return (Properties)(new InitialContext()).lookup("TomcatAuthenticators");
}
}
More information about the jboss-cvs-commits
mailing list