Package org.ametys.core.minimize
Class AbstractSourceMapResourceHandler
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.resources.AbstractResourceHandler
-
- org.ametys.core.minimize.AbstractSourceMapResourceHandler
-
- All Implemented Interfaces:
ResourceHandler,LogEnabled,Configurable,Contextualizable,Serviceable
- Direct Known Subclasses:
CSSSourceMapResourceHandler,JSSourceMapResourceHandler
public abstract class AbstractSourceMapResourceHandler extends AbstractResourceHandler
Resource handler for source map files
-
-
Field Summary
Fields Modifier and Type Field Description protected HashCache_hashCacheHash Cache for Hashed resourcesprotected SourceMapCache_sourceMapCacheSourceMapCache-
Fields inherited from class org.ametys.core.resources.AbstractResourceHandler
_cocoonContext, _context, _resolver, _supportedSuffixes
-
Fields inherited from interface org.ametys.core.resources.ResourceHandler
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description AbstractSourceMapResourceHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Source_getAlternateSource(String location, Map objectModel)Find the source at an alternative locationprotected Source_getExistingSource(String location)Try to retrieve an existing sourcevoidgenerateResource(Source source, OutputStream out, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)Generate the resource configured during setup, and output itStringgetMimeType(Source source, Parameters par)Return the mime type of the configured resource.intgetPriority()Get the priority of this handlervoidservice(ServiceManager manager)Sourcesetup(String location, Map objectModel, Parameters par, Map<String,Object> additionalParameters)Initialize the resource handler with a resource.-
Methods inherited from class org.ametys.core.resources.AbstractResourceHandler
configure, contextualize, getKey, getLastModified, getSize, getValidity, isSupported
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_sourceMapCache
protected SourceMapCache _sourceMapCache
SourceMapCache
-
_hashCache
protected HashCache _hashCache
Hash Cache for Hashed resources
-
-
Constructor Detail
-
AbstractSourceMapResourceHandler
public AbstractSourceMapResourceHandler()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractResourceHandler- Throws:
ServiceException
-
getMimeType
public String getMimeType(Source source, Parameters par)
Description copied from interface:ResourceHandlerReturn the mime type of the configured resource.- Specified by:
getMimeTypein interfaceResourceHandler- Overrides:
getMimeTypein classAbstractResourceHandler- Parameters:
source- The sourcepar- The parameters- Returns:
- The mime type.
-
getPriority
public int getPriority()
Description copied from interface:ResourceHandlerGet the priority of this handler- Specified by:
getPriorityin interfaceResourceHandler- Overrides:
getPriorityin classAbstractResourceHandler- Returns:
- the priority. The bigger the highest priority
-
setup
public Source setup(String location, Map objectModel, Parameters par, Map<String,Object> additionalParameters) throws IOException, ProcessingException
Description copied from interface:ResourceHandlerInitialize the resource handler with a resource.- Specified by:
setupin interfaceResourceHandler- Overrides:
setupin classAbstractResourceHandler- Parameters:
location- The source uriobjectModel- The object modelpar- The parametersadditionalParameters- Additional parameters that can be filled, and will be transmitted to getKey, getValidity and generateResource- Returns:
- the resolved source
- Throws:
IOException- If an error occursProcessingException- If an error occurs
-
_getAlternateSource
protected abstract Source _getAlternateSource(String location, Map objectModel) throws ProcessingException, IOException
Find the source at an alternative location- Parameters:
location- The original locationobjectModel- The object model- Returns:
- The source, or null if not found
- Throws:
IOException- If an error occurredProcessingException- If an error occurred
-
_getExistingSource
protected Source _getExistingSource(String location)
Try to retrieve an existing source- Parameters:
location- The location- Returns:
- The source, or null if not found
-
generateResource
public void generateResource(Source source, OutputStream out, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters) throws IOException, ProcessingException
Description copied from interface:ResourceHandlerGenerate the resource configured during setup, and output it- Parameters:
source- The sourceout- The output stream to write toobjectModel- The object modelparameters- The sitemap parametersadditionalParameters- Additional parameters- Throws:
IOException- If an error occursProcessingException- If an error occurs
-
-