Apama 10.15.0 | Connecting Apama Applications to External Components | Working with Connectivity Plug-ins | Developing Connectivity Plug-ins | Building plug-ins
 
Building plug-ins
See the samples/connectivity_plugin directory of your Apama installation for working samples of connectivity plug-in source code, Ant build files, makefiles, or Microsoft Visual Studio projects for building C++ plug-ins (note that the build instructions in the samples/connectivity_plugin directory assume that you are using a recent version of Microsoft Visual Studio).
Building Java plug-ins
Java plug-ins require the connectivity-plugins-api.jar file in the lib directory of your Apama installation to be on the compiler's classpath as it defines Message, AbstractCodec, AbstractTransport, AbstractChainManager and associated classes. The classes are in the com.softwareag.connectivity.* packages.
All code samples shown in this connectivity plug-ins documentation assume either that the following lines of code are present in the source file, or that the classes are imported individually.
import com.softwareag.connectivity.*;
import java.util.*; // Map, HashMap, List, ArrayList
// are commonly used classes in these samples
You can develop Java-based connectivity plug-ins in Software AG Designer. To do so, you have to add the Apama Java support to your Apama project. See Creating Apama projects for more information. This will automatically take care of the classpath for you.
Building C++ plug-ins
C++ plug-ins require the header files in the include directory of your Apama installation to be on the compiler's include path. The plug-in should be linked as a shared library and it should link against the apclient library in the lib directory of your Apama installation. The resultant library will thus depend on the apclient library.
All code samples shown in this connectivity plug-ins documentation assume either that the following lines of code are present in the source file, or that individual using statements are used for each class.
#include <sag_connectivity_plugins.hpp>

using namespace com::softwareag::connectivity;
For chain manager classes, the following is also needed:
#include <sag_connectivity_chain_managers.hpp>

using namespace com::softwareag::connectivity::chainmanagers;
For information on the compilers had have been tested and are supported, refer to the Supported Platforms document for the current Apama version. This document is available from https://documentation.softwareag.com/apama/index.htm.
Connectivity plug-in headers are a wrapper around a C ABI. Unlike other plug-ins, the C++ plug-ins are therefore not sensitive to which C++ compiler product, compiler version and compiler configuration (for example, a debug or release build) is used. The C++ compiler used does need to correctly support parts of the C++11 standard, and exact settings required for each compiler will vary.
If you are building a shared library to be used by multiple plug-ins and using the plug-in-specific data structures as part of your API between the library and the plug-ins, then you must ensure that the library and all of the plug-ins are compiled using the same version of the Apama header files. This means that if you upgrade Apama and want to recompile one of them, you must recompile all of them. You can choose not to recompile anything and they will still work.
If you compile with headers from multiple service packs of Apama, then you may see errors similar to the following when you try to link them.
*Linux :
undefined reference to `Foo::test(com::softwareag::connectivity10_5_3::data_t const&)'
*Windows:
testlib2.obj : error LNK2019: unresolved external symbol "public: void __cdecl Foo::test(class com::softwareag::connectivity10_5_3::data_t const &)" (?test@Foo@@QEAAXAEBVdata_t@connectivity10_5_3@softwareag@com@@@Z) referenced in function "public: void __cdecl Bar::test(class com::softwareag::connectivity10_5_3::data_t const &)" (?test@Bar@@QEAAXAEBVdata_t@connectivity10_5_3@softwareag@com@@@Z)
testlib2.dll : fatal error LNK1120: 1 unresolved externals
If you encounter a similar error, try recompiling all your components with the same version of the headers.
If you are compiling a single plug-in, or multiple completely independent plug-ins, you can recompile them in any combination at any time.
If you want to develop plug-ins in C++, you have to use your own C++ compiler/development environment.