Hi guys, thanks for your suggestions...... xpages as servlet
responding with data in any format is what xagent does.
http://www.roseindia.net/servlets/ServletContextListener-example.shtml
I am not smart
enough to comprehend things like
http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/JAVADDIN
applicationscope variables is maintained by servlet container, dont know what kind of relationship it has with server task.
and Looks like ServletContextListener and prenty more others
http://www.examulator.com/moodle/mod/resource/view.php?id=460 are what I am after, an direct hit here
http://stackoverflow.com/questions/7092723/load-applicationscoped-bean-with-servletcontext