Package org.forgerock.openig.sql
Class JdbcDataSourceHeaplet
- java.lang.Object
-
- org.forgerock.openig.heap.GenericHeaplet
-
- org.forgerock.openig.sql.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
config { "jdbcUrl" : "jdbc:h2:mem:testdb", "username" : "testuser", "passwordSecretId : "database.password", "secretsProvider" : "MySecretsProvider" }
config { "dataSourceClassName" : "org.h2.jdbcx.JdbcDataSource", "username" : "testuser", "passwordSecretId : "database.password", "secretsProvider" : "MySecretsProvider", "properties" : { "url" : "jdbc:h2:mem:testdb" } }
-
-
Constructor Summary
Constructors Constructor Description JdbcDataSourceHeaplet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
create()
Called to request the heaplet create an object.void
destroy()
Called to indicate that the object created by the heaplet is going to be dereferenced.-
Methods inherited from class org.forgerock.openig.heap.GenericHeaplet
create, endpointRegistry, evaluatedWithHeapProperties, expression, getConfig, getHeap, getSecretService, getSecretsProvider, getType, initialBindings, meterRegistryHolder, start
-
-
-
-
Method Detail
-
create
public Object create() throws HeapException
Description copied from class:GenericHeaplet
Called to request the heaplet create an object. Called byHeaplet.create(Name, JsonValue, Heap)
after initializing the protected field members. Implementations should parse configuration but not acquire resources, start threads, or log any initialization messages. These tasks should be performed by theGenericHeaplet.start()
method.- Specified by:
create
in classGenericHeaplet
- Returns:
- The created object.
- Throws:
HeapException
- if an exception occurred during creation of the heap object or any of its dependencies.
-
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 interfaceHeaplet
- Overrides:
destroy
in classGenericHeaplet
-
-