org.logicalcobwebs.proxool.admin.servlet
Class AdminServlet

java.lang.Object
  extended byHttpServlet
      extended byorg.logicalcobwebs.proxool.admin.servlet.AdminServlet

public class AdminServlet
extends HttpServlet

Use this to admin each pool within Proxool. It acts like a normal servlet., so just configure it within your web app as you see fit. For example, within web.xml:

   <servlet>
       <servlet-name>Admin</servlet-name>
       <servlet-class>org.logicalcobwebs.proxool.admin.servlet.AdminServlet</servlet-class>
   </servlet>

   <servlet-mapping>
       <servlet-name>Admin</servlet-name>
       <url-pattern>/admin</url-pattern>
   </servlet-mapping>
 

Since:
Proxool 0.7
Version:
$Revision: 1.8 $, $Date: 2003/09/29 17:49:19 $
Author:
bill, $Author: billhorsman $ (current maintainer)
See Also:
Serialized Form

Field Summary
private static java.lang.String ACTION
           
protected static java.lang.String ACTION_CHART
           
protected static java.lang.String ACTION_LIST
           
private static java.lang.String ACTION_STATS
           
private static java.lang.String ALIAS
           
private static java.lang.String CONNECTION_ID
           
private static java.text.DateFormat DATE_FORMAT
           
private static java.text.DecimalFormat DECIMAL_FORMAT
           
private static java.lang.String LEVEL
           
private static java.lang.String LEVEL_LESS
           
private static java.lang.String LEVEL_MORE
           
private static Log LOG
           
private static java.lang.String STYLE_CAPTION
           
private static java.lang.String STYLE_DATA
           
private static java.lang.String STYLE_NO_DATA
           
private static java.text.DateFormat TIME_FORMAT
          HH:mm:ss
protected static java.lang.String TYPE
           
protected static java.lang.String TYPE_ACTIVITY_LEVEL
           
protected static java.lang.String TYPE_CONNECTIONS
           
 
Constructor Summary
AdminServlet()
           
 
Method Summary
private  void closeHtml(ServletOutputStream out)
           
private  void closeTable(ServletOutputStream out)
           
private  void doDefinition(ServletOutputStream out, java.lang.String alias, java.lang.String link)
           
private  void doDrillDownConnection(ServletOutputStream out, ConnectionInfoIF drillDownConnection, java.lang.String link)
           
protected  void doGet(HttpServletRequest request, HttpServletResponse response)
           
private  void doList(ServletOutputStream out, java.lang.String alias, java.lang.String link, java.lang.String level)
           
protected  void doPost(HttpServletRequest request, HttpServletResponse response)
           
private  void doSnapshot(ServletOutputStream out, java.lang.String alias, java.lang.String link, java.lang.String level, java.lang.String connectionId)
           
private  void doSnapshotDetails(ServletOutputStream out, java.lang.String alias, SnapshotIF snapshot, java.lang.String link, java.lang.String connectionId)
           
private  void doStatistics(ServletOutputStream out, java.lang.String alias, java.lang.String link)
           
private  void doStats(ServletOutputStream out, java.lang.String alias, java.lang.String link, java.lang.String level, java.lang.String connectionId)
           
private  void drawBarChart(java.lang.StringBuffer out, java.lang.String[] colours, int[] lengths)
           
private  java.lang.String formatMilliseconds(int time)
          Express time in an easy to read HH:mm:ss format
private  void openHtml(ServletOutputStream out)
           
private  void openTable(ServletOutputStream out)
           
