net.sf.easyweb4j.dispatcher
Class FlashMap

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<String,Serializable>
          extended by net.sf.easyweb4j.dispatcher.FlashMap
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Serializable>

public class FlashMap
extends Hashtable<String,Serializable>

A map to hold flash messages. Flash messages in EasyWeb4J are special messages, which are retained for exactly one request after the request in which they were created.

Author:
Chandra Sekar S
See Also:
Serialized Form

Constructor Summary
FlashMap()
          Initializes the table of previous request's flash messages.
 
Method Summary
 Serializable get(Object key)
          Returns the flash message for the given key.
 void rotateFlashes()
          Discards expired flashes, moves current flashes to previous flashes and clears the current flash table.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FlashMap

public FlashMap()
Initializes the table of previous request's flash messages.

Method Detail

rotateFlashes

public void rotateFlashes()
Discards expired flashes, moves current flashes to previous flashes and clears the current flash table. This method is used internally by EasyWeb4J and must not be used directly within the application.


get

public Serializable get(Object key)
Returns the flash message for the given key. If key is not present in the current table, previousFlashes table is used.

Specified by:
get in interface Map<String,Serializable>
Overrides:
get in class Hashtable<String,Serializable>
Parameters:
key - The key of the flash message to retrieve.
Returns:
flash message for the key or null if the key is not present.


Copyright © 2009-2010 Chandra Sekar S. All Rights Reserved.