Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: joist/java/org/joist/session SessionManager.java

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

CVS update: joist/java/org/joist/session SessionManager.java

Author commitlogger at hocus dot collab dot net
Full name commitlogger at hocus dot collab dot net
Date 2000-04-15 21:28:10 PDT
Message User: dlr
  Date: 00/04/15 21:28:10

  Modified: java/org/joist/session SessionManager.java
  Log:
  Added registerToClose() method from the sourcex fork.
  
  Revision Changes Path
  1.4 +65 -3 joist/java/org/joist​/session/SessionMana​ger.java
  
  Index: SessionManager.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/session/Sessio​nManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SessionManager.java 2000/02/29 01:23:59 1.3
  +++ SessionManager.java 2000/04/16 04:28:09 1.4
  @@ -64,7 +64,7 @@
     * Manages information cached in the session.
     *
     * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
     *
     * Copyright (c) 1999 dataweb systems, inc.
    * Copyright (c) 1999, 2000 Collab.Net, Inc.
  @@ -80,16 +80,31 @@
        * Construct with a session.
        */
       public
  - SessionManager(HttpSession session, DataManager dataManager)
  + SessionManager(HttpSession session)
       {
       if (debug) log.debug("Creating a SessionManager for: " + session);
       this.session = session;
   
  - dataMgr = dataManager;
  + dataMgr = new DataManager();
       permissions = new PermissionSet();
       }
   
   
  +//REM:
  +// /**
  +// * Construct with a session.
  +// */
  +// public
  +// SessionManager(HttpSession session, DataManager dataManager)
  +// {
  +// if (debug) log.debug("Creating a SessionManager for: " + session);
  +// this.session = session;
  +//
  +// dataMgr = dataManager;
  +// permissions = new PermissionSet();
  +// }
  +
  +
       /**
        * Resets the instance variables to initial state. Useful after logout.
        */
  @@ -165,6 +180,18 @@
   
   
       /**
  + * Registers a DataSet so it can be closed later.
  + *
  + * @param dataset a DataSet to be closed later
  + */
  + public void
  + registerToClose(DataSet dataset)
  + {
  + dataMgr.registerToCl​ose(dataset);
  + }
  +
  +
  + /**
        * Does whatever cleanup is necessary.
        * Asks the data layer manager to cleanup.
        */
  @@ -853,5 +880,40 @@
       resetRedirectContext()
       {
       redirectContexts = new Hashtable();
  + }
  +
  +
  + /**
  + * Records the particulars of the current request in the database.
  + *
  + * @param connection a JDBC connection
  + * @param servletName the name of the servlet
  + * @param action the action
  + * @param subject the name of type of ID
  + * @param subjectID the ID of the subject
  + */
  + public void
  + recordRequest(Connection connection, String servletName, String action,
  + String subject, String subjectID)
  + throws SQLException
  + {
  + PreparedStatement pstmt = null;
  +
  + try
  + {
  + String sqlStmt = "insert into Request (servlet, action, subject, subjectID, sessionID, userID) values (?,?,?,?,?,?)";
  + pstmt = connection.prepareSt​atement(sqlStmt);
  + pstmt.setString(1, servletName);
  + pstmt.setString(2, action);
  + pstmt.setString(3, subject);
  + pstmt.setString(4, subjectID);
  + pstmt.setString(5, getSessionID());
  + pstmt.setString(6, getUserID());
  + pstmt.executeUpdate();
  + }
  + finally
  + {
  + if (pstmt != null) pstmt.close();
  + }
       }
   }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: joist/java/org/joist/session SessionManager.java commitlogger at hocus dot collab dot net commitlogger at hocus dot collab dot net 2000-04-15 21:28:10 PDT
Messages per page: