sunlabs.brazil.tcl
Class TclRePollHandler

java.lang.Object
  extended by java.lang.Thread
      extended by sunlabs.brazil.handler.PollHandler
          extended by sunlabs.brazil.handler.RePollHandler
              extended by sunlabs.brazil.tcl.TclRePollHandler (view source)
All Implemented Interfaces:
Runnable, Handler

public class TclRePollHandler
extends RePollHandler

Post-process all "polled" properties with tcl code. The following server properties are used:

script
The name of the TCL script to call at each request. The interpreter is created with the following global variables. The script is "evaluted" once on startup. The tcl procedure "process" is called with the java properties object. Any modifications to that object are done here.
debug
If set, the "script" is sourced each time.


Nested Class Summary
 
Nested classes/interfaces inherited from class sunlabs.brazil.handler.RePollHandler
RePollHandler.Extract
 
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
TclRePollHandler()
           
 
Method Summary
 void fillProps(Properties props, HttpRequest target)
          Fill the properties from the input stream
 boolean init(Server server, String prefix)
          Create a tcl interp, extract the properties, and run the init script
 
Methods inherited from class sunlabs.brazil.handler.RePollHandler
processText, respond
 
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

TclRePollHandler

public TclRePollHandler()
Method Detail

init

public boolean init(Server server,
                    String prefix)
Create a tcl interp, extract the properties, and run the init script

Specified by:
init in interface Handler
Overrides:
init in class RePollHandler
Parameters:
server - 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.
Returns:
true if this Handler initialized successfully, false otherwise. If false is returned, this Handler should not be used.

fillProps

public void fillProps(Properties props,
                      HttpRequest target)
               throws IOException
Fill the properties from the input stream

Overrides:
fillProps in class RePollHandler
Throws:
IOException

Version Kenai-svn-r24, Generated 08/18/09
Copyright (c) 2001-2009, Sun Microsystems.