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
_hashCache
Hash Cache for Hashed resourcesprotected SourceMapCache
_sourceMapCache
SourceMapCache-
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 sourcevoid
generateResource(Source source, OutputStream out, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)
Generate the resource configured during setup, and output itString
getMimeType(Source source, Parameters par)
Return the mime type of the configured resource.int
getPriority()
Get the priority of this handlervoid
service(ServiceManager manager)
Source
setup(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:
service
in interfaceServiceable
- Overrides:
service
in classAbstractResourceHandler
- Throws:
ServiceException
-
getMimeType
public String getMimeType(Source source, Parameters par)
Description copied from interface:ResourceHandler
Return the mime type of the configured resource.- Specified by:
getMimeType
in interfaceResourceHandler
- Overrides:
getMimeType
in classAbstractResourceHandler
- Parameters:
source
- The sourcepar
- The parameters- Returns:
- The mime type.
-
getPriority
public int getPriority()
Description copied from interface:ResourceHandler
Get the priority of this handler- Specified by:
getPriority
in interfaceResourceHandler
- Overrides:
getPriority
in 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:ResourceHandler
Initialize the resource handler with a resource.- Specified by:
setup
in interfaceResourceHandler
- Overrides:
setup
in 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:ResourceHandler
Generate 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
-
-