org.codehaus.groovy.grails.web.pages.discovery
Class CachingGrailsConventionGroovyPageLocator

java.lang.Object
  extended by org.codehaus.groovy.grails.web.pages.discovery.DefaultGroovyPageLocator
      extended by org.codehaus.groovy.grails.web.pages.discovery.GrailsConventionGroovyPageLocator
          extended by org.codehaus.groovy.grails.web.pages.discovery.CachingGrailsConventionGroovyPageLocator
All Implemented Interfaces:
org.codehaus.groovy.grails.plugins.PluginManagerAware, GroovyPageLocator, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware

public class CachingGrailsConventionGroovyPageLocator
extends GrailsConventionGroovyPageLocator

Extends GrailsConventionGroovyPageLocator adding caching of the located GrailsPageScriptSource

Since:
2.0

Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.groovy.grails.web.pages.discovery.DefaultGroovyPageLocator
DefaultGroovyPageLocator.PluginViewPathInfo
 
Field Summary
 
Fields inherited from class org.codehaus.groovy.grails.web.pages.discovery.DefaultGroovyPageLocator
pluginManager, reloadEnabled, resourceLoaders, warDeployed
 
Constructor Summary
CachingGrailsConventionGroovyPageLocator()
           
 
Method Summary
 GroovyPageScriptSource findPage(java.lang.String uri)
          Finds a page for the given URI
 GroovyPageScriptSource findPageInBinding(java.lang.String uri, GroovyPageBinding binding)
          Finds a page for the URI and binding
 GroovyPageScriptSource findPageInBinding(java.lang.String pluginName, java.lang.String uri, GroovyPageBinding binding)
          Finds a page for the given URI
 long getCacheTimeout()
           
protected  GroovyPageScriptSource lookupCache(org.codehaus.groovy.grails.web.pages.discovery.CachingGrailsConventionGroovyPageLocator.GroovyPageLocatorCacheKey cacheKey, java.security.PrivilegedAction<GroovyPageScriptSource> updater)
           
 void removePrecompiledPage(GroovyPageCompiledScriptSource scriptSource)
          Removes any precompiled pages for the given URI so that they can be replaced by dynamic pages
 void setCacheTimeout(long cacheTimeout)
           
 
Methods inherited from class org.codehaus.groovy.grails.web.pages.discovery.GrailsConventionGroovyPageLocator
findTemplate, findTemplate, findTemplate, findTemplateByPath, findTemplateInBinding, findTemplateInBinding, findView, findView, findView, findViewByPath, getNameForController, resolveViewFormat
 
Methods inherited from class org.codehaus.groovy.grails.web.pages.discovery.DefaultGroovyPageLocator
addResourceLoader, createGroovyPageCompiledScriptSource, findBinaryScriptSource, findReloadablePage, findResource, findResource, findResourceInPlugins, findResourceScriptPathForSearchPaths, findResourceScriptSource, findResourceScriptSourceInPlugins, getPluginViewPathInfo, isReloadEnabled, removePrefix, removeViewLocationPrefixes, resolveContextPath, resolvePluginViewPath, resolveSearchPaths, resolveViewInBinaryPlugin, setApplicationContext, setPluginManager, setPrecompiledGspMap, setReloadEnabled, setResourceLoader, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingGrailsConventionGroovyPageLocator

public CachingGrailsConventionGroovyPageLocator()
Method Detail

findPageInBinding

public GroovyPageScriptSource findPageInBinding(java.lang.String uri,
                                                GroovyPageBinding binding)
Description copied from interface: GroovyPageLocator
Finds a page for the URI and binding

Specified by:
findPageInBinding in interface GroovyPageLocator
Overrides:
findPageInBinding in class DefaultGroovyPageLocator
Parameters:
uri - The URI
binding - The binding
Returns:
The page source

findPageInBinding

public GroovyPageScriptSource findPageInBinding(java.lang.String pluginName,
                                                java.lang.String uri,
                                                GroovyPageBinding binding)
Description copied from interface: GroovyPageLocator
Finds a page for the given URI

Specified by:
findPageInBinding in interface GroovyPageLocator
Overrides:
findPageInBinding in class DefaultGroovyPageLocator
uri - The URI
Returns:
A script source

findPage

public GroovyPageScriptSource findPage(java.lang.String uri)
Description copied from interface: GroovyPageLocator
Finds a page for the given URI

Specified by:
findPage in interface GroovyPageLocator
Overrides:
findPage in class DefaultGroovyPageLocator
Parameters:
uri - The URI
Returns:
A script source

lookupCache

protected GroovyPageScriptSource lookupCache(org.codehaus.groovy.grails.web.pages.discovery.CachingGrailsConventionGroovyPageLocator.GroovyPageLocatorCacheKey cacheKey,
                                             java.security.PrivilegedAction<GroovyPageScriptSource> updater)

getCacheTimeout

public long getCacheTimeout()

setCacheTimeout

public void setCacheTimeout(long cacheTimeout)

removePrecompiledPage

public void removePrecompiledPage(GroovyPageCompiledScriptSource scriptSource)
Description copied from interface: GroovyPageLocator
Removes any precompiled pages for the given URI so that they can be replaced by dynamic pages

Specified by:
removePrecompiledPage in interface GroovyPageLocator
Overrides:
removePrecompiledPage in class DefaultGroovyPageLocator
Parameters:
scriptSource - The compiled script source