|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object i3.dragos.core.AbstractService i3.dragos.core.services.datasources.DataSourceFactory
public class DataSourceFactory
The DataSourceFactory
creates data sources
. A data source must
be opened after it is obtained from the factory to make it usable.
Data source are identified by two so called datasource URLs
, the physical
and the logical URL.
The identifier of the physical URL is used to associate a database
with a data source implementation. Since some implementations for a data source can be used for
different databases like the implementation for JDBC compliant databases wildcards can be used
for a database identifier in the configuration file. Hence a "*" is not allowed in database
identifiers which are used to obtain a data source from the factory.
DataSourceURL
,
DataSource
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface i3.dragos.core.Service |
---|
Service.Result, Service.State |
Constructor Summary | |
---|---|
DataSourceFactory()
Constructs the factory. |
Method Summary | |
---|---|
DataSource |
create(DataSourceURL physicalDSURL,
DataSourceURL logicalDSURL)
Creates a new data source. |
DataSource |
get(DataSourceURL datasourceURL)
Retrieves a previously created DataSource by its logical DataSourceURL. |
DataSource |
get(java.lang.String datasourceURL)
Retrieves a previously created DataSource by the String representation of its logical DataSourceURL. |
static DataSourceFactory |
getInstance()
Returns the data source factroy registered by the service manager. |
java.lang.String |
getName()
Returns the name of the service. |
java.util.Set<java.lang.String> |
getSupportedDataSources()
Returns the data source identifiers supported by the factory. |
Service.Result |
initialize()
Initializes the services. |
void |
registerDataSourceImplementation(java.lang.String id,
java.lang.String impl)
Registers an implementation for a specific data source. |
Service.Result |
uninitialize()
Uninitializes the services and releases all resources used by the service. |
Methods inherited from class i3.dragos.core.AbstractService |
---|
getState, resume, start, stop, suspend |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSourceFactory()
Method Detail |
---|
public static DataSourceFactory getInstance()
public java.lang.String getName()
public Service.Result initialize()
initialize
in interface Service
initialize
in class AbstractService
public Service.Result uninitialize()
uninitialize
in interface Service
uninitialize
in class AbstractService
public java.util.Set<java.lang.String> getSupportedDataSources()
String
.public void registerDataSourceImplementation(java.lang.String id, java.lang.String impl)
id
- The data source ID.impl
- The full-qualified name of the realization class.public DataSource get(java.lang.String datasourceURL) throws DataSourceFactoryException, java.net.MalformedURLException
datasourceURL
- The URL that identifies the data source.
DataSourceFactoryException
- if the requested data source does not exist.
java.net.MalformedURLException
- if the data source URL does not match the syntax specified in
DataSourceURL
.public DataSource get(DataSourceURL datasourceURL) throws DataSourceFactoryException
datasourceURL
- The URL that identifies the data source.
DataSourceFactoryException
- if the requested data source does not exist.public DataSource create(DataSourceURL physicalDSURL, DataSourceURL logicalDSURL) throws DataSourceFactoryException
physicalDSURL
- The physical DataSourceURL that is needed to create the data source
(must not be null
).logicalDSURL
- The logical DataSourceURL that will identify the data source from now on
(must not be null
).
DataSourceFactoryException
- if something went wrong during the creation of a proper
data source.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |