org.qi4j.library.sql.datasource

## Class AbstractDataSourceServiceImporterMixin<PooledDataSourceType extends DataSource>

- java.lang.Object
- - org.qi4j.library.sql.datasource.AbstractDataSourceServiceImporterMixin<PooledDataSourceType>

- All Implemented Interfaces:
    ServiceImporter<DataSource>, DataSourceServiceImporterActivation
  Direct Known Subclasses:
    BoneCPDataSourceServiceImporter.Mixin, DBCPDataSourceServiceImporter.Mixin

      public abstract class AbstractDataSourceServiceImporterMixin<PooledDataSourceType extends DataSource>
      extends Object
      implements ServiceImporter<DataSource>, DataSourceServiceImporterActivation

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.qi4j.library.sql.datasource.DataSourceServiceImporterActivation

      `DataSourceServiceImporterActivation.Activator`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.slf4j.Logger` | `LOGGER`
    `protected Module` | `module`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractDataSourceServiceImporterMixin()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DataSource` | `importService(ImportedServiceDescriptor importedServiceDescriptor)` Imports an instance of the service type described in the service descriptor.
    `boolean` | `isAvailable(DataSource instance)` Ask if the service is available or not.
    `protected abstract void` | `passivateDataSourcePool(PooledDataSourceType dataSourcePool)`
    `void` | `passivateDataSourceService()`
    `protected abstract PooledDataSourceType` | `setupDataSourcePool(DataSourceConfigurationValue configuration)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOGGER

          protected static final org.slf4j.Logger LOGGER

    - #### module

          @Structure
          protected Module module

  - ### Constructor Detail

    - #### AbstractDataSourceServiceImporterMixin

          public AbstractDataSourceServiceImporterMixin()

  - ### Method Detail

    - #### passivateDataSourceService

          public final void passivateDataSourceService()
                                                throws Exception

      Specified by:
        `passivateDataSourceService` in interface `DataSourceServiceImporterActivation`
      Throws:
        `Exception`

    - #### importService

          public final DataSource importService(ImportedServiceDescriptor importedServiceDescriptor)
                                         throws ServiceImporterException

      Description copied from interface: `ServiceImporter`
      Imports an instance of the service type described in the service descriptor.
      Specified by:
        `importService` in interface `ServiceImporter<DataSource>`
      Parameters:
        `importedServiceDescriptor` - The service descriptor.
      Returns:
        The imported service instance.
      Throws:
        `ServiceImporterException` - if import failed.

    - #### isAvailable

          public final boolean isAvailable(DataSource instance)

      Description copied from interface: `ServiceImporter`
      Ask if the service is available or not.
      Specified by:
        `isAvailable` in interface `ServiceImporter<DataSource>`
      Parameters:
        `instance` - the instance to be checked
      Returns:
        true if the service is available, false if not

    - #### setupDataSourcePool

          protected abstract PooledDataSourceType setupDataSourcePool(DataSourceConfigurationValue configuration)
                                                                                  throws Exception

      Throws:
        `Exception`

    - #### passivateDataSourcePool

          protected abstract void passivateDataSourcePool(PooledDataSourceType dataSourcePool)
                                                   throws Exception

      Throws:
        `Exception`