From 66a0681bdb76416f73c242d40c228ba61182ec2c Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Fri, 31 Mar 2006 04:29:47 +0000 Subject: Added --server option to icegridadmin --- cpp/src/IceGrid/Client.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cpp/src/IceGrid/Client.cpp') diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp index 4edd7b01536..ef613e541a1 100644 --- a/cpp/src/IceGrid/Client.cpp +++ b/cpp/src/IceGrid/Client.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include using namespace std; @@ -47,6 +48,7 @@ Client::usage() "-IDIR Put DIR in the include file search path.\n" "-e COMMANDS Execute COMMANDS.\n" "-d, --debug Print debug messages.\n" + "-s, --server Start icegridadmin as a server (to parse XML files).\n" ; } @@ -65,6 +67,7 @@ Client::run(int argc, char* argv[]) opts.addOpt("I", "", IceUtil::Options::NeedArg, "", IceUtil::Options::Repeat); opts.addOpt("e", "", IceUtil::Options::NeedArg, "", IceUtil::Options::Repeat); opts.addOpt("d", "debug"); + opts.addOpt("s", "server"); vector args; try @@ -88,6 +91,21 @@ Client::run(int argc, char* argv[]) cout << ICE_STRING_VERSION << endl; return EXIT_SUCCESS; } + + if(opts.isSet("s") || opts.isSet("server")) + { + ObjectAdapterPtr adapter = + communicator()->createObjectAdapterWithEndpoints("FileParser", "tcp -h localhost"); + adapter->activate(); + ObjectPrx proxy = adapter-> + add(new FileParserI, Ice::stringToIdentity("FileParser")); + cout << proxy << endl; + + communicator()->waitForShutdown(); + return EXIT_SUCCESS; + } + + if(opts.isSet("D")) { vector optargs = opts.argVec("D"); -- cgit v1.2.3