summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/AdapterFactory.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2005-10-10 20:51:09 +0000
committerMark Spruiell <mes@zeroc.com>2005-10-10 20:51:09 +0000
commit5c820414d32245f8f23ad323787b72fb94f2782b (patch)
tree7b00c76b0c76606ed30740849b83e65921b8be84 /cpp/src/IcePack/AdapterFactory.cpp
parentadding IceGrid (diff)
downloadice-5c820414d32245f8f23ad323787b72fb94f2782b.tar.bz2
ice-5c820414d32245f8f23ad323787b72fb94f2782b.tar.xz
ice-5c820414d32245f8f23ad323787b72fb94f2782b.zip
bug 475: remove IcePack
Diffstat (limited to 'cpp/src/IcePack/AdapterFactory.cpp')
-rw-r--r--cpp/src/IcePack/AdapterFactory.cpp110
1 files changed, 0 insertions, 110 deletions
diff --git a/cpp/src/IcePack/AdapterFactory.cpp b/cpp/src/IcePack/AdapterFactory.cpp
deleted file mode 100644
index e2329992dd3..00000000000
--- a/cpp/src/IcePack/AdapterFactory.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-// **********************************************************************
-//
-// 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.
-//
-// **********************************************************************
-
-#include <Ice/Ice.h>
-#include <IceUtil/UUID.h>
-#include <Freeze/Evictor.h>
-#include <Freeze/Initialize.h>
-#include <IcePack/AdapterFactory.h>
-#include <IcePack/AdapterI.h>
-#include <IcePack/TraceLevels.h>
-
-using namespace std;
-using namespace IcePack;
-
-IcePack::AdapterFactory::AdapterFactory(const Ice::ObjectAdapterPtr& adapter,
- const TraceLevelsPtr& traceLevels,
- const string& envName) :
- _adapter(adapter),
- _traceLevels(traceLevels)
-{
- Ice::PropertiesPtr properties = _adapter->getCommunicator()->getProperties();
-
- //
- // Create and install the freeze evictor for standalone adapter objects.
- //
- properties->setProperty("Freeze.Evictor." + envName + ".adapter.SaveSizeTrigger", "1");
- _evictor = Freeze::createEvictor(_adapter, envName, "adapter");
- _evictor->setSize(1000);
-
- //
- // Install the server object factory.
- //
- _adapter->getCommunicator()->addObjectFactory(this, "::IcePack::StandaloneAdapter");
-
- //
- // Install the evictors.
- //
- _adapter->addServantLocator(_evictor, "IcePackStandaloneAdapter");
-}
-
-//
-// Ice::ObjectFactory::create method implementation
-//
-Ice::ObjectPtr
-IcePack::AdapterFactory::create(const string& type)
-{
- if(type == "::IcePack::StandaloneAdapter")
- {
- return new StandaloneAdapterI(this);
- }
- else
- {
- assert(false);
- return 0; // Keep the compiler happy.
- }
-}
-
-//
-// Ice::ObjectFactory::destroy method implementation
-//
-void
-IcePack::AdapterFactory::destroy()
-{
- _adapter = 0;
- _evictor = 0;
- _traceLevels = 0;
-}
-
-//
-// Create a new adapter servant with the given name and add
-// it the evictor database.
-//
-AdapterPrx
-IcePack::AdapterFactory::createStandaloneAdapter(const string& name)
-{
- StandaloneAdapterPtr adapterI = new StandaloneAdapterI(this);
-
- Ice::Identity id;
- id.category = "IcePackStandaloneAdapter";
- id.name = name + "-" + IceUtil::generateUUID();
-
- _evictor->add(adapterI, id);
-
- return AdapterPrx::uncheckedCast(_adapter->createProxy(id));
-}
-
-void
-IcePack::AdapterFactory::destroy(const Ice::Identity& id)
-{
- try
- {
- _evictor->remove(id);
- }
- catch(const Freeze::DatabaseException& ex)
- {
- ostringstream os;
- os << "couldn't destroy standalone adapter:\n" << ex;
- _traceLevels->logger->warning(os.str());
- }
- catch(const Freeze::EvictorDeactivatedException&)
- {
- assert(false);
- }
-}