Interface HikariConfigMXBean

  • All Known Implementing Classes:
    HikariConfig, HikariDataSource

    public interface HikariConfigMXBean
    The javax.management MBean for a Hikari pool configuration.
    Author:
    Brett Wooldridge
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getCatalog()
      Get the default catalog name to be set on connections.
      long getConnectionTimeout()
      Get the maximum number of milliseconds that a client will wait for a connection from the pool.
      long getIdleTimeout()
      This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool.
      long getLeakDetectionThreshold()
      This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak.
      int getMaximumPoolSize()
      The property controls the maximum number of connections that HikariCP will keep in the pool, including both idle and in-use connections.
      long getMaxLifetime()
      This property controls the maximum lifetime of a connection in the pool.
      int getMinimumIdle()
      The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections.
      java.lang.String getPoolName()
      The name of the connection pool.
      long getValidationTimeout()
      Get the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.
      void setCatalog​(java.lang.String catalog)
      Set the default catalog name to be set on connections.
      void setConnectionTimeout​(long connectionTimeoutMs)
      Set the maximum number of milliseconds that a client will wait for a connection from the pool.
      void setIdleTimeout​(long idleTimeoutMs)
      This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool.
      void setLeakDetectionThreshold​(long leakDetectionThresholdMs)
      This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak.
      void setMaximumPoolSize​(int maxPoolSize)
      The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections.
      void setMaxLifetime​(long maxLifetimeMs)
      This property controls the maximum lifetime of a connection in the pool.
      void setMinimumIdle​(int minIdle)
      The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections.
      void setPassword​(java.lang.String password)
      Set the password used for authentication.
      void setUsername​(java.lang.String username)
      Set the username used for authentication.
      void setValidationTimeout​(long validationTimeoutMs)
      Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.
    • Method Detail

      • getConnectionTimeout

        long getConnectionTimeout()
        Get the maximum number of milliseconds that a client will wait for a connection from the pool. If this time is exceeded without a connection becoming available, a SQLException will be thrown from DataSource.getConnection().
        Returns:
        the connection timeout in milliseconds
      • setConnectionTimeout

        void setConnectionTimeout​(long connectionTimeoutMs)
        Set the maximum number of milliseconds that a client will wait for a connection from the pool. If this time is exceeded without a connection becoming available, a SQLException will be thrown from DataSource.getConnection().
        Parameters:
        connectionTimeoutMs - the connection timeout in milliseconds
      • getValidationTimeout

        long getValidationTimeout()
        Get the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.
        Returns:
        the validation timeout in milliseconds
      • setValidationTimeout

        void setValidationTimeout​(long validationTimeoutMs)
        Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.
        Parameters:
        validationTimeoutMs - the validation timeout in milliseconds
      • getIdleTimeout

        long getIdleTimeout()
        This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool. Whether a connection is retired as idle or not is subject to a maximum variation of +30 seconds, and average variation of +15 seconds. A connection will never be retired as idle before this timeout. A value of 0 means that idle connections are never removed from the pool.
        Returns:
        the idle timeout in milliseconds
      • setIdleTimeout

        void setIdleTimeout​(long idleTimeoutMs)
        This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool. Whether a connection is retired as idle or not is subject to a maximum variation of +30 seconds, and average variation of +15 seconds. A connection will never be retired as idle before this timeout. A value of 0 means that idle connections are never removed from the pool.
        Parameters:
        idleTimeoutMs - the idle timeout in milliseconds
      • getLeakDetectionThreshold

        long getLeakDetectionThreshold()
        This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak. A value of 0 means leak detection is disabled.
        Returns:
        the connection leak detection threshold in milliseconds
      • setLeakDetectionThreshold

        void setLeakDetectionThreshold​(long leakDetectionThresholdMs)
        This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak. A value of 0 means leak detection is disabled.
        Parameters:
        leakDetectionThresholdMs - the connection leak detection threshold in milliseconds
      • getMaxLifetime

        long getMaxLifetime()
        This property controls the maximum lifetime of a connection in the pool. When a connection reaches this timeout, even if recently used, it will be retired from the pool. An in-use connection will never be retired, only when it is idle will it be removed.
        Returns:
        the maximum connection lifetime in milliseconds
      • setMaxLifetime

        void setMaxLifetime​(long maxLifetimeMs)
        This property controls the maximum lifetime of a connection in the pool. When a connection reaches this timeout, even if recently used, it will be retired from the pool. An in-use connection will never be retired, only when it is idle will it be removed.
        Parameters:
        maxLifetimeMs - the maximum connection lifetime in milliseconds
      • getMinimumIdle

        int getMinimumIdle()
        The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections. If the idle connections dip below this value, HikariCP will make a best effort to restore them quickly and efficiently.
        Returns:
        the minimum number of connections in the pool
      • setMinimumIdle

        void setMinimumIdle​(int minIdle)
        The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections. If the idle connections dip below this value, HikariCP will make a best effort to restore them quickly and efficiently.
        Parameters:
        minIdle - the minimum number of idle connections in the pool to maintain
      • getMaximumPoolSize

        int getMaximumPoolSize()
        The property controls the maximum number of connections that HikariCP will keep in the pool, including both idle and in-use connections.
        Returns:
        the maximum number of connections in the pool
      • setMaximumPoolSize

        void setMaximumPoolSize​(int maxPoolSize)
        The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections. Basically this value will determine the maximum number of actual connections to the database backend.

        When the pool reaches this size, and no idle connections are available, calls to getConnection() will block for up to connectionTimeout milliseconds before timing out.

        Parameters:
        maxPoolSize - the maximum number of connections in the pool
      • setPassword

        void setPassword​(java.lang.String password)
        Set the password used for authentication. Changing this at runtime will apply to new connections only. Altering this at runtime only works for DataSource-based connections, not Driver-class or JDBC URL-based connections.
        Parameters:
        password - the database password
      • setUsername

        void setUsername​(java.lang.String username)
        Set the username used for authentication. Changing this at runtime will apply to new connections only. Altering this at runtime only works for DataSource-based connections, not Driver-class or JDBC URL-based connections.
        Parameters:
        username - the database username
      • getPoolName

        java.lang.String getPoolName()
        The name of the connection pool.
        Returns:
        the name of the connection pool
      • getCatalog

        java.lang.String getCatalog()
        Get the default catalog name to be set on connections.
        Returns:
        the default catalog name
      • setCatalog

        void setCatalog​(java.lang.String catalog)
        Set the default catalog name to be set on connections.

        WARNING: THIS VALUE SHOULD ONLY BE CHANGED WHILE THE POOL IS SUSPENDED, AFTER CONNECTIONS HAVE BEEN EVICTED.

        Parameters:
        catalog - the catalog name, or null