summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/Client.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2002-08-22 22:52:31 +0000
committerBenoit Foucher <benoit@zeroc.com>2002-08-22 22:52:31 +0000
commit8ee8c08018e63d5b5b6c505490e27dcb3ef766db (patch)
tree4f888dacbe96952a910eb969a5428aba67030e7b /cpp/src/IcePack/Client.cpp
parentbug fix for identity reuse in add() (diff)
downloadice-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.cpp44
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;