From: Julien V. <coo...@us...> - 2003-04-02 19:29:15
|
User: cooperfbi Date: 03/04/02 11:29:11 Modified: nukes/src/main/org/jboss/nukes/core/modules/core CoreModule.java Log: o remember feature o fixed bad link o size per page in html module is now bigger Revision Changes Path 1.14 +17 -6 nukes/nukes/src/main/org/jboss/nukes/core/modules/core/CoreModule.java Index: CoreModule.java =================================================================== RCS file: /cvsroot/jboss/nukes/nukes/src/main/org/jboss/nukes/core/modules/core/CoreModule.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- CoreModule.java 27 Mar 2003 23:56:51 -0000 1.13 +++ CoreModule.java 2 Apr 2003 19:29:09 -0000 1.14 @@ -61,13 +61,16 @@ * @jboss.xmbean * * @author <a href="mailto:jul...@ya...">Julien Viet</a> - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ */ public class CoreModule extends Module implements Api { + public static final int PERMANENT_USER_MAX_INACTIVE = 60 * 60 * 24 * 3; + public static final int TRANSIENT_USER_MAX_INACTIVE = 60 * 60; + /** * @jmx.managed-constructor */ @@ -231,7 +234,12 @@ */ public void setConfigVar(String name, Object value) { - configVars.put(name, value); + synchronized (this) + { + HashMap copy = new HashMap(configVars); + copy.put(name, value); + configVars = copy; + } } /** @@ -269,7 +277,7 @@ } catch (Exception e) { - e.printStackTrace(); //To change body of catch statement use Options | File Templates. + log.error("Problem when comparing two blocks", e); return 0; } } @@ -398,7 +406,7 @@ } catch (Exception e) { - e.printStackTrace(); //To change body of catch statement use Options | File Templates. + log.error("Exception when stopping component", e); } } @@ -469,7 +477,7 @@ private SortedSet centreBlocks = new TreeSet(blockComparator); private SortedSet rightBlocks = new TreeSet(blockComparator); private SortedSet[] blocks = {leftBlocks, centreBlocks, rightBlocks}; - private final Map configVars = new HashMap(); + private Map configVars = new HashMap(); /** * @jmx.managed-operation @@ -588,7 +596,6 @@ */ public boolean userLogIn(String userName, String pass, boolean rememberMe) { - if (!userLoggedIn()) { if (pass != null) @@ -602,6 +609,10 @@ return false; } HttpSession session = SessionManager.getSession(); + if (rememberMe) + session.setMaxInactiveInterval(PERMANENT_USER_MAX_INACTIVE); + else + session.setMaxInactiveInterval(TRANSIENT_USER_MAX_INACTIVE); session.setAttribute("USER", user); } catch (ObjectNotFoundException e) |