org.apache.jetspeed.services.rundata
Class JetspeedRunDataService

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
              extended byorg.apache.turbine.services.rundata.TurbineRunDataService
                  extended byorg.apache.jetspeed.services.rundata.JetspeedRunDataService
All Implemented Interfaces:
org.apache.turbine.services.Initable, org.apache.turbine.services.rundata.RunDataService, org.apache.turbine.services.Service

public class JetspeedRunDataService
extends org.apache.turbine.services.rundata.TurbineRunDataService

The JetspeedRunDataService extends TurbineRunDataService, 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.

Version:
$Revision: 1.5 $
Author:
Glenn R. Golden

Field Summary
 
Fields inherited from class org.apache.turbine.services.rundata.TurbineRunDataService
COOKIE_PARSER, PARAMETER_PARSER, RUN_DATA
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, properties, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.turbine.services.rundata.RunDataService
DEFAULT_CONFIG, SERVICE_NAME
 
Constructor Summary
JetspeedRunDataService()
           
 
Method Summary
 JetspeedRunData getCurrentRunData()
          Access the current rundata object - the one associated with the current thread.
 org.apache.turbine.util.RunData getRunData(java.lang.String key, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, javax.servlet.ServletConfig config)
          Gets a RunData instance from a specific configuration.
 void init()
          Initializes the service
 boolean putRunData(org.apache.turbine.util.RunData data)
          Puts the used RunData object back to the factory for recycling.
 
Methods inherited from class org.apache.turbine.services.rundata.TurbineRunDataService
getRunData
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init, init, shutdown
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, setInitableBroker, shutdown
 

Constructor Detail

JetspeedRunDataService

public JetspeedRunDataService()
Method Detail

init

public void init()
          throws org.apache.turbine.services.InitializationException
Initializes the service

Throws:
org.apache.turbine.services.InitializationException - if initialization fails.

getRunData

public org.apache.turbine.util.RunData getRunData(java.lang.String key,
                                                  javax.servlet.http.HttpServletRequest req,
                                                  javax.servlet.http.HttpServletResponse res,
                                                  javax.servlet.ServletConfig config)
                                           throws org.apache.turbine.util.TurbineException,
                                                  java.lang.IllegalArgumentException
Gets a RunData instance from a specific configuration.

Parameters:
key - a configuration key.
req - a servlet request.
res - a servlet response.
config - a servlet config.
Returns:
a new or recycled RunData object.
Throws:
org.apache.turbine.util.TurbineException - if the operation fails.
java.lang.IllegalArgumentException - if any of the parameters are null.

putRunData

public boolean putRunData(org.apache.turbine.util.RunData data)
Puts the used RunData object back to the factory for recycling.

Parameters:
data - the used RunData object.
Returns:
true, if pooling is supported and the object was accepted.

getCurrentRunData

public JetspeedRunData getCurrentRunData()
Access the current rundata object - the one associated with the current thread.

Returns:
The current JetspeedRunData object associatd with the current thread.


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.