|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.velocity.runtime.resource.Resource
This class represent a general text resource that may have been retrieved from any number of possible sources.
Field Summary | |
protected java.lang.Object |
data
Resource might require ancillary storage of some kind |
protected long |
lastCheck
The next time the file modification time will be checked (in milliseconds). |
protected long |
lastModified
The file modification time (in milliseconds) for the cached template. |
protected static long |
MILLIS_PER_SECOND
The number of milliseconds in a minute, used to calculate the check interval. |
protected long |
modificationCheckInterval
How often the file modification time is checked (in milliseconds). |
protected java.lang.String |
name
Resource name |
protected long |
nextCheck
The next time the file modification time will be checked (in milliseconds). |
protected ResourceLoader |
resourceLoader
The template loader that initially loaded the input stream for this template, and knows how to check the source of the input stream for modification. |
Constructor Summary | |
Resource()
Default constructor |
Method Summary | |
java.lang.Object |
getData()
Get arbitrary data object that might be used by the resource. |
long |
getLastModified()
Return the lastModifed time of this template. |
java.lang.String |
getName()
Get the name of this template. |
ResourceLoader |
getResourceLoader()
Return the template loader that pulled in the template stream |
boolean |
isSourceModified()
|
abstract boolean |
process()
Perform any subsequent processing that might need to be done by a resource. |
boolean |
requiresChecking()
Is it time to check to see if the resource source has been updated? |
void |
setData(java.lang.Object data)
Set arbitrary data object that might be used by the resource. |
void |
setLastModified(long lastModified)
Set the last modified time for this template. |
void |
setModificationCheckInterval(long modificationCheckInterval)
Set the modification check interval. |
void |
setName(java.lang.String name)
Set the name of this resource, for example test.vm. |
void |
setResourceLoader(ResourceLoader resourceLoader)
Set the template loader for this template. |
void |
touch()
Touch this template and thereby resetting the lastCheck, and nextCheck fields. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected ResourceLoader resourceLoader
protected static final long MILLIS_PER_SECOND
protected long modificationCheckInterval
protected long lastModified
protected long lastCheck
protected long nextCheck
protected java.lang.String name
protected java.lang.Object data
Constructor Detail |
public Resource()
Method Detail |
public abstract boolean process() throws ResourceNotFoundException, ParseErrorException, java.lang.Exception
public boolean isSourceModified()
public void setModificationCheckInterval(long modificationCheckInterval)
interval
- The interval (in minutes).public boolean requiresChecking()
public void touch()
public void setName(java.lang.String name)
public java.lang.String getName()
public long getLastModified()
public void setLastModified(long lastModified)
public ResourceLoader getResourceLoader()
public void setResourceLoader(ResourceLoader resourceLoader)
public void setData(java.lang.Object data)
public java.lang.Object getData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |