summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-01-31 14:56:01 +0000
committerBenoit Foucher <benoit@zeroc.com>2007-01-31 14:56:01 +0000
commitcf12c661398f7ec68eb060a679ede5c5eaa8f407 (patch)
tree31abe4060186b539970f789d83db1a285ae9eadc
parentAdded EventLoggerMsg.res to link (diff)
downloadice-cf12c661398f7ec68eb060a679ede5c5eaa8f407.tar.bz2
ice-cf12c661398f7ec68eb060a679ede5c5eaa8f407.tar.xz
ice-cf12c661398f7ec68eb060a679ede5c5eaa8f407.zip
Added replication demo.
-rw-r--r--cpp/demo/IceGrid/allocate/config.grid1
-rw-r--r--cpp/demo/IceGrid/replication/Client.cpp106
-rw-r--r--cpp/demo/IceGrid/replication/Hello.ice24
-rw-r--r--cpp/demo/IceGrid/replication/HelloI.cpp30
-rw-r--r--cpp/demo/IceGrid/replication/HelloI.h29
-rw-r--r--cpp/demo/IceGrid/replication/Makefile43
-rw-r--r--cpp/demo/IceGrid/replication/Makefile.mak47
-rw-r--r--cpp/demo/IceGrid/replication/README33
-rw-r--r--cpp/demo/IceGrid/replication/Server.cpp41
-rw-r--r--cpp/demo/IceGrid/replication/application.xml39
-rw-r--r--cpp/demo/IceGrid/replication/config.client19
-rw-r--r--cpp/demo/IceGrid/replication/config.master21
-rw-r--r--cpp/demo/IceGrid/replication/config.node117
-rw-r--r--cpp/demo/IceGrid/replication/config.node217
-rw-r--r--cpp/demo/IceGrid/replication/config.replica1 (renamed from cpp/demo/IceGrid/simple/config.replica1)15
-rw-r--r--cpp/demo/IceGrid/replication/config.replica2 (renamed from cpp/demo/IceGrid/simple/config.replica2)15
-rw-r--r--cpp/demo/IceGrid/replication/db/master/.dummy0
-rw-r--r--cpp/demo/IceGrid/replication/db/node1/.dummy0
-rw-r--r--cpp/demo/IceGrid/replication/db/node2/.dummy0
-rw-r--r--cpp/demo/IceGrid/replication/db/replica1/.dummy0
-rw-r--r--cpp/demo/IceGrid/replication/db/replica2/.dummy0
-rwxr-xr-xcpp/demo/IceGrid/replication/replicationC.dsp157
-rwxr-xr-xcpp/demo/IceGrid/replication/replicationS.dsp165
-rw-r--r--cpp/demo/IceGrid/sessionActivation/config.grid1
-rw-r--r--cpp/demo/IceGrid/simple/config.client7
-rw-r--r--cpp/demo/IceGrid/simple/config.grid1
-rw-r--r--cpp/demo/IceGrid/simple/config.master15
-rw-r--r--cpp/demo/IceGrid/simple/config.node111
-rw-r--r--cpp/src/IceGrid/NodeCache.cpp17
-rw-r--r--cpp/src/IceGrid/NodeSessionI.cpp5
-rw-r--r--cpp/src/IceGrid/RegistryI.cpp9
-rw-r--r--cpp/src/IceGrid/ReplicaSessionI.cpp5
32 files changed, 818 insertions, 72 deletions
diff --git a/cpp/demo/IceGrid/allocate/config.grid b/cpp/demo/IceGrid/allocate/config.grid
index 1da5a23446c..21ef3f442f7 100644
--- a/cpp/demo/IceGrid/allocate/config.grid
+++ b/cpp/demo/IceGrid/allocate/config.grid
@@ -31,7 +31,6 @@ IceGrid.Node.CollocateRegistry=1
# Trace properties.
#
IceGrid.Node.Trace.Activator=1
-IceGrid.Node.Trace.Patch=1
#IceGrid.Node.Trace.Adapter=2
#IceGrid.Node.Trace.Server=3
diff --git a/cpp/demo/IceGrid/replication/Client.cpp b/cpp/demo/IceGrid/replication/Client.cpp
new file mode 100644
index 00000000000..1fc5d816c5d
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/Client.cpp
@@ -0,0 +1,106 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2007 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/Thread.h>
+#include <IceGrid/Query.h>
+#include <Hello.h>
+
+using namespace std;
+using namespace Demo;
+
+class HelloClient : public Ice::Application
+{
+public:
+
+ virtual int run(int, char*[]);
+ virtual void interruptCallback(int);
+
+private:
+
+ void menu();
+};
+
+int
+main(int argc, char* argv[])
+{
+ HelloClient app;
+ return app.main(argc, argv, "config.client");
+}
+
+int
+HelloClient::run(int argc, char* argv[])
+{
+ //
+ // Since this is an interactive demo we want the custom interrupt
+ // callback to be called when the process is interrupted.
+ //
+ callbackOnInterrupt();
+
+ //
+ // Get the hello proxy. We configure the proxy to not cache the
+ // server connection with the proxy and to disable the locator
+ // cache. With this configuration, the IceGrid locator will be
+ // queried for each invocation on the proxy and the invocation
+ // will be sent over the server connection matching the returned
+ // endpoints.
+ //
+ Ice::ObjectPrx obj = communicator()->stringToProxy("hello");
+ obj = obj->ice_connectionCached(false);
+ obj = obj->ice_locatorCacheTimeout(0);
+
+ HelloPrx hello = HelloPrx::checkedCast(obj);
+ if(!hello)
+ {
+ cerr << argv[0] << ": couldn't find a `::Demo::Hello' object." << endl;
+ return EXIT_FAILURE;
+ }
+
+ string s;
+ do
+ {
+ cout << "enter the number of iterations: ";
+ cin >> s;
+ int count = atoi(s.c_str());
+ cout << "enter the delay between each greetings (in ms): ";
+ cin >> s;
+ int delay = atoi(s.c_str());
+ if(delay < 0)
+ {
+ delay = 500; // 500 milli-seconds
+ }
+
+ for(int i = 0; i < count; i++)
+ {
+ cout << hello->getGreeting() << endl;
+ IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(delay));
+ }
+ }
+ while(cin.good() && s != "x");
+
+ return EXIT_SUCCESS;
+}
+
+void
+HelloClient::interruptCallback(int)
+{
+ try
+ {
+ communicator()->destroy();
+ }
+ catch(const IceUtil::Exception& ex)
+ {
+ cerr << appName() << ": " << ex << endl;
+ }
+ catch(...)
+ {
+ cerr << appName() << ": unknown exception" << endl;
+ }
+ exit(EXIT_SUCCESS);
+}
diff --git a/cpp/demo/IceGrid/replication/Hello.ice b/cpp/demo/IceGrid/replication/Hello.ice
new file mode 100644
index 00000000000..bf72d107ca9
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/Hello.ice
@@ -0,0 +1,24 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2007 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 HELLO_ICE
+#define HELLO_ICE
+
+module Demo
+{
+
+interface Hello
+{
+ ["cpp:const"] idempotent string getGreeting();
+ idempotent void shutdown();
+};
+
+};
+
+#endif
diff --git a/cpp/demo/IceGrid/replication/HelloI.cpp b/cpp/demo/IceGrid/replication/HelloI.cpp
new file mode 100644
index 00000000000..e7af2a1986c
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/HelloI.cpp
@@ -0,0 +1,30 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2007 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 <HelloI.h>
+
+using namespace std;
+
+HelloI::HelloI(const string& name) : _name(name)
+{
+}
+
+std::string
+HelloI::getGreeting(const Ice::Current&) const
+{
+ return _name + " says Hello World!";
+}
+
+void
+HelloI::shutdown(const Ice::Current& c)
+{
+ cout << _name << " shutting down..." << endl;
+ c.adapter->getCommunicator()->shutdown();
+}
diff --git a/cpp/demo/IceGrid/replication/HelloI.h b/cpp/demo/IceGrid/replication/HelloI.h
new file mode 100644
index 00000000000..a53da41613b
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/HelloI.h
@@ -0,0 +1,29 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2007 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 HELLO_I_H
+#define HELLO_I_H
+
+#include <Hello.h>
+
+class HelloI : public Demo::Hello
+{
+public:
+
+ HelloI(const std::string&);
+
+ virtual std::string getGreeting(const Ice::Current&) const;
+ virtual void shutdown(const Ice::Current&);
+
+private:
+
+ const std::string _name;
+};
+
+#endif
diff --git a/cpp/demo/IceGrid/replication/Makefile b/cpp/demo/IceGrid/replication/Makefile
new file mode 100644
index 00000000000..be4a6fd4dc6
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/Makefile
@@ -0,0 +1,43 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2007 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.
+#
+# **********************************************************************
+
+top_srcdir = ../../..
+
+CLIENT = client
+SERVER = server
+
+TARGETS = $(CLIENT) $(SERVER)
+
+OBJS = Hello.o
+
+COBJS = Client.o
+
+SOBJS = HelloI.o \
+ Server.o
+
+SRCS = $(OBJS:.o=.cpp) \
+ $(COBJS:.o=.cpp) \
+ $(SOBJS:.o=.cpp) \
+
+SLICE_SRCS = Hello.ice
+
+include $(top_srcdir)/config/Make.rules
+
+CPPFLAGS := -I. $(CPPFLAGS)
+LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil
+
+$(CLIENT): $(OBJS) $(COBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) -lIceGrid -lGlacier2 $(LIBS)
+
+$(SERVER): $(OBJS) $(SOBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) $(LIBS)
+
+include .depend
diff --git a/cpp/demo/IceGrid/replication/Makefile.mak b/cpp/demo/IceGrid/replication/Makefile.mak
new file mode 100644
index 00000000000..d92ed9f84a0
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/Makefile.mak
@@ -0,0 +1,47 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2007 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.
+#
+# **********************************************************************
+
+top_srcdir = ..\..\..
+
+CLIENT = client.exe
+SERVER = server.exe
+
+TARGETS = $(CLIENT) $(SERVER)
+
+OBJS = Hello.obj
+
+COBJS = Client.obj
+
+SOBJS = HelloI.obj \
+ Server.obj
+
+SRCS = $(OBJS:.obj=.cpp) \
+ $(COBJS:.obj=.cpp) \
+ $(SOBJS:.obj=.cpp)
+
+!include $(top_srcdir)/config/Make.rules.mak
+
+CPPFLAGS = -I. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+
+!if "$(CPP_COMPILER)" != "BCC2006" & "$(OPTIMIZE)" != "yes"
+CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb)
+SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb)
+!endif
+
+$(CLIENT): $(OBJS) $(COBJS)
+ $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(OBJS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) \
+ icegrid$(LIBSUFFIX).lib glacier2$(LIBSUFFIX).lib
+
+$(SERVER): $(OBJS) $(SOBJS)
+ $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(OBJS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+
+clean::
+ del /q Hello.cpp Hello.h
+
+!include .depend
diff --git a/cpp/demo/IceGrid/replication/README b/cpp/demo/IceGrid/replication/README
new file mode 100644
index 00000000000..98c73978570
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/README
@@ -0,0 +1,33 @@
+To run the demo, start the IceGrid registries and nodes (you can start
+the registries and nodes in any order, you can also start one or two
+registries and start more later):
+
+$ icegridregistry --Ice.Config=config.master
+$ icegridregistry --Ice.Config=config.replica1
+$ icegridregistry --Ice.Config=config.replica2
+$ icegridregistry --Ice.Config=config.node1
+$ icegridregistry --Ice.Config=config.node2
+
+In a separate window:
+
+$ icegridadmin --Ice.Config=config.client -e \
+ "application add 'application.xml'"
+$ client
+
+This will deploy the application described in the file
+"application.xml" and start the client.
+
+The client invokes the number of specified iterations with a given
+delay on a well-known proxy configured to use per-request load
+balancing. Each invocation queries the IceGrid registry locator to
+retrieve the endpoints of the object (you can set Ice.Trace.Location=1
+to see the locator invocations).
+
+While the client is running and invoking on the server, you can try to
+shutdown some of the registries with the `registry shutdown'
+icegridadmin command or from the IceGridAdmin GUI. You can of course
+also try to kill them. As long as one IceGrid registry is still
+running, the client will continue to work.
+
+Similarly, you can shutdown or kill one of the the server or IceGrid
+node, the client will continue to work.
diff --git a/cpp/demo/IceGrid/replication/Server.cpp b/cpp/demo/IceGrid/replication/Server.cpp
new file mode 100644
index 00000000000..c28d440de70
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/Server.cpp
@@ -0,0 +1,41 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2007 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 <HelloI.h>
+
+using namespace std;
+
+class Server : public Ice::Application
+{
+public:
+
+ virtual int run(int argc, char* argv[]);
+
+};
+
+int
+main(int argc, char* argv[])
+{
+ Server app;
+ int status = app.main(argc, argv);
+ return status;
+}
+
+int
+Server::run(int argc, char* argv[])
+{
+ Ice::PropertiesPtr properties = communicator()->getProperties();
+ Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
+ Ice::Identity id = communicator()->stringToIdentity(properties->getProperty("Identity"));
+ adapter->add(new HelloI(properties->getProperty("Ice.ServerId")), id);
+ adapter->activate();
+ communicator()->waitForShutdown();
+ return EXIT_SUCCESS;
+}
diff --git a/cpp/demo/IceGrid/replication/application.xml b/cpp/demo/IceGrid/replication/application.xml
new file mode 100644
index 00000000000..8ec77bbbc86
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/application.xml
@@ -0,0 +1,39 @@
+<!--
+ **********************************************************************
+
+ 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.
+
+ **********************************************************************
+-->
+
+<icegrid>
+ <application name="Simple">
+
+ <server-template id="SimpleServer">
+ <parameter name="index"/>
+ <server id="SimpleServer-${index}" exe="./server" activation="on-demand">
+ <adapter name="Hello" endpoints="tcp" register-process="true" replica-group="ReplicatedHelloAdapter"/>
+ <property name="Identity" value="hello"/>
+ </server>
+ </server-template>
+
+ <replica-group id="ReplicatedHelloAdapter">
+ <load-balancing type="random" n-replicas="2"/>
+ <object identity="hello" type="::Demo::Hello"/>
+ </replica-group>
+
+ <node name="node1">
+ <server-instance template="SimpleServer" index="1"/>
+ <server-instance template="SimpleServer" index="2"/>
+ </node>
+ <node name="node2">
+ <server-instance template="SimpleServer" index="3"/>
+ <server-instance template="SimpleServer" index="4"/>
+ </node>
+
+ </application>
+
+</icegrid>
diff --git a/cpp/demo/IceGrid/replication/config.client b/cpp/demo/IceGrid/replication/config.client
new file mode 100644
index 00000000000..4060f29ec7e
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/config.client
@@ -0,0 +1,19 @@
+#
+# The IceGrid locator proxy.
+#
+Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000:default -p 12001:default -p 12002
+
+Ice.Override.Timeout=10000
+
+#
+# Trace properties.
+#
+Ice.Trace.Network=1
+#Ice.Trace.Location=1
+
+#
+# IceGrid admin properties to allow running IceGrid admin clients.
+#
+IceGridAdmin.Username=benoit
+IceGridAdmin.Password=dummy
+
diff --git a/cpp/demo/IceGrid/replication/config.master b/cpp/demo/IceGrid/replication/config.master
new file mode 100644
index 00000000000..08471143e9e
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/config.master
@@ -0,0 +1,21 @@
+IceGrid.InstanceName=DemoIceGrid
+
+#
+# IceGrid registry configuration.
+#
+Ice.OA.IceGrid.Registry.Client.Endpoints=default -p 12000 -t 10000
+Ice.OA.IceGrid.Registry.Server.Endpoints=default -t 10000
+Ice.OA.IceGrid.Registry.Internal.Endpoints=default -t 10000
+IceGrid.Registry.Data=db/master
+IceGrid.Registry.PermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
+IceGrid.Registry.AdminPermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
+
+Ice.StdErr=db/master/stderr.txt
+Ice.StdOut=db/master/stdout.txt
+
+#
+# Trace properties.
+#
+Ice.ProgramName=Master
+IceGrid.Registry.Trace.Node=2
+IceGrid.Registry.Trace.Replica=2
diff --git a/cpp/demo/IceGrid/replication/config.node1 b/cpp/demo/IceGrid/replication/config.node1
new file mode 100644
index 00000000000..f9b805d0ed8
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/config.node1
@@ -0,0 +1,17 @@
+Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000 -t 10000:default -p 12001 -t 10000:default -p 12002 -t 10000
+
+#
+# IceGrid node configuration.
+#
+IceGrid.Node.Name=node1
+Ice.OA.IceGrid.Node.Endpoints=default -t 10000
+IceGrid.Node.Data=db/node1
+
+Ice.StdErr=db/node1/stderr.txt
+Ice.StdOut=db/node1/stdout.txt
+
+#
+# Trace properties.
+#
+Ice.ProgramName=Node1
+IceGrid.Node.Trace.Replica=2
diff --git a/cpp/demo/IceGrid/replication/config.node2 b/cpp/demo/IceGrid/replication/config.node2
new file mode 100644
index 00000000000..26a9e595af1
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/config.node2
@@ -0,0 +1,17 @@
+Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000 -t 10000:default -p 12001 -t 10000:default -p 12002 -t 10000
+
+#
+# IceGrid node configuration.
+#
+IceGrid.Node.Name=node2
+Ice.OA.IceGrid.Node.Endpoints=default -t 10000
+IceGrid.Node.Data=db/node2
+
+Ice.StdErr=db/node2/stderr.txt
+Ice.StdOut=db/node2/stdout.txt
+
+#
+# Trace properties.
+#
+Ice.ProgramName=Node2
+IceGrid.Node.Trace.Replica=2
diff --git a/cpp/demo/IceGrid/simple/config.replica1 b/cpp/demo/IceGrid/replication/config.replica1
index 273b0b40087..8df5cb75bcd 100644
--- a/cpp/demo/IceGrid/simple/config.replica1
+++ b/cpp/demo/IceGrid/replication/config.replica1
@@ -1,21 +1,22 @@
-Ice.ProgramName=Replica1
-
-Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000:default -p 12002
+Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000 -t 10000:default -p 12002 -t 10000
#
# IceGrid registry configuration.
#
-Ice.OA.IceGrid.Registry.Client.Endpoints=default -p 12001
-Ice.OA.IceGrid.Registry.Server.Endpoints=default
-Ice.OA.IceGrid.Registry.Internal.Endpoints=default
+Ice.OA.IceGrid.Registry.Client.Endpoints=default -p 12001 -t 10000
+Ice.OA.IceGrid.Registry.Server.Endpoints=default -t 10000
+Ice.OA.IceGrid.Registry.Internal.Endpoints=default -t 10000
IceGrid.Registry.Data=db/replica1
IceGrid.Registry.ReplicaName=Replica1
-
IceGrid.Registry.PermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
IceGrid.Registry.AdminPermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
+Ice.StdErr=db/replica1/stderr.txt
+Ice.StdOut=db/replica1/stdout.txt
+
#
# Trace properties.
#
+Ice.ProgramName=Replica1
IceGrid.Registry.Trace.Node=2
IceGrid.Registry.Trace.Replica=2
diff --git a/cpp/demo/IceGrid/simple/config.replica2 b/cpp/demo/IceGrid/replication/config.replica2
index 89ab9c247f4..732fa32d785 100644
--- a/cpp/demo/IceGrid/simple/config.replica2
+++ b/cpp/demo/IceGrid/replication/config.replica2
@@ -1,21 +1,22 @@
-Ice.ProgramName=Replica2
-
-Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000:default -p 12001
+Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000 -t 10000:default -p 12001 -t 10000
#
# IceGrid registry configuration.
#
-Ice.OA.IceGrid.Registry.Client.Endpoints=default -p 12002
-Ice.OA.IceGrid.Registry.Server.Endpoints=default
-Ice.OA.IceGrid.Registry.Internal.Endpoints=default
+Ice.OA.IceGrid.Registry.Client.Endpoints=default -p 12002 -t 10000
+Ice.OA.IceGrid.Registry.Server.Endpoints=default -t 10000
+Ice.OA.IceGrid.Registry.Internal.Endpoints=default -t 10000
IceGrid.Registry.Data=db/replica2
IceGrid.Registry.ReplicaName=Replica2
-
IceGrid.Registry.PermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
IceGrid.Registry.AdminPermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
+Ice.StdErr=db/replica2/stderr.txt
+Ice.StdOut=db/replica2/stdout.txt
+
#
# Trace properties.
#
+Ice.ProgramName=Replica2
IceGrid.Registry.Trace.Node=2
IceGrid.Registry.Trace.Replica=2
diff --git a/cpp/demo/IceGrid/replication/db/master/.dummy b/cpp/demo/IceGrid/replication/db/master/.dummy
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/db/master/.dummy
diff --git a/cpp/demo/IceGrid/replication/db/node1/.dummy b/cpp/demo/IceGrid/replication/db/node1/.dummy
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/db/node1/.dummy
diff --git a/cpp/demo/IceGrid/replication/db/node2/.dummy b/cpp/demo/IceGrid/replication/db/node2/.dummy
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/db/node2/.dummy
diff --git a/cpp/demo/IceGrid/replication/db/replica1/.dummy b/cpp/demo/IceGrid/replication/db/replica1/.dummy
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/db/replica1/.dummy
diff --git a/cpp/demo/IceGrid/replication/db/replica2/.dummy b/cpp/demo/IceGrid/replication/db/replica2/.dummy
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/db/replica2/.dummy
diff --git a/cpp/demo/IceGrid/replication/replicationC.dsp b/cpp/demo/IceGrid/replication/replicationC.dsp
new file mode 100755
index 00000000000..f8784b7dbb6
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/replicationC.dsp
@@ -0,0 +1,157 @@
+# Microsoft Developer Studio Project File - Name="replicationC" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=replicationC - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "replicationC.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "replicationC.mak" CFG="replicationC - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "replicationC - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "replicationC - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "replicationC - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "NDEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Ice.lib IceUtil.lib IceGrid.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"client.exe" /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /debug /nodefaultlib
+
+!ELSEIF "$(CFG)" == "replicationC - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /GZ /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Iced.lib IceUtild.lib IceGridd.lib /nologo /subsystem:console /debug /machine:I386 /out:"client.exe" /pdbtype:sept /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "replicationC - Win32 Release"
+# Name "replicationC - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Hello.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Hello.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Hello.ice
+
+!IF "$(CFG)" == "replicationC - Win32 Release"
+
+USERDEP__HELLO="..\..\..\bin\slice2cpp.exe" "..\..\..\lib\slice.lib"
+# Begin Custom Build
+InputPath=.\Hello.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Hello.ice
+
+"Hello.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Hello.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "replicationC - Win32 Debug"
+
+USERDEP__HELLO="..\..\..\bin\slice2cpp.exe" "..\..\..\lib\sliced.lib"
+# Begin Custom Build
+InputPath=.\Hello.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Hello.ice
+
+"Hello.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Hello.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Target
+# End Project
diff --git a/cpp/demo/IceGrid/replication/replicationS.dsp b/cpp/demo/IceGrid/replication/replicationS.dsp
new file mode 100755
index 00000000000..fe834948f35
--- /dev/null
+++ b/cpp/demo/IceGrid/replication/replicationS.dsp
@@ -0,0 +1,165 @@
+# Microsoft Developer Studio Project File - Name="replicationS" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=replicationS - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "replicationS.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "replicationS.mak" CFG="replicationS - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "replicationS - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "replicationS - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "replicationS - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "NDEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Ice.lib IceUtil.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"server.exe" /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /debug /nodefaultlib
+
+!ELSEIF "$(CFG)" == "replicationS - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /GZ /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Iced.lib IceUtild.lib /nologo /subsystem:console /debug /machine:I386 /out:"server.exe" /pdbtype:sept /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "replicationS - Win32 Release"
+# Name "replicationS - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Hello.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\HelloI.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Server.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Hello.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\HelloI.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Hello.ice
+
+!IF "$(CFG)" == "replicationS - Win32 Release"
+
+USERDEP__HELLO="..\..\..\bin\slice2cpp.exe" "..\..\..\lib\slice.lib"
+# Begin Custom Build
+InputPath=.\Hello.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Hello.ice
+
+"Hello.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Hello.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "replicationS - Win32 Debug"
+
+USERDEP__HELLO="..\..\..\bin\slice2cpp.exe" "..\..\..\lib\sliced.lib"
+# Begin Custom Build
+InputPath=.\Hello.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Hello.ice
+
+"Hello.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Hello.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Target
+# End Project
diff --git a/cpp/demo/IceGrid/sessionActivation/config.grid b/cpp/demo/IceGrid/sessionActivation/config.grid
index 1da5a23446c..21ef3f442f7 100644
--- a/cpp/demo/IceGrid/sessionActivation/config.grid
+++ b/cpp/demo/IceGrid/sessionActivation/config.grid
@@ -31,7 +31,6 @@ IceGrid.Node.CollocateRegistry=1
# Trace properties.
#
IceGrid.Node.Trace.Activator=1
-IceGrid.Node.Trace.Patch=1
#IceGrid.Node.Trace.Adapter=2
#IceGrid.Node.Trace.Server=3
diff --git a/cpp/demo/IceGrid/simple/config.client b/cpp/demo/IceGrid/simple/config.client
index 69daeafd8dd..f72bb443a2f 100644
--- a/cpp/demo/IceGrid/simple/config.client
+++ b/cpp/demo/IceGrid/simple/config.client
@@ -1,9 +1,10 @@
#
# The IceGrid locator proxy.
#
-#Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000
-Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000:default -p 12001:default -p 12002
-
+Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000
+#
+# Dummy username and password for icegridadmin.
+#
IceGridAdmin.Username=benoit
IceGridAdmin.Password=dummy
diff --git a/cpp/demo/IceGrid/simple/config.grid b/cpp/demo/IceGrid/simple/config.grid
index 1da5a23446c..21ef3f442f7 100644
--- a/cpp/demo/IceGrid/simple/config.grid
+++ b/cpp/demo/IceGrid/simple/config.grid
@@ -31,7 +31,6 @@ IceGrid.Node.CollocateRegistry=1
# Trace properties.
#
IceGrid.Node.Trace.Activator=1
-IceGrid.Node.Trace.Patch=1
#IceGrid.Node.Trace.Adapter=2
#IceGrid.Node.Trace.Server=3
diff --git a/cpp/demo/IceGrid/simple/config.master b/cpp/demo/IceGrid/simple/config.master
deleted file mode 100644
index a92de3fe6de..00000000000
--- a/cpp/demo/IceGrid/simple/config.master
+++ /dev/null
@@ -1,15 +0,0 @@
-IceGrid.InstanceName=DemoIceGrid
-
-Ice.ProgramName=Master
-
-Ice.OA.IceGrid.Registry.Client.Endpoints=default -p 12000
-Ice.OA.IceGrid.Registry.Server.Endpoints=default
-Ice.OA.IceGrid.Registry.Internal.Endpoints=default
-IceGrid.Registry.Data=db/registry
-IceGrid.Registry.PermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
-IceGrid.Registry.AdminPermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
-
-IceGrid.Registry.Trace.Node=1
-IceGrid.Registry.Trace.Replica=1
-
-IceGrid.Registry.DefaultTemplates=../../../config/templates.xml
diff --git a/cpp/demo/IceGrid/simple/config.node1 b/cpp/demo/IceGrid/simple/config.node1
deleted file mode 100644
index bfb2d204877..00000000000
--- a/cpp/demo/IceGrid/simple/config.node1
+++ /dev/null
@@ -1,11 +0,0 @@
-Ice.ProgramName=Node1
-
-Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000:default -p 12001:default -p 12002
-
-IceGrid.Node.Name=localhost
-Ice.OA.IceGrid.Node.Endpoints=default
-IceGrid.Node.Data=db/node1
-#IceGrid.Node.Output=db
-#IceGrid.Node.RedirectErrToOut=1
-
-IceGrid.Node.Trace.Replica=2
diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp
index 66cc757afc1..63e23ea919c 100644
--- a/cpp/src/IceGrid/NodeCache.cpp
+++ b/cpp/src/IceGrid/NodeCache.cpp
@@ -149,7 +149,7 @@ public:
}
void
- ice_response(const ServerPrx& proxy, const AdapterPrxDict& adpts, int at, int dt)
+ ice_response(const ServerPrx& server, const AdapterPrxDict& adapters, int at, int dt)
{
if(_traceLevels && _traceLevels->server > 1)
{
@@ -158,15 +158,9 @@ public:
}
//
- // Add the node session timeout on the proxies.
+ // Add the node session timeout on the proxies to ensure the
+ // timeout is large enough.
//
- ServerPrx server = ServerPrx::uncheckedCast(proxy->ice_timeout(_timeout * 1000));
- AdapterPrxDict adapters;
- for(AdapterPrxDict::const_iterator p = adpts.begin(); p != adpts.end(); ++p)
- {
- adapters.insert(make_pair(p->first, AdapterPrx::uncheckedCast(p->second->ice_timeout(_timeout * 1000))));
- }
-
_server->loadCallback(server, adapters, at + _timeout, dt + _timeout);
}
@@ -556,7 +550,7 @@ NodeEntry::loadServer(const ServerEntryPtr& entry, const ServerInfo& server, con
// time to deactivate, up to "deactivation-timeout"
// seconds).
//
- if(timeout > 0 && timeout != sessionTimeout)
+ if(timeout > 0)
{
node = NodePrx::uncheckedCast(node->ice_timeout(timeout * 1000));
}
@@ -608,7 +602,6 @@ NodeEntry::destroyServer(const ServerEntryPtr& entry, const ServerInfo& info, in
Lock sync(*this);
checkSession();
node = _session->getNode();
- int sessionTimeout = _session->getTimeout();
//
// Check if we should use a specific timeout (the load
@@ -616,7 +609,7 @@ NodeEntry::destroyServer(const ServerEntryPtr& entry, const ServerInfo& info, in
// time to deactivate, up to "deactivation-timeout"
// seconds).
//
- if(timeout > 0 && timeout != sessionTimeout)
+ if(timeout > 0)
{
node = NodePrx::uncheckedCast(node->ice_timeout(timeout * 1000));
}
diff --git a/cpp/src/IceGrid/NodeSessionI.cpp b/cpp/src/IceGrid/NodeSessionI.cpp
index e35dd5f0c6e..afc5619c2d5 100644
--- a/cpp/src/IceGrid/NodeSessionI.cpp
+++ b/cpp/src/IceGrid/NodeSessionI.cpp
@@ -138,7 +138,7 @@ NodeSessionI::NodeSessionI(const DatabasePtr& database,
const LoadInfo& load) :
_database(database),
_traceLevels(database->getTraceLevels()),
- _node(NodePrx::uncheckedCast(node->ice_timeout(timeout * 1000))),
+ _node(node),
_info(info),
_timeout(timeout),
_timestamp(IceUtil::Time::now()),
@@ -155,8 +155,7 @@ NodeSessionI::NodeSessionI(const DatabasePtr& database,
objInfo.proxy = _node;
_database->addInternalObject(objInfo, true); // Add or update previous node proxy.
- Ice::ObjectPrx prx = _database->getInternalAdapter()->addWithUUID(this)->ice_timeout(timeout * 1000);
- _proxy = NodeSessionPrx::uncheckedCast(prx);
+ _proxy = NodeSessionPrx::uncheckedCast(_database->getInternalAdapter()->addWithUUID(this));
}
catch(const NodeActiveException&)
{
diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp
index ff0886ba67e..e059519cbc0 100644
--- a/cpp/src/IceGrid/RegistryI.cpp
+++ b/cpp/src/IceGrid/RegistryI.cpp
@@ -1177,9 +1177,6 @@ RegistryI::registerReplicas(const InternalRegistryPrx& internalRegistry,
set<NodePrx> nodes;
nodes.insert(dbNodes.begin(), dbNodes.end());
- int timeout =
- _communicator->getProperties()->getPropertyAsIntWithDefault("IceGrid.Registry.ReplicaSessionTimeout", 30);
-
for(InternalRegistryPrxSeq::const_iterator r = replicas.begin(); r != replicas.end(); ++r)
{
if((*r)->ice_getIdentity() != internalRegistry->ice_getIdentity())
@@ -1201,7 +1198,6 @@ RegistryI::registerReplicas(const InternalRegistryPrx& internalRegistry,
try
{
- InternalRegistryPrx replica = InternalRegistryPrx::uncheckedCast((*r)->ice_timeout(timeout * 1000));
(*r)->registerWithReplica(internalRegistry);
NodePrxSeq nds = (*r)->getNodes();
nodes.insert(nds.begin(), nds.end());
@@ -1252,15 +1248,12 @@ RegistryI::registerNodes(const InternalRegistryPrx& internalRegistry, const Node
{
const string prefix("Node-");
- int timeout =
- _communicator->getProperties()->getPropertyAsIntWithDefault("IceGrid.Registry.NodeSessionTimeout", 30);
for(NodePrxSeq::const_iterator p = nodes.begin(); p != nodes.end(); ++p)
{
assert((*p)->ice_getIdentity().name.find(prefix) != string::npos);
try
{
- NodePrx node = NodePrx::uncheckedCast((*p)->ice_timeout(timeout * 1000));
- _database->getNode((*p)->ice_getIdentity().name.substr(prefix.size()))->setProxy(node);
+ _database->getNode((*p)->ice_getIdentity().name.substr(prefix.size()))->setProxy(*p);
}
catch(const NodeNotExistException&)
{
diff --git a/cpp/src/IceGrid/ReplicaSessionI.cpp b/cpp/src/IceGrid/ReplicaSessionI.cpp
index 389230ebe97..67c633308ff 100644
--- a/cpp/src/IceGrid/ReplicaSessionI.cpp
+++ b/cpp/src/IceGrid/ReplicaSessionI.cpp
@@ -36,7 +36,7 @@ ReplicaSessionI::ReplicaSessionI(const DatabasePtr& database,
_database(database),
_wellKnownObjects(wellKnownObjects),
_traceLevels(database->getTraceLevels()),
- _internalRegistry(InternalRegistryPrx::uncheckedCast(proxy->ice_timeout(timeout * 1000))),
+ _internalRegistry(proxy),
_info(info),
_timeout(timeout),
_timestamp(IceUtil::Time::now()),
@@ -50,8 +50,7 @@ ReplicaSessionI::ReplicaSessionI(const DatabasePtr& database,
ObserverTopicPtr obsv = _database->getObserverTopic(RegistryObserverTopicName);
RegistryObserverTopicPtr::dynamicCast(obsv)->registryUp(toRegistryInfo(_info));
- Ice::ObjectPrx prx = _database->getInternalAdapter()->addWithUUID(this)->ice_timeout(timeout * 1000);
- _proxy = ReplicaSessionPrx::uncheckedCast(prx);
+ _proxy = ReplicaSessionPrx::uncheckedCast(_database->getInternalAdapter()->addWithUUID(this));
}
catch(const ReplicaActiveException&)
{