Class DefaultPoolsInfo

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.kawanfw.sql.api.server.DefaultPoolsInfo
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class DefaultPoolsInfo
extends javax.servlet.http.HttpServlet
Allows to display current JDBC pool status and info for each database.
Includes 3 methods to modify the JDBC pools.

Values are accessed using methods in org.apache.tomcat.jdbc.pool.DataSource class.
The DataSource instances are retrieved in this servlet using DataSourceStore.getDataSources() static method.

See Tomcat JDBC Pool DataSourceProxy for the meaning of the displayed values.

It is also possible to interact with the pool and call three DataSource set methods:
  • DataSource.setMinIdle(int).
  • DataSource.setMaxIdle(int).
  • DataSource.setMaxActive(int).

To call the servlet from a browser, cURL or a program:
http(s)://host:port/default_pools_info?password=<password_value>

Where:
password_value = value of "password" property stored in user.home/.kawansoft/default_pools_info.properties

To modify the pool for a database:
http(s)://host:port/default_pools_info?password=<password_value>&database=database_name&set_method=int_value

Where:
  • database_name=the database as defined in aceql-server.properties. If not specified, set_method will be applied to all databases.
  • set_method = setMinIdle or setMaxIdle or setMaxActive.
  • int_value= the number to pass to the set_method.

Note that You can create your own servlet if you want to develop you own interaction with the JDBC pools.
Just add you servlet name, class and url-pattern in the Servlets Section of your aceql-server.properties file.

Since:
1.0
Author:
Nicolas de Pomereu
See Also:
DataSourceProxy, Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    DefaultPoolsInfo()  
  • Method Summary

    Modifier and Type Method Description
    void doGet​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  

    Methods inherited from class javax.servlet.http.HttpServlet

    service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultPoolsInfo

      public DefaultPoolsInfo()
  • Method Details

    • doGet

      public void doGet​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
      Throws:
      IOException