org.zkoss.util.resource
Interface Loader

All Known Implementing Classes:
AbstractLoader, ContentLoader

public interface Loader

A loader that could load a resource to another format. It is mainly designed to work with ResourceCache.

Author:
tomyeh

Method Summary
 long getLastModified(java.lang.Object src)
          Returns the last modified time, or -1 if reload is required or not exists.
 java.lang.Object load(java.lang.Object src)
          Loads the resource.
 boolean shallCheck(java.lang.Object src, long expiredMillis)
          Returns whether to call getLastModified(java.lang.Object).
 

Method Detail

shallCheck

boolean shallCheck(java.lang.Object src,
                   long expiredMillis)
Returns whether to call getLastModified(java.lang.Object). If false, it assumes the current cached content is up-to-date.

Parameters:
expiredMillis - how many milli-seconds are expired after the last check. In most cases, just return true if expiredMillis > 0

getLastModified

long getLastModified(java.lang.Object src)
Returns the last modified time, or -1 if reload is required or not exists.


load

java.lang.Object load(java.lang.Object src)
                      throws java.lang.Exception
Loads the resource.

Returns:
null if not found
Throws:
java.lang.Exception - you might throw any exception which will be passed back to the caller of ResourceCache.get(java.lang.Object)


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.