org.shept.org.springframework.web.servlet.mvc.formcache
Class SimpleSessionFormCache

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.shept.org.springframework.web.servlet.mvc.formcache.SimpleSessionFormCache
All Implemented Interfaces:
SessionFormCache, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware
Direct Known Subclasses:
LastModifiedSessionFormCache, ReplacementSessionFormCache

public class SimpleSessionFormCache
extends org.springframework.web.context.support.WebApplicationObjectSupport
implements SessionFormCache

Version:
$$Id: SimpleSessionFormCache.java 34 2010-08-20 16:46:49Z aha $$
Author:
Andi

Nested Class Summary
private  class SimpleSessionFormCache.SizeLimitedCache<String,Object>
           
 
Field Summary
static int MAX_CACHE_SIZE
           
private  int maxCacheSize
           
static String SESSION_FORM_CACHE_ATTIRBUTE
           
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
SimpleSessionFormCache()
           
 
Method Summary
 void clearCache(javax.servlet.http.HttpServletRequest request)
           
 void clearForm(javax.servlet.http.HttpServletRequest request, String formAttrName)
           
 void clearOtherForms(javax.servlet.http.HttpServletRequest request, String formAttrName)
           
 Object getForm(javax.servlet.http.HttpServletRequest request, String formAttrName)
           
protected  Map<String,Object> getFormCache(javax.servlet.http.HttpServletRequest request, boolean required, boolean create)
           
 long getLastModified(javax.servlet.http.HttpServletRequest request, String formAttrName)
           
 int getMaxCacheSize()
           
 void saveForm(javax.servlet.http.HttpServletRequest request, String formAttrName, Object command)
           
 void setMaxCacheSize(int maxCacheSize)
           
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_FORM_CACHE_ATTIRBUTE

public static String SESSION_FORM_CACHE_ATTIRBUTE

MAX_CACHE_SIZE

public static int MAX_CACHE_SIZE

maxCacheSize

private int maxCacheSize
Constructor Detail

SimpleSessionFormCache

public SimpleSessionFormCache()
Method Detail

clearForm

public void clearForm(javax.servlet.http.HttpServletRequest request,
                      String formAttrName)
               throws Exception
Throws:
Exception

clearOtherForms

public void clearOtherForms(javax.servlet.http.HttpServletRequest request,
                            String formAttrName)
                     throws Exception
Throws:
Exception

clearCache

public void clearCache(javax.servlet.http.HttpServletRequest request)
Specified by:
clearCache in interface SessionFormCache

getFormCache

protected Map<String,Object> getFormCache(javax.servlet.http.HttpServletRequest request,
                                          boolean required,
                                          boolean create)

getLastModified

public long getLastModified(javax.servlet.http.HttpServletRequest request,
                            String formAttrName)
Specified by:
getLastModified in interface SessionFormCache

saveForm

public void saveForm(javax.servlet.http.HttpServletRequest request,
                     String formAttrName,
                     Object command)
Specified by:
saveForm in interface SessionFormCache

getForm

public Object getForm(javax.servlet.http.HttpServletRequest request,
                      String formAttrName)
Specified by:
getForm in interface SessionFormCache

getMaxCacheSize

public int getMaxCacheSize()
Returns:
the maxCacheSize

setMaxCacheSize

public void setMaxCacheSize(int maxCacheSize)
Parameters:
maxCacheSize - the maxCacheSize to set


Copyright © 2011. All Rights Reserved.