Class ConnectorOutputTypeAdapter<T>
java.lang.Object
de.iip_ecosphere.platform.connectors.types.ConnectorOutputTypeAdapter<T>
- Type Parameters:
T- the target type (seeOutputTypeTranslator)
- All Implemented Interfaces:
ModelAccessProvider,ConnectorOutputTypeTranslator<byte[],,T> de.iip_ecosphere.platform.transport.serialization.OutputTypeTranslator<byte[],T>
- Direct Known Subclasses:
ChanneledConnectorOutputTypeAdapter
public class ConnectorOutputTypeAdapter<T>
extends Object
implements ConnectorOutputTypeTranslator<byte[],T>
Adapts a basic output translator/serializer for reuse.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.iip_ecosphere.platform.connectors.model.ModelAccessProvider
ModelAccessProvider.IOModelAccessFunction, ModelAccessProvider.IOVoidFunction -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ModelAccessprivate de.iip_ecosphere.platform.transport.serialization.Serializer<T> -
Constructor Summary
ConstructorsConstructorDescriptionConnectorOutputTypeAdapter(de.iip_ecosphere.platform.transport.serialization.Serializer<T> serializer) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the model access instance to be used during type translations.Class<? extends byte[]> Returns the source type.Returns the target type.voidCalled to initialize the model access, e.g., to setup notifications.voidsetModelAccess(ModelAccess modelAccess) Defines the model access.to(byte[] source)
-
Field Details
-
serializer
-
modelAccess
-
-
Constructor Details
-
ConnectorOutputTypeAdapter
public ConnectorOutputTypeAdapter(de.iip_ecosphere.platform.transport.serialization.Serializer<T> serializer) Creates an instance.- Parameters:
serializer- the serializer to adapt
-
-
Method Details
-
to
- Specified by:
toin interfacede.iip_ecosphere.platform.transport.serialization.OutputTypeTranslator<byte[],T> - Throws:
IOException
-
getModelAccess
Description copied from interface:ModelAccessProviderReturns the model access instance to be used during type translations.- Specified by:
getModelAccessin interfaceModelAccessProvider- Returns:
- the model access instance, may be null (see
MachineConnector.hasModel())
-
setModelAccess
Description copied from interface:ModelAccessProviderDefines the model access. Handle with care, shall be called (indirectly) by the connector only.- Specified by:
setModelAccessin interfaceModelAccessProvider- Parameters:
modelAccess- the model access
-
initializeModelAccess
Description copied from interface:ConnectorOutputTypeTranslatorCalled to initialize the model access, e.g., to setup notifications. Called only, when the connector is connected.- Specified by:
initializeModelAccessin interfaceConnectorOutputTypeTranslator<byte[],T> - Throws:
IOException- in case the initialization fails, e.g., monitors cannot be set up
-
getSourceType
Description copied from interface:ConnectorOutputTypeTranslatorReturns the source type.- Specified by:
getSourceTypein interfaceConnectorOutputTypeTranslator<byte[],T> - Returns:
- the source type
-
getTargetType
Description copied from interface:ConnectorOutputTypeTranslatorReturns the target type.- Specified by:
getTargetTypein interfaceConnectorOutputTypeTranslator<byte[],T> - Returns:
- the target type
-