public class CacheAccessManager extends AbstractLogEnabled implements Component, Initializable, Serviceable, Contextualizable, ThreadSafe
Modifier and Type | Field and Description |
---|---|
protected Context |
_context
The cocoon context.
|
protected ConcurrentMap<String,Boolean> |
_pageCacheable
A Map keeping record of whether the pages are cacheable or not.
|
protected ConcurrentMap<String,ReentrantLock> |
_pageLocks
Map of page cache locks.
|
protected BackOfficeRequestProxyExtensionPoint |
_requestProxyExtensionPoint
The extension point for adding request headers in BO request
|
static String |
ROLE
The avalon role.
|
Constructor and Description |
---|
CacheAccessManager() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
_isCacheable(String pagePath)
Get the cacheable status of a page from the back-office.
|
void |
contextualize(Context context) |
void |
initialize() |
boolean |
isCacheable(String pagePath)
Tests if the page is cacheable.
|
void |
reset()
Resets all the local caches and locks.
|
void |
resetPage(String pagePath)
Remove a specified page path from the local cache and lock.
|
void |
service(ServiceManager serviceManager) |
void |
unlock(String pagePath)
Release the lock associated with a page.
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected ConcurrentMap<String,Boolean> _pageCacheable
protected ConcurrentMap<String,ReentrantLock> _pageLocks
protected BackOfficeRequestProxyExtensionPoint _requestProxyExtensionPoint
public CacheAccessManager()
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public boolean isCacheable(String pagePath) throws IOException
GeneratePageAction
).pagePath
- the page path.IOException
- if an error occurs sending the cacheability request to the back-office.GeneratePageAction
public void unlock(String pagePath)
pagePath
- the page path.public void reset()
public void resetPage(String pagePath)
pagePath
- the page path.protected boolean _isCacheable(String pagePath) throws IOException
pagePath
- the page path.IOException
- in case of a problem or the connection was aborted