diff options
author | Benoit Foucher <benoit@zeroc.com> | 2002-08-22 22:52:31 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2002-08-22 22:52:31 +0000 |
commit | 8ee8c08018e63d5b5b6c505490e27dcb3ef766db (patch) | |
tree | 4f888dacbe96952a910eb969a5428aba67030e7b /cpp/src/IcePack/Client.cpp | |
parent | bug fix for identity reuse in add() (diff) | |
download | ice-8ee8c08018e63d5b5b6c505490e27dcb3ef766db.tar.bz2 ice-8ee8c08018e63d5b5b6c505490e27dcb3ef766db.tar.xz ice-8ee8c08018e63d5b5b6c505490e27dcb3ef766db.zip |
Added support for IcePack node and re-factored many things in IcePack.
Diffstat (limited to 'cpp/src/IcePack/Client.cpp')
-rw-r--r-- | cpp/src/IcePack/Client.cpp | 44 |
1 files changed, 5 insertions, 39 deletions
diff --git a/cpp/src/IcePack/Client.cpp b/cpp/src/IcePack/Client.cpp index a3c1d5960b1..5484c0b2c86 100644 --- a/cpp/src/IcePack/Client.cpp +++ b/cpp/src/IcePack/Client.cpp @@ -9,6 +9,7 @@ // ********************************************************************** #include <Ice/Application.h> +#include <IcePack/ExceptionFactory.h> #include <IcePack/Parser.h> #include <fstream> @@ -48,39 +49,6 @@ Client::usage() ; } -class AdminExceptionFactory : public Ice::UserExceptionFactory -{ -public: - - virtual void createAndThrow(const string& type) - { - if(type == "::IcePack::DeploymentException") - { - throw DeploymentException(); - } - else if(type == "::IcePack::ParserDeploymentException") - { - throw ParserDeploymentException(); - } - else if(type == "::IcePack::AdapterDeploymentException") - { - throw AdapterDeploymentException(); - } - else if(type == "::IcePack::OfferDeploymentException") - { - throw OfferDeploymentException(); - } - else if(type == "::IcePack::ServerDeploymentException") - { - throw ServerDeploymentException(); - } - } - - virtual void destroy() - { - } -}; - int Client::run(int argc, char* argv[]) { @@ -182,12 +150,10 @@ Client::run(int argc, char* argv[]) return EXIT_FAILURE; } - Ice::UserExceptionFactoryPtr factory = new AdminExceptionFactory; - communicator()->addUserExceptionFactory(factory, "::IcePack::DeploymentException"); - communicator()->addUserExceptionFactory(factory, "::IcePack::ParserDeploymentException"); - communicator()->addUserExceptionFactory(factory, "::IcePack::AdapterDeploymentException"); - communicator()->addUserExceptionFactory(factory, "::IcePack::ServerDeploymentException"); - communicator()->addUserExceptionFactory(factory, "::IcePack::OfferDeploymentException"); + // + // Register IcePack exception factory with the communicator. + // + Ice::UserExceptionFactoryPtr(new ExceptionFactory(communicator())); ParserPtr parser = Parser::createParser(communicator(), admin); int status = EXIT_SUCCESS; |