User: jules_gosnell Date: 02/01/02 03:10:55 Modified: jetty/src/main/org/jboss/jetty JBossUserRealm.java Log: can't check this yet because my build doesn't run - but should be better than what was there before Revision Changes Path 1.11 +40 -10 contrib/jetty/src/main/org/jboss/jetty/JBossUserRealm.java Index: JBossUserRealm.java =================================================================== RCS file: /cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/JBossUserRealm.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- JBossUserRealm.java 2001/12/09 06:05:49 1.10 +++ JBossUserRealm.java 2002/01/02 11:10:55 1.11 @@ -5,10 +5,12 @@ * See terms of license at gnu.org. */ -// $Id: JBossUserRealm.java,v 1.10 2001/12/09 06:05:49 user57 Exp $ +// $Id: JBossUserRealm.java,v 1.11 2002/01/02 11:10:55 jules_gosnell Exp $ package org.jboss.jetty; +import java.io.IOException; +import java.io.Serializable; import java.util.Collections; import java.util.HashMap; import java.util.Set; @@ -16,7 +18,7 @@ import javax.naming.InitialContext; import javax.naming.NamingException; import javax.security.auth.Subject; - +import org.jboss.logging.Logger; import org.jboss.security.AuthenticationManager; import org.jboss.security.RealmMapping; import org.jboss.security.SecurityAssociation; @@ -26,22 +28,20 @@ import org.mortbay.http.UserPrincipal; import org.mortbay.http.UserRealm; -import org.jboss.logging.Logger; - /** An implementation of UserRealm that integrates with the JBossSX * security manager associted with the web application. * @author [EMAIL PROTECTED] - * @version $Revision: 1.10 $ + * @version $Revision: 1.11 $ */ // TODO public class JBossUserRealm - implements UserRealm + implements UserRealm, Serializable { class JBossUserPrincipal extends SimplePrincipal // The JBoss API - implements UserPrincipal // The Jetty API + implements UserPrincipal,Serializable // The Jetty API { JBossUserPrincipal(String name) { @@ -98,7 +98,6 @@ Subject subject = _subjectMgr.getActiveSubject(); request.setAttribute(_subjectAttributeName, subject); } - } else { @@ -133,11 +132,17 @@ { return JBossUserRealm.this; } + + public boolean + isAuthenticated() + { + return false; // TODO + } } - private Logger _log; + private Logger _log; private String _realmName; - private AuthenticationManager _securityMgr; + private AuthenticationManager _securityMgr; private RealmMapping _realmMapping; private HashMap _users = new HashMap(); private String _subjectAttributeName = "j_subject"; // needs accessors - TODO @@ -146,6 +151,12 @@ public JBossUserRealm(String realmName) { + initialise(realmName); + } + + protected void + initialise(String realmName) + { _realmName = realmName; _log = Logger.getLogger(JBossUserRealm.class.getName() + "#" + _realmName); @@ -210,4 +221,23 @@ } //---------------------------------------- + // Serializable + + private void writeObject(java.io.ObjectOutputStream out) + throws IOException + { + out.writeObject(_realmName); +// out.writebject(_log); +// out.writebject(_securityMgr); +// out.writebject(_realmMapping); +// out.writebject(_users); +// out.writebject(_subjectAttributeName); +// out.writebject(_subjectMgr); + } + + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException + { + initialise((String)in.readObject()); + } }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development