summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/CHANGES7
-rw-r--r--cpp/src/Ice/BasicStream.cpp24
2 files changed, 29 insertions, 2 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES
index 7bae539bed2..1e592ef55a5 100644
--- a/cpp/CHANGES
+++ b/cpp/CHANGES
@@ -1,6 +1,10 @@
Changes since version 1.1.0
---------------------------
+- Added support for a default object factory, similar to the semantics of servant
+ locators. Specifically, a factory registered with an empty type id is invoked
+ when a type-specific factory cannot not be found.
+
- Added Ice::Properties::parseIceCommandLineOptions(). This operation converts to
properties all options that start with one of the following prefixes:
--Ice, --IceBox, --IcePack, --IcePatch, --IceSSL, --IceStorm, --Freeze, and --Glacier.
@@ -19,8 +23,7 @@ Changes since version 1.1.0
- Added Linux/SPARC port from Ferris McCormick
-- Fixed a bug where daemonized Ice::Application wouldn't shutdown
- properly.
+- Fixed a bug where daemonized Ice::Application wouldn't shutdown properly.
- Major Freeze update:
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp
index c672e456c08..ed0e50a54ff 100644
--- a/cpp/src/Ice/BasicStream.cpp
+++ b/cpp/src/Ice/BasicStream.cpp
@@ -1233,17 +1233,41 @@ IceInternal::BasicStream::read(PatchFunc patchFunc, void* patchAddr)
string id;
readTypeId(id);
+ //
+ // Try to find a factory registered for the specific type.
+ //
ObjectFactoryPtr userFactory = _instance->servantFactoryManager()->find(id);
if(userFactory)
{
v = userFactory->create(id);
}
+ //
+ // If that fails, invoke the default factory if one has been registered.
+ //
+ if(!v)
+ {
+ userFactory = _instance->servantFactoryManager()->find("");
+ if(userFactory)
+ {
+ v = userFactory->create(id);
+ }
+ }
+
+ //
+ // There isn't a static factory for Ice::Object, so check for that case now.
+ // We do this *after* the factory inquiries above so that a factory could be
+ // registered for "::Ice::Object".
+ //
if(!v && id == Ice::Object::ice_staticId())
{
v = new ::Ice::Object;
}
+ //
+ // Last chance: check the table of static factories (i.e., automatically generated
+ // factories for concrete classes).
+ //
if(!v)
{
ObjectFactoryPtr of = Ice::factoryTable->getObjectFactory(id);