Apama 10.3 | Apama Documentation | Connecting Apama Applications to External Components | Working with IAF Plug-ins | Java Codec Plug-in Development | The codec plug-in development specification for Java | Communication with other layers | Sending downstream messages received from a transport plug-in to the Semantic Mapper
Sending downstream messages received from a transport plug-in to the Semantic Mapper
When a transport plug-in configured to work with the event codec receives a messages from its external message source, it will pass it on to the codec plug-in by calling the sendTransportEvent method (as defined above). It is then up to the codec plug-in to decode the message from whatever custom format is agreed between the transport and codec plug-ins into a standard normalized event that can be passed on to the Semantic Mapper.
When the message has been decoded it should be sent to the Semantic Mapper using its sendNormalisedEvent method:
* Called by the event codec to send a decoded event to the Semantic Mapper.
* @param event A normalized event to be sent to the semantic mapper
* @param timestamps A TimestampSet representing the timestamps attached to
* the event.
* @throws SemanticMapperException Thrown by the Semantic Mapper if there
* is a problem mapping the event
public void sendNormalisedEvent(NormalisedEvent event,
TimestampSet timestamps)
    throws SemanticMapperException;
For example, the implementation of the event codec's sendTranasportEvent could look something like this:
// (Assume there's an instance field: SemanticMapper semanticMapper)
// Decode message
NormalisedEvent normalisedEvent = myDecodeMessage(event);
// Send to Transport layer plug-in
semanticMapper.sendNormalisedEvent(normalisedEvent, timestamps);
If an error occurs in the Semantic Mapper, a SemanticMapperException is thrown. Typically such exceptions do not need to be caught by the codec plug-in, unless the codec plug-in is able to somehow deal with the problem.
A CodecException should be thrown if there is an error decoding the normalized event.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.