public class SimpleSessionHandler extends BasicHandler
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.
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
static String |
SESSION_ID |
static String |
SESSION_LOCALPART |
static String |
SESSION_NS |
static QName |
sessionHeaderName |
makeLockable, name, options
Constructor and Description |
---|
SimpleSessionHandler() |
Modifier and Type | Method and Description |
---|---|
void |
doClient(MessageContext context)
Client side of processing.
|
void |
doServer(MessageContext context)
Server side of processing.
|
void |
invoke(MessageContext context)
Process a MessageContext.
|
void |
setDefaultSessionTimeout(int defaultSessionTimeout)
Set the default session timeout in SECONDS
Again, for testing.
|
void |
setReapPeriodicity(long reapTime)
Set the reaper periodicity in SECONDS
Convenience method for testing.
!!!
|
canHandleBlock, cleanup, generateWSDL, getDeploymentData, getName, getOption, getOptions, getUnderstoodHeaders, init, initHashtable, onFault, setName, setOption, setOptionDefault, setOptions, setOptionsLockable
protected static org.apache.commons.logging.Log log
public static final String SESSION_ID
public static final String SESSION_NS
public static final String SESSION_LOCALPART
public static final QName sessionHeaderName
public void invoke(MessageContext context) throws AxisFault
context
- the MessageContext
to process with this
Handler
.AxisFault
- if the handler encounters an errorpublic void doClient(MessageContext context) throws AxisFault
AxisFault
public void doServer(MessageContext context) throws AxisFault
AxisFault
public void setReapPeriodicity(long reapTime)
public void setDefaultSessionTimeout(int defaultSessionTimeout)
Copyright © The Apache Software Foundation. All Rights Reserved.