Overview
This document describes how to develop management aware applications using SAFplus Management. It assumes that SAFplus Management has been installed on your system. For information on how to install SAFplus Management, see SAFplus Management User's Guide. This document should be used in conjunction with the SAFplus Management example web services application available via download or in our source tree at (.../examples/eval/websvc).
Getting Started
Debugging
Debugging the initial startup of your application
Be tolerant of long instantiation times
The SAFplus AMF will restart an application that exceeds its "instantiation timeout" (30 seconds by default). This will disrupt debugging efforts. To fix this issue, change the component's instantiation timeout. This can be accomplished in a variety of ways... to do it via XML file, look for your the definition in your component (tags: component->instantiate->timeout) and change it to a very large number. For example:
Start gdb instead of your program
Rename your program 'X' to X.bin. Next create an executable script X with this content:
Now when SAFplus AMF starts your program, it will pop up a terminal window and run your program inside gdb. It is important that the process id (PID) of the terminal be the same PID that SAFplus AMF started so that it can monitor your program. This is the purpose of the "exec" prefix and the --disable-factory flag. If your process forks another process and quits, the AMF will see this as a failure (your process quit, after all) and restart it. This can result in repeated restarts.