diff options
author | Benoit Foucher <benoit@zeroc.com> | 2005-04-01 15:42:10 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2005-04-01 15:42:10 +0000 |
commit | f496752b90c2d5c9099b7dbca383bd30820a6ebd (patch) | |
tree | daba3e307aea127eccb2b1c50fe9353f18f1ca05 /cpp/src/IceGrid/ServerFactory.h | |
parent | ObjectNotExistException is now retried. (diff) | |
download | ice-f496752b90c2d5c9099b7dbca383bd30820a6ebd.tar.bz2 ice-f496752b90c2d5c9099b7dbca383bd30820a6ebd.tar.xz ice-f496752b90c2d5c9099b7dbca383bd30820a6ebd.zip |
Copied IcePack code to IceGrid.
Diffstat (limited to 'cpp/src/IceGrid/ServerFactory.h')
-rw-r--r-- | cpp/src/IceGrid/ServerFactory.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/ServerFactory.h b/cpp/src/IceGrid/ServerFactory.h new file mode 100644 index 00000000000..b19697a3dc0 --- /dev/null +++ b/cpp/src/IceGrid/ServerFactory.h @@ -0,0 +1,72 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2005 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. +// +// ********************************************************************** + +#ifndef ICE_GRID_SERVER_FACTORY_H +#define ICE_GRID_SERVER_FACTORY_H + +#include <IceGrid/Internal.h> +#include <IceGrid/Activator.h> +#include <IceGrid/WaitQueue.h> +#include <Freeze/Evictor.h> + +namespace IceGrid +{ + +class TraceLevels; +typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr; + +class ServerFactory : public Ice::ObjectFactory +{ +public: + + ServerFactory(const Ice::ObjectAdapterPtr&, + const TraceLevelsPtr&, + const std::string&, + const ActivatorPtr&, + const WaitQueuePtr&); + + // + // Ice::ObjectFactory method implementation. + // + virtual Ice::ObjectPtr create(const std::string&); + virtual void destroy(); + + void checkConsistency(); + + ServerPrx createServer(const std::string&, const ServerDescriptorPtr&); + ServerAdapterPrx createServerAdapter(const std::string& name, const ServerPrx& server); + + const WaitQueuePtr& getWaitQueue() const; + const Freeze::EvictorPtr& getServerEvictor() const; + const Freeze::EvictorPtr& getServerAdapterEvictor() const; + +private: + + friend class ServerI; + friend class ServerAdapterI; + + void destroy(const ServerPtr&, const Ice::Identity&); + void destroy(const ServerAdapterPtr&, const Ice::Identity&); + + Ice::ObjectAdapterPtr _adapter; + TraceLevelsPtr _traceLevels; + ActivatorPtr _activator; + WaitQueuePtr _waitQueue; + + Freeze::EvictorPtr _serverEvictor; + Freeze::EvictorPtr _serverAdapterEvictor; + Ice::Int _waitTime; + std::string _serversDir; +}; + +typedef ::IceUtil::Handle< ServerFactory> ServerFactoryPtr; + +} + +#endif |