diff options
Diffstat (limited to 'cpp/src/IceBox/Server.cpp')
-rw-r--r-- | cpp/src/IceBox/Server.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/cpp/src/IceBox/Server.cpp b/cpp/src/IceBox/Server.cpp new file mode 100644 index 00000000000..13c18d746df --- /dev/null +++ b/cpp/src/IceBox/Server.cpp @@ -0,0 +1,54 @@ +// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <IceBox/ServiceManagerI.h> + +using namespace std; +using namespace Ice; +using namespace IceBox; + +int +main(int argc, char* argv[]) +{ + CommunicatorPtr communicator; + ServiceManagerPtr serviceManager; + int status; + + addArgumentPrefix("IceBox"); + + try + { + communicator = initialize(argc, argv); + ServiceManagerI* serviceManagerImpl = new ServiceManagerI(communicator); + serviceManager = serviceManagerImpl; + status = serviceManagerImpl->run(argc, argv); + } + catch (const Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + + if (communicator) + { + try + { + communicator->destroy(); + } + catch (const Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + } + + return status; +} |