org.qi4j.library.sql.datasource
Class AbstractDataSourceServiceImporterMixin<PooledDataSourceType extends javax.sql.DataSource>

java.lang.Object
  extended by org.qi4j.library.sql.datasource.AbstractDataSourceServiceImporterMixin<PooledDataSourceType>
All Implemented Interfaces:
ServiceImporter<javax.sql.DataSource>, DataSourceServiceImporterActivation
Direct Known Subclasses:
BoneCPDataSourceServiceImporter.Mixin, C3P0DataSourceServiceImporter.Mixin, DBCPDataSourceServiceImporter.Mixin

public abstract class AbstractDataSourceServiceImporterMixin<PooledDataSourceType extends javax.sql.DataSource>
extends java.lang.Object
implements ServiceImporter<javax.sql.DataSource>, DataSourceServiceImporterActivation


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.qi4j.library.sql.datasource.DataSourceServiceImporterActivation
DataSourceServiceImporterActivation.Activator
 
Field Summary
protected static org.slf4j.Logger LOGGER
           
protected  Module module
           
 
Constructor Summary
AbstractDataSourceServiceImporterMixin()
           
 
Method Summary
 javax.sql.DataSource importService(ImportedServiceDescriptor importedServiceDescriptor)
          Imports an instance of the service type described in the service descriptor.
 boolean isAvailable(javax.sql.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 java.lang.Exception
Specified by:
passivateDataSourceService in interface DataSourceServiceImporterActivation
Throws:
java.lang.Exception

importService

public final javax.sql.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<javax.sql.DataSource>
Parameters:
importedServiceDescriptor - The service descriptor.
Returns:
The imported service instance.
Throws:
ServiceImporterException - if import failed.

isAvailable

public final boolean isAvailable(javax.sql.DataSource instance)
Description copied from interface: ServiceImporter
Ask if the service is available or not.

Specified by:
isAvailable in interface ServiceImporter<javax.sql.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 java.lang.Exception
Throws:
java.lang.Exception

passivateDataSourcePool

protected abstract void passivateDataSourcePool(PooledDataSourceType dataSourcePool)
                                         throws java.lang.Exception
Throws:
java.lang.Exception