Author: tedross
Date: 2009-05-11 10:17:45 -0400 (Mon, 11 May 2009)
New Revision: 3374
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h
Log:
Updated to adapt to changes in the QPID plugin API for management.
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2009-05-11 13:31:02 UTC (rev 3373)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2009-05-11 14:17:45 UTC (rev 3374)
@@ -26,7 +26,7 @@
#include "jrnl/jerrno.hpp"
#include "jrnl/jexception.hpp"
#include "qpid/log/Statement.h"
-#include "qpid/agent/ManagementAgent.h"
+#include "qpid/management/ManagementAgent.h"
#include "qmf/com/redhat/rhm/store/ArgsJournalExpand.h"
#include "qmf/com/redhat/rhm/store/EventCreated.h"
#include "qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h"
@@ -51,7 +51,8 @@
const std::string& journalDirectory,
const std::string& journalBaseFilename,
const qpid::sys::Duration getEventsTimeout,
- const qpid::sys::Duration flushTimeout):
+ const qpid::sys::Duration flushTimeout,
+ qpid::management::ManagementAgent* a):
jcntl(journalId, journalDirectory, journalBaseFilename),
getEventsTimerSetFlag(false),
lastReadRid(0),
@@ -62,6 +63,7 @@
_dlen(0),
_dtok(),
_external(false),
+ _agent(a),
_mgmtObject(0)
{
::pthread_mutex_init(&_getf_mutex, 0);
@@ -74,7 +76,6 @@
journalTimerPtr->start();
journalTimerPtr->add(inactivityFireEventPtr);
- _agent = ManagementAgent::Singleton::getInstance();
if (_agent != 0)
{
_mgmtObject = new _qmf::Journal
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2009-05-11 13:31:02 UTC (rev 3373)
+++ store/trunk/cpp/lib/JournalImpl.h 2009-05-11 14:17:45 UTC (rev 3374)
@@ -99,7 +99,8 @@
const std::string& journalDirectory,
const std::string& journalBaseFilename,
const qpid::sys::Duration getEventsTimeout,
- const qpid::sys::Duration flushTimeout);
+ const qpid::sys::Duration flushTimeout,
+ qpid::management::ManagementAgent* agent);
virtual ~JournalImpl();
@@ -226,8 +227,9 @@
const std::string& journalDirectory,
const std::string& journalBaseFilename,
const qpid::sys::Duration getEventsTimeout,
- const qpid::sys::Duration flushTimeout) :
- JournalImpl(journalId, journalDirectory, journalBaseFilename,
getEventsTimeout, flushTimeout)
+ const qpid::sys::Duration flushTimeout,
+ qpid::management::ManagementAgent* agent) :
+ JournalImpl(journalId, journalDirectory, journalBaseFilename,
getEventsTimeout, flushTimeout, agent)
{}
~TplJournalImpl() {}
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-05-11 13:31:02 UTC (rev 3373)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-05-11 14:17:45 UTC (rev 3374)
@@ -77,7 +77,8 @@
highestRid(0),
isInit(false),
envPath(envpath),
- mgmtObject(0)
+ mgmtObject(0),
+ agent(0)
{}
u_int16_t MessageStoreImpl::chkJrnlNumFilesParam(const u_int16_t param, const std::string
paramName)
@@ -210,7 +211,7 @@
void MessageStoreImpl::initManagement (Broker* broker)
{
if (broker != 0) {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
+ agent = broker->getManagementAgent();
if (agent != 0) {
_qmf::Package packageInitializer(agent);
mgmtObject = new _qmf::Store(agent, this, broker);
@@ -331,7 +332,7 @@
open(mappingDb, txn.get(), "mappings.db", true);
open(bindingDb, txn.get(), "bindings.db", true);
open(generalDb, txn.get(), "general.db", false);
- tplStorePtr.reset(new TplJournalImpl("TplStore", getTplBaseDir(),
"tpl", defJournalGetEventsTimeout, defJournalFlushTimeout));
+ tplStorePtr.reset(new TplJournalImpl("TplStore", getTplBaseDir(),
"tpl", defJournalGetEventsTimeout, defJournalFlushTimeout, agent));
txn.commit();
} catch (const journal::jexception& e) {
txn.abort();
@@ -488,7 +489,7 @@
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue),
std::string("JournalData"),
defJournalGetEventsTimeout,
- defJournalFlushTimeout);
+ defJournalFlushTimeout, agent);
}
value = args.get("qpid.auto_expand");
@@ -765,7 +766,7 @@
}
{
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- jQueue = new JournalImpl(queueName, getJrnlDir(queueName),
std::string("JournalData"), defJournalGetEventsTimeout,
defJournalFlushTimeout);
+ jQueue = new JournalImpl(queueName, getJrnlDir(queueName),
std::string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout,
agent);
}
queue->setExternalQueueStore(dynamic_cast<ExternalQueueStore*>(jQueue));
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2009-05-11 13:31:02 UTC (rev 3373)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2009-05-11 14:17:45 UTC (rev 3374)
@@ -138,6 +138,7 @@
static qpid::sys::Duration defJournalFlushTimeout;
qmf::com::redhat::rhm::store::Store* mgmtObject;
qpid::sys::Mutex jrnlCreateLock;
+ qpid::management::ManagementAgent* agent;
// Parameter validation and calculation
static u_int16_t chkJrnlNumFilesParam(const u_int16_t param,
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp 2009-05-11 13:31:02
UTC (rev 3373)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp 2009-05-11 14:17:45
UTC (rev 3374)
@@ -24,7 +24,7 @@
#include "qpid/log/Statement.h"
#include "qpid/framing/FieldTable.h"
#include "qpid/management/Manageable.h"
-#include "qpid/agent/ManagementAgent.h"
+#include "qpid/management/ManagementAgent.h"
#include "EventCreated.h"
using namespace qmf::com::redhat::rhm::store;
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp
===================================================================
---
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp 2009-05-11
13:31:02 UTC (rev 3373)
+++
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp 2009-05-11
14:17:45 UTC (rev 3374)
@@ -24,7 +24,7 @@
#include "qpid/log/Statement.h"
#include "qpid/framing/FieldTable.h"
#include "qpid/management/Manageable.h"
-#include "qpid/agent/ManagementAgent.h"
+#include "qpid/management/ManagementAgent.h"
#include "EventEnqThresholdExceeded.h"
using namespace qmf::com::redhat::rhm::store;
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp 2009-05-11 13:31:02 UTC
(rev 3373)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp 2009-05-11 14:17:45 UTC
(rev 3374)
@@ -24,7 +24,7 @@
#include "qpid/log/Statement.h"
#include "qpid/framing/FieldTable.h"
#include "qpid/management/Manageable.h"
-#include "qpid/agent/ManagementAgent.h"
+#include "qpid/management/ManagementAgent.h"
#include "EventFull.h"
using namespace qmf::com::redhat::rhm::store;
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp 2009-05-11
13:31:02 UTC (rev 3373)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp 2009-05-11
14:17:45 UTC (rev 3374)
@@ -24,7 +24,7 @@
#include "qpid/log/Statement.h"
#include "qpid/framing/FieldTable.h"
#include "qpid/management/Manageable.h"
-#include "qpid/agent/ManagementAgent.h"
+#include "qpid/management/ManagementAgent.h"
#include "EventRecovered.h"
using namespace qmf::com::redhat::rhm::store;
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp 2009-05-11 13:31:02 UTC
(rev 3373)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp 2009-05-11 14:17:45 UTC
(rev 3374)
@@ -24,7 +24,7 @@
#include "qpid/log/Statement.h"
#include "qpid/framing/FieldTable.h"
#include "qpid/management/Manageable.h"
-#include "qpid/agent/ManagementAgent.h"
+#include "qpid/management/ManagementAgent.h"
#include "Journal.h"
#include "ArgsJournalExpand.h"
@@ -42,8 +42,8 @@
uint8_t Journal::md5Sum[16] =
{0x9,0xc2,0xe2,0xfc,0xcc,0x2e,0x72,0xaa,0x3f,0xce,0x36,0x28,0xce,0x81,0xc,0xd4};
-Journal::Journal (ManagementAgent* _agent, Manageable* _core) :
- ManagementObject(_agent, _core)
+Journal::Journal (ManagementAgent*, Manageable* _core) :
+ ManagementObject(_core)
{
queueRef = ::qpid::management::ObjectId();
@@ -80,7 +80,6 @@
- maxThreads = agent->getMaxThreads();
perThreadStatsArray = new struct PerThreadStats*[maxThreads];
for (int idx = 0; idx < maxThreads; idx++)
perThreadStatsArray[idx] = 0;
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h 2009-05-11 13:31:02 UTC
(rev 3373)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h 2009-05-11 14:17:45 UTC
(rev 3374)
@@ -28,6 +28,12 @@
#include "qpid/framing/FieldTable.h"
#include "qpid/framing/Uuid.h"
+namespace qpid {
+ namespace management {
+ class ManagementAgent;
+ }
+}
+
namespace qmf {
namespace com {
namespace redhat {
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.h 2009-05-11 13:31:02 UTC
(rev 3373)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.h 2009-05-11 14:17:45 UTC
(rev 3374)
@@ -24,7 +24,7 @@
// This source file was created by a code generator.
// Please do not edit.
-#include "qpid/agent/ManagementAgent.h"
+#include "qpid/management/ManagementAgent.h"
namespace qmf {
namespace com {
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp 2009-05-11 13:31:02 UTC
(rev 3373)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp 2009-05-11 14:17:45 UTC
(rev 3374)
@@ -24,7 +24,7 @@
#include "qpid/log/Statement.h"
#include "qpid/framing/FieldTable.h"
#include "qpid/management/Manageable.h"
-#include "qpid/agent/ManagementAgent.h"
+#include "qpid/management/ManagementAgent.h"
#include "Store.h"
@@ -41,8 +41,8 @@
uint8_t Store::md5Sum[16] =
{0x18,0xd,0xd4,0x15,0xd3,0x9a,0xf,0xbe,0x3a,0x40,0xe1,0x1b,0x9e,0x5b,0x7e,0x86};
-Store::Store (ManagementAgent* _agent, Manageable* _core, ::qpid::management::Manageable*
_parent) :
- ManagementObject(_agent, _core)
+Store::Store (ManagementAgent*, Manageable* _core, ::qpid::management::Manageable*
_parent) :
+ ManagementObject(_core)
{
brokerRef = _parent->GetManagementObject ()->getObjectId ();
location = "";
@@ -64,7 +64,6 @@
- maxThreads = agent->getMaxThreads();
perThreadStatsArray = new struct PerThreadStats*[maxThreads];
for (int idx = 0; idx < maxThreads; idx++)
perThreadStatsArray[idx] = 0;
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h 2009-05-11 13:31:02 UTC (rev
3373)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h 2009-05-11 14:17:45 UTC (rev
3374)
@@ -28,6 +28,12 @@
#include "qpid/framing/FieldTable.h"
#include "qpid/framing/Uuid.h"
+namespace qpid {
+ namespace management {
+ class ManagementAgent;
+ }
+}
+
namespace qmf {
namespace com {
namespace redhat {