Package org.opencms.main
Class OpenCmsServlet.RequestCache
java.lang.Object
org.opencms.main.OpenCmsServlet.RequestCache
- Enclosing class:
- OpenCmsServlet
Context class for storing request-dependent caches etc.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a log message to the log buffer.void
close()
Called at the end of the request.getAttribute
(String key) Gets the attribute for the given key.getAttribute
(String key, Function<String, Object> provider) Gets the stored attribute for the given key, or lazily initializes it with the given provider function if it doesn't exist yet.getCachedConfig
(String key) Gets the cached sitemap configuration data.void
setAttribute
(String key, Object value) Sets the attribute for the given key.void
setCachedConfig
(String key, CmsADEConfigData config) Sets the cached sitemap configuration data.
-
Constructor Details
-
RequestCache
public RequestCache()
-
-
Method Details
-
addLog
Adds a log message to the log buffer.- Parameters:
channel
- the channellevel
- the log levelmessage
- the message
-
close
Called at the end of the request. -
getAttribute
Gets the attribute for the given key.- Parameters:
key
- the key- Returns:
- the attribute
-
getAttribute
Gets the stored attribute for the given key, or lazily initializes it with the given provider function if it doesn't exist yet.- Parameters:
key
- the keyprovider
- the function to lazily initialize the entry- Returns:
- the attribute
-
getCachedConfig
Gets the cached sitemap configuration data.- Parameters:
key
- the key- Returns:
- the sitemap config from the cache
-
setAttribute
Sets the attribute for the given key.- Parameters:
key
- the keyvalue
- the attribute value
-
setCachedConfig
Sets the cached sitemap configuration data.- Parameters:
key
- the keyconfig
- the sitemap configuration to cache
-