Interface ConnectionPoolDefinitionIF


  • public interface ConnectionPoolDefinitionIF
    A full definition of everything to do with a connection. You can get one of these from ProxoolFacade.
     String alias = "myPool";
     ConnectionPoolDefinitionIF cpd = ProxoolFacade.getConnectionPoolDefinition(alias);
     
    If you want to update the definition you should either update the properties definition next time you ask for a connection or call Proxool directly.
    Version:
    $Revision: 1.23 $, $Date: 2007/06/19 11:33:35 $
    Author:
    billhorsman, $Author: billhorsman $ (current maintainer)
    • Method Detail

      • getHouseKeepingSleepTime

        long getHouseKeepingSleepTime()
        This is the time the house keeping thread sleeps for between checks. (milliseconds)
      • getMaximumConnectionCount

        int getMaximumConnectionCount()
        The maximum number of connections to the database
      • getMaximumConnectionLifetime

        long getMaximumConnectionLifetime()
        The maximum amount of time that a connection exists for before it is killed (recycled). (milliseconds)
      • getMaximumNewConnections

        int getMaximumNewConnections()
        Deprecated.
        use more descriptive getSimultaneousBuildThrottle() instead
        In order to prevent overloading, this is the maximum number of connections that you can have that are in the progress of being made. That is, ones we have started to make but haven't finished yet.
      • getSimultaneousBuildThrottle

        int getSimultaneousBuildThrottle()
        In order to prevent overloading, this is the maximum number of connections that you can have that are in the progress of being made. That is, ones we have started to make but haven't finished yet.
      • getMinimumConnectionCount

        int getMinimumConnectionCount()
        The minimum number of connections we will keep open, regardless of whether anyone needs them or not.
      • getName

        java.lang.String getName()
        Deprecated.
        use getAlias() instead.
      • getAlias

        java.lang.String getAlias()
        The name associated with this connection pool. This is how you identify this pool when you need to use it.
      • getPassword

        java.lang.String getPassword()
        The password to use to login to the database
      • getPrototypeCount

        int getPrototypeCount()
        This is the number of spare connections we will strive to have. So, if we have a prototypeCount of 5 but only 3 spare connections the prototyper will make an additional 2. This is important because it can take around a seconds to establish a connection, and if we are being very strict about killing connections when they get too old it happens a fair bit.
      • getUrl

        java.lang.String getUrl()
        This is the URL used to connect to the database. e.g. driver:@host:port:database.
      • getUser

        java.lang.String getUser()
      • getJdbcDriverVersion

        java.lang.String getJdbcDriverVersion()
      • getProperties

        java.util.Properties getProperties()
        Deprecated.
        use less ambiguous getDelegateProperties() instead
        Get all of the properties that are defined on the delegated driver.
        Returns:
        the delegate properties
      • getDriver

        java.lang.String getDriver()
      • getRecentlyStartedThreshold

        long getRecentlyStartedThreshold()
        As long as we have one connection that was started within this threshold then we consider the pool to be up. (That is, not down). This allows us to differentiate between having all the connections frozen and just being really busy.
      • getOverloadWithoutRefusalLifetime

        long getOverloadWithoutRefusalLifetime()
        This is the time in milliseconds after the last time that we refused a connection that we still consider ourselves to be overloaded. We have to do this because, even when overloaded, it's not impossible for the available connection count to be high and it's possible to be serving a lot of connections. Recognising an overload is easy (we refuse a connection) - it's recognising when we stop being overloaded that is hard. Hence this fudge :)
      • getMaximumActiveTime

        long getMaximumActiveTime()
        If the housekeeper comes across a thread that has been active for longer than this then it will kill it. So make sure you set this to a number bigger than your slowest expected response!
      • getDebugLevel

        int getDebugLevel()
        Deprecated.
        use isVerbose() instead
      • getFatalSqlExceptions

        java.util.Set getFatalSqlExceptions()
        Get the list of fatal SQL exception (Strings) fragments that will trigger the death of a Connection. All SQLExceptions are caught and tested for containing this text fragment. If it matches than this connection is considered useless and it is discarded. Regardless of what happens the exception is always thrown back to the user.
        Returns:
        the list of exception fragments (String)
        See Also:
        FATAL_SQL_EXCEPTIONS_DELIMITER
      • getHouseKeepingTestSql

        java.lang.String getHouseKeepingTestSql()
        The test SQL that we perform to see if a connection is alright. Should be fast and robust.
        Returns:
        house keeping test SQL
      • isTestBeforeUse

        boolean isTestBeforeUse()
        Whether we test each connection before it is served
        Returns:
        true if we do the test
        See Also:
        getHouseKeepingTestSql()
      • isTestAfterUse

        boolean isTestAfterUse()
        Whether we test each connection after it is closed (that is, returned to the pool)
        Returns:
        true if we do the test
        See Also:
        getHouseKeepingTestSql()
      • getCompleteUrl

        java.lang.String getCompleteUrl()
        The URL that was used to define this pool. For example: proxool:org.hsqldb.jdbcDriver:jdbc:hsqldb:test
        Returns:
        the complete url
      • isVerbose

        boolean isVerbose()
        If this is true then we start logging a lot of stuff everytime we serve a connection and everytime the house keeper and prototyper run. Be prepared for a lot of debug!
        Returns:
        true if in verbose mode
      • isTrace

        boolean isTrace()
        if this is true then we will log each execution. The SQL used and the execution time.
        Returns:
        true if we should log each execution
      • getStatistics

        java.lang.String getStatistics()
        The sample length (in seconds) when taking statistical information, or null to disable statistics. Default is null. You can comma delimit a series of periods. The suffix for the period is either "s" (seconds), "m" (minutes), "h" (hours) or "d" (days). For example: "15s,1h" would give two separate sample rates: every 15 seconds and every hour.
        Returns:
        statistics definition
      • getStatisticsLogLevel

        java.lang.String getStatisticsLogLevel()
        Whether statistics are logged as they are produced. Range: DEBUG, INFO, WARN, ERROR, FATAL. Default is null (no logging)
        Returns:
        statisticsLogLevel
      • getDelegateProperties

        java.util.Properties getDelegateProperties()
        Get all of the properties that are defined on the delegated driver.
        Returns:
        the delegate properties
      • getDelegateProperty

        java.lang.String getDelegateProperty​(java.lang.String name)
      • getFatalSqlExceptionWrapper

        java.lang.String getFatalSqlExceptionWrapper()
        If this is not-null then any fatal SQLException is wrapped up inside an instance of this class. If null, then the original exception is thrown. Range: any valid class name that is a subclass of SQLException or RuntimeException Default: null (original exception is thrown)
        Returns:
        the class name to use for fatal SQL exceptions
      • getInitialContextFactory

        java.lang.String getInitialContextFactory()
        JNDI property
        Returns:
        the initial context factory
      • getProviderUrl

        java.lang.String getProviderUrl()
        JNDI property
        Returns:
        provider URL
      • getSecurityAuthentication

        java.lang.String getSecurityAuthentication()
        JNDI property
        Returns:
        security authentication
      • getSecurityPrincipal

        java.lang.String getSecurityPrincipal()
        JNDI property
        Returns:
        security principal
      • getSecurityCredentials

        java.lang.String getSecurityCredentials()
        JNDI property
        Returns:
        security credentials
      • getJndiName

        java.lang.String getJndiName()
        JNDI property
        Returns:
        JNDI name
      • isJmx

        boolean isJmx()
        Indicate wether this pool should be registered with JMX or not.
        Returns:
        wether this pool should be registered with JMX or not.
      • getJmxAgentId

        java.lang.String getJmxAgentId()
        Get a comma separated list of JMX agent ids (as used by MBeanServerFactory.findMBeanServer(String agentId)) to register the pool to.
        Returns:
        a comma separated list of JMX agent ids (as used by MBeanServerFactory.findMBeanServer(String agentId)) to register the pool to.
      • getInjectableConnectionInterface

        java.lang.Class getInjectableConnectionInterface()
        The class name of an interface that should be injected everytime we make a Connection. Use this when you want to access methods on a concrete class in the vendor's Connection object that aren't declared in a public interface. Without this, the connection that gets served will only give you access to public interfaces (like Connection and any other vendor provided ones)
        Returns:
        the interface
      • getInjectableStatementInterface

        java.lang.Class getInjectableStatementInterface()
        The class name of an interface that should be injected everytime we make a Statement. Use this when you want to access methods on a concrete class in the vendor's Statement object that aren't declared in a public interface. Without this, the statement that is provided will only give you access to public interfaces (like Statement and any other vendor provided ones)
        Returns:
        the interface
      • getInjectablePreparedStatementInterface

        java.lang.Class getInjectablePreparedStatementInterface()
        The class name of an interface that should be injected everytime we make a PreparedStatement. Use this when you want to access methods on a concrete class in the vendor's PreparedStatement object that aren't declared in a public interface. Without this, the PreparedStatement that is provided will only give you access to public interfaces (like PreparedStatement and any other vendor provided ones)
        Returns:
        the interface
      • getInjectableCallableStatementInterface

        java.lang.Class getInjectableCallableStatementInterface()
        The class name of an interface that should be injected everytime we make a CallableStatement. Use this when you want to access methods on a concrete class in the vendor's CallableStatement object that aren't declared in a public interface. Without this, the CallableStatement that is provided will only give you access to public interfaces (like CallableStatement and any other vendor provided ones)
        Returns:
        the interface