![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
After the configuration is completed, the code can access the configuration file. This section lists the code for the Hello World Adapter in C++ and Java.Sample code for the Hello World program is included as part of the SDK installation. To view the code, open the project file SDK_HOME\examples\helloWorld\helloWorld.dsp on Microsoft Windows platforms or the helloWorld.cpp file on UNIX platforms.
HelloWorldApp( MAppProperties* pMAppProperties) //constructorvirtual ~HelloWorldApp() {} //destructorvoid onInitialization() throw (MException) //you must define this methodvoid onTermination() throw (MException) {} //you must define this method
main() is defined as follows:
1. It first creates an MAppPropterties instance to specify application properties.
2. The program then creates the MApp application manager, passing in the properties just defined.
3. Next comes a call to the start() method, which starts the event loop by default. For this example, there is no need to start the event loop, so pass in false.
4. The stop() method is invoked right after that. While the application did not enter the event loop, the stop() method must be called because it performs any internal cleanup and will then call onTermination() to perform developer-defined cleanup.
• make on Unix platformsThe helloWorld example file is included in the installation media as: SDK_HOME\examples\helloWorld\helloWorld.javaThe MAppProperties class is defined as follows:
Define the helloWorld class as follows:// you can also try to pass in parameter as -system:configurl and //-system:repourl
class helloWorldApp extends MApp //create application manager/** Hook to perform application-specific behavior during
* initialization
3. Run the helloWorld adapter using the following command.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |