diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2007-05-03 16:02:46 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2007-05-03 16:02:46 +0000 |
commit | 4f872edb633cfc698289668a139e2901b7c30677 (patch) | |
tree | a903d822fcca58f1a24a020270ccc3e26b400adb /cppe/src/IceE/ReferenceFactory.cpp | |
parent | Added gumstix info (diff) | |
download | ice-4f872edb633cfc698289668a139e2901b7c30677.tar.bz2 ice-4f872edb633cfc698289668a139e2901b7c30677.tar.xz ice-4f872edb633cfc698289668a139e2901b7c30677.zip |
Added propertytoProxy
Diffstat (limited to 'cppe/src/IceE/ReferenceFactory.cpp')
-rw-r--r-- | cppe/src/IceE/ReferenceFactory.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cppe/src/IceE/ReferenceFactory.cpp b/cppe/src/IceE/ReferenceFactory.cpp index 6fb0bed3245..df4aba6f999 100644 --- a/cppe/src/IceE/ReferenceFactory.cpp +++ b/cppe/src/IceE/ReferenceFactory.cpp @@ -24,6 +24,7 @@ #include <IceE/StringUtil.h> #include <IceE/LoggerUtil.h> #include <IceE/Properties.h> +#include <IceE/Communicator.h> using namespace std; using namespace Ice; @@ -592,6 +593,38 @@ IceInternal::ReferenceFactory::create(const string& str) } ReferencePtr +IceInternal::ReferenceFactory::createFromProperties(const string& propertyPrefix) +{ + PropertiesPtr properties = _instance->initializationData().properties; + + ReferencePtr ref = create(properties->getProperty(propertyPrefix)); + if(!ref) + { + return 0; + } + +#ifdef ICEE_HAS_LOCATOR + string property = propertyPrefix + ".Locator"; + if(!properties->getProperty(property).empty()) + { + ref = ref->changeLocator( + LocatorPrx::uncheckedCast(_communicator->propertyToProxy(property))); + } +#endif + +#ifdef ICEE_HAS_ROUTER + property = propertyPrefix + ".Router"; + if(!properties->getProperty(property).empty()) + { + ref = ref->changeRouter( + RouterPrx::uncheckedCast(_communicator->propertyToProxy(property))); + } +#endif + + return ref; +} + +ReferencePtr IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s) { // |