|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object HttpServlet org.logicalcobwebs.proxool.admin.servlet.AdminServlet
public class AdminServlet
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> <init-param> <param-name>output</param-name> <param-value>full|simple</param-value> </init-param> <init-param> <param-name>cssFile</param-name> <param-value>/my_path/my.css</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>Admin</servlet-name> <url-pattern>/proxool</url-pattern> </servlet-mapping>Options:
Field Summary | |
---|---|
private static java.lang.String |
ALIAS
The request parameter name that defines the pool |
private static java.lang.String |
CONNECTION_ID
If we are drilling down into a connection (on the snapshot tab then
this points to the ID we are
getting detailed information for. |
private static java.lang.String |
CORE_PROPERTY
Used as part of the CSS class |
private java.lang.String |
cssFile
A valid URLL that can be linked to to override default, inline CSS. |
private static java.text.DateFormat |
DATE_FORMAT
dd-MMM-yyyy HH:mm:ss |
private static java.text.DecimalFormat |
DECIMAL_FORMAT
|
private static java.lang.String |
DELEGATED_PROPERTY
Used as part of the CSS class |
private static java.lang.String |
DETAIL
|
private static java.lang.String |
DETAIL_LESS
|
private static java.lang.String |
DETAIL_MORE
|
private static Log |
LOG
|
private java.lang.String |
output
Either OUTPUT_FULL (default) or OUTPUT_SIMPLE |
static java.lang.String |
OUTPUT_FULL
OUtput full HTML including <HTML>, <HEAD> and <BODY> tags. |
static java.lang.String |
OUTPUT_SIMPLE
OUtput simple HTML excluding <HTML>, <HEAD> and <BODY> tags. |
private static java.lang.String |
SNAPSHOT
Used as part of the CSS class |
private static java.lang.String |
STANDARD_PROPERTY
Used as part of the CSS class |
private static java.lang.String |
STATISTIC
Used as part of the CSS class |
private static java.lang.String[] |
STATUS_CLASSES
The CSS class for a connection in different states: null available active offline |
private static java.lang.String |
TAB
The request parameter name that defines: TAB_DEFINITION (default)
TAB_SNAPSHOT
TAB_STATISTICS
|
private static java.lang.String |
TAB_DEFINITION
|
private static java.lang.String |
TAB_SNAPSHOT
|
private static java.lang.String |
TAB_STATISTICS
|
private static java.text.DateFormat |
TIME_FORMAT
HH:mm:ss |
Constructor Summary | |
---|---|
AdminServlet()
|
Method Summary | |
---|---|
private void |
closeHtml(ServletOutputStream out)
|
private void |
closeTable(ServletOutputStream out)
|
private void |
doDefinition(ServletOutputStream out,
ConnectionPoolDefinitionIF cpd)
Output the definition |
private void |
doDrillDownConnection(ServletOutputStream out,
ConnectionInfoIF drillDownConnection)
|
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response)
Show the details for a pool. |
private void |
doList(ServletOutputStream out,
java.lang.String alias,
java.lang.String tab,
java.lang.String link)
Output the list of available connection pools. |
protected void |
doPost(HttpServletRequest request,
HttpServletResponse response)
Delegate to #doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) |
private void |
doSnapshot(ServletOutputStream out,
ConnectionPoolDefinitionIF cpd,
java.lang.String link,
java.lang.String level,
java.lang.String connectionId)
Output a snapshot of the pool. |
private void |
doSnapshotDetails(ServletOutputStream out,
ConnectionPoolDefinitionIF cpd,
SnapshotIF snapshot,
java.lang.String link,
java.lang.String connectionId)
If we want a more detailed snapshot then #doSnapshot(javax.servlet.ServletOutputStream, org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF, String, String, String)
calls this too |
private void |
doStatistics(ServletOutputStream out,
StatisticsIF[] statisticsArray,
ConnectionPoolDefinitionIF cpd)
Output the statistics. |
private void |
doTabs(ServletOutputStream out,
java.lang.String alias,
java.lang.String link,
java.lang.String tab,
boolean statisticsAvailable,
boolean statisticsComingSoon)
Output the tabs that we are showing at the top of the page |
private void |
drawBarChart(java.lang.StringBuffer out,
java.lang.String[] colours,
int[] lengths)
We can draw a bar chart simply enough. |
private java.lang.String |
formatMilliseconds(int time)
Express time in an easy to read HH:mm:ss format |
private static java.lang.String |
getStatusClass(ConnectionInfoIF info)
What CSS class to use for a particular connection. |
void |
init(ServletConfig servletConfig)
|
private void |
openDataTable(ServletOutputStream out)
|
private void |
openHtml(ServletOutputStream out)
|
private void |
printDefinitionEntry(ServletOutputStream out,
java.lang.String name,
java.lang.String value,
java.lang.String type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Log LOG
private static final java.lang.String[] STATUS_CLASSES
public static final java.lang.String OUTPUT_FULL
output
,
configuration
,
Constant Field Valuespublic static final java.lang.String OUTPUT_SIMPLE
output
,
configuration
,
Constant Field Valuesprivate java.lang.String output
OUTPUT_FULL
(default) or OUTPUT_SIMPLE
configuration
private java.lang.String cssFile
configuration
private static final java.lang.String STATISTIC
private static final java.lang.String CORE_PROPERTY
private static final java.lang.String STANDARD_PROPERTY
private static final java.lang.String DELEGATED_PROPERTY
private static final java.lang.String SNAPSHOT
private static final java.text.DateFormat TIME_FORMAT
formatMilliseconds(int)
private static final java.text.DateFormat DATE_FORMAT
private static final java.text.DecimalFormat DECIMAL_FORMAT
private static final java.lang.String DETAIL
private static final java.lang.String DETAIL_MORE
private static final java.lang.String DETAIL_LESS
private static final java.lang.String TAB
TAB_DEFINITION
(default)TAB_SNAPSHOT
TAB_STATISTICS
private static final java.lang.String TAB_DEFINITION
TAB
,
Constant Field Valuesprivate static final java.lang.String TAB_SNAPSHOT
TAB
,
Constant Field Valuesprivate static final java.lang.String TAB_STATISTICS
TAB
,
Constant Field Valuesprivate static final java.lang.String ALIAS
private static final java.lang.String CONNECTION_ID
snapshot
tab then
this points to the ID
we are
getting detailed information for.
Constructor Detail |
---|
public AdminServlet()
Method Detail |
---|
public void init(ServletConfig servletConfig) throws ServletException
ServletException
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
ServletException
java.io.IOException
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
ServletException
java.io.IOException
private void doTabs(ServletOutputStream out, java.lang.String alias, java.lang.String link, java.lang.String tab, boolean statisticsAvailable, boolean statisticsComingSoon) throws java.io.IOException
out
- where to write the HTNL toalias
- the current poollink
- the URL to get back to this servlettab
- the active tabstatisticsAvailable
- whether statistics are available (true if configured and ready)statisticsComingSoon
- whether statistics will be available (true if configured but not ready yet)
java.io.IOException
private void doStatistics(ServletOutputStream out, StatisticsIF[] statisticsArray, ConnectionPoolDefinitionIF cpd) throws java.io.IOException
out
- where to write HTML tostatisticsArray
- the statistics we have ready to seecpd
- defines the connection
java.io.IOException
private void drawBarChart(java.lang.StringBuffer out, java.lang.String[] colours, int[] lengths)
out
- where to write the HTMLcolours
- the colur (CSS valid string) for each segmentlengths
- the length of each segment. Can be any size since the chart just takes up as much room
as possible as uses the relative length of each segment.private void doDefinition(ServletOutputStream out, ConnectionPoolDefinitionIF cpd) throws java.io.IOException
definition
out
- where to write the HTMLcpd
- the definition
java.io.IOException
private void doSnapshot(ServletOutputStream out, ConnectionPoolDefinitionIF cpd, java.lang.String link, java.lang.String level, java.lang.String connectionId) throws java.io.IOException, ProxoolException
snapshot
of the pool.
out
- where to write the HTMLcpd
- defines the poollink
- the URL back to this servletlevel
- either DETAIL_LESS
or DETAIL_MORE
connectionId
- the connection we want to drill into (optional)
java.io.IOException
ProxoolException
private void doSnapshotDetails(ServletOutputStream out, ConnectionPoolDefinitionIF cpd, SnapshotIF snapshot, java.lang.String link, java.lang.String connectionId) throws java.io.IOException
more
detailed snapshot
then #doSnapshot(javax.servlet.ServletOutputStream, org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF, String, String, String)
calls this too
out
- where to write the HTMLcpd
- defines the poolsnapshot
- snapshotlink
- the URL back to this servletconnectionId
- the connection we want to drill into (optional)connectionId
-
java.io.IOException
private static java.lang.String getStatusClass(ConnectionInfoIF info)
info
- so we know the ConnectionInfoIF.getStatus()
status
STATUS_CLASSES
private void doDrillDownConnection(ServletOutputStream out, ConnectionInfoIF drillDownConnection) throws java.io.IOException
java.io.IOException
private void openHtml(ServletOutputStream out) throws java.io.IOException
java.io.IOException
private void closeHtml(ServletOutputStream out) throws java.io.IOException
java.io.IOException
private void openDataTable(ServletOutputStream out) throws java.io.IOException
java.io.IOException
private void closeTable(ServletOutputStream out) throws java.io.IOException
java.io.IOException
private void printDefinitionEntry(ServletOutputStream out, java.lang.String name, java.lang.String value, java.lang.String type) throws java.io.IOException
java.io.IOException
private void doList(ServletOutputStream out, java.lang.String alias, java.lang.String tab, java.lang.String link) throws java.io.IOException
out
- where to write the HTMLalias
- identifies the current pooltab
- identifies the tab we are on so that changing pools doesn't change the tablink
- the URL back to this servlet
java.io.IOException
private java.lang.String formatMilliseconds(int time)
time
- in milliseconds
TIME_FORMAT
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |