| 1 | #include <string>
|
---|
| 2 | #include "ariba/utility/system/StartupWrapper.h"
|
---|
| 3 | #include "PingPong.h"
|
---|
| 4 |
|
---|
| 5 | using std::string;
|
---|
| 6 | using ariba::utility::StartupWrapper;
|
---|
| 7 | using ariba::application::pingpong::PingPong;
|
---|
| 8 |
|
---|
| 9 | //*************************************************
|
---|
| 10 | /*
|
---|
| 11 | #include "ariba/utility/bootstrap/BootstrapManager.h"
|
---|
| 12 | using ariba::utility::BootstrapManager;
|
---|
| 13 |
|
---|
| 14 | void debug(){
|
---|
| 15 | StartupWrapper::startSystem();
|
---|
| 16 |
|
---|
| 17 | BootstrapManager& manager = BootstrapManager::instance();
|
---|
| 18 | manager.registerModule( BootstrapManager::BootstrapTypePeriodicBroadcast );
|
---|
| 19 |
|
---|
| 20 | manager.publish("testname", "testinfo1", "testinfo2", "testinfo3");
|
---|
| 21 | getchar();
|
---|
| 22 | manager.revoke("testname");
|
---|
| 23 |
|
---|
| 24 | manager.unregisterModule( BootstrapManager::BootstrapTypePeriodicBroadcast );
|
---|
| 25 | StartupWrapper::stopSystem();
|
---|
| 26 | }
|
---|
| 27 | */
|
---|
| 28 | //*************************************************
|
---|
| 29 |
|
---|
| 30 | int main( int argc, char** argv ) {
|
---|
| 31 |
|
---|
| 32 | //debug();
|
---|
| 33 | //return 0;
|
---|
| 34 |
|
---|
| 35 | // get config file
|
---|
| 36 | string config = "../etc/settings.cnf";
|
---|
| 37 | if (argc >= 2) config = argv[1];
|
---|
| 38 |
|
---|
| 39 | StartupWrapper::initConfig( config );
|
---|
| 40 | StartupWrapper::startSystem();
|
---|
| 41 |
|
---|
| 42 | // this will do the main functionality and block
|
---|
| 43 | PingPong ping;
|
---|
| 44 | StartupWrapper::startup(&ping);
|
---|
| 45 |
|
---|
| 46 | // --> we will run blocking until <enter> is hit
|
---|
| 47 |
|
---|
| 48 | StartupWrapper::shutdown(&ping);
|
---|
| 49 | StartupWrapper::stopSystem();
|
---|
| 50 |
|
---|
| 51 | return 0;
|
---|
| 52 | }
|
---|