The Null codec IAF plug-in
The NullCodec/JNullCodec codec layer plug-ins are very useful in situations where it does not make sense to decouple the transport and codec layers. The transport layer plug-in might be best placed to perform all the necessary encoding and/or decoding of events, and to supply and receive Apama normalized events, rather than custom transport-specific messages.
The Null codec plug-in is provided to make it easy to develop such transport plug-ins. This is a trivial codec layer plug-in that passes downstream normalized events from the transport layer to the Semantic Mapper, and upstream normalized events from the Semantic Mapper to the transport layer with no modification.
In order to load this plug-in, the <codec> element in the adapter's configuration file needs to load the NullCodec or JNullCodec library (this represents the filename of the library that implements the plug-in). Note that for the Java version, the full path to the plug-in's .jar file needs to be specified.
A configuration file for C/C++ uses this:
<codec name="NullCodec" library="NullCodec">
In a configuration file for Java:
<codec name="JNullCodec"
jarName="Apama_install_dir\lib\JNullCodec.jar"
className="com.apama.iaf.codec.nullcodec.JNullCodec">
Note:
The NullCodec and JNullCodec plug-ins can only be used with transport plug-ins that understand NormalisedEvent objects. The Null codec plug-ins expect downstream NormalisedEvent objects from the transport and pass upstream NormalisedEvent objects it receives directly to the transport plug-in. Using the Null codec plug-ins with a transport that expects any other kind of object does not work and can possibly crash the adapter.