public abstract class AbstractResourceHandler extends AbstractLogEnabled implements ResourceHandler, Serviceable, Configurable, Contextualizable
| Modifier and Type | Field and Description |
|---|---|
protected Context |
_cocoonContext
The cocoon context
|
protected Context |
_context
The context
|
protected SourceResolver |
_resolver
The source resolver
|
protected Set<String> |
_supportedSuffixes
The supported suffixes
|
MAX_PRIORITY, MIN_PRIORITY| Constructor and Description |
|---|
AbstractResourceHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Configuration configuration) |
void |
contextualize(Context context) |
Serializable |
getKey(Source source,
Map objectModel,
Parameters parameters,
Map<String,Object> additionalParameters)
Get the unique key for this resource, for cache purpose.
|
long |
getLastModified(Source source,
Parameters parameters)
Get the resource last modified time
|
String |
getMimeType(Source source,
Parameters parameters)
Return the mime type of the configured resource.
|
int |
getPriority()
Get the priority of this handler
|
long |
getSize(Source source,
Parameters parameters)
Get the resource size, if available.
|
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
|
void |
service(ServiceManager manager) |
Source |
setup(String location,
Map objectModel,
Parameters par,
Map<String,Object> additionalParameters)
Initialize the resource handler with a resource.
|
getLogger, setLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateResourceprotected Set<String> _supportedSuffixes
protected SourceResolver _resolver
protected Context _cocoonContext
public AbstractResourceHandler()
public void service(ServiceManager manager) throws ServiceException
service in interface ServiceableServiceExceptionpublic void contextualize(Context context) throws ContextException
contextualize in interface ContextualizableContextExceptionpublic void configure(Configuration configuration) throws ConfigurationException
configure in interface ConfigurableConfigurationExceptionpublic Source setup(String location, Map objectModel, Parameters par, Map<String,Object> additionalParameters) throws IOException, ProcessingException
ResourceHandlersetup in interface ResourceHandlerlocation - 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 boolean isSupported(String source)
ResourceHandlerisSupported in interface ResourceHandlersource - The uri of resourcetrue if the resource is supportedpublic int getPriority()
ResourceHandlergetPriority in interface ResourceHandlerpublic String getMimeType(Source source, Parameters parameters)
ResourceHandlergetMimeType in interface ResourceHandlersource - The sourceparameters - The parameterspublic Serializable getKey(Source source, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)
ResourceHandlergetKey in interface ResourceHandlersource - The sourceobjectModel - The object modelparameters - The parametersadditionalParameters - Additional parameterspublic SourceValidity getValidity(Source source, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)
ResourceHandlergetValidity in interface ResourceHandlersource - The sourceobjectModel - The object modelparameters - The parametersadditionalParameters - Additional parameterspublic long getSize(Source source, Parameters parameters)
ResourceHandlergetSize in interface ResourceHandlersource - The sourceparameters - The parameterspublic long getLastModified(Source source, Parameters parameters)
ResourceHandlergetLastModified in interface ResourceHandlersource - The sourceparameters - The parameters