|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.sessions.impl.TransientSessionManagerFactory
Factory for creating instances of
TransientSessionManager
.
The format of the element passed to the
createSessionManager()
method must conform to the
description of the sessionManager
element in the session_configuration.xsd
schema. For
example:
<sessionManager factory="uk.org.ogsadai.sessions.impl.TransientSessionManagerFactory"> <timeout default="600000" max="unbounded"/> <sessionAttribute name="MySessionAttribute1" impl="uk.org.ogsadai.sessions.impl.MyStaticSessionAttribute"> <anyXML/> </sessionAttribute> <sessionAttribute name="MySessionAttribute2" impl="uk.org.ogsadai.sessions.impl.MyStaticSessionAttribute"> <anyXML/> </sessionAttribute> </sessionManager>
This must contain timeout
child-element to specify the
default and maximum timeout durations for any sessions created by
the session manager. It may also contain a sequence of zero or more
sessionAttribute
elements. These describe the
static session attributes that will be present in every
session created by the session manager. The name
attribute provides an identity that can be used for accessing the
attribute from the session. The impl
attribute
specifies the implementation class for the attribute value, and the
specified class must implement the AttributeValue
interface. Each sessionAttribute
element may contain
any child elements, and the entire element will be passed to the
session attribute value object for initialisation purposes.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
|
private static DAILogger |
LOG
|
Constructor Summary | |
TransientSessionManagerFactory()
|
Method Summary | |
private StaticSessionAttribute |
createAttribute(org.w3c.dom.Element attributeElement)
Creates a static session attribute from the specified element using the name and impl attributes. |
protected SessionConfiguration |
createConfiguration(long defaultTimeout,
long maxTimeout,
java.util.Set attributes,
Properties properties,
DataResourceAccessor dataResource)
Creates and returns an anonymous instance of the TransientSessionConfiguration class
that simply returns the specified timeouts and static
properties. |
SessionManager |
createSessionManager(org.w3c.dom.Element configuration,
Properties properties,
DataResourceAccessor dataResource)
Creates a new session manager instance. |
private java.util.Set |
parseAttributes(org.w3c.dom.Element parent)
Parses each of the sessionAttribute
child-elements, creating and initialising the corresponding
objects then storing them in a set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static final DAILogger LOG
Constructor Detail |
public TransientSessionManagerFactory()
Method Detail |
public SessionManager createSessionManager(org.w3c.dom.Element configuration, Properties properties, DataResourceAccessor dataResource) throws SessionManagerCreationException
SessionManagerFactory
This method is invoked only once when a data service resource is instantiated. The object returned is then used for managing all the sessions associated with that data service resource.
createSessionManager
in interface SessionManagerFactory
configuration
- The sessionConfiguration
element from the session
configuration file. This may contain settings used to
initialise the SessionManager
.properties
- The properties associated with the session.dataResource
- The data resource accessor associated with the session manager
or null
if no data resource accessor is
associated.
SessionManager
, initialised and ready for
use.
SessionManagerCreationException
- if there is a problem creating
the new session manager. The consequence of this is that the
data service resource cannot be properly initialised, so
requests cannot be processed.private java.util.Set parseAttributes(org.w3c.dom.Element parent) throws SessionAttrCreationException
sessionAttribute
child-elements, creating and initialising the corresponding
objects then storing them in a set.
parent
- XML fragment containing the attribute names and class
names.
SessionAttrCreationException
- if there is a problem when
creating any attribute object.private StaticSessionAttribute createAttribute(org.w3c.dom.Element attributeElement) throws SessionAttrCreationException
name
and impl
attributes.
Reflection is used to instantiate the object then the
initialise
method is invoked.
attributeElement
- XML fragment containing the attribute name and class name.
SessionAttrCreationException
- if there is a problem when
creating the attribute object.protected SessionConfiguration createConfiguration(long defaultTimeout, long maxTimeout, java.util.Set attributes, Properties properties, DataResourceAccessor dataResource)
TransientSessionConfiguration
class
that simply returns the specified timeouts and static
properties.
defaultTimeout
- Default timeout for new sessions.maxTimeout
- Maximum timeout for new sessions.attributes
- Static session attribute set for new sessions.properties
- Data service resource properties.dataResource
- Data resource which needs to be informed of session events.
SessionConfiguration.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |