diff options
author | Bernard Normier <bernard@zeroc.com> | 2003-11-25 20:34:55 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2003-11-25 20:34:55 +0000 |
commit | b3165c39f075d54ec310b23166bea90e40540b0e (patch) | |
tree | d9c7eedeba9131611e3f9959f4b2fe27c8790da3 /cpp/demo/Freeze/phonebook/Collocated.cpp | |
parent | More Freeze tracing (diff) | |
download | ice-b3165c39f075d54ec310b23166bea90e40540b0e.tar.bz2 ice-b3165c39f075d54ec310b23166bea90e40540b0e.tar.xz ice-b3165c39f075d54ec310b23166bea90e40540b0e.zip |
Added support for re-indexing
Diffstat (limited to 'cpp/demo/Freeze/phonebook/Collocated.cpp')
-rw-r--r-- | cpp/demo/Freeze/phonebook/Collocated.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/cpp/demo/Freeze/phonebook/Collocated.cpp b/cpp/demo/Freeze/phonebook/Collocated.cpp index c7bb8a6a411..d2d4a9d8689 100644 --- a/cpp/demo/Freeze/phonebook/Collocated.cpp +++ b/cpp/demo/Freeze/phonebook/Collocated.cpp @@ -14,6 +14,8 @@ #include <Ice/Application.h> #include <ContactFactory.h> +#include <NameIndex.h> +#include <PhoneBookI.h> #include <Parser.h> using namespace std; @@ -48,6 +50,12 @@ PhoneBookCollocated::run(int argc, char* argv[]) PropertiesPtr properties = communicator()->getProperties(); // + // Create and install a factory for contacts. + // + ContactFactoryPtr contactFactory = new ContactFactory(); + communicator()->addObjectFactory(contactFactory, "::Contact"); + + // // Create the name index. // NameIndexPtr index = new NameIndex("name"); @@ -65,6 +73,8 @@ PhoneBookCollocated::run(int argc, char* argv[]) evictor->setSize(evictorSize); } + contactFactory->setEvictor(evictor); + // // Create an Object Adapter, use the Evictor as Servant Locator. // @@ -74,16 +84,10 @@ PhoneBookCollocated::run(int argc, char* argv[]) // // Create the phonebook, and add it to the Object Adapter. // - PhoneBookIPtr phoneBook = new PhoneBookI(evictor, index); + PhoneBookIPtr phoneBook = new PhoneBookI(evictor, contactFactory, index); adapter->add(phoneBook, stringToIdentity("phonebook")); // - // Create and install a factory for contacts. - // - ObjectFactoryPtr contactFactory = new ContactFactory(evictor); - communicator()->addObjectFactory(contactFactory, "::Contact"); - - // // Everything ok, let's go. // int runParser(int, char*[], const CommunicatorPtr&); |