org.apache.axis.handlers

Class SimpleSessionHandler

public class SimpleSessionHandler extends BasicHandler

This handler uses SOAP headers to do simple session management.

Essentially, you install it on both the request and response chains of your service, on both the client and the server side.

ON THE SERVER:

ON THE CLIENT:

SimpleSessions are "reaped" periodically via a very simplistic mechanism. Each time the handler is invoke()d we check to see if more than reapPeriodicity milliseconds have elapsed since the last reap. If so, we walk the collection of active Sessions, and for each one, if it hasn't been "touched" (i.e. had a getProperty() or setProperty() performed) in longer than its timeout, we remove it from the collection.

Author: Glen Daniels (gdaniels@apache.org)

Field Summary
protected static Loglog
static QNamesessionHeaderName
static StringSESSION_ID
static StringSESSION_LOCALPART
static StringSESSION_NS
Method Summary
voiddoClient(MessageContext context)
Client side of processing.
voiddoServer(MessageContext context)
Server side of processing.
voidinvoke(MessageContext context)
Process a MessageContext.
voidsetDefaultSessionTimeout(int defaultSessionTimeout)
Set the default session timeout in SECONDS Again, for testing.
voidsetReapPeriodicity(long reapTime)
Set the reaper periodicity in SECONDS Convenience method for testing.

Field Detail

log

protected static Log log

sessionHeaderName

public static final QName sessionHeaderName

SESSION_ID

public static final String SESSION_ID

SESSION_LOCALPART

public static final String SESSION_LOCALPART

SESSION_NS

public static final String SESSION_NS

Method Detail

doClient

public void doClient(MessageContext context)
Client side of processing.

doServer

public void doServer(MessageContext context)
Server side of processing.

invoke

public void invoke(MessageContext context)
Process a MessageContext.

setDefaultSessionTimeout

public void setDefaultSessionTimeout(int defaultSessionTimeout)
Set the default session timeout in SECONDS Again, for testing.

setReapPeriodicity

public void setReapPeriodicity(long reapTime)
Set the reaper periodicity in SECONDS Convenience method for testing. !!! TODO: Should be able to set this via options on the Handler or perhaps the engine.
Copyright B) 2005 Apache Web Services Project. All Rights Reserved.