org.wings.util
Class SessionLocal<T>

java.lang.Object
  extended by org.wings.util.SessionLocal<T>

public class SessionLocal<T>
extends Object

A helper class for storing session local variables similar to ThreadLocal for thread local variables.


Constructor Summary
SessionLocal()
           
 
Method Summary
 T get()
          return the current value of this variable from the session
protected  T initialValue()
          override this method to get the initial value for a new session
 void remove()
          remove the value, if get is called, the value will be reinitialized
 void set(T value)
          Set the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionLocal

public SessionLocal()
Method Detail

get

public T get()
return the current value of this variable from the session

Returns:
The current value or the result of initialValue() if called for the first time.

initialValue

protected T initialValue()
override this method to get the initial value for a new session

Returns:
The stored value

set

public void set(T value)
Set the value. the value which is set may be null, but the object set is never null because it is wrapped.

Parameters:
value - Value. null is also a valid value.

remove

public void remove()
remove the value, if get is called, the value will be reinitialized



wingS Swings ;-)