For the complete documentation index, see llms.txt. This page is also available as Markdown.

Datasource Service Events

These events occur around the lifecycle of datasources and the datasource service.

onDatasourceServiceStartup

This event is triggered immediately after the datasource service has started. You could use this event to register custom datasources after the service has started, for example.

Data Key
Type
Description

DatasourceService

Java class

Instance of the BoxLang DatasourceService

Example

class myDatasourceListener {
    function onDatasourceServiceStartup( struct data ) {
        println("Datasource service is starting up");
        println( data.datasourceService.getNames() );
    }
}

onDatasourceServiceShutdown

This event is triggered immediately prior to datasource service shutdown. You could use this event to perform any cleanup on custom datasources, for example.

Data Key
Type
Description

DatasourceService

Java class

Instance of the BoxLang DatasourceService

Example

onDatasourceStartup

This event is triggered immediately prior to datasource startup. You can listen to this event to perform any last-minute configuration tweaks on the datasource before it is started.

Data Key
Type
Description

name

String

Datasource name

properties

Struct

Datasource configuration properties

config

Java class

Instance of the DatasourceConfig class, which stores all configuration for this datasource.

Example

onDatasourceConfigLoad

This event is triggered immediately prior to datasource configuration load. You can use this event to modify the datasource configuration prior to processing

Data Key
Type
Description

name

String

Datasource name

properties

Struct

Datasource configuration properties

Example

onDatasourceInitialized

This event is triggered after the datasource configuration has been loaded and processed but before the HikariCP connection pool is established. This interception point gives modules and interceptors full access to the raw HikariCP configuration for advanced customization — connection pool sizing, statement caching, timeouts, and any other HikariCP-specific settings.

Data Key
Type
Description

name

String

Datasource name

properties

Struct

Datasource configuration properties

hikariConfig

Java class

The raw com.zaxxer.hikari.HikariConfig instance, fully configured but not yet used to create a pool

Example

Last updated

Was this helpful?