Interface DataSrc


public interface DataSrc
Represents a data source corresponding to an external resource, serving as a factory for DataConn instances or managing a connection pool.

Implementations encapsulate resource initialization, connection creation, and cleanup for external systems such as relational databases, caches, or messaging services. Data sources can be registered globally via Globals.uses(String, DataSrc) or locally via LogicRunner.uses(String, DataSrc).

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this data source and releases any resources or connection pools it manages.
    Creates a new DataConn instance backed by this data source.
    void
    Sets up this data source before connections are created from it.
  • Method Details

    • setup

      void setup(AsyncGroup ag) throws com.github.sttk.errs.Err
      Sets up this data source before connections are created from it.

      Asynchronous setup tasks may be registered with the provided AsyncGroup.

      Parameters:
      ag - the asynchronous group for registering background setup tasks
      Throws:
      com.github.sttk.errs.Err - if setting up this data source fails
    • close

      void close()
      Closes this data source and releases any resources or connection pools it manages.
    • createDataConn

      DataConn createDataConn() throws com.github.sttk.errs.Err
      Creates a new DataConn instance backed by this data source.
      Returns:
      a newly created DataConn
      Throws:
      com.github.sttk.errs.Err - if creating the data connection fails