geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r704177 - in /geronimo/sandbox/djencks/jetty7: ./ geronimo-jetty7-builder/ geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/ geronimo-jetty7-builder/src/test/java/org/apache/geronimo/jetty7/deployment/ geronimo-je...
Date Mon, 13 Oct 2008 17:32:06 GMT
Author: djencks
Date: Mon Oct 13 10:32:05 2008
New Revision: 704177

URL: http://svn.apache.org/viewvc?rev=704177&view=rev
Log:
update to trunk changes and jetty refactorings

Removed:
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyServer.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/NonAuthenticator.java
Modified:
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/pom.xml
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/test/java/org/apache/geronimo/jetty7/deployment/PlanParsingTest.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7-clustering-builder-wadi/src/main/java/org/apache/geronimo/jetty7/cluster/wadi/builder/WADIJettyClusteringBuilder.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/pom.xml
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/AbstractPreHandler.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyContainerImpl.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyManagerImpl.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyWebAppContext.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/GeronimoSelectChannelSSLListener.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/GeronimoSocketSSLListener.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/HTTPSSelectChannelConnector.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/HTTPSSocketConnector.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/JettyConnector.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/AbstractImmutableHandler.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/ComponentContextHandler.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/GeronimoRunAsToken.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/GeronimoUserIdentity.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/JettySecurityHandler.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/TwistyWebAppContext.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/requestlog/NCSARequestLog.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/AuthConfigProviderHandlerFactory.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/ServerAuthConfigGBean.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/BaseAuthModule.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/BasicAuthModule.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/ClientCertAuthModule.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/DigestAuthModule.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/JAASLoginService.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/test/java/org/apache/geronimo/jetty7/AbstractWebModuleTest.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/test/java/org/apache/geronimo/jetty7/ApplicationTest.java
    geronimo/sandbox/djencks/jetty7/jetty7/pom.xml
    geronimo/sandbox/djencks/jetty7/pom.xml

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/pom.xml?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/pom.xml (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/pom.xml Mon Oct 13 10:32:05 2008
@@ -46,6 +46,14 @@
         </dependency>
         
         <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>jee-specs</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
             <!-- TODO remove this WTF??? why isn't this picked up from geronimo-web-2.5-builder? -->
             <groupId>asm</groupId>
             <artifactId>asm</artifactId>
@@ -66,6 +74,11 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl104-over-slf4j</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
     
     <build>

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java Mon Oct 13 10:32:05 2008
@@ -423,7 +423,7 @@
             }
 
             if (jettyWebApp.isSetWebContainer()) {
-                AbstractNameQuery webContainerName = ENCConfigBuilder.getGBeanQuery(NameFactory.GERONIMO_SERVICE, jettyWebApp.getWebContainer());
+                AbstractNameQuery webContainerName = ENCConfigBuilder.getGBeanQuery(GBeanInfoBuilder.DEFAULT_J2EE_TYPE, jettyWebApp.getWebContainer());
                 webModuleData.setReferencePattern("JettyContainer", webContainerName);
             } else {
                 webModuleData.setReferencePattern("JettyContainer", jettyContainerObjectName);
@@ -778,18 +778,19 @@
         }
         JettyAuthenticationType authType = jettyWebApp.getAuthentication();
         if (loginConfigArray.length == 1 || authType != null) {
-            AbstractName factoryName = moduleContext.getNaming().createChildName(module.getModuleName(), "securityHandlerFactory", NameFactory.GERONIMO_SERVICE);
+            AbstractName factoryName = moduleContext.getNaming().createChildName(module.getModuleName(), "securityHandlerFactory", GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
             webModuleData.setReferencePattern("SecurityHandlerFactory", factoryName);
             GBeanData securityFactoryData = new GBeanData(factoryName, AuthConfigProviderHandlerFactory.class);
             securityFactoryData.setAttribute("messageLayer", "Http");
-            securityFactoryData.setAttribute("appContext", webModuleData.getAttribute("contextPath"));
+            Object contextPath = webModuleData.getAttribute("contextPath");
+            securityFactoryData.setAttribute("appContext", contextPath);
             if (jettyWebApp.isSetSecurityRealmName()) {
                 securityFactoryData.setAttribute("securityRealm", jettyWebApp.getSecurityRealmName());
             }
             moduleContext.addGBean(securityFactoryData);
 
 
-            AbstractName providerName = moduleContext.getNaming().createChildName(module.getModuleName(), "authConfigProvider", NameFactory.GERONIMO_SERVICE);
+            AbstractName providerName = moduleContext.getNaming().createChildName(module.getModuleName(), "authConfigProvider", GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
             GBeanData authConfigProviderData;
             if (authType != null) {
                 try {
@@ -861,9 +862,9 @@
                 if (loginConfig.isSetAuthMethod()) {
                     authConfigProviderData = new GBeanData(providerName, ServerAuthModuleGBean.class);
                     authConfigProviderData.setAttribute("messageLayer", "Http");
-                    authConfigProviderData.setAttribute("appContext", webModuleData.getAttribute("contextPath"));
+                    authConfigProviderData.setAttribute("appContext", contextPath);
                     //TODO ??
-                    authConfigProviderData.setAttribute("authenticationID", webModuleData.getAttribute("contextRoot"));
+                    authConfigProviderData.setAttribute("authenticationID", contextPath);
 
                     AuthModuleType<ServerAuthModule> authModuleType = new AuthModuleType<ServerAuthModule>();
                     String authMethod = loginConfig.getAuthMethod().getStringValue();

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/test/java/org/apache/geronimo/jetty7/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/test/java/org/apache/geronimo/jetty7/deployment/PlanParsingTest.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/test/java/org/apache/geronimo/jetty7/deployment/PlanParsingTest.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/test/java/org/apache/geronimo/jetty7/deployment/PlanParsingTest.java Mon Oct 13 10:32:05 2008
@@ -35,6 +35,7 @@
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.NamingBuilderCollection;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -68,8 +69,8 @@
     private Naming naming = new Jsr77Naming();
     private Artifact baseId = new Artifact("test", "base", "1", "car");
     private AbstractName baseRootName = naming.createRootName(baseId, "root", NameFactory.SERVICE_MODULE);
-    private AbstractNameQuery jettyContainerObjectName = new AbstractNameQuery(naming.createChildName(baseRootName, "jettyContainer", NameFactory.GERONIMO_SERVICE));
-    private AbstractNameQuery credentialStoreName = new AbstractNameQuery(naming.createChildName(baseRootName, "CredentialStore", NameFactory.GERONIMO_SERVICE));
+    private AbstractNameQuery jettyContainerObjectName = new AbstractNameQuery(naming.createChildName(baseRootName, "jettyContainer", GBeanInfoBuilder.DEFAULT_J2EE_TYPE));
+    private AbstractNameQuery credentialStoreName = new AbstractNameQuery(naming.createChildName(baseRootName, "CredentialStore", GBeanInfoBuilder.DEFAULT_J2EE_TYPE));
     private AbstractName pojoWebServiceTemplate = null;
     private WebServiceBuilder webServiceBuilder = null;
     private Environment defaultEnvironment = new Environment();

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7-clustering-builder-wadi/src/main/java/org/apache/geronimo/jetty7/cluster/wadi/builder/WADIJettyClusteringBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7-clustering-builder-wadi/src/main/java/org/apache/geronimo/jetty7/cluster/wadi/builder/WADIJettyClusteringBuilder.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7-clustering-builder-wadi/src/main/java/org/apache/geronimo/jetty7/cluster/wadi/builder/WADIJettyClusteringBuilder.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7-clustering-builder-wadi/src/main/java/org/apache/geronimo/jetty7/cluster/wadi/builder/WADIJettyClusteringBuilder.java Mon Oct 13 10:32:05 2008
@@ -33,6 +33,7 @@
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -149,7 +150,7 @@
             GBeanData webModuleData,
             DeploymentContext moduleContext) throws GBeanAlreadyExistsException {
         AbstractName name = moduleContext.getNaming().createChildName(moduleContext.getModuleName(),
-                "WADISessionManager", NameFactory.GERONIMO_SERVICE);
+                "WADISessionManager", GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
 
         GBeanData beanData = new GBeanData(name, BasicWADISessionManager.class);
 
@@ -245,7 +246,7 @@
     protected AbstractName addPreHandlerFactory(DeploymentContext moduleContext,
             GBeanData webModuleData, AbstractName sessionManagerName) throws GBeanAlreadyExistsException {
         AbstractName name = moduleContext.getNaming().createChildName(moduleContext.getModuleName(),
-                "WADIClusteredPreHandlerFactory", NameFactory.GERONIMO_SERVICE);
+                "WADIClusteredPreHandlerFactory", GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
 
         GBeanData beanData = new GBeanData(name, WADIClusteredPreHandlerFactory.class);
         beanData.setReferencePattern(WADIClusteredPreHandlerFactory.GBEAN_REF_WADI_SESSION_MANAGER, sessionManagerName);
@@ -260,7 +261,7 @@
     protected AbstractName addSessionHandlerFactory(DeploymentContext moduleContext,
             GBeanData webModuleData, AbstractName sessionManagerName) throws GBeanAlreadyExistsException {
         AbstractName name = moduleContext.getNaming().createChildName(moduleContext.getModuleName(),
-                "ClusteredSessionHandlerFactory", NameFactory.GERONIMO_SERVICE);
+                "ClusteredSessionHandlerFactory", GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
 
         GBeanData beanData = new GBeanData(name, ClusteredSessionHandlerFactory.class);
         beanData.setReferencePattern(ClusteredSessionHandlerFactory.GBEAN_REF_SESSION_MANAGER, sessionManagerName);

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/pom.xml?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/pom.xml (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/pom.xml Mon Oct 13 10:32:05 2008
@@ -38,6 +38,11 @@
             <artifactId>geronimo-servlet_3.0_spec</artifactId>
             <version>1.0-EA-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-ejb_3.0_spec</artifactId>
+            <version>1.0.1</version>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
@@ -51,16 +56,19 @@
             <artifactId>geronimo-connector</artifactId>
             <version>${version}</version>
         </dependency>
+
         <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
-            <artifactId>geronimo-security</artifactId>
+            <artifactId>jee-specs</artifactId>
             <version>${version}</version>
+            <type>car</type>
+            <scope>provided</scope>
         </dependency>
 
-        <!-- xbean-reflect, g-management come via g-j2ee from this -->
         <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-webservices</artifactId>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>webservices-common</artifactId>
+            <type>car</type>
             <version>${version}</version>
             <exclusions>
                 <exclusion>
@@ -70,11 +78,19 @@
             </exclusions>
         </dependency>
 
+        <!-- xbean-reflect, g-management come via g-j2ee from this -->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.modules</groupId>-->
+            <!--<artifactId>geronimo-webservices</artifactId>-->
+            <!--<version>${version}</version>-->
+            <!--<scope>provided</scope>-->
+        <!--</dependency>-->
+         
         <dependency>
             <groupId>org.mortbay.jetty</groupId>
             <artifactId>jetty</artifactId>
         </dependency>
-
+        
         <dependency>
             <groupId>org.mortbay.jetty</groupId>
             <artifactId>jetty-ajp</artifactId>
@@ -89,14 +105,31 @@
             <groupId>org.mortbay.jetty</groupId>
             <artifactId>jetty-util</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>jetty-webapp</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>jetty-security</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>jetty-plus</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>xerces</groupId>
             <artifactId>xercesImpl</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl104-over-slf4j</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
-
+    
     <build>
         <plugins>
             <plugin>
@@ -114,6 +147,6 @@
             </plugin>
         </plugins>
     </build>
-
+    
 </project>
 

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/AbstractPreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/AbstractPreHandler.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/AbstractPreHandler.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/AbstractPreHandler.java Mon Oct 13 10:32:05 2008
@@ -19,6 +19,7 @@
 
 import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.Server;
+import org.mortbay.component.LifeCycle;
 
 /**
  * @version $Rev: 449059 $ $Date: 2006-09-23 05:23:09 +1000 (Sat, 23 Sep 2006) $
@@ -38,6 +39,12 @@
         throw new UnsupportedOperationException();
     }
 
+    public void addLifeCycleListener(Listener listener) {
+    }
+
+    public void removeLifeCycleListener(Listener listener) {
+    }
+
     public final boolean isRunning() {
         throw new UnsupportedOperationException();
     }

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyContainerImpl.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyContainerImpl.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyContainerImpl.java Mon Oct 13 10:32:05 2008
@@ -76,7 +76,7 @@
         this.jettyHome = jettyHome;
         this.serverInfo = serverInfo;
 
-        server = new JettyServer();
+        server = new Server();
 
         //set up the jetty7+ handler structure which is to have a HandlerCollection,
         //each element of which is always tried on each request.

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyManagerImpl.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyManagerImpl.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyManagerImpl.java Mon Oct 13 10:32:05 2008
@@ -25,15 +25,12 @@
 import java.util.Map.Entry;
 import java.util.Set;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.ReferencePatterns;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty7.connector.AJP13Connector;
 import org.apache.geronimo.jetty7.connector.HTTPBlockingConnector;
 import org.apache.geronimo.jetty7.connector.HTTPSSelectChannelConnector;
@@ -53,6 +50,8 @@
 import org.apache.geronimo.management.geronimo.WebAccessLog;
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Jetty implementation of WebManager.  Knows how to manipulate
@@ -245,7 +244,7 @@
     public AbstractName getConnectorConfiguration(ConnectorType connectorType, List<ConnectorAttribute> connectorAttributes, WebContainer container, String uniqueName) {
         GBeanInfo gbeanInfo = CONNECTOR_GBEAN_INFOS.get(connectorType);
         AbstractName containerName = kernel.getAbstractNameFor(container);
-        AbstractName name = kernel.getNaming().createSiblingName(containerName, uniqueName, NameFactory.GERONIMO_SERVICE);
+        AbstractName name = kernel.getNaming().createSiblingName(containerName, uniqueName, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
         GBeanData gbeanData = new GBeanData(name, gbeanInfo);
         gbeanData.setReferencePattern(JettyConnector.CONNECTOR_CONTAINER_REFERENCE, containerName);
         for (ConnectorAttribute connectorAttribute : connectorAttributes) {

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyWebAppContext.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyWebAppContext.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/JettyWebAppContext.java Mon Oct 13 10:32:05 2008
@@ -66,7 +66,7 @@
 import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.MimeTypes;
 import org.mortbay.jetty.security.NoSecurityHandler;
-import org.mortbay.jetty.security.SecurityHandler;
+import org.mortbay.jetty.handler.SecurityHandler;
 import org.mortbay.jetty.servlet.ErrorPageErrorHandler;
 import org.mortbay.jetty.servlet.ServletHandler;
 import org.mortbay.jetty.servlet.ServletHolder;

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/GeronimoSelectChannelSSLListener.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/GeronimoSelectChannelSSLListener.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/GeronimoSelectChannelSSLListener.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/GeronimoSelectChannelSSLListener.java Mon Oct 13 10:32:05 2008
@@ -22,8 +22,8 @@
 
 import javax.net.ssl.SSLContext;
 
-import org.mortbay.jetty.security.SslSocketConnector;
-import org.mortbay.jetty.security.SslSelectChannelConnector;
+import org.mortbay.jetty.ssl.SslSelectChannelConnector;
+import org.mortbay.jetty.ssl.SslSocketConnector;
 import org.apache.geronimo.management.geronimo.KeystoreManager;
 
 /**

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/GeronimoSocketSSLListener.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/GeronimoSocketSSLListener.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/GeronimoSocketSSLListener.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/GeronimoSocketSSLListener.java Mon Oct 13 10:32:05 2008
@@ -16,7 +16,7 @@
  */
 package org.apache.geronimo.jetty7.connector;
 
-import org.mortbay.jetty.security.SslSocketConnector;
+import org.mortbay.jetty.ssl.SslSocketConnector;
 import org.apache.geronimo.management.geronimo.KeystoreManager;
 
 import javax.net.ssl.SSLServerSocketFactory;

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/HTTPSSelectChannelConnector.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/HTTPSSelectChannelConnector.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/HTTPSSelectChannelConnector.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/HTTPSSelectChannelConnector.java Mon Oct 13 10:32:05 2008
@@ -24,7 +24,6 @@
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty7.JettyContainer;
 import org.apache.geronimo.jetty7.JettySecureConnector;
 import org.apache.geronimo.management.geronimo.KeystoreManager;
@@ -141,7 +140,7 @@
         infoFactory.addAttribute("trustStore", String.class, true, true);
         infoFactory.addAttribute("clientAuthRequired", boolean.class, true, true);
         infoFactory.addAttribute("clientAuthRequested", boolean.class, true, true);
-        infoFactory.addReference("KeystoreManager", KeystoreManager.class, NameFactory.GERONIMO_SERVICE);
+        infoFactory.addReference("KeystoreManager", KeystoreManager.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
         infoFactory.addInterface(JettySecureConnector.class);
         infoFactory.setConstructor(new String[]{"JettyContainer", "ThreadPool", "KeystoreManager"});
         GBEAN_INFO = infoFactory.getBeanInfo();

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/HTTPSSocketConnector.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/HTTPSSocketConnector.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/HTTPSSocketConnector.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/HTTPSSocketConnector.java Mon Oct 13 10:32:05 2008
@@ -18,9 +18,9 @@
 package org.apache.geronimo.jetty7.connector;
 
 import javax.net.ssl.KeyManagerFactory;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty7.JettyContainer;
 import org.apache.geronimo.jetty7.JettySecureConnector;
 import org.apache.geronimo.management.geronimo.KeystoreManager;
@@ -137,7 +137,7 @@
         infoFactory.addAttribute("trustStore", String.class, true, true);
         infoFactory.addAttribute("clientAuthRequired", boolean.class, true, true);
         infoFactory.addAttribute("clientAuthRequested", boolean.class, true, true);
-        infoFactory.addReference("KeystoreManager", KeystoreManager.class, NameFactory.GERONIMO_SERVICE);
+        infoFactory.addReference("KeystoreManager", KeystoreManager.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
         infoFactory.addInterface(JettySecureConnector.class);
         infoFactory.setConstructor(new String[]{"JettyContainer", "ThreadPool", "KeystoreManager"});
         GBEAN_INFO = infoFactory.getBeanInfo();

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/JettyConnector.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/JettyConnector.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/JettyConnector.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/connector/JettyConnector.java Mon Oct 13 10:32:05 2008
@@ -26,7 +26,6 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty7.JettyContainer;
 import org.apache.geronimo.jetty7.JettyWebConnector;
 import org.apache.geronimo.management.LazyStatisticsProvider;
@@ -279,8 +278,8 @@
 
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Jetty HTTP Connector", JettyConnector.class);
-        infoFactory.addReference(CONNECTOR_CONTAINER_REFERENCE, JettyContainer.class, NameFactory.GERONIMO_SERVICE);
-        infoFactory.addReference("ThreadPool", ThreadPool.class, NameFactory.GERONIMO_SERVICE);
+        infoFactory.addReference(CONNECTOR_CONTAINER_REFERENCE, JettyContainer.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
+        infoFactory.addReference("ThreadPool", ThreadPool.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
         // this is needed because the getters/setters are not added automatically
         infoFactory.addOperation("setStatsOn", new Class[] { boolean.class }, "void");
         // removed 'minThreads' from persistent and manageable String[]

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/AbstractImmutableHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/AbstractImmutableHandler.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/AbstractImmutableHandler.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/AbstractImmutableHandler.java Mon Oct 13 10:32:05 2008
@@ -113,4 +113,11 @@
     public boolean isFailed() {
         return false;
     }
+
+    public void addLifeCycleListener(Listener listener) {
+    }
+
+    public void removeLifeCycleListener(Listener listener) {
+    }
+    
 }

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/ComponentContextHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/ComponentContextHandler.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/ComponentContextHandler.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/ComponentContextHandler.java Mon Oct 13 10:32:05 2008
@@ -27,6 +27,7 @@
 
 import org.apache.geronimo.naming.java.RootContext;
 import org.mortbay.jetty.Handler;
+import org.mortbay.component.LifeCycle;
 
 /**
  * @version $Rev$ $Date$
@@ -59,4 +60,5 @@
             RootContext.setComponentContext(oldContext);
         }
     }
+
 }

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/GeronimoRunAsToken.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/GeronimoRunAsToken.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/GeronimoRunAsToken.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/GeronimoRunAsToken.java Mon Oct 13 10:32:05 2008
@@ -22,11 +22,11 @@
 
 import javax.security.auth.Subject;
 
-import org.mortbay.jetty.security.RunAsToken;
 import org.apache.geronimo.security.ContextManager;
+import org.mortbay.jetty.RunAsToken;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class GeronimoRunAsToken implements RunAsToken {
 

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/GeronimoUserIdentity.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/GeronimoUserIdentity.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/GeronimoUserIdentity.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/GeronimoUserIdentity.java Mon Oct 13 10:32:05 2008
@@ -23,37 +23,41 @@
 import java.security.AccessControlContext;
 import java.security.AccessControlException;
 import java.security.Principal;
-import java.util.Map;
 
 import javax.security.jacc.WebRoleRefPermission;
 
-import org.mortbay.jetty.security.RunAsToken;
-import org.mortbay.jetty.security.UserIdentity;
 import org.mortbay.jetty.servlet.ServletHolder;
+import org.mortbay.jetty.UserIdentity;
+import org.mortbay.jetty.RunAsToken;
+import org.mortbay.jetty.ServerAuthResult;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class GeronimoUserIdentity implements UserIdentity {
 
-    private final Principal userPrincipal;
+    private final ServerAuthResult serverAuthResult;
     private final AccessControlContext acc;
     private RunAsToken runAsToken;
-    private ServletHolder serverletHolder;
+    private ServletHolder servletHolder;
 
-    public GeronimoUserIdentity(Principal userPrincipal, AccessControlContext acc) {
-        this.userPrincipal = userPrincipal;
+    public GeronimoUserIdentity(ServerAuthResult serverAuthResult, AccessControlContext acc) {
+        this.serverAuthResult = serverAuthResult;
         this.acc = acc;
     }
 
     public Principal getUserPrincipal() {
-        return userPrincipal;
+        return serverAuthResult.getUserPrincipal();
     }/* ------------------------------------------------------------ */
 
+    public String getAuthMethod() {
+        return serverAuthResult.getAuthMethod();
+    }
+
     //jaspi called from Request.isUserInRole and ConstraintSecurityHandler.check
     public boolean isUserInRole(String role) {
         // JACC v1.0 secion B.19
-        String servletName = serverletHolder.getName();
+        String servletName = servletHolder.getName();
         if (servletName == null || servletName.equals("jsp")) {
             servletName = "";
         }
@@ -74,8 +78,8 @@
     }
 
     public ServletHolder setServletHolder(ServletHolder newServletHolder) {
-        ServletHolder oldServletHolder = serverletHolder;
-        this.serverletHolder = newServletHolder;
+        ServletHolder oldServletHolder = servletHolder;
+        this.servletHolder = newServletHolder;
         return oldServletHolder;
     }
 

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/JettySecurityHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/JettySecurityHandler.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/JettySecurityHandler.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/JettySecurityHandler.java Mon Oct 13 10:32:05 2008
@@ -38,10 +38,13 @@
 import org.apache.geronimo.security.jacc.RunAsSource;
 import org.mortbay.jetty.Request;
 import org.mortbay.jetty.Response;
+import org.mortbay.jetty.UserIdentity;
+import org.mortbay.jetty.RunAsToken;
+import org.mortbay.jetty.ServerAuthResult;
+import org.mortbay.jetty.ServerAuthentication;
 import org.mortbay.jetty.security.AbstractSecurityHandler;
-import org.mortbay.jetty.security.RunAsToken;
 import org.mortbay.jetty.security.ServletCallbackHandler;
-import org.mortbay.jetty.security.UserIdentity;
+import org.mortbay.jetty.security.SimpleAuthResult;
 
 public class JettySecurityHandler extends AbstractSecurityHandler {
 
@@ -55,14 +58,8 @@
             String policyContextID,
             Subject defaultSubject,
             RunAsSource runAsSource,
-            ServerAuthConfig serverAuthConfig,
-            Subject serviceSubject,
-            Map authProperties,
-            ServletCallbackHandler servletCallbackHandler) {
-        setAuthConfig(serverAuthConfig);
-        setServiceSubject(serviceSubject);
-        setAuthProperties(authProperties);
-        setServletCallbackHandler(servletCallbackHandler);
+            ServerAuthentication serverAuthentication) {
+        setServerAuthentication(serverAuthentication);
         this.policyContextID = policyContextID;
         this.runAsSource = runAsSource;
 
@@ -109,16 +106,15 @@
         }
     }
 
-    protected UserIdentity newUserIdentity(ServletCallbackHandler callbackHandler, Subject clientSubject) {
+    protected UserIdentity newUserIdentity(ServerAuthResult serverAuthResult) {
+        Subject clientSubject = serverAuthResult.getClientSubject();
         AccessControlContext acc = ContextManager.registerSubjectShort(clientSubject);
         ContextManager.setCallers(clientSubject, clientSubject);
-        final CallerPrincipalCallback principalCallback = callbackHandler.getThreadCallerPrincipalCallback();
-        Principal userPrincipal = principalCallback == null? null: principalCallback.getPrincipal();
-        return new GeronimoUserIdentity(userPrincipal, acc);
+        return new GeronimoUserIdentity(serverAuthResult, acc);
     }
 
     protected UserIdentity newSystemUserIdentity() {
-        return new GeronimoUserIdentity(null, default_acc);
+        return new GeronimoUserIdentity(SimpleAuthResult.NO_AUTH_RESULTS, default_acc);
     }
 
     public RunAsToken newRunAsToken(String runAsRole) {

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/TwistyWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/TwistyWebAppContext.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/TwistyWebAppContext.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/handler/TwistyWebAppContext.java Mon Oct 13 10:32:05 2008
@@ -29,10 +29,11 @@
 import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.handler.ErrorHandler;
-import org.mortbay.jetty.security.SecurityHandler;
+import org.mortbay.jetty.handler.SecurityHandler;
 import org.mortbay.jetty.servlet.ServletHandler;
 import org.mortbay.jetty.servlet.SessionHandler;
 import org.mortbay.jetty.webapp.WebAppContext;
+import org.mortbay.component.LifeCycle;
 
 /**
  * @version $Rev$ $Date$
@@ -108,5 +109,11 @@
         public boolean isFailed() {
             return TwistyWebAppContext.super.isFailed();
         }
+
+        public void addLifeCycleListener(Listener listener) {
+        }
+
+        public void removeLifeCycleListener(Listener listener) {
+        }
     }
 }

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/requestlog/NCSARequestLog.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/requestlog/NCSARequestLog.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/requestlog/NCSARequestLog.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/requestlog/NCSARequestLog.java Mon Oct 13 10:32:05 2008
@@ -19,7 +19,6 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty7.JettyContainer;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.mortbay.jetty.RequestLog;
@@ -127,8 +126,8 @@
 
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("NCSA Request Log", NCSARequestLog.class);
-        infoFactory.addReference("JettyContainer", JettyContainer.class, NameFactory.GERONIMO_SERVICE);
-        infoFactory.addReference("ServerInfo", ServerInfo.class, NameFactory.GERONIMO_SERVICE);
+        infoFactory.addReference("JettyContainer", JettyContainer.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
+        infoFactory.addReference("ServerInfo", ServerInfo.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
 
         infoFactory.addInterface(JettyRequestLog.class, new String[]{"filename", "logDateFormat", "logTimeZone",
                 "retainDays", "extended", "append", "ignorePaths", "preferProxiedForAddress", });

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/AuthConfigProviderHandlerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/AuthConfigProviderHandlerFactory.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/AuthConfigProviderHandlerFactory.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/AuthConfigProviderHandlerFactory.java Mon Oct 13 10:32:05 2008
@@ -33,9 +33,12 @@
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.jetty7.handler.JettySecurityHandler;
-import org.apache.geronimo.jetty7.security.auth.BaseAuthModule;
 import org.apache.geronimo.security.jacc.RunAsSource;
+import org.mortbay.jetty.plus.jaas.JAASLoginService;
 import org.mortbay.jetty.security.ServletCallbackHandler;
+import org.mortbay.jetty.security.jaspi.JaspiServerAuthentication;
+import org.mortbay.jetty.ServerAuthentication;
+import org.mortbay.jetty.LoginService;
 
 /**
  * Fetches a ServerAuthConfig out of the AuthConfigFactory
@@ -46,14 +49,15 @@
 @GBean
 public class AuthConfigProviderHandlerFactory implements SecurityHandlerFactory {
 
-    private final ServerAuthConfig serverAuthConfig;
-    private final ServletCallbackHandler servletCallbackHandler = new ServletCallbackHandler();
     private final Map authConfigProperties = new HashMap<Object, Object>();
     private final Subject serviceSubject = null;
+    private final ServerAuthentication serverAuthentication;
 
 
     public AuthConfigProviderHandlerFactory(@ParamAttribute(name = "messageLayer")String messageLayer,
-                                            @ParamAttribute(name = "appContext")String appContext
+                                            @ParamAttribute(name = "appContext")String appContext,
+                                            @ParamAttribute(name = "securityRealm")String securityRealm,
+                                            @ParamAttribute(name = "allowLazyAuthentication") boolean allowLazyAuthentication
     ) throws AuthException {
         AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
         RegistrationListener listener = new RegistrationListener() {
@@ -62,11 +66,16 @@
             }
         };
         AuthConfigProvider authConfigProvider = authConfigFactory.getConfigProvider(messageLayer, appContext, listener);
-        this.serverAuthConfig = authConfigProvider.getServerAuthConfig(messageLayer, appContext, servletCallbackHandler);
+        LoginService loginService = new JAASLoginService(securityRealm);
+        ServletCallbackHandler servletCallbackHandler = new ServletCallbackHandler(loginService);
+        ServerAuthConfig serverAuthConfig = authConfigProvider.getServerAuthConfig(messageLayer, appContext, servletCallbackHandler);
+        //TODO appContext is supposed to be server-name<space>context-root
+        this.serverAuthentication = new JaspiServerAuthentication(appContext, serverAuthConfig, authConfigProperties, servletCallbackHandler, serviceSubject, allowLazyAuthentication);
+
     }
 
     public JettySecurityHandler buildSecurityHandler(String policyContextID, Subject defaultSubject, RunAsSource runAsSource) {
-        return new JettySecurityHandler(policyContextID, defaultSubject, runAsSource, serverAuthConfig, serviceSubject, authConfigProperties, servletCallbackHandler);
+        return new JettySecurityHandler(policyContextID, defaultSubject, runAsSource, serverAuthentication);
     }
 
 }
\ No newline at end of file

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/ServerAuthConfigGBean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/ServerAuthConfigGBean.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/ServerAuthConfigGBean.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/ServerAuthConfigGBean.java Mon Oct 13 10:32:05 2008
@@ -20,8 +20,8 @@
 
 package org.apache.geronimo.jetty7.security;
 
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
 
 import javax.security.auth.Subject;
 import javax.security.auth.message.config.ServerAuthConfig;
@@ -29,7 +29,9 @@
 
 import org.apache.geronimo.jetty7.handler.JettySecurityHandler;
 import org.apache.geronimo.security.jacc.RunAsSource;
+import org.mortbay.jetty.ServerAuthentication;
 import org.mortbay.jetty.security.ServletCallbackHandler;
+import org.mortbay.jetty.security.jaspi.JaspiServerAuthentication;
 import org.mortbay.jetty.security.jaspi.SimpleAuthConfig;
 
 /**
@@ -39,19 +41,19 @@
  */
 public class ServerAuthConfigGBean implements SecurityHandlerFactory {
 
-    private ServerAuthConfig serverAuthConfig;
-    private ServletCallbackHandler servletCallbackHandler = new ServletCallbackHandler();
     private Map authConfigProperties = new HashMap<Object, Object>();
     private Subject serviceSubject = null;
+    private final ServerAuthentication serverAuthentication;
 
 
-    public ServerAuthConfigGBean(ServletCallbackHandler servletCallbackHandler, ServerAuthContext serverAuthContext) {
-        this.servletCallbackHandler = servletCallbackHandler;
-        this.serverAuthConfig = new SimpleAuthConfig(null, serverAuthContext);
+    public ServerAuthConfigGBean(ServletCallbackHandler servletCallbackHandler, ServerAuthContext serverAuthContext, String appContext, boolean allowLazyAuthentication) {
+        ServerAuthConfig serverAuthConfig = new SimpleAuthConfig(null, serverAuthContext);
+        //TODO appContext is supposed to be server-name<space>context-root
+        this.serverAuthentication = new JaspiServerAuthentication(appContext, serverAuthConfig, authConfigProperties, servletCallbackHandler, serviceSubject, allowLazyAuthentication);
     }
 
     public JettySecurityHandler buildSecurityHandler(String policyContextID, Subject defaultSubject, RunAsSource runAsSource) {
-        return new JettySecurityHandler(policyContextID, defaultSubject, runAsSource, serverAuthConfig, serviceSubject, authConfigProperties, servletCallbackHandler);
+        return new JettySecurityHandler(policyContextID, defaultSubject, runAsSource, serverAuthentication);
     }
 
 }

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/BaseAuthModule.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/BaseAuthModule.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/BaseAuthModule.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/BaseAuthModule.java Mon Oct 13 10:32:05 2008
@@ -21,20 +21,29 @@
 package org.apache.geronimo.jetty7.security.auth;
 
 import java.util.Map;
+import java.util.Set;
+import java.io.IOException;
 
 import javax.security.auth.Subject;
 import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.callback.Callback;
 import javax.security.auth.message.AuthException;
 import javax.security.auth.message.AuthStatus;
 import javax.security.auth.message.MessageInfo;
 import javax.security.auth.message.MessagePolicy;
+import javax.security.auth.message.callback.PasswordValidationCallback;
+import javax.security.auth.message.callback.CallerPrincipalCallback;
+import javax.security.auth.message.callback.GroupPrincipalCallback;
 import javax.security.auth.message.config.ServerAuthContext;
 import javax.security.auth.message.module.ServerAuthModule;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.mortbay.jetty.security.JettyMessageInfo;
-import org.mortbay.jetty.security.jaspi.modules.LoginService;
+import org.mortbay.jetty.LoginCallback;
+import org.mortbay.jetty.JettyMessageInfo;
+import org.mortbay.util.B64Code;
+import org.mortbay.util.StringUtil;
 
 /**
  * @version $Rev$ $Date$
@@ -46,7 +55,6 @@
     public static final String LOGIN_SERVICE_KEY = "org.apache.geronimo.securityRealm";
 
     protected CallbackHandler callbackHandler;
-    protected LoginService loginService;
 
     public Class[] getSupportedMessageTypes()
     {
@@ -57,17 +65,14 @@
     {
     }
 
-    public BaseAuthModule(CallbackHandler callbackHandler, String securityRealm)
+    public BaseAuthModule(CallbackHandler callbackHandler)
     {
         this.callbackHandler = callbackHandler;
-        this.loginService = new JAASLoginService(securityRealm);
     }
 
     public void initialize(MessagePolicy requestPolicy, MessagePolicy responsePolicy, CallbackHandler handler, Map options) throws AuthException
     {
         this.callbackHandler = handler;
-        String securityRealm = (String) options.get(LOGIN_SERVICE_KEY);
-        this.loginService = new JAASLoginService(securityRealm);
     }
 
     public void cleanSubject(MessageInfo messageInfo, Subject subject) throws AuthException
@@ -96,4 +101,30 @@
         if (mandatory == null) return false;
         return Boolean.valueOf(mandatory);
     }
+    protected boolean login(Subject clientSubject, String credentials, String authMethod, MessageInfo messageInfo) throws IOException, UnsupportedCallbackException {
+        credentials = credentials.substring(credentials.indexOf(' ') + 1);
+        credentials = B64Code.decode(credentials, StringUtil.__ISO_8859_1);
+        int i = credentials.indexOf(':');
+        String userName = credentials.substring(0, i);
+        char[] password = new char[credentials.length() - (i + 1)];
+        credentials.getChars(i + 1, credentials.length(), password, 0);//substring(i+1);
+        return login(clientSubject, userName, password, authMethod, messageInfo);
+    }
+
+    protected boolean login(Subject clientSubject, String username, char[] password, String authMethod, MessageInfo messageInfo) throws IOException, UnsupportedCallbackException {
+        PasswordValidationCallback passwordValidationCallback = new PasswordValidationCallback(clientSubject, username, password);
+        callbackHandler.handle(new Callback[]{passwordValidationCallback});
+        if (passwordValidationCallback.getResult()) {
+            Set<LoginCallback> loginCallbacks = clientSubject.getPrivateCredentials(LoginCallback.class);
+            if (!loginCallbacks.isEmpty()) {
+                LoginCallback loginCallback = loginCallbacks.iterator().next();
+                CallerPrincipalCallback callerPrincipalCallback = new CallerPrincipalCallback(clientSubject, loginCallback.getUserPrincipal());
+                GroupPrincipalCallback groupPrincipalCallback = new GroupPrincipalCallback(clientSubject, loginCallback.getGroups().toArray(new String[loginCallback.getGroups().size()]));
+                callbackHandler.handle(new Callback[]{callerPrincipalCallback, groupPrincipalCallback});
+            }
+            messageInfo.getMap().put(JettyMessageInfo.AUTH_METHOD_KEY, authMethod);
+        }
+        return passwordValidationCallback.getResult();
+
+    }
 }

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/BasicAuthModule.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/BasicAuthModule.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/BasicAuthModule.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/BasicAuthModule.java Mon Oct 13 10:32:05 2008
@@ -24,7 +24,6 @@
 import java.util.Map;
 
 import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.UnsupportedCallbackException;
 import javax.security.auth.message.AuthException;
@@ -36,10 +35,6 @@
 
 import org.mortbay.jetty.HttpHeaders;
 import org.mortbay.jetty.security.Constraint;
-import org.mortbay.jetty.security.JettyMessageInfo;
-import org.mortbay.jetty.security.jaspi.modules.LoginCredentials;
-import org.mortbay.jetty.security.jaspi.modules.LoginResult;
-import org.mortbay.jetty.security.jaspi.modules.UserPasswordLoginCredentials;
 import org.mortbay.log.Log;
 
 /**
@@ -55,9 +50,9 @@
     {
     }
 
-    public BasicAuthModule(CallbackHandler callbackHandler, String securityRealm, String realmName)
+    public BasicAuthModule(CallbackHandler callbackHandler, String realmName)
     {
-        super(callbackHandler, securityRealm);
+        super(callbackHandler);
         this.realmName = realmName;
     }
 
@@ -80,13 +75,7 @@
             if (credentials != null)
             {
                 if (Log.isDebugEnabled()) Log.debug("Credentials: " + credentials);
-                LoginCredentials loginCredentials = new UserPasswordLoginCredentials(credentials);
-                LoginResult loginResult = loginService.login(clientSubject, loginCredentials);
-                //TODO what should happen if !isMandatory but credentials exist and are wrong?
-                if (loginResult.isSuccess())
-                {
-                    callbackHandler.handle(new Callback[]{loginResult.getCallerPrincipalCallback(), loginResult.getGroupPrincipalCallback()});
-                    messageInfo.getMap().put(JettyMessageInfo.AUTH_METHOD_KEY, Constraint.__BASIC_AUTH);
+                if (login(clientSubject, credentials, Constraint.__BASIC_AUTH, messageInfo)) {
                     return AuthStatus.SUCCESS;
                 }
 

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/ClientCertAuthModule.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/ClientCertAuthModule.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/ClientCertAuthModule.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/ClientCertAuthModule.java Mon Oct 13 10:32:05 2008
@@ -24,7 +24,6 @@
 import java.security.Principal;
 
 import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.UnsupportedCallbackException;
 import javax.security.auth.message.AuthException;
@@ -33,12 +32,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.mortbay.jetty.security.B64Code;
+import org.mortbay.util.B64Code;
 import org.mortbay.jetty.security.Constraint;
-import org.mortbay.jetty.security.JettyMessageInfo;
-import org.mortbay.jetty.security.jaspi.modules.LoginCredentials;
-import org.mortbay.jetty.security.jaspi.modules.UserPasswordLoginCredentials;
-import org.mortbay.jetty.security.jaspi.modules.LoginResult;
 
 /**
  * @version $Rev$ $Date$
@@ -51,9 +46,9 @@
     {
     }
 
-    public ClientCertAuthModule(CallbackHandler callbackHandler, String securityRealm)
+    public ClientCertAuthModule(CallbackHandler callbackHandler)
     {
-        super(callbackHandler, securityRealm);
+        super(callbackHandler);
     }
 
     @Override
@@ -80,12 +75,8 @@
             //TODO no idea if this is correct
             final char[] password = B64Code.encode(certs[0].getSignature());
 
-            LoginCredentials loginCredentials = new UserPasswordLoginCredentials(username, password);
-            LoginResult loginResult = loginService.login(clientSubject, loginCredentials);
-            if (loginResult.isSuccess())
-            {
-                callbackHandler.handle(new Callback[] {loginResult.getCallerPrincipalCallback(), loginResult.getGroupPrincipalCallback()});
-                messageInfo.getMap().put(JettyMessageInfo.AUTH_METHOD_KEY, Constraint.__CERT_AUTH);
+            //TODO is cert_auth correct?
+            if (login(clientSubject, username, password, Constraint.__CERT_AUTH, messageInfo)) {
                 return AuthStatus.SUCCESS;
             }
 

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/DigestAuthModule.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/DigestAuthModule.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/DigestAuthModule.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/DigestAuthModule.java Mon Oct 13 10:32:05 2008
@@ -25,7 +25,6 @@
 import java.util.Map;
 
 import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.UnsupportedCallbackException;
 import javax.security.auth.message.AuthException;
@@ -36,17 +35,13 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.mortbay.jetty.HttpHeaders;
-import org.mortbay.jetty.security.B64Code;
 import org.mortbay.jetty.security.Constraint;
 import org.mortbay.jetty.security.Credential;
-import org.mortbay.jetty.security.JettyMessageInfo;
-import org.mortbay.jetty.security.jaspi.modules.LoginCredentials;
-import org.mortbay.jetty.security.jaspi.modules.UserPasswordLoginCredentials;
-import org.mortbay.jetty.security.jaspi.modules.LoginResult;
 import org.mortbay.log.Log;
 import org.mortbay.util.QuotedStringTokenizer;
 import org.mortbay.util.StringUtil;
 import org.mortbay.util.TypeUtil;
+import org.mortbay.util.B64Code;
 
 /**
  * @version $Rev$ $Date$
@@ -65,9 +60,9 @@
     {
     }
 
-    public DigestAuthModule(CallbackHandler callbackHandler, String securityRealm, String realmName)
+    public DigestAuthModule(CallbackHandler callbackHandler, String realmName)
     {
-        super(callbackHandler, securityRealm);
+        super(callbackHandler);
         this.realmName = realmName;
     }
 
@@ -147,13 +142,7 @@
 
                 if (n > 0)
                 {
-                    LoginCredentials loginCredentials = new UserPasswordLoginCredentials(digest.username,digest.toString().toCharArray());
-                    LoginResult loginResult = loginService.login(clientSubject, loginCredentials);
-                    //TODO what should happen if !isMandatory but credentials exist and are wrong?
-                    if (loginResult.isSuccess())
-                    {
-                        callbackHandler.handle(new Callback[] {loginResult.getCallerPrincipalCallback(), loginResult.getGroupPrincipalCallback()});
-                        messageInfo.getMap().put(JettyMessageInfo.AUTH_METHOD_KEY, Constraint.__DIGEST_AUTH);
+                    if (login(clientSubject, digest.username, digest.toString().toCharArray(), Constraint.__DIGEST_AUTH, messageInfo)) {
                         return AuthStatus.SUCCESS;
                     }
                 }

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java Mon Oct 13 10:32:05 2008
@@ -25,9 +25,9 @@
 import java.security.Principal;
 import java.util.Arrays;
 import java.util.Map;
+import java.util.Set;
 
 import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.UnsupportedCallbackException;
 import javax.security.auth.message.AuthException;
@@ -44,11 +44,8 @@
 
 import org.mortbay.jetty.security.Constraint;
 import org.mortbay.jetty.security.CrossContextPsuedoSession;
-import org.mortbay.jetty.security.JettyMessageInfo;
 import org.mortbay.jetty.security.jaspi.modules.UserInfo;
-import org.mortbay.jetty.security.jaspi.modules.LoginResult;
-import org.mortbay.jetty.security.jaspi.modules.LoginCredentials;
-import org.mortbay.jetty.security.jaspi.modules.UserPasswordLoginCredentials;
+import org.mortbay.jetty.LoginCallback;
 import org.mortbay.log.Log;
 import org.mortbay.util.StringUtil;
 import org.mortbay.util.URIUtil;
@@ -81,16 +78,16 @@
     {
     }
 
-    public FormAuthModule(CallbackHandler callbackHandler, String securityRealm, String loginPage, String errorPage)
+    public FormAuthModule(CallbackHandler callbackHandler, String loginPage, String errorPage)
     {
-        super(callbackHandler, securityRealm);
+        super(callbackHandler);
         setLoginPage(loginPage);
         setErrorPage(errorPage);
     }
 
-    public FormAuthModule(CallbackHandler callbackHandler, String securityRealm, CrossContextPsuedoSession<UserInfo> ssoSource, String loginPage, String errorPage)
+    public FormAuthModule(CallbackHandler callbackHandler, CrossContextPsuedoSession<UserInfo> ssoSource, String loginPage, String errorPage)
     {
-        super(callbackHandler, securityRealm);
+        super(callbackHandler);
         this.ssoSource = ssoSource;
         setLoginPage(loginPage);
         setErrorPage(errorPage);
@@ -321,26 +318,23 @@
     private boolean tryLogin(MessageInfo messageInfo, Subject clientSubject, HttpServletResponse response, HttpSession session, String username, char[] password)
             throws AuthException, IOException, UnsupportedCallbackException
     {
-        LoginCredentials loginCredentials = new UserPasswordLoginCredentials(username, password);
-        LoginResult loginResult = loginService.login(clientSubject, loginCredentials);
-        //TODO what should happen if !isMandatory but credentials exist and are wrong?
-        if (loginResult.isSuccess())
-        {
-            callbackHandler.handle(new Callback[]{loginResult.getCallerPrincipalCallback(), loginResult.getGroupPrincipalCallback()});
-            messageInfo.getMap().put(JettyMessageInfo.AUTH_METHOD_KEY, Constraint.__FORM_AUTH);
+        if (login(clientSubject, username, password, Constraint.__FORM_AUTH, messageInfo)) {
+            Set<LoginCallback> loginCallbacks = clientSubject.getPrivateCredentials(LoginCallback.class);
+            if (!loginCallbacks.isEmpty()) {
+                LoginCallback loginCallback = loginCallbacks.iterator().next();
+                FormCredential form_cred = new FormCredential(username, password, loginCallback.getUserPrincipal());
 
-            FormCredential form_cred = new FormCredential(username, password, loginResult.getCallerPrincipalCallback().getPrincipal());
+                session.setAttribute(__J_AUTHENTICATED, form_cred);
+            }
 
-            session.setAttribute(__J_AUTHENTICATED, form_cred);
             // Sign-on to SSO mechanism
-            if (ssoSource != null)
-            {
+            if (ssoSource != null) {
                 UserInfo userInfo = new UserInfo(username, password);
-                ssoSource.store(userInfo,  response);
+                ssoSource.store(userInfo, response);
             }
-
+            return true;
         }
-        return loginResult.isSuccess();
+        return false;
     }
 
 

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/JAASLoginService.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/JAASLoginService.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/JAASLoginService.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/JAASLoginService.java Mon Oct 13 10:32:05 2008
@@ -26,17 +26,15 @@
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
-import javax.security.auth.message.AuthException;
 
-import org.mortbay.jetty.security.jaspi.modules.LoginService;
-import org.mortbay.jetty.security.jaspi.modules.LoginResult;
-import org.mortbay.jetty.security.jaspi.modules.LoginCredentials;
-import org.mortbay.jetty.security.jaspi.modules.UserPasswordLoginCredentials;
 import org.apache.geronimo.security.ContextManager;
 import org.apache.geronimo.security.realm.providers.PasswordCallbackHandler;
+import org.mortbay.jetty.LoginCallback;
+import org.mortbay.jetty.LoginService;
+import org.mortbay.jetty.ServerAuthException;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class JAASLoginService implements LoginService {
     private final String securityRealm;
@@ -45,24 +43,27 @@
         this.securityRealm = securityRealm;
     }
 
-    public LoginResult login(Subject subject, LoginCredentials loginCredentials) throws AuthException {
-        String username = ((UserPasswordLoginCredentials)loginCredentials).getUsername();
-        char[] password = ((UserPasswordLoginCredentials)loginCredentials).getPassword();
+    public void login(LoginCallback loginCallback) throws ServerAuthException {
+        String username = loginCallback.getUserName();
+        char[] password = loginCallback.getPassword();
         CallbackHandler callbackHandler = new PasswordCallbackHandler(username, password);
         try {
             LoginContext loginContext = ContextManager.login(securityRealm, callbackHandler);
             Subject establishedSubject = loginContext.getSubject();
             Principal userPrincipal = ContextManager.getCurrentPrincipal(establishedSubject);
+            Subject subject = loginCallback.getSubject();
             subject.getPrincipals().addAll(establishedSubject.getPrincipals());
             subject.getPrivateCredentials().addAll(establishedSubject.getPrivateCredentials());
             subject.getPublicCredentials().addAll((establishedSubject.getPublicCredentials()));
-            return new LoginResult(true, userPrincipal, null, subject);
+            loginCallback.setUserPrincipal(userPrincipal);
+//            loginCallback.setGroups();
+            loginCallback.setSuccess(true);
         } catch (LoginException e) {
-            return new LoginResult(false, null, null, null);
+            //
         }
     }
 
-    public void logout(Subject subject) throws AuthException {
+    public void logout(Subject subject) throws ServerAuthException {
         //not sure how to do this
     }
 

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/test/java/org/apache/geronimo/jetty7/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/test/java/org/apache/geronimo/jetty7/AbstractWebModuleTest.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/test/java/org/apache/geronimo/jetty7/AbstractWebModuleTest.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/test/java/org/apache/geronimo/jetty7/AbstractWebModuleTest.java Mon Oct 13 10:32:05 2008
@@ -19,8 +19,8 @@
 import java.io.File;
 import java.net.URL;
 import java.security.PermissionCollection;
-import java.security.Principal;
 import java.security.Permissions;
+import java.security.Principal;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -31,8 +31,8 @@
 import javax.security.auth.message.AuthException;
 import javax.security.auth.message.AuthStatus;
 import javax.security.auth.message.MessageInfo;
-import javax.security.jacc.WebUserDataPermission;
 import javax.security.jacc.WebResourcePermission;
+import javax.security.jacc.WebUserDataPermission;
 import javax.transaction.TransactionManager;
 
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
@@ -40,6 +40,7 @@
 import org.apache.geronimo.jetty7.connector.HTTPSocketConnector;
 import org.apache.geronimo.jetty7.security.SecurityHandlerFactory;
 import org.apache.geronimo.jetty7.security.ServerAuthConfigGBean;
+import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.security.deploy.SubjectInfo;
 import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
@@ -50,18 +51,16 @@
 import org.apache.geronimo.security.jacc.mappingprovider.GeronimoPolicyConfigurationFactory;
 import org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal;
 import org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal;
-import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.testsupport.TestSupport;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
+import org.mortbay.jetty.LoginCallback;
+import org.mortbay.jetty.LoginService;
+import org.mortbay.jetty.ServerAuthException;
 import org.mortbay.jetty.security.ServletCallbackHandler;
-import org.mortbay.jetty.security.jaspi.modules.FormAuthModule;
-import org.mortbay.jetty.security.jaspi.modules.LoginCredentials;
-import org.mortbay.jetty.security.jaspi.modules.LoginResult;
-import org.mortbay.jetty.security.jaspi.modules.LoginService;
-import org.mortbay.jetty.security.jaspi.modules.UserPasswordLoginCredentials;
 import org.mortbay.jetty.security.jaspi.modules.BaseAuthModule;
+import org.mortbay.jetty.security.jaspi.modules.FormAuthModule;
 
 
 /**
@@ -107,13 +106,14 @@
             unchecked.add(new WebResourcePermission("/", ""));
             ComponentPermissions componentPermissions = new ComponentPermissions(new Permissions(), unchecked, Collections.<String, PermissionCollection>emptyMap());
             setUpJACC(Collections.<String, SubjectInfo>emptyMap(), Collections.<Principal, Set<String>>emptyMap(), componentPermissions, policyContextId);
-            final ServletCallbackHandler callbackHandler = new ServletCallbackHandler();
-            securityHandlerFactory = new ServerAuthConfigGBean(callbackHandler, new BaseAuthModule(callbackHandler, null) {
+            LoginService loginService = newLoginService();
+            final ServletCallbackHandler callbackHandler = new ServletCallbackHandler(loginService);
+            securityHandlerFactory = new ServerAuthConfigGBean(callbackHandler, new BaseAuthModule(callbackHandler) {
                 @Override
                 public AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject) throws AuthException {
                     return AuthStatus.SUCCESS;
                 }
-            });
+            }, null, false);
         }
         String contextPath = "/test";
         JettyWebAppContext app = new JettyWebAppContext(null,
@@ -157,10 +157,10 @@
     protected JettyWebAppContext setUpSecureAppContext(String securityRealmName, Map<String, SubjectInfo> roleDesignates, Map<Principal, Set<String>> principalRoleMap, ComponentPermissions componentPermissions, SubjectInfo defaultSubjectInfo, PermissionCollection checked, Set securityRoles) throws Exception {
         String policyContextId = "TEST";
         ApplicationPolicyConfigurationManager jacc = setUpJACC(roleDesignates, principalRoleMap, componentPermissions, policyContextId);
-        ServletCallbackHandler callbackHandler = new ServletCallbackHandler();
         LoginService loginService = newLoginService();
-        FormAuthModule authModule = new FormAuthModule(callbackHandler, loginService, "/auth/logon.html?param=test", "/auth/logonError.html?param=test");
-        SecurityHandlerFactory securityHandlerFactory = new ServerAuthConfigGBean(callbackHandler, authModule);
+        ServletCallbackHandler callbackHandler = new ServletCallbackHandler(loginService);
+        FormAuthModule authModule = new FormAuthModule(callbackHandler, "/auth/logon.html?param=test", "/auth/logonError.html?param=test");
+        SecurityHandlerFactory securityHandlerFactory = new ServerAuthConfigGBean(callbackHandler, authModule, null, false);
         return setUpAppContext(
                 securityRealmName,
                 securityHandlerFactory,
@@ -188,8 +188,7 @@
         users.put("izumi", "violin");
         Map<String, List<String>> groups = new HashMap<String, List<String>>();
         groups.put("alan", Collections.singletonList("it"));
-        TestLoginService loginService = new TestLoginService(users, groups);
-        return loginService;
+        return new TestLoginService(users, groups);
 
     }
 
@@ -236,25 +235,26 @@
             this.groups = groups;
         }
 
-        public LoginResult login(Subject subject, LoginCredentials loginCredentials) throws AuthException {
-            UserPasswordLoginCredentials creds = (UserPasswordLoginCredentials) loginCredentials;
-            String pws = users.get(creds.getUsername());
-            if (pws != null && pws.equals(new String(creds.getPassword()))) {
-                final GeronimoUserPrincipal userPrincipal = new GeronimoUserPrincipal(creds.getUsername());
+        public void login(LoginCallback loginCallback) throws ServerAuthException {
+            String userName = loginCallback.getUserName();
+            String pws = users.get(userName);
+            if (pws != null && pws.equals(new String(loginCallback.getPassword()))) {
+                final GeronimoUserPrincipal userPrincipal = new GeronimoUserPrincipal(userName);
+                Subject subject = loginCallback.getSubject();
                 subject.getPrincipals().add(userPrincipal);
-                List<String> usersGroups = groups.get(creds.getUsername());
+                loginCallback.setUserPrincipal(userPrincipal);
+                List<String> usersGroups = groups.get(userName);
                 if (usersGroups != null) {
                     for (String group: usersGroups) {
                         subject.getPrincipals().add(new GeronimoGroupPrincipal(group));
                     }
-                    return new LoginResult(true, userPrincipal, usersGroups.toArray(new String[usersGroups.size()]), subject);
+                    loginCallback.setGroups(usersGroups);
                 }
-                return new LoginResult(true, userPrincipal, new String[0], subject);
+                loginCallback.setSuccess(true);
             }
-            return new LoginResult(false, null, null, subject);
         }
 
-        public void logout(Subject subject) throws AuthException {
+        public void logout(Subject subject) throws ServerAuthException {
         }
 
         @Deprecated

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/test/java/org/apache/geronimo/jetty7/ApplicationTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/test/java/org/apache/geronimo/jetty7/ApplicationTest.java?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/test/java/org/apache/geronimo/jetty7/ApplicationTest.java (original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/test/java/org/apache/geronimo/jetty7/ApplicationTest.java Mon Oct 13 10:32:05 2008
@@ -28,6 +28,7 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.mortbay.jetty.servlet.SessionHandler;
+import org.mortbay.component.LifeCycle;
 
 
 /**
@@ -69,7 +70,12 @@
                         throws IOException, ServletException {
                     next.handle(target, request, response, dispatch);
                 }
-                
+
+                public void addLifeCycleListener(Listener listener) {
+                }
+
+                public void removeLifeCycleListener(Listener listener) {
+                }
             };
         }
 

Modified: geronimo/sandbox/djencks/jetty7/jetty7/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/jetty7/pom.xml?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/jetty7/pom.xml (original)
+++ geronimo/sandbox/djencks/jetty7/jetty7/pom.xml Mon Oct 13 10:32:05 2008
@@ -130,71 +130,7 @@
                 <groupId>org.apache.geronimo.buildsupport</groupId>
                 <artifactId>car-maven-plugin</artifactId>
                 <configuration>
-                    <useMavenDependencies>
-                        <value>false</value>
-                    </useMavenDependencies>
                     <category>Jetty</category>
-                    <dependencies>
-                        <dependency start="true">
-                            <groupId>org.apache.geronimo.configs</groupId>
-                            <artifactId>j2ee-server</artifactId>
-                            <type>car</type>
-                        </dependency>
-                        <dependency start="true">
-                            <groupId>org.apache.geronimo.framework</groupId>
-                            <artifactId>server-security-config</artifactId>
-                            <type>car</type>
-                        </dependency>
-                        <dependency start="true">
-                            <groupId>org.apache.geronimo.configs</groupId>
-                            <artifactId>transaction</artifactId>
-                            <type>car</type>
-                        </dependency>
-                        <dependency start="true">
-                            <groupId>org.apache.geronimo.modules</groupId>
-                            <artifactId>geronimo-jetty7</artifactId>
-                            <type>jar</type>
-                        </dependency>
-                        <dependency start="true">
-                            <groupId>org.slf4j</groupId>
-                            <artifactId>slf4j-api</artifactId>
-                            <type>jar</type>
-                        </dependency>
-                        <dependency start="true">
-                            <groupId>org.mortbay.jetty</groupId>
-                            <artifactId>jetty</artifactId>
-                            <type>jar</type>
-                        </dependency>
-                        <dependency start="true">
-                            <groupId>org.mortbay.jetty</groupId>
-                            <artifactId>jetty-ajp</artifactId>
-                            <type>jar</type>
-                        </dependency>
-                        <dependency start="true">
-                            <groupId>org.mortbay.jetty</groupId>
-                            <artifactId>jetty-ssl</artifactId>
-                            <type>jar</type>
-                        </dependency>
-                        <dependency start="true">
-                            <groupId>org.mortbay.jetty</groupId>
-                            <artifactId>jetty-util</artifactId>
-                            <type>jar</type>
-                        </dependency>
-                        <dependency start="true">
-                            <groupId>org.apache.geronimo.configs</groupId>
-                            <artifactId>webservices-common</artifactId>
-                            <type>car</type>
-                        </dependency>
-                        <dependency>
-                            <groupId>org.apache.geronimo.specs</groupId>
-                            <artifactId>geronimo-jaspi_1.0_spec</artifactId>
-                            <version>1.0-SNAPSHOT</version>
-                        </dependency>
-                        <dependency>
-                            <groupId>org.apache.geronimo.components</groupId>
-                            <artifactId>geronimo-jaspi</artifactId>
-                        </dependency>
-                    </dependencies>
                     <instance>
                         <plugin-artifact>
                             <config-xml-content>

Modified: geronimo/sandbox/djencks/jetty7/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/pom.xml?rev=704177&r1=704176&r2=704177&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/pom.xml (original)
+++ geronimo/sandbox/djencks/jetty7/pom.xml Mon Oct 13 10:32:05 2008
@@ -65,6 +65,24 @@
                 <artifactId>jetty-util</artifactId>
                 <version>7.0-SNAPSHOT</version>
             </dependency>
+            
+            <dependency>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>jetty-webapp</artifactId>
+                <version>7.0-SNAPSHOT</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>jetty-security</artifactId>
+                <version>7.0-SNAPSHOT</version>
+            </dependency>
+            <!-- for JAASLoginModule which we probably don't want -->
+            <dependency>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>jetty-plus</artifactId>
+                <version>7.0-SNAPSHOT</version>
+            </dependency>
 
         </dependencies>
     </dependencyManagement>



Mime
View raw message