summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-02-08 16:26:39 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-02-08 16:26:39 +0000
commitd0a0add45e5cbb240f157fe3f86f6cd6cc97fc6a (patch)
tree8bbe532f3f9286486434f0fe43ade00d3e5410d3 /cpp
parentAdded alternate sequence mappings (diff)
downloadice-d0a0add45e5cbb240f157fe3f86f6cd6cc97fc6a.tar.bz2
ice-d0a0add45e5cbb240f157fe3f86f6cd6cc97fc6a.tar.xz
ice-d0a0add45e5cbb240f157fe3f86f6cd6cc97fc6a.zip
Minor fixes for locator cache timeout.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/config/PropertyNames.def1
-rw-r--r--cpp/doc/Properties.sgml18
-rw-r--r--cpp/src/Ice/ObjectAdapterI.cpp5
-rw-r--r--cpp/src/Ice/PropertyNames.cpp3
-rw-r--r--cpp/src/Ice/PropertyNames.h2
-rw-r--r--cpp/src/Ice/Reference.cpp11
-rw-r--r--cpp/src/Ice/Reference.h2
-rw-r--r--cpp/src/Ice/ReferenceFactory.cpp14
-rw-r--r--cpp/src/Ice/ReferenceFactory.h2
9 files changed, 43 insertions, 15 deletions
diff --git a/cpp/config/PropertyNames.def b/cpp/config/PropertyNames.def
index 4206cb9c212..23d0418af60 100644
--- a/cpp/config/PropertyNames.def
+++ b/cpp/config/PropertyNames.def
@@ -121,6 +121,7 @@ Ice:
Default.CollocationOptimization
Default.Host
Default.Locator
+ Default.LocatorCacheTimeout
Default.Package
Default.Protocol
Default.Router
diff --git a/cpp/doc/Properties.sgml b/cpp/doc/Properties.sgml
index 06d5fc286a6..243c7eae370 100644
--- a/cpp/doc/Properties.sgml
+++ b/cpp/doc/Properties.sgml
@@ -885,6 +885,24 @@ for the &IceGrid; locator is <literal>IceGrid/Locator:tcp -p
</section>
</section>
+<section id="Ice.Default.LocatorCacheTimeout"><title>Ice.Default.LocatorCacheTimeout</title>
+<section><title>Synopsis</title>
+<synopsis>
+Ice.Default.LocatorCacheTimeout=<replaceable>num</replaceable>
+</synopsis>
+</section>
+<section>
+<title>Description</title>
+<para>
+Specifies the default locator cache timeout for indirect proxies. If
+<replaceable>num</replaceable> is set to a value larger than zero,
+locator cache entries older than <replaceable>num</replaceable>
+seconds will be ignored. If set to 0, the locator cache won't be
+used. If set to -1, locator cache entries won't expire.
+</para>
+</section>
+</section>
+
<section><title>Ice.Default.CollocationOptmization</title>
<section><title>Synopsis</title>
<synopsis>
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp
index 754d82f45f0..1932afdb59c 100644
--- a/cpp/src/Ice/ObjectAdapterI.cpp
+++ b/cpp/src/Ice/ObjectAdapterI.cpp
@@ -911,7 +911,7 @@ Ice::ObjectAdapterI::newDirectProxy(const Identity& ident, const string& facet)
//
ReferencePtr ref = _instance->referenceFactory()->create(
ident, _instance->getDefaultContext(), facet, Reference::ModeTwoway, false, endpoints, 0,
- _instance->defaultsAndOverrides()-> defaultCollocationOptimization);
+ _instance->defaultsAndOverrides()->defaultCollocationOptimization);
return _instance->proxyFactory()->referenceToProxy(ref);
}
@@ -924,7 +924,8 @@ Ice::ObjectAdapterI::newIndirectProxy(const Identity& ident, const string& facet
//
ReferencePtr ref = _instance->referenceFactory()->create(
ident, _instance->getDefaultContext(), facet, Reference::ModeTwoway, false, id, 0, _locatorInfo,
- _instance->defaultsAndOverrides()->defaultCollocationOptimization);
+ _instance->defaultsAndOverrides()->defaultCollocationOptimization,
+ _instance->defaultsAndOverrides()->defaultLocatorCacheTimeout);
//
// Return a proxy for the reference.
diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp
index c89b0abf810..82f6a784530 100644
--- a/cpp/src/Ice/PropertyNames.cpp
+++ b/cpp/src/Ice/PropertyNames.cpp
@@ -7,7 +7,7 @@
//
// **********************************************************************
-// Generated by makeprops.py from file `../config/PropertyNames.def', Wed Jan 4 16:04:58 2006
+// Generated by makeprops.py from file `../config/PropertyNames.def', Wed Feb 8 17:24:02 2006
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -23,6 +23,7 @@ const char* IceInternal::PropertyNames::IceProps[] =
"Ice.Default.CollocationOptimization",
"Ice.Default.Host",
"Ice.Default.Locator",
+ "Ice.Default.LocatorCacheTimeout",
"Ice.Default.Package",
"Ice.Default.Protocol",
"Ice.Default.Router",
diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h
index 937141f50d8..d79eafe36a2 100644
--- a/cpp/src/Ice/PropertyNames.h
+++ b/cpp/src/Ice/PropertyNames.h
@@ -7,7 +7,7 @@
//
// **********************************************************************
-// Generated by makeprops.py from file `../config/PropertyNames.def', Wed Jan 4 16:04:58 2006
+// Generated by makeprops.py from file `../config/PropertyNames.def', Wed Feb 8 17:24:02 2006
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index 6937b67d27c..b0bcdb05d78 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -772,7 +772,8 @@ IceInternal::DirectReference::changeLocator(const LocatorPrx& newLocator) const
LocatorInfoPtr newLocatorInfo = getInstance()->locatorManager()->get(newLocator);
return getInstance()->referenceFactory()->create(getIdentity(), getContext(), getFacet(), getMode(),
getSecure(), "", 0, newLocatorInfo,
- getCollocationOptimization());
+ getCollocationOptimization(),
+ getLocatorCacheTimeout());
}
else
{
@@ -831,7 +832,8 @@ IceInternal::DirectReference::changeAdapterId(const string& newAdapterId) const
getInstance()->locatorManager()->get(getInstance()->referenceFactory()->getDefaultLocator());
return getInstance()->referenceFactory()->create(getIdentity(), getContext(), getFacet(), getMode(),
getSecure(), newAdapterId, getRouterInfo(), locatorInfo,
- getCollocationOptimization());
+ getCollocationOptimization(),
+ getLocatorCacheTimeout());
}
else
{
@@ -991,11 +993,12 @@ void IceInternal::decRef(IceInternal::IndirectReference* p) { p->__decRef(); }
IceInternal::IndirectReference::IndirectReference(const InstancePtr& inst, const CommunicatorPtr& com,
const Identity& ident, const Context& ctx, const string& fs, Mode md,
bool sec, const string& adptid, const RouterInfoPtr& rtrInfo,
- const LocatorInfoPtr& locInfo, bool collocationOpt)
+ const LocatorInfoPtr& locInfo, bool collocationOpt,
+ int locatorCacheTimeout)
: RoutableReference(inst, com, ident, ctx, fs, md, sec, rtrInfo, collocationOpt),
_adapterId(adptid),
_locatorInfo(locInfo),
- _locatorCacheTimeout(inst->defaultsAndOverrides()->defaultLocatorCacheTimeout)
+ _locatorCacheTimeout(locatorCacheTimeout)
{
}
diff --git a/cpp/src/Ice/Reference.h b/cpp/src/Ice/Reference.h
index 2f3a89a3a8a..f610208b70c 100644
--- a/cpp/src/Ice/Reference.h
+++ b/cpp/src/Ice/Reference.h
@@ -250,7 +250,7 @@ public:
IndirectReference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&,
const std::string&, Mode, bool, const std::string&, const RouterInfoPtr&, const LocatorInfoPtr&,
- bool);
+ bool, int);
const LocatorInfoPtr& getLocatorInfo() const { return _locatorInfo; }
diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp
index c3601a6d1a3..94baac6b428 100644
--- a/cpp/src/Ice/ReferenceFactory.cpp
+++ b/cpp/src/Ice/ReferenceFactory.cpp
@@ -86,7 +86,8 @@ IceInternal::ReferenceFactory::create(const Identity& ident,
const string& adapterId,
const RouterInfoPtr& routerInfo,
const LocatorInfoPtr& locatorInfo,
- bool collocationOptimization)
+ bool collocationOptimization,
+ int locatorCacheTimeout)
{
Mutex::Lock sync(*this);
@@ -104,7 +105,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident,
// Create new reference
//
return new IndirectReference(_instance, _communicator, ident, context, facet, mode, secure,
- adapterId, routerInfo, locatorInfo, collocationOptimization);
+ adapterId, routerInfo, locatorInfo, collocationOptimization, locatorCacheTimeout);
}
ReferencePtr
@@ -410,7 +411,8 @@ IceInternal::ReferenceFactory::create(const string& str)
if(beg == string::npos)
{
return create(ident, _instance->getDefaultContext(), facet, mode, secure, "", routerInfo, locatorInfo,
- _instance->defaultsAndOverrides()->defaultCollocationOptimization);
+ _instance->defaultsAndOverrides()->defaultCollocationOptimization,
+ _instance->defaultsAndOverrides()->defaultLocatorCacheTimeout);
}
vector<EndpointIPtr> endpoints;
@@ -501,7 +503,8 @@ IceInternal::ReferenceFactory::create(const string& str)
throw ex;
}
return create(ident, _instance->getDefaultContext(), facet, mode, secure, adapter, routerInfo,
- locatorInfo, _instance->defaultsAndOverrides()->defaultCollocationOptimization);
+ locatorInfo, _instance->defaultsAndOverrides()->defaultCollocationOptimization,
+ _instance->defaultsAndOverrides()->defaultLocatorCacheTimeout);
break;
}
default:
@@ -578,7 +581,8 @@ IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s)
{
s->read(adapterId);
return create(ident, _instance->getDefaultContext(), facet, mode, secure, adapterId, routerInfo,
- locatorInfo, _instance->defaultsAndOverrides()->defaultCollocationOptimization);
+ locatorInfo, _instance->defaultsAndOverrides()->defaultCollocationOptimization,
+ _instance->defaultsAndOverrides()->defaultLocatorCacheTimeout);
}
}
diff --git a/cpp/src/Ice/ReferenceFactory.h b/cpp/src/Ice/ReferenceFactory.h
index 874ad79a909..c500767b9ab 100644
--- a/cpp/src/Ice/ReferenceFactory.h
+++ b/cpp/src/Ice/ReferenceFactory.h
@@ -39,7 +39,7 @@ public:
//
ReferencePtr create(const ::Ice::Identity&, const ::Ice::Context&, const ::std::string&,
Reference::Mode, bool, const ::std::string&,
- const RouterInfoPtr&, const LocatorInfoPtr&, bool);
+ const RouterInfoPtr&, const LocatorInfoPtr&, bool, int);
//
// Create a fixed reference.
//