com.googlecode.fascinator.portal.services.impl
Class EhcacheDynamicPageCacheImpl

java.lang.Object
  extended by com.googlecode.fascinator.portal.services.impl.EhcacheDynamicPageCacheImpl
All Implemented Interfaces:
DynamicPageCache, EventListener, org.apache.tapestry5.ioc.services.RegistryShutdownListener

public class EhcacheDynamicPageCacheImpl
extends Object
implements DynamicPageCache

Implements a DynamicPageCache using Ehcache.

Author:
Oliver Lucido

Constructor Summary
EhcacheDynamicPageCacheImpl(PortalManager portalManager, VelocityService velocityService, ScriptingServices scriptingServices)
          Construct and configure the caches.
 
Method Summary
 String getPath(String pathId)
          Gets the fully resolved path for the specified path including the skin.
 org.python.core.PyObject getScriptObject(String path)
          Gets the script object with the specified path.
 void putPath(String pathId, String path)
          Puts an entry into the path lookup cache.
 void registryDidShutdown()
          Shutdown the caches properly when Tapestry shuts down.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EhcacheDynamicPageCacheImpl

public EhcacheDynamicPageCacheImpl(PortalManager portalManager,
                                   VelocityService velocityService,
                                   ScriptingServices scriptingServices)
Construct and configure the caches.

Parameters:
portalManager - PortalManager instance
velocityService - VelocityService instance
scriptingServices - ScriptingServices instance
Method Detail

registryDidShutdown

public void registryDidShutdown()
Shutdown the caches properly when Tapestry shuts down.

Specified by:
registryDidShutdown in interface org.apache.tapestry5.ioc.services.RegistryShutdownListener

getScriptObject

public org.python.core.PyObject getScriptObject(String path)
Gets the script object with the specified path. If not already cached the script object will be created by the JythonCacheEntryFactory.

Specified by:
getScriptObject in interface DynamicPageCache
Parameters:
path - jython script path - including portal and skin. this should be a valid Velocity resource
Returns:
a script object or null if an error occurred

getPath

public String getPath(String pathId)
Gets the fully resolved path for the specified path including the skin.

Specified by:
getPath in interface DynamicPageCache
Parameters:
pathId - a path to resolve
Returns:
resolved path

putPath

public void putPath(String pathId,
                    String path)
Puts an entry into the path lookup cache.

Specified by:
putPath in interface DynamicPageCache
Parameters:
pathId - path to resolve
path - resolved path


Copyright © 2009-2012. All Rights Reserved.