public abstract class AbstractCompiledResourceHandler extends AbstractResourceHandler implements Component
Modifier and Type | Field and Description |
---|---|
private static Map<String,Pair<List<String>,Long>> |
_dependenciesCache |
_cocoonContext, _context, _resolver, _supportedSuffixes
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
AbstractCompiledResourceHandler() |
Modifier and Type | Method and Description |
---|---|
private Long |
_getCalculatedLastModified(Source inputSource,
String sourceUri,
long lastModified,
HashMap<String,String> knowDependencies) |
private List<String> |
_getDependencies(Source inputSource,
String sourceUri,
long lastModified) |
private String |
_getDependenciesKeys(Source inputSource,
String sourceUri,
String fileURI,
long lastModified,
HashMap<String,String> knowDependencies) |
private String |
_getDependencyURI(String sourceUri,
String dependency) |
protected boolean |
_isBasicallySupported(String source)
Is the source supported upon its uri
|
protected abstract List<String> |
getDependenciesList(Source inputSource)
Calculate the list of dependencies for the given source, for validity calculations.
|
Serializable |
getKey(Source source,
Map objectModel,
Parameters parameters,
Map<String,Object> additionalParameters)
Get the unique key for this resource, for cache purpose.
|
protected abstract Source |
getSourceToCompile(String location,
Map<String,Object> additionalParameters)
Get the compiled source uri
|
SourceValidity |
getValidity(Source source,
Map objectModel,
Parameters parameters,
Map<String,Object> additionalParameters)
Get the resource validity, for cache purpose.
|
boolean |
isSupported(String source)
Determines if the resource is supported by this handler
|
Source |
setup(String location,
Map objectModel,
Parameters par,
Map<String,Object> additionalParameters)
Initialize the resource handler with a resource.
|
configure, contextualize, getLastModified, getMimeType, getPriority, getSize, service
getLogger, setLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateResource
public AbstractCompiledResourceHandler()
protected abstract List<String> getDependenciesList(Source inputSource)
inputSource
- The sourceprotected abstract Source getSourceToCompile(String location, Map<String,Object> additionalParameters) throws MalformedURLException, IOException
location
- The requested locationadditionalParameters
- Additional parameters to fill, that will be transmitted to the generate methodMalformedURLException
- if location is malformed.IOException
- If an IO error occursprotected boolean _isBasicallySupported(String source)
source
- The location to analysepublic boolean isSupported(String source)
ResourceHandler
isSupported
in interface ResourceHandler
isSupported
in class AbstractResourceHandler
source
- The uri of resourcetrue
if the resource is supportedpublic Source setup(String location, Map objectModel, Parameters par, Map<String,Object> additionalParameters) throws IOException, ProcessingException
ResourceHandler
setup
in interface ResourceHandler
setup
in class AbstractResourceHandler
location
- The source uriobjectModel
- The object modelpar
- The parametersadditionalParameters
- Additional parameters that can be filled, and will be transmitted to getKey, getValidity and generateResourceIOException
- If an error occursProcessingException
- If an error occurspublic Serializable getKey(Source source, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)
ResourceHandler
getKey
in interface ResourceHandler
getKey
in class AbstractResourceHandler
source
- The sourceobjectModel
- The object modelparameters
- The parametersadditionalParameters
- Additional parameterspublic SourceValidity getValidity(Source source, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)
ResourceHandler
getValidity
in interface ResourceHandler
getValidity
in class AbstractResourceHandler
source
- The sourceobjectModel
- The object modelparameters
- The parametersadditionalParameters
- Additional parametersprivate Long _getCalculatedLastModified(Source inputSource, String sourceUri, long lastModified, HashMap<String,String> knowDependencies)
private String _getDependenciesKeys(Source inputSource, String sourceUri, String fileURI, long lastModified, HashMap<String,String> knowDependencies)
private String _getDependencyURI(String sourceUri, String dependency) throws URISyntaxException
URISyntaxException
private List<String> _getDependencies(Source inputSource, String sourceUri, long lastModified)