|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.web.util.resource.ExtendletLoader
public abstract class ExtendletLoader
A skeletal implementation of the loader used to implement an extendlet.
All you have to do is to implement parse(java.io.InputStream, java.lang.String)
and getExtendletContext().
Extendlet| Constructor Summary | |
|---|---|
protected |
ExtendletLoader()
|
| Method Summary | |
|---|---|
int |
getCheckPeriod()
Returns the check period, or -1 if the content is never changed. |
protected abstract ExtendletContext |
getExtendletContext()
Returns the extendlet context. |
long |
getLastModified(java.lang.Object src)
Returns the last modified time. |
java.lang.Object |
load(java.lang.Object src)
Loads the resource. |
protected abstract java.lang.Object |
parse(java.io.InputStream is,
java.lang.String path)
It is called to parse the resource into an intermediate format depending on Extendlet. |
boolean |
shallCheck(java.lang.Object src,
long expiredMillis)
Returns whether to call Loader.getLastModified(java.lang.Object). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ExtendletLoader()
| Method Detail |
|---|
public boolean shallCheck(java.lang.Object src,
long expiredMillis)
LoaderLoader.getLastModified(java.lang.Object).
If false, it assumes the current cached content is up-to-date.
shallCheck in interface LoaderexpiredMillis - how many milli-seconds are expired after the last
check. In most cases, just return true if expiredMillis > 0public long getLastModified(java.lang.Object src)
getLastModified in interface Loader
public java.lang.Object load(java.lang.Object src)
throws java.lang.Exception
Loader
load in interface Loaderjava.lang.Exception - you might throw any exception which will be
passed back to the caller of ResourceCache.get(java.lang.Object)
protected abstract java.lang.Object parse(java.io.InputStream is,
java.lang.String path)
throws java.lang.Exception
Extendlet.
is - the content of the resourcepath - the path of the resource
java.lang.Exceptionprotected abstract ExtendletContext getExtendletContext()
public int getCheckPeriod()
Default: It checks if an integer (unit: second) is assigned to a system property called org.zkoss.util.resource.extendlet.checkPeriod. If no such system property, -1 is assumed (never change). For the runtime environment the content is never changed, since all extendlet resources are packed in JAR files.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||