org.talika.tarsis.command.action
Class ActionSession

java.lang.Object
  extended by org.talika.tarsis.command.action.ActionSession
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.servlet.http.HttpSessionBindingListener

public final class ActionSession
extends java.lang.Object
implements javax.servlet.http.HttpSessionBindingListener, java.io.Serializable

This object serves as transport object for all instances of statefull actions for an user, instead of saving them individually in the user's session.

Version:
$Revision: 121 $
Author:
Jose M. Palomar
See Also:
Serialized Form

Constructor Summary
ActionSession()
          Constructs a new ActionSession object.
 
Method Summary
 Action getInstance(java.lang.String name)
          Obtains an action instance from session.
 void setInstance(java.lang.String name, Action action)
          Saves an action instance on session.
 void valueBound(javax.servlet.http.HttpSessionBindingEvent httpSessionBindingEvent)
          Notifies the object that it is being bound to a session and identifies the session.
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent httpSessionBindingEvent)
          Notifies the object that it is being unbound from a session and identifies the session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionSession

public ActionSession()
Constructs a new ActionSession object.

Method Detail

setInstance

public void setInstance(java.lang.String name,
                        Action action)
Saves an action instance on session.

Parameters:
name - String action class name.
action - Action action instance.

getInstance

public Action getInstance(java.lang.String name)
Obtains an action instance from session.

Parameters:
name - String action class name.
Returns:
Action action instance or null if not found.

valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent httpSessionBindingEvent)
Notifies the object that it is being bound to a session and identifies the session. This method do nothing.

Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener
Parameters:
httpSessionBindingEvent - HttpSessionBindingEvent the event that identifies the session.
See Also:
HttpSessionBindingListener.valueBound(HttpSessionBindingEvent)

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent httpSessionBindingEvent)
Notifies the object that it is being unbound from a session and identifies the session. When ActionSession is unbound it call destroy method for all action instances in session to allow them to release any resource.

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener
Parameters:
httpSessionBindingEvent - HttpSessionBindingEvent the event that identifies the session.
See Also:
HttpSessionBindingListener.valueUnbound(HttpSessionBindingEvent)


Copyright © 2002-2012 Talika Open Source Group. All Rights Reserved.