Package org.ametys.core.minimize
Class SourceMapCache
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.minimize.SourceMapCache
- All Implemented Interfaces:
LogEnabled
,Initializable
,Component
,Serviceable
public class SourceMapCache
extends AbstractLogEnabled
implements Component, Serviceable, Initializable
A simple cache for source maps from files
-
Field Summary
Modifier and TypeFieldDescriptionprotected AbstractCacheManager
CacheManager used to create and get cacheprotected SourceResolver
Excalibur source resolverstatic final String
The avalon ROLE -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet a value from the cachevoid
void
Put a source map into the cachevoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon ROLE -
_cacheManager
CacheManager used to create and get cache -
_sourceResolver
Excalibur source resolver
-
-
Constructor Details
-
SourceMapCache
public SourceMapCache()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
put
Put a source map into the cache- Parameters:
uri
- The uri of the source mapcontent
- The content of the source maplastModified
- The last modified date of the source map- Throws:
IOException
- If the uri is invalid
-
get
Get a value from the cache- Parameters:
uri
- The uri of the source map- Returns:
- The data, or null if the uri is not in the cache
-