org.qi4j.library.sql.datasource
Class DataSourceService.Mixin

java.lang.Object
  extended by org.qi4j.library.sql.datasource.DataSourceService.Mixin
All Implemented Interfaces:
Activatable, ServiceImporter
Enclosing interface:
DataSourceService

public static class DataSourceService.Mixin
extends Object
implements Activatable, ServiceImporter


Constructor Summary
DataSourceService.Mixin()
           
 
Method Summary
 void activate()
          This is invoked on the service when the instance is being activated
 DataSourceConfiguration getConfiguration(String identity)
           
 Object importService(ImportedServiceDescriptor importedServiceDescriptor)
          Imports an instance of the service type described in the service descriptor.
 boolean isActive(Object instance)
          Ask if the underlying service is currently active or not.
 boolean isAvailable(Object instance)
          Ask if the service is available or not.
 void passivate()
          This is invoked on the service when the instance is being passivated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceService.Mixin

public DataSourceService.Mixin()
Method Detail

activate

public void activate()
              throws Exception
Description copied from interface: Activatable
This is invoked on the service when the instance is being activated

Specified by:
activate in interface Activatable
Throws:
Exception - if service could not be activated

passivate

public void passivate()
               throws Exception
Description copied from interface: Activatable
This is invoked on the service when the instance is being passivated

Specified by:
passivate in interface Activatable
Throws:
Exception - if the service could not be passivated

importService

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

getConfiguration

public DataSourceConfiguration getConfiguration(String identity)
                                         throws InstantiationException
Throws:
InstantiationException

isActive

public boolean isActive(Object instance)
Description copied from interface: ServiceImporter
Ask if the underlying service is currently active or not.

Specified by:
isActive in interface ServiceImporter
Parameters:
instance - the instance to be checked
Returns:
true if the service is active, false if not

isAvailable

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

Specified by:
isAvailable in interface ServiceImporter
Parameters:
instance - the instance to be checked
Returns:
true if the service is available, false if not