|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webmacro.resource.CachingProvider
org.webmacro.resource.UrlProvider
This is the canonical provider for mapping URLs to Handlers. The reactor will request that the "handler" provider return a Handler object when supplied with a URL.
You could implement your own version of this class to return handlers based on whatever criteria you wanted.
Field Summary | |
static long |
AVG_TIMEOUT
|
static long |
MAX_TIMEOUT
|
static long |
MIN_TIMEOUT
|
Fields inherited from class org.webmacro.resource.CachingProvider |
_cacheSupportsReload |
Constructor Summary | |
UrlProvider()
|
Method Summary | |
java.lang.String |
getType()
We serve up "url" type resources |
static java.io.InputStream |
getUrlInputStream(java.net.URL u)
Utility routine to get the input stream associated with a URL. |
static long |
getUrlLastModified(java.net.URL u)
Utility routine to get the last modification date for a URL. |
void |
init(Broker b,
Settings config)
If you override this method be sure and call super.init(...) |
java.lang.Object |
load(java.lang.String name,
CacheElement ce)
Load a URL from the specified name and return it. |
Methods inherited from class org.webmacro.resource.CachingProvider |
destroy, flush, get, load, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long AVG_TIMEOUT
public static final long MAX_TIMEOUT
public static final long MIN_TIMEOUT
Constructor Detail |
public UrlProvider()
Method Detail |
public final java.lang.String getType()
public void init(Broker b, Settings config) throws InitException
CachingProvider
init
in interface Provider
init
in class CachingProvider
InitException
public final java.lang.Object load(java.lang.String name, CacheElement ce) throws ResourceException
Http expires information will be obeyed between the MIN_TIMEOUT and MAX_TIMEOUT bounds. URLs which do not specify a timeout, and files from the filesystem, will be cached for AVG_TIMEOUT milliseconds.
ResourceException
public static long getUrlLastModified(java.net.URL u)
public static java.io.InputStream getUrlInputStream(java.net.URL u) throws java.io.IOException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |