Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 8 Advanced Features : Using the MPlugin Class

Using the MPlugin Class
The MPlugin class allows applications to add extra functionality to an adapter at runtime without recompiling the adapter. Possible uses of the MPlugin class are:
loading new MApp components
See the SDK_HOME/examples/java directory for a plug-in example.
Defining a Plug-in
To define a plug-in, you need to create a subclass of MPlugin and implement one C function and four C++ methods.
Configuring a Plug-in
You can configure a plug-in by using the TIBCO Designer to add a custom plug-in object to the adapter instance description stored in the project repository.
For example, to configure a Java plug-in MyPlugin.java:
1.
Click the Edit Adapter XML button in the Configuration tab of Generic Adapter Configuration resource.
2.
AESDK:plugins
AESDK:plugin
AESDK:name pluginObject
AESDK:className MyPlugin
AESDK:verbose true
AESDK:pluginObject true
AESDK:filename MyPlugin.java
Where MyPlugin and MyPlugin.java specify the class name and file name of the sample custom plug-in.
3.
Click OK to close the XML file.
4.
Click Apply.
Running an Adapter with a Plug-in
To load a plug-in into the adapter, specify the system:plugin command-line argument as follows:
"-system:plugin your_plugin_shared_library"
Several plug-ins can be loaded by a single adapter.
Before using this feature, be sure to call MAppProperties::setCommandLine().

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved