portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggol...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata JetspeedRunDataService.java
Date Thu, 08 Aug 2002 00:08:37 GMT
ggolden     2002/08/07 17:08:37

  Modified:    src/java/org/apache/jetspeed/services/rundata
                        JetspeedRunDataService.java
  Log:
  To support the "current" StateManager routines, getRunData and putRunData
  have been enhanced to set / clear the current request's http session with
  the StateManagerService.
  
  Although this has only a little to do with the rundata (http session is part of the
  rundata), this is THE place to the sort of thing that MUST be done at the start
  of each http request, and MUST be un-done at the end.  Turbine will make sure
  to call these two routines for each http request, no matter what happens.
  
  Revision  Changes    Path
  1.2       +24 -3     jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata/JetspeedRunDataService.java
  
  Index: JetspeedRunDataService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata/JetspeedRunDataService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JetspeedRunDataService.java	15 May 2002 02:46:10 -0000	1.1
  +++ JetspeedRunDataService.java	8 Aug 2002 00:08:37 -0000	1.2
  @@ -76,8 +76,10 @@
   import org.apache.turbine.util.RunData;
   import org.apache.turbine.util.TurbineException;
   import org.apache.turbine.util.Log;
  +import org.apache.turbine.services.TurbineServices;
   
   import org.apache.jetspeed.services.rundata.JetspeedRunData;
  +import org.apache.jetspeed.services.statemanager.StateManagerService;
   
   
   /**
  @@ -85,6 +87,9 @@
   * adding the ability to get the current runData object for the thread
   * at any time.  This is accomplished by storing the active runData objects
   * in a map, keyed by thread.
  +* Also done here, because this is so nicely bracketed around each http request
  +* by Turbine, is the association of the http session for this request / thread
  +* with the state manager.
   *
   * @author <a href="mailto:ggolden@umich.edu">Glenn R. Golden</a>
   * @version $Revision$
  @@ -141,6 +146,14 @@
           // store the rundata associated with this thread
           m_runDataStore.put(Thread.currentThread(), r);
   
  +        // associate this http session with this thread in the state manager
  +        StateManagerService stateManager = (StateManagerService)TurbineServices
  +                .getInstance().getService(StateManagerService.SERVICE_NAME);
  +        if (stateManager != null)
  +        {
  +            stateManager.setCurrentContext(req.getSession(true));
  +        }
  +
           if (Log.getLogger().isDebugEnabled())
               Log.debug("JetspeedRunDataService: storing rundata " + r
                           + " for thread: " + Thread.currentThread());
  @@ -157,6 +170,14 @@
       */
       public boolean putRunData(RunData data)
       {
  +        // un-associate this http session with this thread in the state manager
  +        StateManagerService stateManager = (StateManagerService)TurbineServices
  +                .getInstance().getService(StateManagerService.SERVICE_NAME);
  +        if (stateManager != null)
  +        {
  +            stateManager.clearCurrentContext();
  +        }
  +
           // remove this thread's rundata
           m_runDataStore.remove(Thread.currentThread());
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message