Apama 10.3 | Apama Documentation | Connecting Apama Applications to External Components | Working with IAF Plug-ins | Transport Plug-in Development in Java | Getting started with Java transport layer plug-in development
Getting started with Java transport layer plug-in development
Your distribution includes a complete "skeleton" implementation of a transport layer plug-in in order to make development of new plug-ins faster.
This is located in the samples\iaf_plugin\java\skeleton\src directory of the installation, in a file called SkeletonTransport.java. The SkeletonTransport class complies fully with the Transport Plug-in Development Specification, but contains none of the custom message source/sink functionality that would be present in a full transport plug-in.
The skeleton starts a background thread to do the actual message reading. This is required unless the message source can asynchronously call back into the class that implements the plug-in.
The code contains TODO: comments indicating the main changes that need to be made to add support for a specific message source/sink. These include:
*Adding code to sendTransportEvent for sending an upstream event received from an event codec on to the external message sink (if supported).
*Adding code to the run method of the MessageProcessingThread for retrieving downstream messages from the external source and forwarding them on to an event codec (if supported).
*Alternatively, if the external message source works by making asynchronous calls using the listener pattern, the processing thread should usually be removed, and much of the code can be moved directly to the method called by the message source.
*Adding code to start communications with the external messaging system in the start method, and to ensure it is ceases in the stop method.
*Adding code to validate and save any new plug-in properties that are to be supported, in updateProperties.
*Adding code to initialize and clean up resources associated with the plug-in's operation. This would usually be done in the start/stop methods, in the background processing thread, or in the updateProperties and cleanup methods.
Depending on your requirements, it may also be necessary to make changes to the other methods – addEventDecoder, removeEventDecoder, flushUpstream, flushDownstream, getStatus, and the constructor.
The skeleton directory includes an Apache Ant build file called build.xml that provides a convenient way to build .jar files of compiled classes from plug-in source files, ready for use with the IAF.

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.