scriptella.spi |
Service Provider Interface classes.
Service Provider Requirements
Although Scriptella supports any JDBC Driver through
JDBC Bridge, writing a custom Provider may be easier and more effective.
The requirements for Service Provider are minimal:
Driver Registration
No special steps are required to register Scriptella Provider.
Simply specify driver class name in a driver attribute of <connection> element.
Examples:
<connection driver="provider.class.name" url="provider:url"/>
You may also specify a driver's classpath. Classpath URIs are resolved relative to an ETL file:
<connection driver="provider.class.name" url="provider:url" classpath="driver.jar;lib/driver-addons.jar"/>
In this case the driver is loaded using a separate classloader
Driver Alias
Putting a driver into scriptella.driver.SHORT_NAME package
and specifying "Driver" as a class name automatically
allows referencing the driver by a SHORT_NAME alias. Example:
<connection driver="SHORT_NAME">
loads scriptella.driver.SHORT_NAME.Driver class.
Additional Recommendations
url is not a required attribute for custom providers, nevertheless
it may make sense to specify URL protocol for your driver.
- If your solution performs scripts compilation and this procedure is expensive, use caching
based on Resource indentities as described in javadoc for Connection.
- Pack your provider as a JAR file setting specification title, version and other attributes in manifest.
Adding a simple readme file inside a JAR may help users to quickly get how to use it.
- Scriptella built-in drivers can be used as a reference implementation to create a new driver.
|
Java Source File Name | Type | Comment |
AbstractConnection.java | Class | A base class for connections. |
AbstractScriptellaDriver.java | Class | An abstract base for Scriptella drivers. |
Connection.java | Interface | Represents a connection to the system provided by
ScriptellaDriver . |
ConnectionParameters.java | Class | Represents connection parameters. |
ConnectionParametersTest.java | Class | Tests for
ConnectionParameters . |
DialectIdentifier.java | Class | Represents vendor dialect information. |
DriverContext.java | Interface | Global ETL Context available to drivers. |
IndexedQueryCallback.java | Class | Query callback implementation which supports indexing. |
MockConnectionParameters.java | Class | Mock implementation of
scriptella.spi.ConnectionParameters . |
MockDriverContext.java | Class | Mock implementation of drivers context suitable for typical cases. |
MockParametersCallbacks.java | Class | Set of common implementations for testing. |
ParametersCallback.java | Interface | Callback interface to obtain parameter values. |
ProviderException.java | Class | Thrown by connection provider to indicate any kind of failure. |
QueryCallback.java | Interface | Callback interface for query result set iteration. |
Resource.java | Interface | Represents reference to a text resource capable of creating new readers. |
ScriptellaDriver.java | Interface | Service Provider Interface for integrating third-party systems with Scriptella. |