Poll Handler

  2 posts   Feedicon  
Replies: 1 - Last Post: June 06, 2009 10:38
by: digitalrinaldo
showing 1 - 2 of 2
 
Posted: June 02, 2009 00:59 by digitalrinaldo
When deploying a webapp, one often needs periodic actions. The PolllHandler was developed for this purpose to get changing status information and set the properties to reflec this change. I have not used it for a few years. What am I doing wrong.


I set the poll handler.

#
# Poll handler
#
poll.class=sunlabs.brazil.handler.PollHandler
poll.url=/configuration.html
poll.prepend=config.
poll.namespace=server

Here is what I run

<set name="environmentName" value="ST7" namespace="server" />
<set name="environmentPrefix" value="st7" />
<set name="configurationDone" value="true" />

Here is what I see when I print the properties whay are the names blank.

config.
config.
config.
config.count.attempts=10
config.count.errors=0
 
Posted: June 06, 2009 10:38 by digitalrinaldo
Stephen Uhler cleared this up for me. The PollHandler has two roles, as a handler to return java property type files to http requests and as a cron replacement. Since the pollhandler runs on a request thread care needs to be taken to make sure it is using the same session. I configured it as follows and I am using ides effects to set values int he global server namespace.

handlers=session poll background map enablehttps trustme mount template file
#
# Poll handler
#
poll.class=sunlabs.brazil.handler.PollHandler
poll.url=/configuration.html
poll.prepend=config.
poll.namespace=server
poll.fast=true

The prepend is not really needed. If you were to look at the output by listing all the properties by calling something like

<definemacro name="showAllProperties" global="true" >
<foreach name="a" glob="*" sort>
<get name="a.name">=<get name="a.value"><br>
</foreach>
</definemacro>

You would see some config params that have nothing after them in some cases, this is the PoolHanlder attempting to parse output and turn it into properties and failing.
Replies: 1 - Last Post: June 06, 2009 10:38
by: digitalrinaldo
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120127.ac94057)
 
 
Close
loading
Please Confirm
Close