org.mortbay.j2ee.session
Class LocalState

java.lang.Object
  extended by org.mortbay.j2ee.session.LocalState
All Implemented Interfaces:
Serializable, State

public class LocalState
extends Object
implements State, Serializable

Hold the state of an HttpSession

Version:
1.0
Author:
Jules Gosnell
See Also:
Serialized Form

Field Summary
protected  int _actualMaxInactiveInterval
           
protected  Map _attributes
           
protected  long _creationTime
           
protected static Enumeration _emptyEnumeration
           
protected static Map _emptyMap
           
protected static String[] _emptyStringArray
           
protected  String _id
           
protected  long _lastAccessedTime
           
protected static org.jboss.logging.Logger _log
           
protected  int _maxInactiveInterval
           
 
Constructor Summary
protected LocalState()
           
  LocalState(String id, int maxInactiveInterval, int actualMaxInactiveInterval)
           
  LocalState(String id, long creationTime, int maxInactiveInterval, int actualMaxInactiveInterval)
           
 
Method Summary
protected  void ensureAttributes()
           
 int getActualMaxInactiveInterval()
           
 Object getAttribute(String name)
           
 Enumeration getAttributeNameEnumeration()
           
 String[] getAttributeNameStringArray()
           
 Map getAttributes()
           
 long getCreationTime()
           
 String getId()
           
 long getLastAccessedTime()
           
 int getMaxInactiveInterval()
           
 boolean isValid()
           
 boolean isValid(int extraTime)
           
protected  long remainingTime()
           
 Object removeAttribute(String name, boolean returnValue)
           
 Object setAttribute(String name, Object value, boolean returnValue)
           
 void setAttributes(Map attributes)
           
 void setLastAccessedTime(long time)
           
 void setMaxInactiveInterval(int interval)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

protected static final org.jboss.logging.Logger _log

_id

protected String _id

_maxInactiveInterval

protected int _maxInactiveInterval

_actualMaxInactiveInterval

protected int _actualMaxInactiveInterval

_creationTime

protected long _creationTime

_lastAccessedTime

protected long _lastAccessedTime

_attributes

protected Map _attributes

_emptyMap

protected static Map _emptyMap

_emptyEnumeration

protected static Enumeration _emptyEnumeration

_emptyStringArray

protected static String[] _emptyStringArray
Constructor Detail

LocalState

public LocalState(String id,
                  long creationTime,
                  int maxInactiveInterval,
                  int actualMaxInactiveInterval)

LocalState

public LocalState(String id,
                  int maxInactiveInterval,
                  int actualMaxInactiveInterval)

LocalState

protected LocalState()
Method Detail

getId

public String getId()
Specified by:
getId in interface State

getCreationTime

public long getCreationTime()
Specified by:
getCreationTime in interface State

getActualMaxInactiveInterval

public int getActualMaxInactiveInterval()
Specified by:
getActualMaxInactiveInterval in interface State

getLastAccessedTime

public long getLastAccessedTime()
Specified by:
getLastAccessedTime in interface State

setLastAccessedTime

public void setLastAccessedTime(long time)
Specified by:
setLastAccessedTime in interface State

getMaxInactiveInterval

public int getMaxInactiveInterval()
Specified by:
getMaxInactiveInterval in interface State

setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)
Specified by:
setMaxInactiveInterval in interface State

ensureAttributes

protected void ensureAttributes()

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface State

getAttributes

public Map getAttributes()
Specified by:
getAttributes in interface State

getAttributeNameEnumeration

public Enumeration getAttributeNameEnumeration()
Specified by:
getAttributeNameEnumeration in interface State

getAttributeNameStringArray

public String[] getAttributeNameStringArray()
Specified by:
getAttributeNameStringArray in interface State

setAttribute

public Object setAttribute(String name,
                           Object value,
                           boolean returnValue)
Specified by:
setAttribute in interface State

setAttributes

public void setAttributes(Map attributes)
Specified by:
setAttributes in interface State

removeAttribute

public Object removeAttribute(String name,
                              boolean returnValue)
Specified by:
removeAttribute in interface State

remainingTime

protected long remainingTime()

isValid

public boolean isValid(int extraTime)

isValid

public boolean isValid()
Specified by:
isValid in interface State


Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.