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,
Parameters parameters)
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,
Parameters parameters)
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,
Parameters par)
Initialize the resource handler with a resource.
|
getLogger, setLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateResource
protected Set<String> _supportedSuffixes
protected SourceResolver _resolver
protected Context _cocoonContext
public AbstractResourceHandler()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public Source setup(String location, Parameters par) throws IOException, ProcessingException
ResourceHandler
setup
in interface ResourceHandler
location
- The source uripar
- The parametersIOException
- If an error occursProcessingException
- If an error occurspublic boolean isSupported(String source)
ResourceHandler
isSupported
in interface ResourceHandler
source
- The uri of resourcetrue
if the resource is supportedpublic int getPriority()
ResourceHandler
getPriority
in interface ResourceHandler
public String getMimeType(Source source, Parameters parameters)
ResourceHandler
getMimeType
in interface ResourceHandler
source
- The sourceparameters
- The parameterspublic Serializable getKey(Source source, Parameters parameters)
ResourceHandler
getKey
in interface ResourceHandler
source
- The sourceparameters
- The parameterspublic SourceValidity getValidity(Source source, Parameters parameters)
ResourceHandler
getValidity
in interface ResourceHandler
source
- The sourceparameters
- The parameterspublic long getSize(Source source, Parameters parameters)
ResourceHandler
getSize
in interface ResourceHandler
source
- The sourceparameters
- The parameterspublic long getLastModified(Source source, Parameters parameters)
ResourceHandler
getLastModified
in interface ResourceHandler
source
- The sourceparameters
- The parameters