|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object i3.dragos.core.services.datasources.DataSource
public abstract class DataSource
DRAGOS uses the concept of a data source to support abritrary storages. For each different database there must be a special implementation of this class.
Since DRAGOS uses reflection to instantiate the DataSource
implementations, each must provide a public constructor that takes
two DataSourceURL
arguments (the physical and the
logical DataSourceURL).
DataSourceURL
,
DataSourceFactory
Constructor Summary | |
---|---|
DataSource(DataSourceURL physicalDSURL,
DataSourceURL logicalDSURL)
Constructs a new data source. |
Method Summary | |
---|---|
abstract void |
close()
Closes the connection to the data source and frees all resources that were used by the connection. |
DataSourceTransaction |
createTransaction()
Creates an implementation specific top-level transaction for the data source. |
abstract DataSourceTransaction |
createTransaction(DataSourceTransaction parent)
Creates a (potentially nested) transaction. |
DataSourceURL |
getLogicalURL()
Returns the (logical) data source URL that identifies the data source. |
abstract DataSourceMetaData |
getMetaData()
Returns informations on the data source and its capabilities. |
DataSourceURL |
getPhysicalURL()
Returns the (physical) data source URL that identifies the data source. |
abstract void |
open()
Opens a physical connection to the data source. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSource(DataSourceURL physicalDSURL, DataSourceURL logicalDSURL) throws DataSourceException
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
).
DataSourceException
- if something went wrong during the
initial construction of the datasourceMethod Detail |
---|
public final DataSourceURL getPhysicalURL()
public final DataSourceURL getLogicalURL()
public abstract void open() throws DataSourceException
DataSourceException
- if it was not possible to open the data
source.public abstract void close() throws DataSourceException
DataSourceException
- if it was not possible to close the data
source.public abstract DataSourceMetaData getMetaData()
open()
has
not been called before!
public final DataSourceTransaction createTransaction() throws DataSourceException
In contrast to TransactionManager
,
there is a separate method for creating nested transactions, because we do not
have a Thread<->Transaction
mapping here that would
allow us to automatically determine the appropriate parent transaction.
This method is a shortcut for createTransaction(null)
.
DataSourceException
- if it was not possible to create the
transaction.public abstract DataSourceTransaction createTransaction(DataSourceTransaction parent) throws DataSourceException
Throws a DataSourceTransactionException if
parent != null
and
Transaction.State.BEGUN
orTransaction.State.ROLLBACK_ONLY
orThe TransactionManager may only create one top-level transaction per thread. A DataSource implementation may throw a DataSourceTransactionException if there is already a top-level transaction for this thread that has not yet been rolled back or committed.
parent
- the parent transaction, may be null
.
DataSourceException
- in case of errors, see full method comment for details.DataSourceMetaData.supportsNestedTransactions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |