com.kuka.roboticsAPI.persistenceModel
Class PersistenceEngine

java.lang.Object
  extended by com.kuka.roboticsAPI.AbstractEngine
      extended by com.kuka.roboticsAPI.persistenceModel.PersistenceEngine
All Implemented Interfaces:
IEngine, IPersistenceEngine

public class PersistenceEngine
extends AbstractEngine
implements IPersistenceEngine

This class handles the life cycle of the persistence data sources, which provide access to persistent objects.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

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.
<T extends IDataSource>
T
getDataSource(Class<T> sourceinterface)
          Searches for the first data source class implementing the given interface.
<T extends IDataSource>
T
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

PersistenceEngine

public PersistenceEngine(RoboticsAPIContext context)
Creates a new persistence engine class.

Parameters:
context - The context for this controller. null is not allowed.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.
Method Detail

getDefaultDataSource

public IDataSource getDefaultDataSource()
Gets the default data source for all persistence engines.

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.

Specified by:
getDefaultDataSource in interface IPersistenceEngine
Returns:
the default data source for all persistence engines. Returns null if default data source is not set.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

clearDefaultDataSource

public static void clearDefaultDataSource()
Resets default data source to null.


initialize

public void initialize()
Initializes the engine. This method is automatically called by the engine context when it is initialized.

Specified by:
initialize in interface IEngine
Overrides:
initialize in class AbstractEngine
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

setParameters

public void setParameters(com.kuka.common.ParameterSet parameters)
Sets the parameters for this engine.

Specified by:
setParameters in interface IEngine
Overrides:
setParameters in class AbstractEngine
Parameters:
parameters - The parameters for this engine.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

loadDataSourcesFromFile

protected void loadDataSourcesFromFile(File file)
                                throws IOException
Loads data sources from a file.

Parameters:
file - The file.
Throws:
IOException - if the file could not be read

loadDataSourcesFromURL

protected void loadDataSourcesFromURL(URL url)
                               throws IOException
Loads data sources from an URL.

Parameters:
url - The URL.
Throws:
IOException - if the content at the URL could not be read

getDataSource

public <T extends IDataSource> T getDataSource(Class<T> sourceinterface,
                                               String name)
Searches for the data source class implementing the given interface with the given name. The source will be open after this call.

If default data source is set and implements the requested interface - it will be returned without checking the other data sources.

Specified by:
getDataSource in interface IPersistenceEngine
Type Parameters:
T - The interface type the data source should implement.
Parameters:
sourceinterface - The concrete interface which the data source should implement.
name - The name of the data source.
Returns:
The data source implementing the specified interface.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getDataSource

public <T extends IDataSource> T getDataSource(Class<T> sourceinterface)
Searches for the first data source class implementing the given interface. The source will be open after this call.

If default data source is set and implements the requested interface - it will be returned without checking the other data sources.

Specified by:
getDataSource in interface IPersistenceEngine
Type Parameters:
T - The interface type the data source should implement.
Parameters:
sourceinterface - The concrete interface which the data source should implement.
Returns:
The first data source implementing the specified interface.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

dispose

public void dispose()
Disposes the persistence engine and all data sources.

Specified by:
dispose in interface IEngine
Overrides:
dispose in class AbstractEngine
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getEngineType

public Class<? extends IEngine> getEngineType()
Gets the type of the engine. This should be the concrete IEngine interface which the engine is implementing.

Specified by:
getEngineType in interface IEngine
Specified by:
getEngineType in class AbstractEngine
Returns:
The type of the engine. This should be the concrete IEngine interface which the engine is implementing.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.


Copyright © 2019. All rights reserved.