Class DataSourceService

  • All Implemented Interfaces:
    Supplier<io.agroal.api.AgroalDataSource>, org.jboss.msc.Service, org.jboss.msc.service.Service<io.agroal.api.AgroalDataSource>, org.jboss.msc.value.Value<io.agroal.api.AgroalDataSource>

    public class DataSourceService
    extends Object
    implements org.jboss.msc.service.Service<io.agroal.api.AgroalDataSource>, Supplier<io.agroal.api.AgroalDataSource>
    Defines an extension to provide DataSources based on the Agroal project
    Author:
    Luis Barreiro
    • Field Summary

      • Fields inherited from interface org.jboss.msc.service.Service

        NULL
    • Constructor Summary

      Constructors 
      Constructor Description
      DataSourceService​(Consumer<io.agroal.api.AgroalDataSource> consumer, Supplier<Class> driverSupplier, Supplier<org.wildfly.security.auth.client.AuthenticationContext> authenticationContextSupplier, Supplier<org.wildfly.common.function.ExceptionSupplier<org.wildfly.security.credential.source.CredentialSource,​Exception>> credentialSourceSupplier, Supplier<jakarta.transaction.TransactionSynchronizationRegistry> transactionSynchronizationRegistrySupplier, String dataSourceName, String jndiName, boolean jta, boolean connectable, boolean xa, io.agroal.api.configuration.supplier.AgroalDataSourceConfigurationSupplier dataSourceConfiguration)  
    • Constructor Detail

      • DataSourceService

        public DataSourceService​(Consumer<io.agroal.api.AgroalDataSource> consumer,
                                 Supplier<Class> driverSupplier,
                                 Supplier<org.wildfly.security.auth.client.AuthenticationContext> authenticationContextSupplier,
                                 Supplier<org.wildfly.common.function.ExceptionSupplier<org.wildfly.security.credential.source.CredentialSource,​Exception>> credentialSourceSupplier,
                                 Supplier<jakarta.transaction.TransactionSynchronizationRegistry> transactionSynchronizationRegistrySupplier,
                                 String dataSourceName,
                                 String jndiName,
                                 boolean jta,
                                 boolean connectable,
                                 boolean xa,
                                 io.agroal.api.configuration.supplier.AgroalDataSourceConfigurationSupplier dataSourceConfiguration)
    • Method Detail

      • start

        public void start​(org.jboss.msc.service.StartContext context)
                   throws org.jboss.msc.service.StartException
        Specified by:
        start in interface org.jboss.msc.Service
        Throws:
        org.jboss.msc.service.StartException
      • stop

        public void stop​(org.jboss.msc.service.StopContext context)
        Specified by:
        stop in interface org.jboss.msc.Service
      • get

        public io.agroal.api.AgroalDataSource get()
        Specified by:
        get in interface Supplier<io.agroal.api.AgroalDataSource>