diff options
author | Michi Henning <michi@zeroc.com> | 2007-09-19 11:22:45 +1000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2007-09-19 11:22:45 +1000 |
commit | cd0338e842b7751c423f5384d247202d3c981be4 (patch) | |
tree | 2b2965f974c3f7f0dda3b94ed4d7c1c49175d375 /cpp/src | |
parent | Added more tests. Changed stack marshaling to reverse order during (diff) | |
parent | Added missing facet (diff) | |
download | ice-cd0338e842b7751c423f5384d247202d3c981be4.tar.bz2 ice-cd0338e842b7751c423f5384d247202d3c981be4.tar.xz ice-cd0338e842b7751c423f5384d247202d3c981be4.zip |
Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice
Conflicts:
cs/src/Ice/Instance.cs
Removed conflicts. Added more tests. Changed stack
marshaling to reverse order during marshaling instead
of during unmarshaling.
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Freeze/ConnectionI.cpp | 21 | ||||
-rw-r--r-- | cpp/src/Freeze/MapI.cpp | 1 | ||||
-rw-r--r-- | cpp/src/Freeze/TransactionI.cpp | 1 | ||||
-rw-r--r-- | cpp/src/Ice/CommunicatorI.cpp | 18 | ||||
-rw-r--r-- | cpp/src/Ice/CommunicatorI.h | 4 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 179 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.h | 25 | ||||
-rw-r--r-- | cpp/src/Ice/ObjectAdapterI.cpp | 28 | ||||
-rw-r--r-- | cpp/src/Ice/ObjectAdapterI.h | 15 | ||||
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 42 | ||||
-rw-r--r-- | cpp/src/Ice/PropertiesI.h | 20 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.cpp | 83 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.h | 2 | ||||
-rw-r--r-- | cpp/src/IceBox/Service.cpp | 1 | ||||
-rw-r--r-- | cpp/src/IceBox/ServiceManagerI.cpp | 14 | ||||
-rw-r--r-- | cpp/src/IceGrid/DescriptorHelper.cpp | 51 | ||||
-rw-r--r-- | cpp/src/IceGrid/DescriptorHelper.h | 20 | ||||
-rwxr-xr-x | cpp/src/IceUtil/Timer.cpp | 2 |
18 files changed, 413 insertions, 114 deletions
diff --git a/cpp/src/Freeze/ConnectionI.cpp b/cpp/src/Freeze/ConnectionI.cpp index 258060f9f5c..7bd9a114f13 100644 --- a/cpp/src/Freeze/ConnectionI.cpp +++ b/cpp/src/Freeze/ConnectionI.cpp @@ -44,17 +44,8 @@ Freeze::ConnectionI::close() { if(_transaction) { - try - { - _transaction->rollbackInternal(true); - } - catch(const DatabaseException&) - { - // - // Ignored - // - } - assert(!_transaction); + _transaction->rollbackInternal(true); + assert(_transaction == 0); } while(!_mapList.empty()) @@ -97,7 +88,13 @@ Freeze::ConnectionI::__decRef() else if(_refCount == 1 && _transaction != 0 && _transaction->dbTxn() != 0 && _transaction->__getRefNoSync() == 1) { sync.release(); - close(); + if(_transaction) + { + // + // This makes the transaction release the last refcount on the connection + // + _transaction->rollbackInternal(true); + } } } diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp index ee2b1de0e3a..57728bc8f0e 100644 --- a/cpp/src/Freeze/MapI.cpp +++ b/cpp/src/Freeze/MapI.cpp @@ -1313,6 +1313,7 @@ Freeze::MapHelperI::close() { if(_db != 0) { + closeAllIterators(); _connection->unregisterMap(this); } _db = 0; diff --git a/cpp/src/Freeze/TransactionI.cpp b/cpp/src/Freeze/TransactionI.cpp index a11c0eb44c4..725953a4c6c 100644 --- a/cpp/src/Freeze/TransactionI.cpp +++ b/cpp/src/Freeze/TransactionI.cpp @@ -273,5 +273,6 @@ Freeze::TransactionI::postCompletion(bool committed, bool deadlock) ConnectionIPtr connection = _connection; _connection = 0; + connection->clearTransaction(); // may release the last _refCount } diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index c7ca49ea899..cb01f17259f 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -258,6 +258,24 @@ Ice::CommunicatorI::flushBatchRequests() _instance->flushBatchRequests(); } +ObjectPrx +Ice::CommunicatorI::getAdmin() const +{ + return _instance->getAdmin(); +} + +void +Ice::CommunicatorI::addAdminFacet(const Ice::ObjectPtr& servant, const string& facet) +{ + _instance->addAdminFacet(servant, facet); +} + +Ice::ObjectPtr +Ice::CommunicatorI::removeAdminFacet(const string& facet) +{ + return _instance->removeAdminFacet(facet); +} + Ice::CommunicatorI::CommunicatorI(const InitializationData& initData) { __setNoDelete(true); diff --git a/cpp/src/Ice/CommunicatorI.h b/cpp/src/Ice/CommunicatorI.h index c424ed41f47..579497447ed 100644 --- a/cpp/src/Ice/CommunicatorI.h +++ b/cpp/src/Ice/CommunicatorI.h @@ -63,6 +63,10 @@ public: virtual void flushBatchRequests(); + virtual ObjectPrx getAdmin() const; + virtual void addAdminFacet(const ObjectPtr&, const std::string&); + virtual ObjectPtr removeAdminFacet(const std::string&); + private: CommunicatorI(const InitializationData&); diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 959bf3e1a06..a206e5ca614 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -35,6 +35,9 @@ #include <Ice/Initialize.h> #include <Ice/LoggerUtil.h> #include <IceUtil/StringUtil.h> +#include <Ice/PropertiesI.h> +#include <IceUtil/UUID.h> +#include <Ice/Communicator.h> #include <stdio.h> @@ -483,6 +486,83 @@ IceInternal::Instance::identityToString(const Identity& ident) const } } + +Ice::ObjectPrx +IceInternal::Instance::getAdmin() const +{ + IceUtil::RecMutex::Lock sync(*this); + + if(_state == StateDestroyed) + { + throw CommunicatorDestroyedException(__FILE__, __LINE__); + } + + if(_adminAdapter == 0) + { + return 0; + } + else + { + return _adminAdapter->createProxy(_adminIdentity); + } +} + +void +IceInternal::Instance::addAdminFacet(const Ice::ObjectPtr& servant, const string& facet) +{ + IceUtil::RecMutex::Lock sync(*this); + + if(_state == StateDestroyed) + { + throw CommunicatorDestroyedException(__FILE__, __LINE__); + } + + if(_adminAdapter == 0) + { + if(_adminFacets.insert(FacetMap::value_type(facet, servant)).second == false) + { + throw AlreadyRegisteredException(__FILE__, __LINE__, "facet", facet); + } + } + else + { + _adminAdapter->addFacet(servant, _adminIdentity, facet); + } +} + +Ice::ObjectPtr +IceInternal::Instance::removeAdminFacet(const string& facet) +{ + IceUtil::RecMutex::Lock sync(*this); + + if(_state == StateDestroyed) + { + throw CommunicatorDestroyedException(__FILE__, __LINE__); + } + + ObjectPtr result; + + if(_adminAdapter == 0) + { + FacetMap::iterator p = _adminFacets.find(facet); + if(p == _adminFacets.end()) + { + throw NotRegisteredException(__FILE__, __LINE__, "facet", facet); + } + else + { + result = p->second; + _adminFacets.erase(p); + } + } + else + { + result = _adminAdapter->removeFacet(_adminIdentity, facet); + } + return result; +} + + IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const InitializationData& initData) : _state(StateActive), _initData(initData), @@ -702,6 +782,12 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi _initData.wstringConverter = new UnicodeWstringConverter(); } + // + // Add Process and PropertiesAdmin facets + // + _adminFacets.insert(FacetMap::value_type("Properties", new PropertiesAdminI(_initData.properties))); + _adminFacets.insert(FacetMap::value_type("Process", new ProcessI(communicator))); + __setNoDelete(false); } catch(...) @@ -782,8 +868,8 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[]) _referenceFactory->setDefaultRouter( RouterPrx::uncheckedCast(_proxyFactory->propertyToProxy("Ice.Default.Router"))); - _referenceFactory->setDefaultLocator( - LocatorPrx::uncheckedCast(_proxyFactory->propertyToProxy("Ice.Default.Locator"))); + LocatorPrx defaultLocator = LocatorPrx::uncheckedCast(_proxyFactory->propertyToProxy("Ice.Default.Locator")); + _referenceFactory->setDefaultLocator(defaultLocator); // // Show process id if requested (but only once). @@ -813,6 +899,61 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[]) } // + // Create Admin object depending on configuration + // No-op unless Endpoints is set + // + const string adminOA = "Ice.Admin"; + if(_initData.properties->getProperty(adminOA + ".Endpoints") != "") + { + string serverId = _initData.properties->getProperty("Ice.Admin.ServerId"); + string instanceName = _initData.properties->getProperty("Ice.Admin.InstanceName"); + + if((defaultLocator != 0 && serverId != "") || instanceName != "") + { + _adminIdentity.name = "admin"; + if(instanceName == "") + { + instanceName = IceUtil::generateUUID(); + } + _adminIdentity.category = instanceName; + + // + // Create OA + // + _adminAdapter = _objectAdapterFactory->createObjectAdapter(adminOA, "", 0); + + // + // Add all facets to OA + // + for(FacetMap::iterator p = _adminFacets.begin(); p != _adminFacets.end(); ++p) + { + _adminAdapter->addFacet(p->second, _adminIdentity, p->first); + } + _adminFacets.clear(); + + // + // Activate OA + // + _adminAdapter->activate(); + + if(defaultLocator != 0 && serverId != "") + { + ProcessPrx process = ProcessPrx::uncheckedCast( + _adminAdapter->createProxy(_adminIdentity)->ice_facet("Process")); + + try + { + defaultLocator->getRegistry()->setServerProcessProxy(serverId, process); + } + catch(const ServerNotFoundException&) + { + throw InitializationException(__FILE__, __LINE__, "Locator knows nothing about server '" + serverId + "'"); + } + } + } + } + + // // Start connection monitor if necessary. // Int interval = 0; @@ -960,6 +1101,9 @@ IceInternal::Instance::destroy() // No destroy function defined. // _dynamicLibraryList->destroy(); _dynamicLibraryList = 0; + + _adminAdapter = 0; + _adminFacets.clear(); _state = StateDestroyed; } @@ -992,6 +1136,7 @@ IceInternal::Instance::destroy() return true; } + IceInternal::UTF8BufferI::UTF8BufferI() : _buffer(0), _offset(0) @@ -1033,3 +1178,33 @@ IceInternal::UTF8BufferI::reset() _buffer = 0; _offset = 0; } + + +IceInternal::ProcessI::ProcessI(const CommunicatorPtr& communicator) : + _communicator(communicator) +{ +} + +void +IceInternal::ProcessI::shutdown(const Current&) +{ + _communicator->shutdown(); +} + +void +IceInternal::ProcessI::writeMessage(const string& message, Int fd, const Current&) +{ + switch(fd) + { + case 1: + { + cout << message << endl; + break; + } + case 2: + { + cerr << message << endl; + break; + } + } +} diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h index a129104e386..f9dda82de07 100644 --- a/cpp/src/Ice/Instance.h +++ b/cpp/src/Ice/Instance.h @@ -34,6 +34,8 @@ #include <Ice/Initialize.h> #include <Ice/SharedContext.h> #include <Ice/ImplicitContextI.h> +#include <Ice/FacetMap.h> +#include <Ice/Process.h> #include <list> namespace Ice @@ -78,8 +80,11 @@ public: void setDefaultContext(const ::Ice::Context&); SharedContextPtr getDefaultContext() const; Ice::Identity stringToIdentity(const std::string&) const; - std::string identityToString(const Ice::Identity&) const; + + Ice::ObjectPrx getAdmin() const; + void addAdminFacet(const Ice::ObjectPtr&, const std::string&); + Ice::ObjectPtr removeAdminFacet(const std::string&); const Ice::ImplicitContextIPtr& getImplicitContext() const { @@ -125,6 +130,9 @@ private: Ice::PluginManagerPtr _pluginManager; SharedContextPtr _defaultContext; const Ice::ImplicitContextIPtr _implicitContext; + Ice::ObjectAdapterPtr _adminAdapter; + Ice::FacetMap _adminFacets; + Ice::Identity _adminIdentity; }; class UTF8BufferI : public Ice::UTF8Buffer @@ -144,6 +152,21 @@ private: size_t _offset; }; + +class ProcessI : public Ice::Process +{ +public: + + ProcessI(const Ice::CommunicatorPtr&); + + virtual void shutdown(const Ice::Current&); + virtual void writeMessage(const std::string&, Ice::Int, const Ice::Current&); + +private: + + const Ice::CommunicatorPtr _communicator; +}; + } #endif diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp index 3de824796c8..9d7cf4c7d5c 100644 --- a/cpp/src/Ice/ObjectAdapterI.cpp +++ b/cpp/src/Ice/ObjectAdapterI.cpp @@ -1322,31 +1322,3 @@ Ice::ObjectAdapterI::filterProperties(StringSeq& unknownProps) return noProps; } -Ice::ObjectAdapterI::ProcessI::ProcessI(const CommunicatorPtr& communicator) : - _communicator(communicator) -{ -} - -void -Ice::ObjectAdapterI::ProcessI::shutdown(const Current&) -{ - _communicator->shutdown(); -} - -void -Ice::ObjectAdapterI::ProcessI::writeMessage(const string& message, Int fd, const Current&) -{ - switch(fd) - { - case 1: - { - cout << message << endl; - break; - } - case 2: - { - cerr << message << endl; - break; - } - } -} diff --git a/cpp/src/Ice/ObjectAdapterI.h b/cpp/src/Ice/ObjectAdapterI.h index b0e567837c3..84322f3a495 100644 --- a/cpp/src/Ice/ObjectAdapterI.h +++ b/cpp/src/Ice/ObjectAdapterI.h @@ -27,7 +27,6 @@ #include <Ice/LocatorInfoF.h> #include <Ice/ThreadPoolF.h> #include <Ice/Exception.h> -#include <Ice/Process.h> #include <Ice/BuiltinSequences.h> #include <list> @@ -130,20 +129,6 @@ private: bool _threadPerConnection; size_t _threadPerConnectionStackSize; Identity _processId; - - class ProcessI : public Process - { - public: - - ProcessI(const CommunicatorPtr&); - - virtual void shutdown(const Current&); - virtual void writeMessage(const std::string&, Int, const Current&); - - private: - - const CommunicatorPtr _communicator; - }; }; } diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index cc49cd4f78f..72671064a06 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -15,6 +15,7 @@ #include <Ice/PropertyNames.h> #include <Ice/Logger.h> #include <Ice/LoggerUtil.h> +#include <Ice/Communicator.h> #include <fstream> using namespace std; @@ -471,3 +472,44 @@ Ice::PropertiesI::loadConfig() PropertyValue pv(value, true); _properties["Ice.Config"] = pv; } + + +// +// PropertiesAdminI +// + + +Ice::PropertiesAdminI::PropertiesAdminI(const PropertiesPtr& properties) : + _properties(properties) +{ +} + +string +Ice::PropertiesAdminI::getProperty(const string& name, const Ice::Current&) +{ + return _properties->getProperty(name); +} + +string +Ice::PropertiesAdminI::getPropertyWithDefault(const string& name, const string& dflt, const Ice::Current&) +{ + return _properties->getPropertyWithDefault(name, dflt); +} + +Ice::Int +Ice::PropertiesAdminI::getPropertyAsInt(const string& name, const Ice::Current&) +{ + return _properties->getPropertyAsInt(name); +} + +Ice::Int +Ice::PropertiesAdminI::getPropertyAsIntWithDefault(const string& name, Ice::Int dflt, const Ice::Current&) +{ + return _properties->getPropertyAsIntWithDefault(name, dflt); +} + +Ice::PropertyDict +Ice::PropertiesAdminI::getPropertiesForPrefix(const string& prefix, const Ice::Current&) +{ + return _properties->getPropertiesForPrefix(prefix); +} diff --git a/cpp/src/Ice/PropertiesI.h b/cpp/src/Ice/PropertiesI.h index aadf7eda5f7..26231480edd 100644 --- a/cpp/src/Ice/PropertiesI.h +++ b/cpp/src/Ice/PropertiesI.h @@ -19,7 +19,7 @@ namespace Ice { -class ICE_API PropertiesI : public Properties, public IceUtil::Mutex +class PropertiesI : public Properties, public IceUtil::Mutex { public: @@ -70,6 +70,24 @@ private: const StringConverterPtr _converter; }; + +class PropertiesAdminI : public PropertiesAdmin +{ +public: + + PropertiesAdminI(const PropertiesPtr&); + + virtual std::string getProperty(const std::string&, const Current&); + virtual std::string getPropertyWithDefault(const std::string&, const std::string&, const Current&); + virtual Int getPropertyAsInt(const std::string&, const Current&); + virtual Int getPropertyAsIntWithDefault(const std::string&, Int, const Current&); + virtual PropertyDict getPropertiesForPrefix(const std::string&, const Current&); + +private: + + const PropertiesPtr _properties; +}; + } #endif diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp index b4eb08cafce..db9d25059fe 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.xml, Thu Sep 6 17:17:28 2007 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Fri Sep 7 11:03:12 2007 // IMPORTANT: Do not edit this file -- any edits made here will be lost! @@ -17,6 +17,21 @@ const IceInternal::Property IcePropsData[] = { IceInternal::Property("Ice.ACM.Client", false, 0), IceInternal::Property("Ice.ACM.Server", false, 0), + IceInternal::Property("Ice.Admin.AdapterId", false, 0), + IceInternal::Property("Ice.Admin.Endpoints", false, 0), + IceInternal::Property("Ice.Admin.Locator", false, 0), + IceInternal::Property("Ice.Admin.PublishedEndpoints", false, 0), + IceInternal::Property("Ice.Admin.RegisterProcess", true, 0), + IceInternal::Property("Ice.Admin.ReplicaGroupId", false, 0), + IceInternal::Property("Ice.Admin.Router", false, 0), + IceInternal::Property("Ice.Admin.ThreadPerConnection", false, 0), + IceInternal::Property("Ice.Admin.ThreadPerConnection.StackSize", false, 0), + IceInternal::Property("Ice.Admin.ThreadPool.Size", false, 0), + IceInternal::Property("Ice.Admin.ThreadPool.SizeMax", false, 0), + IceInternal::Property("Ice.Admin.ThreadPool.SizeWarn", false, 0), + IceInternal::Property("Ice.Admin.ThreadPool.StackSize", false, 0), + IceInternal::Property("Ice.Admin.InstanceName", false, 0), + IceInternal::Property("Ice.Admin.ServerId", false, 0), IceInternal::Property("Ice.BatchAutoFlush", false, 0), IceInternal::Property("Ice.ChangeUser", false, 0), IceInternal::Property("Ice.Compression.Level", false, 0), @@ -67,7 +82,7 @@ const IceInternal::Property IcePropsData[] = IceInternal::Property("Ice.PrintProcessId", false, 0), IceInternal::Property("Ice.ProgramName", false, 0), IceInternal::Property("Ice.RetryIntervals", false, 0), - IceInternal::Property("Ice.ServerId", false, 0), + IceInternal::Property("Ice.ServerId", true, 0), IceInternal::Property("Ice.ServerIdleTime", false, 0), IceInternal::Property("Ice.StdErr", false, 0), IceInternal::Property("Ice.StdOut", false, 0), @@ -116,7 +131,7 @@ const IceInternal::Property IceBoxPropsData[] = IceInternal::Property("IceBox.ServiceManager.Endpoints", false, 0), IceInternal::Property("IceBox.ServiceManager.Locator", false, 0), IceInternal::Property("IceBox.ServiceManager.PublishedEndpoints", false, 0), - IceInternal::Property("IceBox.ServiceManager.RegisterProcess", false, 0), + IceInternal::Property("IceBox.ServiceManager.RegisterProcess", true, 0), IceInternal::Property("IceBox.ServiceManager.ReplicaGroupId", false, 0), IceInternal::Property("IceBox.ServiceManager.Router", false, 0), IceInternal::Property("IceBox.ServiceManager.ThreadPerConnection", false, 0), @@ -154,7 +169,7 @@ const IceInternal::Property IceGridPropsData[] = IceInternal::Property("IceGrid.Node.Endpoints", false, 0), IceInternal::Property("IceGrid.Node.Locator", false, 0), IceInternal::Property("IceGrid.Node.PublishedEndpoints", false, 0), - IceInternal::Property("IceGrid.Node.RegisterProcess", false, 0), + IceInternal::Property("IceGrid.Node.RegisterProcess", true, 0), IceInternal::Property("IceGrid.Node.ReplicaGroupId", false, 0), IceInternal::Property("IceGrid.Node.Router", false, 0), IceInternal::Property("IceGrid.Node.ThreadPerConnection", false, 0), @@ -215,7 +230,7 @@ const IceInternal::Property IceGridPropsData[] = IceInternal::Property("IceGrid.Registry.Client.Endpoints", false, 0), IceInternal::Property("IceGrid.Registry.Client.Locator", false, 0), IceInternal::Property("IceGrid.Registry.Client.PublishedEndpoints", false, 0), - IceInternal::Property("IceGrid.Registry.Client.RegisterProcess", false, 0), + IceInternal::Property("IceGrid.Registry.Client.RegisterProcess", true, 0), IceInternal::Property("IceGrid.Registry.Client.ReplicaGroupId", false, 0), IceInternal::Property("IceGrid.Registry.Client.Router", false, 0), IceInternal::Property("IceGrid.Registry.Client.ThreadPerConnection", false, 0), @@ -232,7 +247,7 @@ const IceInternal::Property IceGridPropsData[] = IceInternal::Property("IceGrid.Registry.Internal.Endpoints", false, 0), IceInternal::Property("IceGrid.Registry.Internal.Locator", false, 0), IceInternal::Property("IceGrid.Registry.Internal.PublishedEndpoints", false, 0), - IceInternal::Property("IceGrid.Registry.Internal.RegisterProcess", false, 0), + IceInternal::Property("IceGrid.Registry.Internal.RegisterProcess", true, 0), IceInternal::Property("IceGrid.Registry.Internal.ReplicaGroupId", false, 0), IceInternal::Property("IceGrid.Registry.Internal.Router", false, 0), IceInternal::Property("IceGrid.Registry.Internal.ThreadPerConnection", false, 0), @@ -258,7 +273,7 @@ const IceInternal::Property IceGridPropsData[] = IceInternal::Property("IceGrid.Registry.Server.Endpoints", false, 0), IceInternal::Property("IceGrid.Registry.Server.Locator", false, 0), IceInternal::Property("IceGrid.Registry.Server.PublishedEndpoints", false, 0), - IceInternal::Property("IceGrid.Registry.Server.RegisterProcess", false, 0), + IceInternal::Property("IceGrid.Registry.Server.RegisterProcess", true, 0), IceInternal::Property("IceGrid.Registry.Server.ReplicaGroupId", false, 0), IceInternal::Property("IceGrid.Registry.Server.Router", false, 0), IceInternal::Property("IceGrid.Registry.Server.ThreadPerConnection", false, 0), @@ -272,7 +287,7 @@ const IceInternal::Property IceGridPropsData[] = IceInternal::Property("IceGrid.Registry.SessionManager.Endpoints", false, 0), IceInternal::Property("IceGrid.Registry.SessionManager.Locator", false, 0), IceInternal::Property("IceGrid.Registry.SessionManager.PublishedEndpoints", false, 0), - IceInternal::Property("IceGrid.Registry.SessionManager.RegisterProcess", false, 0), + IceInternal::Property("IceGrid.Registry.SessionManager.RegisterProcess", true, 0), IceInternal::Property("IceGrid.Registry.SessionManager.ReplicaGroupId", false, 0), IceInternal::Property("IceGrid.Registry.SessionManager.Router", false, 0), IceInternal::Property("IceGrid.Registry.SessionManager.ThreadPerConnection", false, 0), @@ -314,7 +329,7 @@ const IceInternal::Property IcePatch2PropsData[] = IceInternal::Property("IcePatch2.Endpoints", false, 0), IceInternal::Property("IcePatch2.Locator", false, 0), IceInternal::Property("IcePatch2.PublishedEndpoints", false, 0), - IceInternal::Property("IcePatch2.RegisterProcess", false, 0), + IceInternal::Property("IcePatch2.RegisterProcess", true, 0), IceInternal::Property("IcePatch2.ReplicaGroupId", false, 0), IceInternal::Property("IcePatch2.Router", false, 0), IceInternal::Property("IcePatch2.ThreadPerConnection", false, 0), @@ -327,7 +342,7 @@ const IceInternal::Property IcePatch2PropsData[] = IceInternal::Property("IcePatch2.Admin.Endpoints", false, 0), IceInternal::Property("IcePatch2.Admin.Locator", false, 0), IceInternal::Property("IcePatch2.Admin.PublishedEndpoints", false, 0), - IceInternal::Property("IcePatch2.Admin.RegisterProcess", false, 0), + IceInternal::Property("IcePatch2.Admin.RegisterProcess", true, 0), IceInternal::Property("IcePatch2.Admin.ReplicaGroupId", false, 0), IceInternal::Property("IcePatch2.Admin.Router", false, 0), IceInternal::Property("IcePatch2.Admin.ThreadPerConnection", false, 0), @@ -402,7 +417,7 @@ const IceInternal::Property IceStormPropsData[] = IceInternal::Property("IceStorm.Publish.Endpoints", false, 0), IceInternal::Property("IceStorm.Publish.Locator", false, 0), IceInternal::Property("IceStorm.Publish.PublishedEndpoints", false, 0), - IceInternal::Property("IceStorm.Publish.RegisterProcess", false, 0), + IceInternal::Property("IceStorm.Publish.RegisterProcess", true, 0), IceInternal::Property("IceStorm.Publish.ReplicaGroupId", false, 0), IceInternal::Property("IceStorm.Publish.Router", false, 0), IceInternal::Property("IceStorm.Publish.ThreadPerConnection", false, 0), @@ -415,7 +430,7 @@ const IceInternal::Property IceStormPropsData[] = IceInternal::Property("IceStorm.TopicManager.Endpoints", false, 0), IceInternal::Property("IceStorm.TopicManager.Locator", false, 0), IceInternal::Property("IceStorm.TopicManager.PublishedEndpoints", false, 0), - IceInternal::Property("IceStorm.TopicManager.RegisterProcess", false, 0), + IceInternal::Property("IceStorm.TopicManager.RegisterProcess", true, 0), IceInternal::Property("IceStorm.TopicManager.ReplicaGroupId", false, 0), IceInternal::Property("IceStorm.TopicManager.Router", false, 0), IceInternal::Property("IceStorm.TopicManager.ThreadPerConnection", false, 0), @@ -455,16 +470,36 @@ const IceInternal::Property Glacier2PropsData[] = { IceInternal::Property("Glacier2.AddSSLContext", false, 0), IceInternal::Property("Glacier2.AddUserToAllowCategories", true, "Glacier2.Filter.Category.AcceptUser"), + IceInternal::Property("Glacier2.Admin.AdapterId", false, 0), IceInternal::Property("Glacier2.Admin.Endpoints", false, 0), + IceInternal::Property("Glacier2.Admin.Locator", false, 0), IceInternal::Property("Glacier2.Admin.PublishedEndpoints", false, 0), - IceInternal::Property("Glacier2.Admin.RegisterProcess", false, 0), + IceInternal::Property("Glacier2.Admin.RegisterProcess", true, 0), + IceInternal::Property("Glacier2.Admin.ReplicaGroupId", false, 0), + IceInternal::Property("Glacier2.Admin.Router", false, 0), + IceInternal::Property("Glacier2.Admin.ThreadPerConnection", false, 0), + IceInternal::Property("Glacier2.Admin.ThreadPerConnection.StackSize", false, 0), + IceInternal::Property("Glacier2.Admin.ThreadPool.Size", false, 0), + IceInternal::Property("Glacier2.Admin.ThreadPool.SizeMax", false, 0), + IceInternal::Property("Glacier2.Admin.ThreadPool.SizeWarn", false, 0), + IceInternal::Property("Glacier2.Admin.ThreadPool.StackSize", false, 0), IceInternal::Property("Glacier2.AllowCategories", true, "Glacier2.Filter.Category.Accept"), + IceInternal::Property("Glacier2.Client.AdapterId", false, 0), + IceInternal::Property("Glacier2.Client.Endpoints", false, 0), + IceInternal::Property("Glacier2.Client.Locator", false, 0), + IceInternal::Property("Glacier2.Client.PublishedEndpoints", false, 0), + IceInternal::Property("Glacier2.Client.RegisterProcess", true, 0), + IceInternal::Property("Glacier2.Client.ReplicaGroupId", false, 0), + IceInternal::Property("Glacier2.Client.Router", false, 0), + IceInternal::Property("Glacier2.Client.ThreadPerConnection", false, 0), + IceInternal::Property("Glacier2.Client.ThreadPerConnection.StackSize", false, 0), + IceInternal::Property("Glacier2.Client.ThreadPool.Size", false, 0), + IceInternal::Property("Glacier2.Client.ThreadPool.SizeMax", false, 0), + IceInternal::Property("Glacier2.Client.ThreadPool.SizeWarn", false, 0), + IceInternal::Property("Glacier2.Client.ThreadPool.StackSize", false, 0), IceInternal::Property("Glacier2.Client.AlwaysBatch", false, 0), IceInternal::Property("Glacier2.Client.Buffered", false, 0), - IceInternal::Property("Glacier2.Client.Endpoints", false, 0), IceInternal::Property("Glacier2.Client.ForwardContext", false, 0), - IceInternal::Property("Glacier2.Client.PublishedEndpoints", false, 0), - IceInternal::Property("Glacier2.Client.RegisterProcess", false, 0), IceInternal::Property("Glacier2.Client.SleepTime", false, 0), IceInternal::Property("Glacier2.Client.Trace.Override", false, 0), IceInternal::Property("Glacier2.Client.Trace.Reject", false, 0), @@ -500,12 +535,22 @@ const IceInternal::Property Glacier2PropsData[] = IceInternal::Property("Glacier2.SSLPermissionsVerifier.ThreadPerConnection", false, 0), IceInternal::Property("Glacier2.SSLPermissionsVerifier", false, 0), IceInternal::Property("Glacier2.RoutingTable.MaxSize", false, 0), + IceInternal::Property("Glacier2.Server.AdapterId", false, 0), + IceInternal::Property("Glacier2.Server.Endpoints", false, 0), + IceInternal::Property("Glacier2.Server.Locator", false, 0), + IceInternal::Property("Glacier2.Server.PublishedEndpoints", false, 0), + IceInternal::Property("Glacier2.Server.RegisterProcess", true, 0), + IceInternal::Property("Glacier2.Server.ReplicaGroupId", false, 0), + IceInternal::Property("Glacier2.Server.Router", false, 0), + IceInternal::Property("Glacier2.Server.ThreadPerConnection", false, 0), + IceInternal::Property("Glacier2.Server.ThreadPerConnection.StackSize", false, 0), + IceInternal::Property("Glacier2.Server.ThreadPool.Size", false, 0), + IceInternal::Property("Glacier2.Server.ThreadPool.SizeMax", false, 0), + IceInternal::Property("Glacier2.Server.ThreadPool.SizeWarn", false, 0), + IceInternal::Property("Glacier2.Server.ThreadPool.StackSize", false, 0), IceInternal::Property("Glacier2.Server.AlwaysBatch", false, 0), IceInternal::Property("Glacier2.Server.Buffered", false, 0), - IceInternal::Property("Glacier2.Server.Endpoints", false, 0), IceInternal::Property("Glacier2.Server.ForwardContext", false, 0), - IceInternal::Property("Glacier2.Server.PublishedEndpoints", false, 0), - IceInternal::Property("Glacier2.Server.RegisterProcess", false, 0), IceInternal::Property("Glacier2.Server.SleepTime", false, 0), IceInternal::Property("Glacier2.Server.Trace.Override", false, 0), IceInternal::Property("Glacier2.Server.Trace.Request", false, 0), diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h index 2085a9ea8bc..53c003fa79f 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.xml, Thu Sep 6 17:17:28 2007 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Fri Sep 7 11:03:12 2007 // IMPORTANT: Do not edit this file -- any edits made here will be lost! diff --git a/cpp/src/IceBox/Service.cpp b/cpp/src/IceBox/Service.cpp index ba4e91525a6..aa198b86b40 100644 --- a/cpp/src/IceBox/Service.cpp +++ b/cpp/src/IceBox/Service.cpp @@ -79,6 +79,7 @@ IceBox::IceBoxService::start(int argc, char* argv[]) } _serviceManager = new ServiceManagerI(communicator(), argc, argv); + return _serviceManager->start(); } diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp index e75dd7fee26..8f8dd794376 100644 --- a/cpp/src/IceBox/ServiceManagerI.cpp +++ b/cpp/src/IceBox/ServiceManagerI.cpp @@ -245,6 +245,20 @@ IceBox::ServiceManagerI::start() // } } + + // + // Register "this" as a facet to the Admin object + // + try + { + _communicator->addAdminFacet(this, "IceBox.ServiceManager"); + } + catch(const CommunicatorDestroyedException&) + { + // + // Ignored + // + } } catch(const FailureException& ex) { diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp index c41aa5c04de..1368294a5c5 100644 --- a/cpp/src/IceGrid/DescriptorHelper.cpp +++ b/cpp/src/IceGrid/DescriptorHelper.cpp @@ -1195,19 +1195,20 @@ ServiceHelper::ServiceHelper(const ServiceDescriptorPtr& descriptor) : } bool -ServiceHelper::operator==(const ServiceHelper& helper) const +ServiceHelper::operator==(const CommunicatorHelper& h) const { - if(!CommunicatorHelper::operator==(helper)) + const ServiceHelper* helper = dynamic_cast<const ServiceHelper*>(&h); + if(!helper || !CommunicatorHelper::operator==(h)) { return false; } - if(_desc->name != helper._desc->name) + if(_desc->name != helper->_desc->name) { return false; } - if(_desc->entry != helper._desc->entry) + if(_desc->entry != helper->_desc->entry) { return false; } @@ -1216,7 +1217,7 @@ ServiceHelper::operator==(const ServiceHelper& helper) const } bool -ServiceHelper::operator!=(const ServiceHelper& helper) const +ServiceHelper::operator!=(const CommunicatorHelper& helper) const { return !operator==(helper); } @@ -1272,66 +1273,67 @@ ServerHelper::ServerHelper(const ServerDescriptorPtr& descriptor) : } bool -ServerHelper::operator==(const ServerHelper& helper) const +ServerHelper::operator==(const CommunicatorHelper& h) const { - if(!CommunicatorHelper::operator==(helper)) + const ServerHelper* helper = dynamic_cast<const ServerHelper*>(&h); + if(!helper || !CommunicatorHelper::operator==(h)) { return false; } - if(_desc->id != helper._desc->id) + if(_desc->id != helper->_desc->id) { return false; } - if(_desc->exe != helper._desc->exe) + if(_desc->exe != helper->_desc->exe) { return false; } - if(_desc->pwd != helper._desc->pwd) + if(_desc->pwd != helper->_desc->pwd) { return false; } if(set<string>(_desc->options.begin(), _desc->options.end()) != - set<string>(helper._desc->options.begin(), helper._desc->options.end())) + set<string>(helper->_desc->options.begin(), helper->_desc->options.end())) { return false; } if(set<string>(_desc->envs.begin(), _desc->envs.end()) != - set<string>(helper._desc->envs.begin(), helper._desc->envs.end())) + set<string>(helper->_desc->envs.begin(), helper->_desc->envs.end())) { return false; } - if(_desc->activation != helper._desc->activation) + if(_desc->activation != helper->_desc->activation) { return false; } - if(_desc->activationTimeout != helper._desc->activationTimeout) + if(_desc->activationTimeout != helper->_desc->activationTimeout) { return false; } - if(_desc->deactivationTimeout != helper._desc->deactivationTimeout) + if(_desc->deactivationTimeout != helper->_desc->deactivationTimeout) { return false; } - if(_desc->distrib != helper._desc->distrib) + if(_desc->distrib != helper->_desc->distrib) { return false; } - if(_desc->allocatable != helper._desc->allocatable) + if(_desc->allocatable != helper->_desc->allocatable) { return false; } - if(_desc->user != helper._desc->user) + if(_desc->user != helper->_desc->user) { return false; } @@ -1340,7 +1342,7 @@ ServerHelper::operator==(const ServerHelper& helper) const } bool -ServerHelper::operator!=(const ServerHelper& helper) const +ServerHelper::operator!=(const CommunicatorHelper& helper) const { return !operator==(helper); } @@ -1483,14 +1485,15 @@ IceBoxHelper::IceBoxHelper(const IceBoxDescriptorPtr& descriptor) : } bool -IceBoxHelper::operator==(const IceBoxHelper& helper) const +IceBoxHelper::operator==(const CommunicatorHelper& h) const { - if(!ServerHelper::operator==(helper)) + const IceBoxHelper* helper = dynamic_cast<const IceBoxHelper*>(&h); + if(!helper || !ServerHelper::operator==(h)) { return false; } - - if(_services != helper._services) + + if(_services != helper->_services) { return false; } @@ -1499,7 +1502,7 @@ IceBoxHelper::operator==(const IceBoxHelper& helper) const } bool -IceBoxHelper::operator!=(const IceBoxHelper& helper) const +IceBoxHelper::operator!=(const CommunicatorHelper& helper) const { return !operator==(helper); } diff --git a/cpp/src/IceGrid/DescriptorHelper.h b/cpp/src/IceGrid/DescriptorHelper.h index e222940686c..f16d50afb71 100644 --- a/cpp/src/IceGrid/DescriptorHelper.h +++ b/cpp/src/IceGrid/DescriptorHelper.h @@ -86,8 +86,8 @@ public: CommunicatorHelper() { } virtual ~CommunicatorHelper() { } - bool operator==(const CommunicatorHelper&) const; - bool operator!=(const CommunicatorHelper&) const; + virtual bool operator==(const CommunicatorHelper&) const; + virtual bool operator!=(const CommunicatorHelper&) const; virtual void getIds(std::multiset<std::string>&, std::multiset<Ice::Identity>&) const; virtual void getReplicaGroups(std::set<std::string>&) const; @@ -115,8 +115,8 @@ public: ServiceHelper(const ServiceDescriptorPtr&); ServiceHelper() { } - bool operator==(const ServiceHelper&) const; - bool operator!=(const ServiceHelper&) const; + virtual bool operator==(const CommunicatorHelper&) const; + virtual bool operator!=(const CommunicatorHelper&) const; ServiceDescriptorPtr getDescriptor() const; ServiceDescriptorPtr instantiate(const Resolver&, const PropertyDescriptorSeq&, @@ -141,8 +141,8 @@ public: ServerHelper(const ServerDescriptorPtr&); ServerHelper() { } - bool operator==(const ServerHelper&) const; - bool operator!=(const ServerHelper&) const; + virtual bool operator==(const CommunicatorHelper&) const; + virtual bool operator!=(const CommunicatorHelper&) const; ServerDescriptorPtr getDescriptor() const; virtual ServerDescriptorPtr instantiate(const Resolver&, const PropertyDescriptorSeq&, @@ -203,8 +203,8 @@ public: IceBoxHelper(const IceBoxDescriptorPtr&); IceBoxHelper() { } - bool operator==(const IceBoxHelper&) const; - bool operator!=(const IceBoxHelper&) const; + virtual bool operator==(const CommunicatorHelper&) const; + virtual bool operator!=(const CommunicatorHelper&) const; virtual ServerDescriptorPtr instantiate(const Resolver&, const PropertyDescriptorSeq&, const PropertySetDescriptorDict&) const; @@ -267,8 +267,8 @@ public: NodeHelper(const std::string&, const NodeDescriptor&, const Resolver&, bool); virtual ~NodeHelper() { } - bool operator==(const NodeHelper&) const; - bool operator!=(const NodeHelper&) const; + virtual bool operator==(const NodeHelper&) const; + virtual bool operator!=(const NodeHelper&) const; NodeUpdateDescriptor diff(const NodeHelper&) const; NodeDescriptor update(const NodeUpdateDescriptor&, const Resolver&) const; diff --git a/cpp/src/IceUtil/Timer.cpp b/cpp/src/IceUtil/Timer.cpp index fd80db92f2c..adca267c58e 100755 --- a/cpp/src/IceUtil/Timer.cpp +++ b/cpp/src/IceUtil/Timer.cpp @@ -152,8 +152,8 @@ Timer::run() const Token& first = *(_tokens.begin()); if(first.scheduledTime <= now) { - _tokens.erase(_tokens.begin()); token = first; + _tokens.erase(_tokens.begin()); if(token.delay == IceUtil::Time()) { _tasks.erase(token.task); |