org.logicalcobwebs.proxool.configuration
类 ServletConfigurator

java.lang.Object
  继承者 javax.servlet.GenericServlet
      继承者 javax.servlet.http.HttpServlet
          继承者 org.logicalcobwebs.proxool.configuration.ServletConfigurator
所有已实现的接口:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ServletConfigurator
extends javax.servlet.http.HttpServlet

Allows you to configure Proxool using a servlet. There are three different ways: The init parameters can either directly configure Proxool (in a similar fashion to the PropertyConfigurator) or they can point to separate XML or property files. For example:

1. XML file delegates to JAXPConfigurator passing in the filename. If the filename is not absolute then it is prepended with the application directory.

    <servlet>
        <servlet-name>ServletConfigurator</servlet-name>
        <servlet-class>org.logicalcobwebs.proxool.configuration.ServletConfigurator</servlet-class>
        <init-param>
            <param-name>xmlFile</param-name>
            <param-value>WEB-INF/proxool.xml</param-value>
        </init-param>
    </servlet>
 
2. Property file delegates to PropertyConfigurator passing in the filename. If the filename is not absolute then it is prepended with the application directory.
    <servlet>
        <servlet-name>ServletConfigurator</servlet-name>
        <servlet-class>org.logicalcobwebs.proxool.configuration.ServletConfigurator</servlet-class>
        <init-param>
            <param-name>propertyFile</param-name>
            <param-value>WEB-INF/proxool.properties</param-value>
        </init-param>
    </servlet>
 
3. Init parameters delegates to PropertyConfigurator by passing in a new Properties object based on the servlet's init parameters.
    <servlet>
        <servlet-name>ServletConfigurator</servlet-name>
        <servlet-class>org.logicalcobwebs.proxool.configuration.ServletConfigurator</servlet-class>
        <init-param>
            <param-name>jdbc-0.proxool.alias</param-name>
            <param-value>test</param-value>
        </init-param>
        <init-param>
            <param-name>jdbc-0.proxool.driver-url</param-name>
            <param-value>jdbc:hsqldb:.</param-value>
        </init-param>
        <init-param>
            <param-name>jdbc-0.proxool.driver-class</param-name>
            <param-value>org.hsqldb.jdbcDriver</param-value>
        </init-param>
    </servlet>
 

It will also automatically shutdown Proxool. See destroy().

从以下版本开始:
Proxool 0.7
版本:
$Revision: 1.7 $, $Date: 2006/01/18 14:39:58 $
作者:
bill, $Author: billhorsman $ (current maintainer)
另请参见:
序列化表格

构造方法摘要
ServletConfigurator()
           
 
方法摘要
 void destroy()
          Shuts down Proxool by removing all connection pools.
 void init(javax.servlet.ServletConfig servletConfig)
           
 
从类 javax.servlet.http.HttpServlet 继承的方法
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
从类 javax.servlet.GenericServlet 继承的方法
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ServletConfigurator

public ServletConfigurator()
方法详细信息

init

public void init(javax.servlet.ServletConfig servletConfig)
          throws javax.servlet.ServletException
指定者:
接口 javax.servlet.Servlet 中的 init
覆盖:
javax.servlet.GenericServlet 中的 init
抛出:
javax.servlet.ServletException

destroy

public void destroy()
Shuts down Proxool by removing all connection pools. If you want to disable this behaviour then use:
 <init-param>
   <param-name>autoShutdown</param-name>
   <param-value>false</param-value>
 </init-param>
 

指定者:
接口 javax.servlet.Servlet 中的 destroy
覆盖:
javax.servlet.GenericServlet 中的 destroy


Copyright © 2014. All rights reserved.