xmlBlaster 2.2.0 client API

http.dhtml.systemInfo
Class SystemInfo

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by http.dhtml.systemInfo.SystemInfo
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class SystemInfo
extends javax.servlet.http.HttpServlet

A servlet demonstrating the browser callback framework, using a persistent http connection.

This servlets subscribes to messages in xmlBlaster, which are requested from the browser, currently 'cpuinfo' and 'meminfo' messages.
You see in your browser two bars displaying the current load of the xmlBlaster.org web server.
Inside the browser the bars are updated with DHTML.

If you want to do something similar, you can use this as a base for your application.

See xmlBlaster/demo/http/README for further informations

See Also:
Serialized Form

Constructor Summary
SystemInfo()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Subscribes to xmlBlaster messages 'cpuinfo' and 'meminfo'.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          dummy
 void htmlOutput(java.lang.String htmlData, javax.servlet.http.HttpServletResponse response)
          Returns a HTML file to the Browser.
 void init(javax.servlet.ServletConfig conf)
          This method is invoked only once when the servlet is started.
 void popupError(javax.servlet.http.HttpServletResponse response, java.lang.String error)
          Report an error to the browser, which displays it in an alert() message.
 void xmlOutput(java.lang.String xmlData, javax.servlet.http.HttpServletResponse response)
          Send XML-Data to browser.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemInfo

public SystemInfo()
Method Detail

init

public void init(javax.servlet.ServletConfig conf)
          throws javax.servlet.ServletException
This method is invoked only once when the servlet is started.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
conf - init parameter of the servlet
Throws:
javax.servlet.ServletException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException
dummy

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException
Subscribes to xmlBlaster messages 'cpuinfo' and 'meminfo'.

The message updates are received asynchronous over the callbackFrame.
The return from this doGet() may be ignored

Invoking example:
"/servlet/SystemInfo?ActionType=cpuinfo"

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request -
response -
Throws:
javax.servlet.ServletException

htmlOutput

public void htmlOutput(java.lang.String htmlData,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException
Returns a HTML file to the Browser.

Parameters:
htmlData - the complete HTML page
response - the servlet response-object
Throws:
javax.servlet.ServletException
See Also:
HttpServletResponse

popupError

public void popupError(javax.servlet.http.HttpServletResponse response,
                       java.lang.String error)
Report an error to the browser, which displays it in an alert() message.

Parameters:
sessionId - The browser
error - The text to display

xmlOutput

public void xmlOutput(java.lang.String xmlData,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException
Send XML-Data to browser. The browser needs to handle the data.

Parameters:
xmlData - XML data
response - servlet response
Throws:
javax.servlet.ServletException

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.