diff options
Diffstat (limited to 'cpp/demo/Glacier/session/Server.cpp')
-rw-r--r-- | cpp/demo/Glacier/session/Server.cpp | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/cpp/demo/Glacier/session/Server.cpp b/cpp/demo/Glacier/session/Server.cpp deleted file mode 100644 index 7d767890602..00000000000 --- a/cpp/demo/Glacier/session/Server.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Ice/Ice.h> -#include <Glacier/Glacier.h> -#include <HelloSessionI.h> - -using namespace std; - -class PermissionsVerifierI : public Glacier::PermissionsVerifier -{ -public: - - virtual bool - checkPermissions(const string& userId, const string& password, string&, const Ice::Current&) const - { - return userId == password; - } -}; - -int -run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) -{ - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("HelloSessionManager"); - - // - // Create the SessionManager. - // - Ice::ObjectPtr object = new HelloSessionManagerI(adapter); - adapter->add(object, Ice::stringToIdentity("HelloSessionManager")); - - // - // Create the PermissionsVerifier. - // - Ice::ObjectPtr verifier = new PermissionsVerifierI; - adapter->add(verifier, Ice::stringToIdentity("PermissionsVerifier")); - - adapter->activate(); - communicator->waitForShutdown(); - return EXIT_SUCCESS; -} - -int -main(int argc, char* argv[]) -{ - int status; - Ice::CommunicatorPtr communicator; - - try - { - Ice::PropertiesPtr properties = Ice::createProperties(); - properties->load("config"); - communicator = Ice::initializeWithProperties(argc, argv, properties); - status = run(argc, argv, communicator); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } - - if(communicator) - { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } - } - - return status; -} |