Each data service resource that is deployed will have its own session configuration document. This file is used to configure the session manager component of the data service resource. The session manager is used to create, access and terminate the sessions that perform document requests are joined to. An introduction to sessions was provided by the Sessions Page of the Background Reading section.
The session configuration document allows the service deployer to specify the session manager factory implementation class. This is a class that defines a factory method for creating the session manager instance. That instance will then be used by the data service resource during its lifetime. OGSA-DAI includes the uk.org.ogsadai.sessions.impl.TransientSessionManagerFactory which is a factory that creates instances of a transient session manager. This transient session manager stores the sessions that it creates in memory without persisting them to database or file. It is the default implementation used for all new data service resources that are deployed.
The session configuration document also allows the specification of the default and maximum timeout values for new sessions that are created by the session manager. Finally, the document may contain a collection of static session attributes. Recall that these are special session attributes that will occur in every new session created by the session manager.
The first example shows a default session configuration document specifying the standard session manager factory, a default timeout of 600000 milliseconds and a maximum timeout of 120000 milliseconds.
<?xml version="1.0" encoding="UTF-8"?> <sessionConfiguration xmlns="https://ogsadai.org.uk/namespaces/2005/10/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://ogsadai.org.uk/namespaces/2005/10/config path/to/schema/ogsadai/xsd/sessions_config.xsd"> <sessionManagerFactory impl="uk.org.ogsadai.sessions.impl.TransientSessionManagerFactory"> <timeout default="600000" max="1200000"/> </sessionManagerFactory> </sessionConfiguration>
The second example expands on the first by introducing two statis session attributes. Objects of the specified implemetation classes will be created and added to every new session. They will be retrievable using the specified names.
<?xml version="1.0" encoding="UTF-8"?> <sessionConfiguration xmlns="https://ogsadai.org.uk/namespaces/2005/10/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://ogsadai.org.uk/namespaces/2005/10/config path/to/schema/ogsadai/xsd/sessions_config.xsd"> <sessionManagerFactory impl="uk.org.ogsadai.sessions.impl.TransientSessionManagerFactory"> <timeout default="600000" max="1200000"/> <sessionAttribute name="MySessionAttribute1" impl="package.name.MyAttributeValueClass"> <anyXML/> </sessionAttribute> <sessionAttribute name="MySessionAttribute2" impl="package.name.MyOtherAttributeValueClass"> <anyXML/> </sessionAttribute> </sessionManagerFactory> </sessionConfiguration>
Notice that the sessionAttribute elements allow any XML child elements. These may optionally be used by the attribute value implementation class for configuration purposes.
The document root element must be a sessionConfiguration element containing:
OGSA-DAI/schema/ogsadai/xsd/sessions_config.xsd
Back: How to Write an Activity Configuration Document | Up: Configuration Files | |
© International Business Machines Corporation, 2002-2006 | © The University of Edinburgh, 2002-2006 |