Class JdbcDataSourceHeaplet

  • All Implemented Interfaces:
    Heaplet

    public class JdbcDataSourceHeaplet
    extends GenericHeaplet
    Creates and initializes a JDBC data source in a heap environment.
     
     config {
       "poolName"            : String                    [OPTIONAL  - pool name]
       "jdbcUrl"             : Configuration expression  [OPTIONAL* - database JDBC URL]
       "dataSourceClassName" : Configuration expression  [OPTIONAL* - database data source class name]
       "driverClassName"     : Configuration expression  [OPTIONAL# - database driver class name, if required]
       "username"            : Configuration expression  [OPTIONAL  - database user to authenticate with]
       "passwordSecretId     : password Secret ID        [OPTIONAL  - database password to authenticate with]
       "secretsProvider"     : Secrets Provider          [OPTIONAL  - secrets provider to use to retrieve password]
       "properties"          : object {                  [OPTIONAL  - data source-specific properties:
          ...                                                         Consult data source-specific property settings
       },
       "executor             : executor                  [OPTIONAL  - executor used to perform housekeeping, defaults to
                                                                      heap {@literal SCHEDULED_EXECUTOR_SERVICE_HEAP_KEY}
     }
     
     
    • * Either 'jdbcUrl' or 'dataSourceClassName' should be used depending on the underlying data source support
    • # 'driverClassName' may need to be specified for older JDBC drivers
    Example configuration using 'jdbcUrl':
     
     config {
       "jdbcUrl"             : "jdbc:h2:mem:testdb",
       "username"            : "testuser",
       "passwordSecretId     : "database.password",
       "secretsProvider"     : "MySecretsProvider"
     }
     
     
    Example configuration using 'dataSourceName' with 'url' property:
     
     config {
       "dataSourceClassName" : "org.h2.jdbcx.JdbcDataSource",
       "username"            : "testuser",
       "passwordSecretId     : "database.password",
       "secretsProvider"     : "MySecretsProvider",
       "properties" : {
          "url"              : "jdbc:h2:mem:testdb"
       }
     }
     
     
    • Constructor Detail

      • JdbcDataSourceHeaplet

        public JdbcDataSourceHeaplet()
    • Method Detail

      • destroy

        public void destroy()
        Description copied from interface: Heaplet
        Called to indicate that the object created by the heaplet is going to be dereferenced. This gives the heaplet an opportunity to free any resources that are being held prior to its dereference.
        Specified by:
        destroy in interface Heaplet
        Overrides:
        destroy in class GenericHeaplet