![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
Running an Adapter as a Microsoft Windows Service
1. Ensure that the adapter code is updating the application state information (see MHostInfo in the online API documentation).
2. Rename the wrap.exe or gwrap.exe binary to the name of your application (for example, SimpleApp.exe).
Name the properties file app_name.tra (for example, SimpleApp.tra). It will be picked up automatically when one of the TIBCO Wrapper command-line options is used. You can also specify which properties file to use through the --propFile filename command-line option.
4. Install the service with the Service Control Manager by using the --install command line option.
− using the --start command line option
If you changed details in the properties file, run --uninstall and --install again. Otherwise, changes do not take effect.Note that the properties file itself is not read when the application is running as a Windows Service.
• Explicitly Linking the Library—This produces an executable that can be run from the command line.
• Delayed Application Shared Library Loading—At times, it is necessary to set a per-application PATH instead of accepting a system setting. The PATH environment variable dictates which dependent shared libraries are loaded.This approach produces a shared library that can then be loaded by the Wrapper executable, and allows you to do this.
1.
2. Write an AppStop() method, if required.
3.
4. Modify the existing adapter code to call the SetServiceState() function as appropriate for the adapter.
5. Compile and link with the libwrap.lib static library.
If you named the properties file app_name.tra (for example, SimpleApp.tra), it is picked up automatically. You can also specify which properties file to use through a command-line option.
7. Install the service with the Service Control Manager by using the --install command line option.
− using the --start command line option
If you changed details in the properties file, run --uninstall and --install again. Otherwise, changes do not take effect.Note that the properties file itself is not read when the application is running as a Windows service.To run a C++ adapter as a service on Microsoft Windows platforms, and change the loading of dependent shared libraries to allow the wrapper to modify the PATH environment variable:
2.
3. Write an AppStop() method, if required.
4. Write a RegisterWrapperEntryPoints() function. This function gives you a function callback pointer for setting the service state.
5. Write a SetServiceState() function, as appropriate for the adapter, that uses the pointer obtained from RegisterWrapperEntryPoints().
6. Create a properties file detailing Service properties. Be sure to set the application.library property to point to the application shared library.
If you named the properties file app_name.tra (for example, SimpleApp.tra), it is picked up automatically. You can also specify which properties file to use through a command-line option.
7. Rename the wrap.exe or gwrap.exe binary to the name of the application (for example, SimpleApp.exe).
8. Install the service with the Service Control Manager by using the --install command line option.
− using the --start command line option
If you changed details in the properties file, run --uninstall and --install again. Otherwise, changes do not take effect.Note that the properties file itself is not read when the application is running as a Windows service.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |