net.sf.wfnm.web
Class HttpSessionWrapper

java.lang.Object
  extended bynet.sf.wfnm.web.HttpSessionWrapper
All Implemented Interfaces:
AttributeContainer, javax.servlet.http.HttpSession

public class HttpSessionWrapper
extends Object
implements AttributeContainer, javax.servlet.http.HttpSession

An attribute container wrapper for http session. Implements the AttributeContainer abstraction of the http session and handles the binding/unbinding of objects to/from the original http session

Version:
1.0.6
Author:
Maurizio Albari

Method Summary
 Object getAttribute(String key)
          Gets the value of an attribute.
 Enumeration getAttributeNames()
          Returns an enumeration of attribute names.
 long getCreationTime()
          Returns the creation time of the session.
 String getId()
          Get the unique identifier of this attribute container.
 long getLastAccessedTime()
          Returns the last accessed time of the session.
 int getMaxInactiveInterval()
          Returns the max inactive interval of the session.
 javax.servlet.ServletContext getServletContext()
          Returns the servlet context.
 javax.servlet.http.HttpSessionContext getSessionContext()
          Returns the http session context.
 Object getValue(String key)
          Returns the value of an object.
 String[] getValueNames()
          Returns an array of the value names
 void invalidate()
          Invalidate the session
 boolean isNew()
          Returns whether the session is new.
 void putValue(String key, Object value)
          Set the value of an attribute AND notify the event to WFNM.
 void removeAttribute(String key)
          Removes the attribute AND notify the event to WFNM.
 void removeAttributeValue(String key)
          Removes an attribute.
 void removeValue(String key)
          Removes the attribute AND notify the event to WFNM.
 void setAttribute(String key, Object value)
          Set the value of an attribute AND notify the event to WFNM.
 void setAttributeValue(String key, Object value)
          Set the value of an attribute.
 void setMaxInactiveInterval(int maxInactiveInterval)
          Set the max inactive interval of the session.
static javax.servlet.http.HttpSession wrapItIfNecessary(javax.servlet.http.HttpSession session)
          Wraps the session with the HttpSessionWrapper if necessary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

wrapItIfNecessary

public static javax.servlet.http.HttpSession wrapItIfNecessary(javax.servlet.http.HttpSession session)
Wraps the session with the HttpSessionWrapper if necessary

Parameters:
session - the http session
Returns:
the wrapped http session

setAttribute

public void setAttribute(String key,
                         Object value)
Set the value of an attribute AND notify the event to WFNM.

Specified by:
setAttribute in interface javax.servlet.http.HttpSession
Parameters:
key - the key of the attribute
value - the value of the attribute

getAttribute

public Object getAttribute(String key)
Gets the value of an attribute.

Specified by:
getAttribute in interface AttributeContainer
Parameters:
key - the attribute key
Returns:
the value of the attribute

getAttributeNames

public Enumeration getAttributeNames()
Returns an enumeration of attribute names.

Specified by:
getAttributeNames in interface AttributeContainer
Returns:
an enumeration of attribute names

setAttributeValue

public void setAttributeValue(String key,
                              Object value)
Set the value of an attribute.

Specified by:
setAttributeValue in interface AttributeContainer
Parameters:
key - the attribute key
value - the attribute value

getCreationTime

public long getCreationTime()
Returns the creation time of the session.

Specified by:
getCreationTime in interface javax.servlet.http.HttpSession
Returns:
the creation time of the session

getId

public String getId()
Get the unique identifier of this attribute container.

Specified by:
getId in interface AttributeContainer
Returns:
the unique identifier of this attribute container

getLastAccessedTime

public long getLastAccessedTime()
Returns the last accessed time of the session.

Specified by:
getLastAccessedTime in interface javax.servlet.http.HttpSession
Returns:
the last accessed time of the session

setMaxInactiveInterval

public void setMaxInactiveInterval(int maxInactiveInterval)
Set the max inactive interval of the session.

Specified by:
setMaxInactiveInterval in interface javax.servlet.http.HttpSession
Parameters:
maxInactiveInterval - the max inactive interval of the session

getMaxInactiveInterval

public int getMaxInactiveInterval()
Returns the max inactive interval of the session.

Specified by:
getMaxInactiveInterval in interface javax.servlet.http.HttpSession
Returns:
the max inactive interval of the session

isNew

public boolean isNew()
Returns whether the session is new.

Specified by:
isNew in interface javax.servlet.http.HttpSession
Returns:
true if the session is new

getServletContext

public javax.servlet.ServletContext getServletContext()
Returns the servlet context.

Specified by:
getServletContext in interface javax.servlet.http.HttpSession
Returns:
the servlet context

getSessionContext

public javax.servlet.http.HttpSessionContext getSessionContext()
Returns the http session context.

Specified by:
getSessionContext in interface javax.servlet.http.HttpSession
Returns:
the http session context

getValue

public Object getValue(String key)
Returns the value of an object.

Specified by:
getValue in interface javax.servlet.http.HttpSession
Parameters:
key - the key of the object
Returns:
the value of the object

getValueNames

public String[] getValueNames()
Returns an array of the value names

Specified by:
getValueNames in interface javax.servlet.http.HttpSession
Returns:
an array of the value names

invalidate

public void invalidate()
Invalidate the session

Specified by:
invalidate in interface javax.servlet.http.HttpSession

putValue

public void putValue(String key,
                     Object value)
Set the value of an attribute AND notify the event to WFNM.

Specified by:
putValue in interface javax.servlet.http.HttpSession
Parameters:
key - the key of the attrubute
value - the value of the attribute

removeAttribute

public void removeAttribute(String key)
Removes the attribute AND notify the event to WFNM.

Specified by:
removeAttribute in interface javax.servlet.http.HttpSession
Parameters:
key - the key of the attribute

removeAttributeValue

public void removeAttributeValue(String key)
Removes an attribute.

Specified by:
removeAttributeValue in interface AttributeContainer
Parameters:
key - the attribute key

removeValue

public void removeValue(String key)
Removes the attribute AND notify the event to WFNM.

Specified by:
removeValue in interface javax.servlet.http.HttpSession
Parameters:
key - the key of the attribute


Copyright © 2004-2005 Maurizio Albari@SourceForge.net. All Rights Reserved.