Class MonitoredTranslatingProtocolAdapter<O,I,CO,CI>
java.lang.Object
de.iip_ecosphere.platform.connectors.types.AbstractProtocolAdapter<O,I,CO,CI>
de.iip_ecosphere.platform.connectors.types.TranslatingProtocolAdapter<O,I,CO,CI>
de.iip_ecosphere.platform.connectors.types.ChannelTranslatingProtocolAdapter<O,I,CO,CI>
de.iip_ecosphere.platform.services.environment.metricsProvider.MonitoredTranslatingProtocolAdapter<O,I,CO,CI>
- Type Parameters:
O- the output type from the underlying machine/platformI- the input type to the underlying machine/platformCO- the output type of the connectorCI- the input type of the connector
- All Implemented Interfaces:
de.iip_ecosphere.platform.connectors.types.ChannelProtocolAdapter<O,,I, CO, CI> de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<O,I, CO, CI>
public class MonitoredTranslatingProtocolAdapter<O,I,CO,CI>
extends de.iip_ecosphere.platform.connectors.types.ChannelTranslatingProtocolAdapter<O,I,CO,CI>
Implements a monitoring wrapper for
TranslatingProtocolAdapter to be instrumented into by generation.- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprivate de.iip_ecosphere.platform.support.metrics.Clockprivate LogRunnableprivate MemoryMXBeanprivate MetricsProvider -
Constructor Summary
ConstructorsConstructorDescriptionMonitoredTranslatingProtocolAdapter(de.iip_ecosphere.platform.connectors.types.ConnectorOutputTypeTranslator<O, CO> outputTranslator, de.iip_ecosphere.platform.connectors.types.ConnectorInputTypeTranslator<CI, I> inputTranslator, MetricsProvider metrics, File log) Creates a monitored translating protocol adapter with empty channels.MonitoredTranslatingProtocolAdapter(String outputChannel, de.iip_ecosphere.platform.connectors.types.ConnectorOutputTypeTranslator<O, CO> outputTranslator, String inputChannel, de.iip_ecosphere.platform.connectors.types.ConnectorInputTypeTranslator<CI, I> inputTranslator, MetricsProvider metrics, File log) Creates a monitored translating protocol adapter. -
Method Summary
Modifier and TypeMethodDescriptionadaptInput(CI data) adaptOutput(String channel, O data) private voidLogs an activity if there is a logger.Methods inherited from class de.iip_ecosphere.platform.connectors.types.ChannelTranslatingProtocolAdapter
getInputChannel, getOutputChannelMethods inherited from class de.iip_ecosphere.platform.connectors.types.TranslatingProtocolAdapter
getConnectorInputType, getConnectorOutputType, getProtocolInputType, getProtocolOutputType, initializeModelAccess, setModelAccessMethods inherited from class de.iip_ecosphere.platform.connectors.types.AbstractProtocolAdapter
getModelAccessMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.connectors.types.ProtocolAdapter
getConnectorInputType, getConnectorOutputType, getModelAccess, getProtocolInputType, getProtocolOutputType, initializeModelAccess, setModelAccess
-
Field Details
-
ADAPT_INPUT_TIME
- See Also:
-
ADAPT_OUTPUT_TIME
- See Also:
-
metrics
-
clock
private de.iip_ecosphere.platform.support.metrics.Clock clock -
memBean
-
logger
-
-
Constructor Details
-
MonitoredTranslatingProtocolAdapter
public MonitoredTranslatingProtocolAdapter(de.iip_ecosphere.platform.connectors.types.ConnectorOutputTypeTranslator<O, CO> outputTranslator, de.iip_ecosphere.platform.connectors.types.ConnectorInputTypeTranslator<CI, I> inputTranslator, MetricsProvider metrics, File log) Creates a monitored translating protocol adapter with empty channels.- Parameters:
outputTranslator- the output translatorinputTranslator- the input translatormetrics- the metrics provider used to measurelog- optional file to log individual values to (may be null for none)
-
MonitoredTranslatingProtocolAdapter
public MonitoredTranslatingProtocolAdapter(String outputChannel, de.iip_ecosphere.platform.connectors.types.ConnectorOutputTypeTranslator<O, CO> outputTranslator, String inputChannel, de.iip_ecosphere.platform.connectors.types.ConnectorInputTypeTranslator<CI, I> inputTranslator, MetricsProvider metrics, File log) Creates a monitored translating protocol adapter.- Parameters:
outputChannel- the name of the input channel. Further semantics is implied/restrictions are imposed by the underlying protocol.outputTranslator- the output translatorinputChannel- the name of the input channel. Further semantics is implied/restrictions are imposed by the underlying protocol.inputTranslator- the input translatormetrics- the metrics provider used to measurelog- optional file to log individual values to (may be null for none)
-
-
Method Details
-
log
Logs an activity if there is a logger.- Parameters:
activity- the activity nameduration- the duration
-
adaptInput
-
adaptOutput
-