org.logicalcobwebs.proxool.configuration
类 XMLConfigurator

java.lang.Object
  继承者 org.xml.sax.helpers.DefaultHandler
      继承者 org.logicalcobwebs.proxool.configuration.XMLConfigurator
所有已实现的接口:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class XMLConfigurator
extends org.xml.sax.helpers.DefaultHandler

A SAX 2 ContentHandler that can configure Proxool from an XML source.

This is just a ContentHandler, so you must associate it with a SAX parser for it to actually do anything. If you have JAXP available JAXPConfigurator will do this for you.

Properties that you pass on to the delegate driver have to be treated specially. They must be contained within a <driver-properties> element.

See the Proxool properties for documentation on the available configuration properties.

Example configuration:
 <proxool>
     <alias>apple</alias>
     <driver-url>jdbc:hsqldb:.</driver-url>
     <driver-class>org.hsqldb.jdbcDriver</driver-class>
     <driver-properties>
         <property name="user" value="abc" />
         <property name="password" value="def" />
     </driver-properties>
     <house-keeping-sleep-time>40000</house-keeping-sleep-time>
     <house-keeping-test-sql>select CURRENT_DATE</house-keeping-test-sql>
     <maximum-connection-count>10</maximum-connection-count>
     <minimum-connection-count>3</minimum-connection-count>
     <maximum-connection-lifetime>18000000</maximum-connection-lifetime> <!-- 5 hours -->
     <simultaneous-build-throttle>5</simultaneous-build-throttle>
     <recently-started-threshold>40000</recently-started-threshold>
     <overload-without-refusal-lifetime>50000</overload-without-refusal-lifetime>
     <maximum-active-time>60000</maximum-active-time>
     <verbose>true</verbose>
     <trace>true</trace>
     <fatal-sql-exception>ORA-1234</fatal-sql-exception>
     <prototype-count>2</prototype-count>
 </proxool>
 
When the parser reaches the end of the <proxool> element the pool is automatically registered. You can contain the <proxool> element in any other elements as you wish. And the <proxool> element can occur as many times as you wish. This allows you to use an XML file that configures your whole application as the source. This configurator will ignore everything apart from the elements contained within the <proxool> element.

Validation
A couple of additional steps are required if you want your SAX parser to validate your Proxool xml confguration:

This class is not thread safe.

版本:
$Revision: 1.18 $, $Date: 2006/01/18 14:39:58 $
作者:
billhorsman, $Author: billhorsman $ (current maintainer)

构造方法摘要
XMLConfigurator()
           
 
方法摘要
 void characters(char[] chars, int start, int length)
           
 void endElement(String uri, String lname, String qname)
           
 void error(SAXParseException e)
           
 void fatalError(SAXParseException e)
           
 void startElement(String uri, String lname, String qname, Attributes attributes)
           
 void warning(SAXParseException e)
           
 
从类 org.xml.sax.helpers.DefaultHandler 继承的方法
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

XMLConfigurator

public XMLConfigurator()
方法详细信息

startElement

public void startElement(String uri,
                         String lname,
                         String qname,
                         Attributes attributes)
                  throws SAXException
指定者:
接口 ContentHandler 中的 startElement
覆盖:
org.xml.sax.helpers.DefaultHandler 中的 startElement
抛出:
SAXException
另请参见:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

characters

public void characters(char[] chars,
                       int start,
                       int length)
                throws SAXException
指定者:
接口 ContentHandler 中的 characters
覆盖:
org.xml.sax.helpers.DefaultHandler 中的 characters
抛出:
SAXException
另请参见:
ContentHandler.characters(char[], int, int)

endElement

public void endElement(String uri,
                       String lname,
                       String qname)
                throws SAXException
指定者:
接口 ContentHandler 中的 endElement
覆盖:
org.xml.sax.helpers.DefaultHandler 中的 endElement
抛出:
SAXException
另请参见:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

warning

public void warning(SAXParseException e)
             throws SAXException
指定者:
接口 ErrorHandler 中的 warning
覆盖:
org.xml.sax.helpers.DefaultHandler 中的 warning
抛出:
SAXException
另请参见:
ErrorHandler.warning(SAXParseException)

error

public void error(SAXParseException e)
           throws SAXException
指定者:
接口 ErrorHandler 中的 error
覆盖:
org.xml.sax.helpers.DefaultHandler 中的 error
抛出:
SAXException
另请参见:
ErrorHandler.error(SAXParseException)

fatalError

public void fatalError(SAXParseException e)
                throws SAXException
指定者:
接口 ErrorHandler 中的 fatalError
覆盖:
org.xml.sax.helpers.DefaultHandler 中的 fatalError
抛出:
SAXException
另请参见:
ErrorHandler.fatalError(SAXParseException)


Copyright © 2014. All rights reserved.