![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
To use the TIBCO Wrapper, ensure that you link in the wrapper libraries under C++. In addition, you need to make the following source code changes.Adapters need only be certain that they are updating the application’s state by using the MHostInfo class. This is how the Win32 Service Control Manager (SCM) get notified that the application is running. State change notifications are required, otherwise the SCM will regard the service as non-functional. This may lead to unexpected behavior.
You should create MHostInfo the same place you create MAppProperties so that you can set the "Initializing" state before setting "Running" state inside onInitialization().Make sure that the application state is set for failure and exit conditions. Before the adapter exits, the state should be set first to STOPPING and then to STOPPED. While there is some facility in the TIBCO Wrapper tool to detect or correct inconsistent state changes, the application itself is responsible for setting state back to the SCM correctly.Note that the tool can be used in conjunction with existing Java adapters without modification, provided they are updating the application state as noted above. Otherwise, this code needs to be added before attempting to install the adapter as a Service.Adapters need to rename their current main() to ApplicationMain() and call the LaunchWrapper() method while passing their ApplicationMain() method to the wrapper.In addition, the service state for C++ applications must be set using the wrapper function SetServiceState() instead of relying on MApp::setHostInfo().
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |