com.synthesisstudios.holmz.service
Class ServiceProvider

java.lang.Object
  extended by com.synthesisstudios.holmz.service.ServiceProvider

public abstract class ServiceProvider
extends java.lang.Object

An abstract super class for a ServiceProvider that provides a specific implementation of the Holmz API. Loading the holmz-impl.jar into the classpath will configure the default ServiceProvider, which can then be fetched from the getDefaultServiceProvider static method.


Constructor Summary
ServiceProvider()
           
 
Method Summary
protected abstract  Service createService(javax.sql.DataSource dataSource)
          ServiceProviders must implement this method to create a Service object.
static ServiceProvider getDefaultServiceProvider()
          Gets the default ServiceProvider, or throws an IllegalStateException if one has not been configured.
 Service getService(javax.sql.DataSource dataSource)
          Gets a shared, possibly cached Service object uses the given DataSource.
 Service getService(java.lang.String url, java.lang.String username, java.lang.String password)
          Gets a shared, possibly cached Service object uses the given DataSource.
abstract  java.lang.String getServiceVersion()
          ServiceProviders should implement this method to publish what version of holmz is running.
static void registerServiceProvider(ServiceProvider serviceProvider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceProvider

public ServiceProvider()
Method Detail

registerServiceProvider

public static void registerServiceProvider(ServiceProvider serviceProvider)

getDefaultServiceProvider

public static ServiceProvider getDefaultServiceProvider()
Gets the default ServiceProvider, or throws an IllegalStateException if one has not been configured. Loading the holmz-impl.jar into the classpath will configure the default ServiceProvider.


getService

public Service getService(java.lang.String url,
                          java.lang.String username,
                          java.lang.String password)
Gets a shared, possibly cached Service object uses the given DataSource.


getService

public Service getService(javax.sql.DataSource dataSource)
Gets a shared, possibly cached Service object uses the given DataSource.


createService

protected abstract Service createService(javax.sql.DataSource dataSource)
ServiceProviders must implement this method to create a Service object. The Service object will be cached for future use.


getServiceVersion

public abstract java.lang.String getServiceVersion()
ServiceProviders should implement this method to publish what version of holmz is running. The version string format is implementation specific.