org.mentawai.core
Interface StickyAction

All Superinterfaces:
Action
All Known Implementing Classes:
BaseAction, BaseAjaxtagAction, BaseLoginAction, LogoutAction, ProtectedBaseAction, SingleInstanceBaseAction, SuccessAction

public interface StickyAction
extends Action

An interface describing a sticky action, in other words, an action that can adhere to the session and persist its state. This is similar to what other frameworks call continuations, but much simpler.

Author:
Sergio Oliveira

Field Summary
 
Fields inherited from interface org.mentawai.core.Action
ACCESSDENIED, ADD, AJAX, ALREADY, BACK, BLOCKED, CREATED, EDIT, ERROR, EXCEPTION, HTML, INDEX, JSON, JSP, LIST, LOGIN, MAIN, NEXT, NOT_FOUND, NULL, REMOVED, SHOW, STREAM, SUCCESS, TEST, UPDATED, XML
 
Method Summary
 void adhere()
          Adhere to the session, so the instance of this action will persist until disjoin is called.
 void disjoin()
          Remove this action from session and discard its instance losing all state (instance variables) associated with it.
 void onRemoved()
          This method will be called if the session has expired or if it has been invalidated and there are sticky actions still sticked to the session.
 
Methods inherited from interface org.mentawai.core.Action
getApplication, getCookies, getInput, getLocale, getOutput, getSession, setApplication, setCookies, setInput, setLocale, setOutput, setSession
 

Method Detail

adhere

void adhere()
Adhere to the session, so the instance of this action will persist until disjoin is called.


disjoin

void disjoin()
Remove this action from session and discard its instance losing all state (instance variables) associated with it.


onRemoved

void onRemoved()
This method will be called if the session has expired or if it has been invalidated and there are sticky actions still sticked to the session. This is very useful for clean up and will be called if your action calls adhere and forget to call disjoin, leaving the actiion instance forever in the session.



Copyright © 2013. All Rights Reserved.