diff options
author | Kim van der Riet <kpvdr@apache.org> | 2008-04-04 18:14:42 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2008-04-04 18:14:42 +0000 |
commit | a2ea9d432dc5713dadd4c710a982cc466de3ea8b (patch) | |
tree | d7c955359c88b80b24c4f70146309a806511adda /cpp/managementgen/templates/Class.cpp | |
parent | 2193d76646028d97b7bfff69335d4239954adbe5 (diff) | |
download | qpid-python-a2ea9d432dc5713dadd4c710a982cc466de3ea8b.tar.gz |
Patch from Ted Ross (see QPID-902): This patch contains the following improvements for management:\n1) Schema display cleaned up in the python mgmt-cli\n2) Locking added automatically to management object accessors (manual locking removed from broker/Queue.cpp)\n3) Schemas are now pre-registered with the management agent using a package initializer. This allows management consoles to get schema information for a class even if no instances of the class exist.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@644806 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/managementgen/templates/Class.cpp')
-rw-r--r-- | cpp/managementgen/templates/Class.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/cpp/managementgen/templates/Class.cpp b/cpp/managementgen/templates/Class.cpp index 3c3dfff5a2..5862685670 100644 --- a/cpp/managementgen/templates/Class.cpp +++ b/cpp/managementgen/templates/Class.cpp @@ -35,7 +35,6 @@ string /*MGEN:Class.NameCap*/::packageName = string ("/*MGEN:Class.NamePackage string /*MGEN:Class.NameCap*/::className = string ("/*MGEN:Class.NameLower*/"); uint8_t /*MGEN:Class.NameCap*/::md5Sum[16] = {/*MGEN:Class.SchemaMD5*/}; -bool /*MGEN:Class.NameCap*/::firstInst = true; /*MGEN:Class.NameCap*/::/*MGEN:Class.NameCap*/ (Manageable* _core/*MGEN:Class.ParentArg*//*MGEN:Class.ConstructorArgs*/) : ManagementObject(_core) @@ -63,18 +62,6 @@ namespace { const string DEFAULT("default"); } -bool /*MGEN:Class.NameCap*/::firstInstance (void) -{ - Mutex::ScopedLock alock(accessorLock); - if (firstInst) - { - firstInst = false; - return true; - } - - return false; -} - void /*MGEN:Class.NameCap*/::writeSchema (Buffer& buf) { FieldTable ft; @@ -100,6 +87,7 @@ void /*MGEN:Class.NameCap*/::writeSchema (Buffer& buf) void /*MGEN:Class.NameCap*/::writeConfig (Buffer& buf) { + sys::RWlock::ScopedRlock readLock (accessLock); configChanged = false; writeTimestamps (buf); @@ -108,6 +96,7 @@ void /*MGEN:Class.NameCap*/::writeConfig (Buffer& buf) void /*MGEN:Class.NameCap*/::writeInstrumentation (Buffer& buf, bool skipHeaders) { + sys::RWlock::ScopedWlock writeLock (accessLock); instChanged = false; if (!skipHeaders) |