org.apache.catalina.manager

Class StatusTransformer

public class StatusTransformer extends Object

This is a refactoring of the servlet to externalize the output into a simple class. Although we could use XSLT, that is unnecessarily complex.

Version: $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $

Author: Peter Lin

Method Summary
static Stringfilter(Object obj)
Filter the specified message string for characters that are sensitive in HTML.
static StringformatSeconds(Object obj)
Formats the given time (given in seconds) as a string.
static StringformatSize(Object obj, boolean mb)
Display the given size in bytes, either as KB or MB.
static StringformatTime(Object obj, boolean seconds)
Display the given time in ms, either as ms or s.
static voidsetContentType(HttpServletResponse response, int mode)
static voidwriteBody(PrintWriter writer, Object[] args, int mode)
Write the header body.
static voidwriteConnectorState(PrintWriter writer, ObjectName tpName, String name, MBeanServer mBeanServer, Vector globalRequestProcessors, Vector requestProcessors, int mode)
Write connector state.
protected static voidwriteContext(PrintWriter writer, ObjectName objectName, MBeanServer mBeanServer, int mode)
Write context state.
static voidwriteDetailedState(PrintWriter writer, MBeanServer mBeanServer, int mode)
Write applications state.
static voidwriteFooter(PrintWriter writer, int mode)
static voidwriteHeader(PrintWriter writer, int mode)
Process a GET request for the specified resource.
static voidwriteJspMonitor(PrintWriter writer, Set jspMonitorONs, MBeanServer mBeanServer, int mode)
Write JSP monitoring information.
static voidwriteManager(PrintWriter writer, Object[] args, int mode)
Write the manager webapp information.
static voidwriteManager(PrintWriter writer, ObjectName objectName, MBeanServer mBeanServer, int mode)
Write detailed information about a manager.
static voidwriteOSState(PrintWriter writer, int mode)
Write the OS state.
static voidwritePageHeading(PrintWriter writer, Object[] args, int mode)
protected static voidwriteProcessorState(PrintWriter writer, ObjectName pName, MBeanServer mBeanServer, int mode)
Write processor state.
static voidwriteServerInfo(PrintWriter writer, Object[] args, int mode)
static voidwriteVMState(PrintWriter writer, int mode)
Write the VM state.
static voidwriteWrapper(PrintWriter writer, ObjectName objectName, MBeanServer mBeanServer, int mode)
Write detailed information about a wrapper.

Method Detail

filter

public static String filter(Object obj)
Filter the specified message string for characters that are sensitive in HTML. This avoids potential attacks caused by including JavaScript codes in the request URL that is often reported in error messages.

Parameters: obj The message string to be filtered

formatSeconds

public static String formatSeconds(Object obj)
Formats the given time (given in seconds) as a string.

Parameters: obj Time object to be formatted as string

Returns: String formatted time

formatSize

public static String formatSize(Object obj, boolean mb)
Display the given size in bytes, either as KB or MB.

Parameters: mb true to display megabytes, false for kilobytes

formatTime

public static String formatTime(Object obj, boolean seconds)
Display the given time in ms, either as ms or s.

Parameters: seconds true to display seconds, false for milliseconds

setContentType

public static void setContentType(HttpServletResponse response, int mode)

writeBody

public static void writeBody(PrintWriter writer, Object[] args, int mode)
Write the header body. XML output doesn't bother to output this stuff, since it's just title.

Parameters: writer The output writer args What to write mode 0 means write

writeConnectorState

public static void writeConnectorState(PrintWriter writer, ObjectName tpName, String name, MBeanServer mBeanServer, Vector globalRequestProcessors, Vector requestProcessors, int mode)
Write connector state.

writeContext

protected static void writeContext(PrintWriter writer, ObjectName objectName, MBeanServer mBeanServer, int mode)
Write context state.

writeDetailedState

public static void writeDetailedState(PrintWriter writer, MBeanServer mBeanServer, int mode)
Write applications state.

writeFooter

public static void writeFooter(PrintWriter writer, int mode)

writeHeader

public static void writeHeader(PrintWriter writer, int mode)
Process a GET request for the specified resource.

Parameters: request The servlet request we are processing response The servlet response we are creating

Throws: IOException if an input/output error occurs ServletException if a servlet-specified error occurs

writeJspMonitor

public static void writeJspMonitor(PrintWriter writer, Set jspMonitorONs, MBeanServer mBeanServer, int mode)
Write JSP monitoring information.

writeManager

public static void writeManager(PrintWriter writer, Object[] args, int mode)
Write the manager webapp information.

Parameters: writer The output writer args What to write mode 0 means write

writeManager

public static void writeManager(PrintWriter writer, ObjectName objectName, MBeanServer mBeanServer, int mode)
Write detailed information about a manager.

writeOSState

public static void writeOSState(PrintWriter writer, int mode)
Write the OS state. Mode 0 will generate HTML. Mode 1 will generate XML.

writePageHeading

public static void writePageHeading(PrintWriter writer, Object[] args, int mode)

writeProcessorState

protected static void writeProcessorState(PrintWriter writer, ObjectName pName, MBeanServer mBeanServer, int mode)
Write processor state.

writeServerInfo

public static void writeServerInfo(PrintWriter writer, Object[] args, int mode)

writeVMState

public static void writeVMState(PrintWriter writer, int mode)
Write the VM state. Mode 0 will generate HTML. Mode 1 will generate XML.

writeWrapper

public static void writeWrapper(PrintWriter writer, ObjectName objectName, MBeanServer mBeanServer, int mode)
Write detailed information about a wrapper.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.