|
||||||||||
| 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, java.lang.String)
and getExtendletContext().
If the real path is not the same as the path specified in URL,
you can override getRealPath(java.lang.String).
Extendlet| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.zkoss.util.resource.Loader |
|---|
org.zkoss.util.resource.Loader.Resource |
| 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(Object src)
Returns the last modified time. |
protected String |
getRealPath(String path)
Returns the real path for the specified path. |
Object |
load(Object src)
|
protected abstract Object |
parse(InputStream is,
String path,
String orgpath)
It is called to parse the resource into an intermediate format depending on Extendlet. |
boolean |
shallCheck(Object src,
long expiredMillis)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ExtendletLoader()
| Method Detail |
|---|
protected String getRealPath(String path)
Default: return path, i.e., the path specified in URL is the real path.
Notice that parse(java.io.InputStream, java.lang.String, java.lang.String) will receive the original path
(rather than the returned path).
path - the path specified in URL.
Notice that it does NOT start with "~./". Rather it starts with
"/". For example, "/zul/css/zk.wcs".
public boolean shallCheck(Object src,
long expiredMillis)
shallCheck in interface org.zkoss.util.resource.Loaderpublic long getLastModified(Object src)
getLastModified in interface org.zkoss.util.resource.Loader
public Object load(Object src)
throws Exception
load in interface org.zkoss.util.resource.LoaderException
protected abstract Object parse(InputStream is,
String path,
String orgpath)
throws Exception
Extendlet.
The object is returned directly by load(java.lang.Object), so
you can return an instance of org.zkoss.util.resource.Loader.Resource
to have more control on ResourceCache.
is - the content of the resourcepath - the path of the resource.
It is the value returned by getRealPath(java.lang.String), so called
the real pathorgpath - the original path.
It is the path passed to the path argument
of getRealPath(java.lang.String). It is useful if you want to retrieve
the additional information encoded into the URI.
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 | |||||||||