| java.lang.Object java.lang.Thread sunlabs.brazil.handler.PollHandler
PollHandler | public class PollHandler extends Thread implements Handler(Code) | | Handler for periodically polling another web site, whose
results are (optionally) added to the server's properties.
THis also includes the ability to request URL's on a cron-like schedule.
The result of fetching the url is expected to be a text document in
java Properties format.
Properties:
- url
- The fully qualified URL to fetch periodically.
- interval
- The interval (in seconds) to fetch the url. Defaults
to 10 seconds. If match is specified, this is the
interval used to check for a time/date match.
- prepend
- The string to prepend to the properties.
If not supplied, no properties are loaded.
- match
- If specified, a regular expression that must match
the current time for this URL to run. The format to match is:
"EEE-dd-HH-mm" (eg: Thu-Dec, 14, 14:12 pm).
author: Stephen Uhler version: %V% PollHandler.java 1.2 |
Method Summary | |
public boolean | init(Server server, String prefix) Set up the initial configuration, and kick off a thread
to periodically fetch the url. | public boolean | respond(Request request) This might allow control over the polling via requests at a later date. | public void | run() Periodically poll the url, and copy the results into the server
properties. |
init | public boolean init(Server server, String prefix)(Code) | | Set up the initial configuration, and kick off a thread
to periodically fetch the url.
|
respond | public boolean respond(Request request)(Code) | | This might allow control over the polling via requests at a later date.
For now, it always returns false.
|
run | public void run()(Code) | | Periodically poll the url, and copy the results into the server
properties.
|
|
|