diff options
author | Matthew Newhook <matthew@zeroc.com> | 2015-03-18 12:58:16 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2015-03-18 12:58:16 -0230 |
commit | 9b7668c7c92cf9cb311fe444cdddb489cd2a219d (patch) | |
tree | 5016567c58c81f5654e9d01935e199c6bf4761d2 /cpp/demo/Database/Oracle/proc/Server.pc | |
parent | VS add-in & build updates: (diff) | |
download | ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.bz2 ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.xz ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.zip |
Removed demos.
Moved demoscript to distribution.
Diffstat (limited to 'cpp/demo/Database/Oracle/proc/Server.pc')
-rw-r--r-- | cpp/demo/Database/Oracle/proc/Server.pc | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/cpp/demo/Database/Oracle/proc/Server.pc b/cpp/demo/Database/Oracle/proc/Server.pc deleted file mode 100644 index 34e3c6e9c45..00000000000 --- a/cpp/demo/Database/Oracle/proc/Server.pc +++ /dev/null @@ -1,106 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 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 <EmpI.h> -#include <DeptI.h> -#include <DeptFactoryI.h> -#include <Ice/Application.h> -#include <Ice/ServantLocator.h> -#include <sqlca.h> - -using namespace std; - -class HRServer : public Ice::Application -{ -public: - - HRServer(const CurrentSqlContext&); - - virtual int run(int, char*[]); - -private: - CurrentSqlContext _currentCtx; -}; - -class DefaultServantLocator : public Ice::ServantLocator -{ -public: - - DefaultServantLocator(const Ice::ObjectPtr& servant) : - _servant(servant) - { - } - - virtual Ice::ObjectPtr locate(const Ice::Current&, Ice::LocalObjectPtr&) - { - return _servant; - } - - virtual void finished(const Ice::Current& curr, - const Ice::ObjectPtr& servant, - const Ice::LocalObjectPtr& cookie) - { - } - - virtual void deactivate(const std::string&) - { - } - -private: - Ice::ObjectPtr _servant; -}; - - -int -main(int argc, char* argv[]) -{ - sqlca sqlca; - EXEC SQL CONTEXT USE DEFAULT; - EXEC SQL ENABLE THREADS; - - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - initData.properties->load("config.server"); - - const string connectInfo = initData.properties - ->getPropertyWithDefault("Oracle.ConnectInfo", "scott/tiger"); - CurrentSqlContext currentCtx(connectInfo); - initData.threadHook = currentCtx.getHook(); - - HRServer app(currentCtx); - return app.main(argc, argv, initData); -} - -HRServer::HRServer(const CurrentSqlContext& currentCtx) : - _currentCtx(currentCtx) -{ -} - -int -HRServer::run(int argc, char* argv[]) -{ - Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("HR"); - - const string empCategory = "Emp"; - const string deptCategory = "Dept"; - - adapter->addServantLocator(new DefaultServantLocator(new EmpI(_currentCtx, empCategory, deptCategory)), - empCategory); - - adapter->addServantLocator(new DefaultServantLocator(new DeptI(_currentCtx, empCategory)), deptCategory); - - adapter->add(new DeptFactoryI(_currentCtx, deptCategory, empCategory), - communicator()->stringToIdentity("DeptFactory")); - - adapter->activate(); - communicator()->waitForShutdown(); - return EXIT_SUCCESS; -} - |