|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.database.Datasources
public class Datasources
Contains a collection of Datasource instances that have been
created from an XML definition. A Datasources instance can
either be created by calling the public constructor or by executing the
ParticipantDatasources which participates in the
application-wide repository.
Datasource,
Xml2Datasources,
Rep,
ParticipantDatasources| Field Summary | |
|---|---|
static String |
DEFAULT_PARTICIPANT_NAME
|
| Constructor Summary | |
|---|---|
Datasources()
Creates a new empty Datasources instance. |
|
Datasources(String xmlPath,
ResourceFinder resourceFinder)
Creates a new Datasources instance from the definitions in
an XML file. |
|
| Method Summary | |
|---|---|
void |
cleanup()
Cleans up all connections that have been reserved by this datasource. |
Datasource |
getDatasource(String name)
Retrieves the Datasource that corresponds to a provided
name. |
Collection<String> |
getDatasourceNames()
Retrieves a collection of all the Datasource names that are
known by this Datasources instance. |
static Datasources |
getRepInstance()
Retrieves the Datasources instance that is initialized by
the ParticipantDatasources participant in the
application-wide repository. |
String |
getXmlPath()
Retrieves the path of the XML document that populated this DataSources instance |
static boolean |
hasRepInstance()
Checks if a ParticipantDatasources participant has been
initialized and is available from the application-wide repository. |
void |
setDatasource(String name,
Datasource datasource)
Stores a Datasource with a provided name to be able to
reference it later. |
void |
storeToXml()
Stores the XML document with all the data in the current Datasources instance to the same file that populated
this instance. |
void |
storeToXml(File destination)
Stores the XML document with all the data in the current Datasources instance to the provided file. |
String |
toXml()
Creates an XML document with all the data in the current Datasources instance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_PARTICIPANT_NAME
| Constructor Detail |
|---|
public Datasources()
throws DatasourcesException
Datasources instance.
DatasourcesException
public Datasources(String xmlPath,
ResourceFinder resourceFinder)
throws DatasourcesException,
DatasourceNotFoundException
Datasources instance from the definitions in
an XML file.
xmlPath - the path of the XML resource that will be used for the
populationresourceFinder - a ResourceFinder instance that will be
used to find the file that corresponds to the provided
xmlPath
DatasourcesException - when an exception occured during the
obtainance of the resource's modification time or during the processing
of the XML file
DatasourceNotFoundException| Method Detail |
|---|
public static boolean hasRepInstance()
ParticipantDatasources participant has been
initialized and is available from the application-wide repository.
true if this participant is available; or
false otherwise
getRepInstance()public static Datasources getRepInstance()
Datasources instance that is initialized by
the ParticipantDatasources participant in the
application-wide repository.
Datasources instances; or
null if the ParticipantDatasources couldn't be
found
hasRepInstance()public Datasource getDatasource(String name)
Datasource that corresponds to a provided
name.
name - a String that identifies the
Datasource that has to be retrieved
Datasource instance; or
null if name isn't known
public void setDatasource(String name,
Datasource datasource)
Datasource with a provided name to be able to
reference it later.
name - a String that identifies the
Datasourcedatasource - the Datasource instance that has to be
storedpublic Collection<String> getDatasourceNames()
Datasource names that are
known by this Datasources instance.
Collectionpublic String getXmlPath()
DataSources instance
DataSources instancepublic String toXml()
Datasources instance
String
public void storeToXml()
throws DatasourcesException
Datasources instance to the same file that populated
this instance.
DatasourcesException - when an error occurred during the
storage
public void storeToXml(File destination)
throws DatasourcesException
Datasources instance to the provided file.
destination - the File in which the data will be stored
DatasourcesException - when an error occurred during the
storage
public void cleanup()
throws DatabaseException
DatabaseException - when an error occured during the cleanup
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||