|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.roboticsAPI.AbstractEngine
com.kuka.roboticsAPI.persistenceModel.PersistenceEngine
public class PersistenceEngine
This class handles the life cycle of the persistence data sources, which provide access to persistent objects.
| Constructor Summary | |
|---|---|
PersistenceEngine(RoboticsAPIContext context)
Creates a new persistence engine class. |
|
| Method Summary | ||
|---|---|---|
static void |
clearDefaultDataSource()
Resets default data source to null. |
|
void |
dispose()
Disposes the persistence engine and all data sources. |
|
|
getDataSource(Class<T> sourceinterface)
Searches for the first data source class implementing the given interface. |
|
|
getDataSource(Class<T> sourceinterface,
String name)
Searches for the data source class implementing the given interface with the given name. |
|
IDataSource |
getDefaultDataSource()
Gets the default data source for all persistence engines. |
|
Class<? extends IEngine> |
getEngineType()
Gets the type of the engine. |
|
void |
initialize()
Initializes the engine. |
|
protected void |
loadDataSourcesFromFile(File file)
Loads data sources from a file. |
|
protected void |
loadDataSourcesFromURL(URL url)
Loads data sources from an URL. |
|
void |
setParameters(com.kuka.common.ParameterSet parameters)
Sets the parameters for this engine. |
|
| Methods inherited from class com.kuka.roboticsAPI.AbstractEngine |
|---|
getContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.kuka.roboticsAPI.IEngine |
|---|
getContext |
| Constructor Detail |
|---|
public PersistenceEngine(RoboticsAPIContext context)
context - The context for this controller. null is not allowed.| Method Detail |
|---|
public IDataSource getDefaultDataSource()
Default data source is returned for every data source request if its interface type is the same as the interface type of the requested data source. It can be configured in the configuration file of the RobotcsAPI.
getDefaultDataSource in interface IPersistenceEnginepublic static void clearDefaultDataSource()
null.
public void initialize()
initialize in interface IEngineinitialize in class AbstractEnginepublic void setParameters(com.kuka.common.ParameterSet parameters)
setParameters in interface IEnginesetParameters in class AbstractEngineparameters - The parameters for this engine.
protected void loadDataSourcesFromFile(File file)
throws IOException
file - The file.
IOException - if the file could not be read
protected void loadDataSourcesFromURL(URL url)
throws IOException
url - The URL.
IOException - if the content at the URL could not be read
public <T extends IDataSource> T getDataSource(Class<T> sourceinterface,
String name)
If default data source is set and implements the requested interface - it will be returned without checking the other data sources.
getDataSource in interface IPersistenceEngineT - The interface type the data source should implement.sourceinterface - The concrete interface which the data source should implement.name - The name of the data source.
public <T extends IDataSource> T getDataSource(Class<T> sourceinterface)
If default data source is set and implements the requested interface - it will be returned without checking the other data sources.
getDataSource in interface IPersistenceEngineT - The interface type the data source should implement.sourceinterface - The concrete interface which the data source should implement.
public void dispose()
dispose in interface IEnginedispose in class AbstractEnginepublic Class<? extends IEngine> getEngineType()
getEngineType in interface IEnginegetEngineType in class AbstractEngine
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||