public class RequestCachingConnector
extends org.springframework.extensions.webscripts.connector.AlfrescoConnector
If a GET request is within the context of an executing page with a valid RequestContext, then the request response is cached keyed on the URI.
The cache is examined for further GET requests. The cache is then destroyed when the RequestContext is discarded at the end of the page processing lifecycle. This removes the need for complex cache management and concerns over stale data between page requests - the cache is simply used to provide identical data to discrete components that execute within the context of the same page without causing multiple requests.
| Constructor and Description |
|---|
RequestCachingConnector(org.springframework.extensions.config.RemoteConfigElement.ConnectorDescriptor descriptor,
String endpoint)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.extensions.webscripts.connector.Response |
call(String uri,
org.springframework.extensions.webscripts.connector.ConnectorContext context)
Override the call method to intercept GET requests - maintain a simple
URI keyed cache of the Response in the thread local RequestContext.
|
applyRequestAuthenticationapplyRequestHeaders, call, call, call, initRemoteClient, processResponsepublic RequestCachingConnector(org.springframework.extensions.config.RemoteConfigElement.ConnectorDescriptor descriptor,
String endpoint)
descriptor - ConnectorDescriptorendpoint - Stringpublic org.springframework.extensions.webscripts.connector.Response call(String uri, org.springframework.extensions.webscripts.connector.ConnectorContext context)
call in interface org.springframework.extensions.webscripts.connector.Connectorcall in class org.springframework.extensions.webscripts.connector.HttpConnectorCopyright © 2005–2016 Alfresco Software. All rights reserved.