private  void printDefinitionEntry(ServletOutputStream out, java.lang.String name, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

ACTION_LIST

protected static final java.lang.String ACTION_LIST
See Also:
Constant Field Values

ACTION_STATS

private static final java.lang.String ACTION_STATS
See Also:
Constant Field Values

ACTION_CHART

protected static final java.lang.String ACTION_CHART
See Also:
Constant Field Values

TYPE

protected static final java.lang.String TYPE
See Also:
Constant Field Values

TYPE_CONNECTIONS

protected static final java.lang.String TYPE_CONNECTIONS
See Also:
Constant Field Values

TYPE_ACTIVITY_LEVEL

protected static final java.lang.String TYPE_ACTIVITY_LEVEL
See Also:
Constant Field Values

STYLE_CAPTION

private static final java.lang.String STYLE_CAPTION
See Also:
Constant Field Values

STYLE_DATA

private static final java.lang.String STYLE_DATA
See Also:
Constant Field Values

STYLE_NO_DATA

private static final java.lang.String STYLE_NO_DATA
See Also:
Constant Field Values

TIME_FORMAT

private static final java.text.DateFormat TIME_FORMAT
HH:mm:ss

See Also:
formatMilliseconds(int)

DATE_FORMAT

private static final java.text.DateFormat DATE_FORMAT

DECIMAL_FORMAT

private static final java.text.DecimalFormat DECIMAL_FORMAT

LEVEL

private static final java.lang.String LEVEL
See Also:
Constant Field Values

LEVEL_MORE

private static final java.lang.String LEVEL_MORE
See Also:
Constant Field Values

LEVEL_LESS

private static final java.lang.String LEVEL_LESS
See Also:
Constant Field Values

ACTION

private static final java.lang.String ACTION
See Also:
Constant Field Values

ALIAS

private static final java.lang.String ALIAS
See Also:
Constant Field Values

CONNECTION_ID

private static final java.lang.String CONNECTION_ID
See Also:
Constant Field Values
Constructor Detail

AdminServlet

public AdminServlet()
Method Detail

doPost

protected void doPost(HttpServletRequest request,
                      HttpServletResponse response)
               throws ServletException,
                      java.io.IOException
Throws:
ServletException
java.io.IOException

doGet

protected void doGet(HttpServletRequest request,
                     HttpServletResponse response)
              throws ServletException,
                     java.io.IOException
Throws:
ServletException
java.io.IOException

doStats

private void doStats(ServletOutputStream out,
                     java.lang.String alias,
                     java.lang.String link,
                     java.lang.String level,
                     java.lang.String connectionId)
              throws ProxoolException,
                     java.io.IOException
Throws:
ProxoolException
java.io.IOException

doStatistics

private void doStatistics(ServletOutputStream out,
                          java.lang.String alias,
                          java.lang.String link)
                   throws ProxoolException,
                          java.io.IOException
Throws:
ProxoolException
java.io.IOException

drawBarChart

private void drawBarChart(java.lang.StringBuffer out,
                          java.lang.String[] colours,
                          int[] lengths)

doDefinition

private void doDefinition(ServletOutputStream out,
                          java.lang.String alias,
                          java.lang.String link)
                   throws ProxoolException,
                          java.io.IOException
Throws:
ProxoolException
java.io.IOException

doSnapshot

private void doSnapshot(ServletOutputStream out,
                        java.lang.String alias,
                        java.lang.String link,
                        java.lang.String level,
                        java.lang.String connectionId)
                 throws java.io.IOException,
                        ProxoolException
Throws:
java.io.IOException
ProxoolException

doSnapshotDetails

private void doSnapshotDetails(ServletOutputStream out,
                               java.lang.String alias,
                               SnapshotIF snapshot,
                               java.lang.String link,
                               java.lang.String connectionId)
                        throws java.io.IOException
Throws:
java.io.IOException

doDrillDownConnection

private void doDrillDownConnection(ServletOutputStream out,
                                   ConnectionInfoIF drillDownConnection,
                                   java.lang.String link)
                            throws java.io.IOException
Throws:
java.io.IOException

openHtml

private void openHtml(ServletOutputStream out)
               throws java.io.IOException
Throws:
java.io.IOException

closeHtml

private void closeHtml(ServletOutputStream out)
                throws java.io.IOException
Throws:
java.io.IOException

openTable

private void openTable(ServletOutputStream out)
                throws java.io.IOException
Throws:
java.io.IOException

closeTable

private void closeTable(ServletOutputStream out)
                 throws java.io.IOException
Throws:
java.io.IOException

printDefinitionEntry

private void printDefinitionEntry(ServletOutputStream out,
                                  java.lang.String name,
                                  java.lang.String value)
                           throws java.io.IOException
Throws:
java.io.IOException

doList

private void doList(ServletOutputStream out,
                    java.lang.String alias,
                    java.lang.String link,
                    java.lang.String level)
             throws java.io.IOException,
                    ProxoolException
Throws:
java.io.IOException
ProxoolException

formatMilliseconds

private java.lang.String formatMilliseconds(int time)
Express time in an easy to read HH:mm:ss format

Parameters:
time - in milliseconds
Returns:
time (e.g. 180000 = 00:30:00)
See Also:
TIME_FORMAT