FileDocCategorySizeDatePackage
AxisHttpSession.javaAPI DocApache Axis 1.44156Sat Apr 22 18:57:28 BST 2006org.apache.axis.transport.http

AxisHttpSession

public class AxisHttpSession extends Object implements org.apache.axis.session.Session
An HTTP/Servlet implementation of Axis sessions.
author
Glen Daniels (gdaniels@apache.org)

Fields Summary
public static final String
AXIS_SESSION_MARKER
private HttpSession
rep
private HttpServletRequest
req
Constructors Summary
public AxisHttpSession(HttpServletRequest realRequest)

    
      
    
        req = realRequest;
    
public AxisHttpSession(HttpSession realSession)

        if (realSession != null)
            setRep(realSession);
    
Methods Summary
protected voidensureSession()

        if (rep == null) {
            setRep(req.getSession());
        }
    
public java.lang.Objectget(java.lang.String key)
Get a property from the session

param
key the name of the property desired.

        ensureSession();
        return rep.getAttribute(key);
    
public java.util.EnumerationgetKeys()
Get an enumeration of the keys in this session

        ensureSession();
        return rep.getAttributeNames();
    
public java.lang.ObjectgetLockObject()
Get an Object suitable for synchronizing the session. This method exists because different session implementations might provide different ways of getting at shared data. For a simple hashtable- based session, this would just be the hashtable, but for sessions which use database connections, etc. it might be an object wrapping a table ID or somesuch.

        ensureSession();
        return rep;
    
public javax.servlet.http.HttpSessiongetRep()
Get the internal HttpSession.

        ensureSession();
        return rep;
    
public intgetTimeout()
Return the sessions' time-to-live.

return
the timeout value for this session.

        ensureSession();
        return rep.getMaxInactiveInterval();
    
public voidinvalidate()
invalidate the session

        rep.invalidate();
    
public voidremove(java.lang.String key)
Remove a property from the session

param
key the name of the property desired.

        ensureSession();
        rep.removeAttribute(key);
    
public voidset(java.lang.String key, java.lang.Object value)
Set a property in the session

param
key the name of the property to set.
param
value the value of the property.

        ensureSession();
        rep.setAttribute(key, value);
    
private voidsetRep(javax.servlet.http.HttpSession realSession)
Set our internal HttpSession to the passed servlet HttpSession. Not sure if we'll really need this method...

        rep = realSession;
        rep.setAttribute(AXIS_SESSION_MARKER, Boolean.TRUE);
    
public voidsetTimeout(int timeout)
Set the session's time-to-live. This is implementation-specific, but basically should be the # of seconds of inactivity which will cause the session to time out and invalidate. "inactivity" is implementation-specific.

        ensureSession();
        rep.setMaxInactiveInterval(timeout);
    
public voidtouch()
"Touch" the session (mark it recently used)

        // ???