IAccessAdapter< T extends DataObject > Interface Reference

Inheritance diagram for IAccessAdapter< T extends DataObject >:
Collaboration diagram for IAccessAdapter< T extends DataObject >:

List of all members.


Detailed Description

Base interface of all access adapters, which provides the functionality required by Tesla. During initialization, the method IAccessAdapter#initialize(int, int, String, String, HashMap) is called, such that the adapter can configure itself to access the required data. Developers must ensure that the parameters are internally stored and returned by the corresponding get-methods.
Note: This interface contains an IAccessAdapterTest which can be run by Tesla's JUnit-Component. Developers who re-implement this interface should run this component to validate their implementation.

Author:
sschwieb
Parameters:
<T>an interface extending DataObject.

Classes

class  AdapterTest

Public Methods

void close ()
int getExperimentId ()
int getComponentId ()
int getRoleId ()
void initialize (int experimentId, ComponentEntity component, int roleId, Properties properties)
RoleImpl getProducerRole ()
Set< Class<?extends T > > getSubTypes ()
public< L extends T >
InputIterator< Annotation< L > > 
getAllAnnotations (Class< L > clazz)
InputIterator< String > getAllSignalIds ()
Annotation< T > getAnnotationById (long id)
ComponentEntity getProducer ()

Method Details

void close ( )

This method is called when the lifecycle of an adapter ends, either by a component itself or by the framework. Subclasses should release used resources and free reserved memory.

public<L extends T> InputIterator<Annotation<L> > getAllAnnotations ( Class< L >  clazz)

Returns all annotations where the DataObject is of the given class.

Returns:
an InputIterator to iterate the annotations. Never returns null.
InputIterator<String> getAllSignalIds ( )

Returns the ids of all signals which were annotated by the underlying component.

Returns:
Annotation<T> getAnnotationById ( long  id)

Returns the annotation with the given id, or null, if it does not exist.

Parameters:
id
Returns:
int getComponentId ( )

Returns the unique id of the component which produced the results.

Returns:
int getExperimentId ( )

Returns the unique id of the currently executed experiment, as set in IAccessAdapter#initialize(int, int, String, String, Map). Must never return 0.

Returns:
the experiment id.
ComponentEntity getProducer ( )

Returns the ComponentEntity which created the data accessed by this adapter.

Returns:
RoleImpl getProducerRole ( )

Returns the role of the component which created the data accessed by this adapter.

Returns:
int getRoleId ( )

Returns the unique id of the accessed role (generated by Tesla during runtime), as set in IAccessAdapter#initialize(int, int, String, String, Map). Must never return 0.

Returns:
the role id.
Set<Class<? extends T> > getSubTypes ( )
void initialize ( int  experimentId,
ComponentEntity  component,
int  roleId,
Properties  properties 
)

Initialization-method which is called at the beginning of an adapter life cycle.

Parameters:
experimentIdthe unique id of the experiment that is currently executed
roleIdthe id of the role that is getting accessed. Note that this is not the role definition id.
dataObjectClassthe fully qualified name of the DataObject implementation that is getting accessed
propertiesan optional map of properties which can contain implementation-specific attributes. Can be null.