| 
 |   | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.Thread
sunlabs.brazil.handler.PollHandler
sunlabs.brazil.handler.RePollHandler (view source)
public class RePollHandler
Do regsub processing on content to extract properties.
Properties:
If the name "X" is used, no property will be extracted for that match.
First remote content is obtained. Then each regular expression token is processed in turn for the purpose of extracting portions of that content into server properties. [re].sub is used to transform the content before attempting to extract properties.
Content is extracted into the following properties.
| Nested Class Summary | |
|---|---|
| static class | RePollHandler.ExtractA "bag" to store regular expression extraction instructions | 
| Nested classes/interfaces inherited from class java.lang.Thread | 
|---|
| Thread.State, Thread.UncaughtExceptionHandler | 
| Field Summary | 
|---|
| Fields inherited from class sunlabs.brazil.handler.PollHandler | 
|---|
| interval, post, url | 
| Fields inherited from class java.lang.Thread | 
|---|
| MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY | 
| Constructor Summary | |
|---|---|
| RePollHandler() | |
| Method Summary | |
|---|---|
|  void | fillProps(Properties props,
          HttpRequest target)Fill the properties by extracting fields from the response. | 
|  boolean | init(Server server,
     String prefix)Set up the initial configuration, and kick off a thread to periodically fetch the url. | 
|  void | processText(Properties props,
            String data)Process the contents as a string through the regular expressions. | 
|  boolean | respond(Request request)Allow The url and post data (if any) to be changed. | 
| Methods inherited from class sunlabs.brazil.handler.PollHandler | 
|---|
| run | 
| Methods inherited from class java.lang.Thread | 
|---|
| activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public RePollHandler()
| Method Detail | 
|---|
public boolean init(Server server,
                    String prefix)
PollHandler
init in interface Handlerinit in class PollHandlerserver - The HTTP server that created this Handler.
                Typical Handlers will use Server.props
                to obtain run-time configuration information.prefix - The handlers name.
                The string this Handler may prepend to all
                of the keys that it uses to extract configuration information
                from Server.props.  This is set (by the Server
                and ChainHandler) to help avoid configuration parameter
                namespace collisions.
true if this Handler initialized
                successfully, false otherwise.  If
                false is returned, this Handler
                should not be used.public boolean respond(Request request)
respond in interface Handlerrespond in class PollHandlerrequest - The Request object that represents the HTTP
                request.
true if the request was handled.  A request was
                handled if a response was supplied to the client, typically
                by calling Request.sendResponse() or
                Request.sendError.
public void fillProps(Properties props,
                      HttpRequest target)
               throws IOException
fillProps in class PollHandlerIOException
public void processText(Properties props,
                        String data)
| 
 | Version Kenai-svn-r24, Generated 08/18/09 Copyright (c) 2001-2009, Sun Microsystems. | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||