rhmessaging commits: r1848 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-07 13:23:08 -0400 (Mon, 07 Apr 2008)
New Revision: 1848
Modified:
mgmt/cumin/python/cumin/widgets.py
Log:
Private-ize some attributes.
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-04-07 17:03:50 UTC (rev 1847)
+++ mgmt/cumin/python/cumin/widgets.py 2008-04-07 17:23:08 UTC (rev 1848)
@@ -113,23 +113,23 @@
def __init__(self, app, name):
super(CuminForm, self).__init__(app, name)
- self.cancel = self.Cancel(app, "cancel", self)
- self.cancel.set_tab_index(201)
- self.add_child(self.cancel)
+ self.__cancel = self.Cancel(app, "cancel", self)
+ self.__cancel.set_tab_index(201)
+ self.add_child(self.__cancel)
- self.submit = self.Submit(app, "submit", self)
- self.submit.set_tab_index(200)
- self.add_child(self.submit)
+ self.__submit = self.Submit(app, "submit", self)
+ self.__submit.set_tab_index(200)
+ self.add_child(self.__submit)
def do_process(self, session, *args):
self.page.set_modal(session, True)
- if self.cancel.get(session):
- self.cancel.set(session, False)
+ if self.__cancel.get(session):
+ self.__cancel.set(session, False)
self.process_cancel(session, *args)
- elif self.submit.get(session):
- self.submit.set(session, False)
+ elif self.__submit.get(session):
+ self.__submit.set(session, False)
self.process_submit(session, *args)
else:
@@ -293,33 +293,33 @@
def __init__(self, app, name):
super(StateSwitch, self).__init__(app, name)
- self.param = Parameter(app, "param")
- self.add_parameter(self.param)
+ self.__param = Parameter(app, "param")
+ self.add_parameter(self.__param)
- self.states = list()
- self.titles = dict()
+ self.__states = list()
+ self.__titles = dict()
def add_state(self, state, title):
- self.states.append(state)
- self.titles[state] = title
+ self.__states.append(state)
+ self.__titles[state] = title
- if self.param.default is None:
- self.param.default = state
+ if self.__param.default is None:
+ self.__param.default = state
def get(self, session):
- return self.param.get(session)
+ return self.__param.get(session)
def set(self, session, value):
- return self.param.set(session, value)
+ return self.__param.set(session, value)
def get_items(self, session):
- return self.states
+ return self.__states
def render_item_link(self, session, state):
branch = session.branch()
self.set(branch, state)
- title = self.titles[state]
+ title = self.__titles[state]
class_ = self.get(session) == state and "selected"
return fmt_link(branch.marshal(), title, class_)
16 years, 9 months
rhmessaging commits: r1847 - mgmt/cumin/bin.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-04-07 13:03:50 -0400 (Mon, 07 Apr 2008)
New Revision: 1847
Modified:
mgmt/cumin/bin/cumin-admin
Log:
fixed scoping of 'force'
Modified: mgmt/cumin/bin/cumin-admin
===================================================================
--- mgmt/cumin/bin/cumin-admin 2008-04-07 17:00:48 UTC (rev 1846)
+++ mgmt/cumin/bin/cumin-admin 2008-04-07 17:03:50 UTC (rev 1847)
@@ -101,7 +101,7 @@
sys.exit(1)
elif command == "remove-user":
- if force:
+ if config.force:
if len(args) != 2:
print "Error: no user name given"
sys.exit(1)
16 years, 9 months
rhmessaging commits: r1846 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-07 13:00:48 -0400 (Mon, 07 Apr 2008)
New Revision: 1846
Modified:
store/trunk/cpp/lib/Makefile.am
Log:
Added missing management gen files from Makefile.am
Modified: store/trunk/cpp/lib/Makefile.am
===================================================================
--- store/trunk/cpp/lib/Makefile.am 2008-04-07 16:15:36 UTC (rev 1845)
+++ store/trunk/cpp/lib/Makefile.am 2008-04-07 17:00:48 UTC (rev 1846)
@@ -94,8 +94,13 @@
jrnl/wmgr.hpp \
jrnl/wrfc.hpp \
gen/qpid/management/PackageMrgstore.cpp \
+ gen/qpid/management/PackageMrgstore.h \
gen/qpid/management/Journal.cpp \
- gen/qpid/management/Store.cpp
+ gen/qpid/management/Journal.h \
+ gen/qpid/management/Store.cpp \
+ gen/qpid/management/Store.h \
+ gen/qpid/management/ArgsJournalExpand.h \
+ gen/qpid/management/ArgsJournalReconfigure.h
BUILT_SOURCES = db-inc.h
16 years, 9 months
rhmessaging commits: r1845 - in store/trunk: specs and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-07 12:15:36 -0400 (Mon, 07 Apr 2008)
New Revision: 1845
Added:
store/trunk/specs/
store/trunk/specs/management-schema.xml
Log:
Added management XML spec file
Added: store/trunk/specs/management-schema.xml
===================================================================
--- store/trunk/specs/management-schema.xml (rev 0)
+++ store/trunk/specs/management-schema.xml 2008-04-07 16:15:36 UTC (rev 1845)
@@ -0,0 +1,51 @@
+<schema package="mrgstore">
+
+<!--
+ License Text
+-->
+ <class name="store">
+ <configElement name="qpidBrokerRef" type="objId" access="RO" index="y" parentRef="y"/>
+ <configElement name="location" type="sstr" access="RO" desc="Logical directory on disk"/>
+ <configElement name="async" type="bool" access="RO" desc="Asynchronous IO"/>
+ <configElement name="defaultInitialFileCount" type="uint16" access="RO" unit="file" desc="Default number of files initially allocated to each journal"/>
+ <configElement name="defaultDataFileSize" type="uint32" access="RO" unit="RdPg" desc="Default size of each journal data file"/>
+ </class>
+
+ <class name="journal">
+ <configElement name="name" type="sstr" access="RO" index="y"/>
+ <configElement name="journalDirectory" type="sstr" access="RO" desc="Directory containing journal files"/>
+ <configElement name="journalBaseFileName" type="sstr" access="RO" desc="Base filename prefix for journal"/>
+ <configElement name="journalWritePageSize" type="uint32" access="RO" unit="byte" desc="Page size in write-page-cache"/>
+ <configElement name="journalWritePages" type="uint32" access="RO" unit="wpage" desc="Number of pages in write-page-cache"/>
+ <configElement name="journalReadPageSize" type="uint32" access="RO" unit="byte" desc="Page size in read-page-cache"/>
+ <configElement name="journalReadPages" type="uint32" access="RO" unit="rpage" desc="Number of pages in read-page-cache"/>
+
+ <instElement name="initialFileCount" type="uint16" unit="file" desc="Number of files initially allocated to this journal"/>
+ <instElement name="dataFileSize" type="uint32" unit="byte" desc="Size of each journal data file"/>
+ <instElement name="journalCurrentFileCount" type="uint32" unit="file" desc="Number of files currently allocated to this journal"/>
+ <instElement name="journalRecordDepth" type="hilo32" unit="record" desc="Number of enqueued records (durable messages)"/>
+ <instElement name="journalRecordEnqueues" type="count64" unit="record" desc="Total enqueued records on journal"/>
+ <instElement name="journalRecordDequeues" type="count64" unit="record" desc="Total dequeued records on journal"/>
+
+<!--
+ The following are not yet "wired up" in JournalImpl.cpp
+-->
+ <instElement name="journalFreeFileCount" type="hilo32" unit="file" desc="Number of files free on this journal. Includes free files trapped in holes."/>
+ <instElement name="journalAvailableFileCount" type="hilo32" unit="file" desc="Number of files available to be written. Excluding holes"/>
+ <instElement name="journalWriteWaitFailures" type="count64" unit="record" desc="AIO Wait failures on write"/>
+ <instElement name="journalWriteBusyFailures" type="count64" unit="record" desc="AIO Busy failures on write"/>
+ <instElement name="journalReadRecordCount" type="count64" unit="record" desc="Records read from the journal"/>
+ <instElement name="journalReadBusyFailures" type="count64" unit="record" desc="AIO Busy failures on read"/>
+ <instElement name="journalWritePageCacheDepth" type="hilo32" unit="page" desc="Current depth of write-page-cache"/>
+ <instElement name="journalReadPageCacheDepth" type="hilo32" unit="page" desc="Current depth of read-page-cache"/>
+
+ <method name="expand" desc="Increase number of files allocated for this journal">
+ <arg name="by" type="uint32" dir="I" desc="Number of files to increase journal size by"/>
+ </method>
+
+ <method name="reconfigure" desc="Destructively reconfigure dimensions for this journal">
+ <arg name="fileCount" type="uint32" dir="I" desc="Number of files in journal"/>
+ <arg name="fileSize" type="uint32" dir="I" desc="Size of files in journal"/>
+ </method>
+ </class>
+</schema>
16 years, 9 months
rhmessaging commits: r1844 - in store/trunk/cpp: lib/gen and 4 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-07 12:11:44 -0400 (Mon, 07 Apr 2008)
New Revision: 1844
Added:
store/trunk/cpp/lib/gen/
store/trunk/cpp/lib/gen/qpid/
store/trunk/cpp/lib/gen/qpid/management/
store/trunk/cpp/lib/gen/qpid/management/ArgsJournalExpand.h
store/trunk/cpp/lib/gen/qpid/management/ArgsJournalReconfigure.h
store/trunk/cpp/lib/gen/qpid/management/Journal.cpp
store/trunk/cpp/lib/gen/qpid/management/Journal.h
store/trunk/cpp/lib/gen/qpid/management/PackageMrgstore.cpp
store/trunk/cpp/lib/gen/qpid/management/PackageMrgstore.h
store/trunk/cpp/lib/gen/qpid/management/Store.cpp
store/trunk/cpp/lib/gen/qpid/management/Store.h
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/BdbMessageStore.h
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/Makefile.am
store/trunk/cpp/lib/StorePlugin.cpp
store/trunk/cpp/lib/jrnl/jcfg.hpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
store/trunk/cpp/lib/jrnl/wmgr.hpp
store/trunk/cpp/tests/Makefile.am
Log:
Reconfigured jcntl::initialize() to take journal file geometry paramtetrs. Initial instrumentation for management, including connecting management reconfigure method, which descructively resizes the journal. The directory cpp/lib/gen added here contain generated management files and will be removed later when the generator is added to the build process.
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -35,6 +35,8 @@
#include "StringDbt.h"
#include "JournalImpl.h"
#include "DataTokenImpl.h"
+#include "qpid/management/ManagementAgent.h"
+#include "qpid/management/PackageMrgstore.h"
using namespace rhm::bdbstore;
using namespace qpid::broker;
@@ -45,6 +47,7 @@
using std::max;
using qpid::framing::Buffer;
using qpid::framing::FieldTable;
+using qpid::management::ManagementAgent;
static const u_int8_t MESSAGE_MESSAGE = 1;
static const u_int8_t BASIC_MESSAGE = 2;
@@ -71,11 +74,32 @@
{
}
+
+void BdbMessageStore::initManagement (Broker* broker)
+{
+ if (broker != 0)
+ {
+ ManagementAgent::shared_ptr agent = ManagementAgent::getAgent ();
+ if (agent.get () != 0)
+ {
+ qpid::management::PackageMrgstore packageInitializer(agent);
+ mgmtObject = qpid::management::Store::shared_ptr(new qpid::management::Store (this, broker));
+
+ mgmtObject->set_location(storeDir);
+ mgmtObject->set_async(useAsync);
+ mgmtObject->set_defaultInitialFileCount(numJrnlFiles);
+ mgmtObject->set_defaultDataFileSize(jrnlFsizePgs);
+
+ agent->addObject(mgmtObject, 3, 0);
+ }
+ }
+}
+
bool BdbMessageStore::init(const std::string& dir, const bool async, const bool force, u_int16_t jfiles, u_int32_t jfileSizePgs)
{
if (isInit) return true;
-
+
numJrnlFiles = jfiles;
jrnlFsizePgs = jfileSizePgs;
useAsync = async;
@@ -220,6 +244,9 @@
} catch (const std::exception& e) {
std::cerr << e.what() << std::endl;
} catch (...) {}
+
+ if (mgmtObject.get() != 0)
+ mgmtObject->resourceDestroy();
}
void BdbMessageStore::truncate()
Modified: store/trunk/cpp/lib/BdbMessageStore.h
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.h 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/BdbMessageStore.h 2008-04-07 16:11:44 UTC (rev 1844)
@@ -34,6 +34,7 @@
#include "TxnCtxt.h"
#include <qpid/broker/Broker.h>
#include <qpid/broker/MessageStore.h>
+#include <qpid/management/Manageable.h>
#include <qpid/sys/Monitor.h>
#include <qpid/sys/Time.h>
#include <map>
@@ -42,6 +43,7 @@
#include <boost/format.hpp>
#include <boost/intrusive_ptr.hpp>
#include <boost/ptr_container/ptr_list.hpp>
+#include "qpid/management/Store.h"
namespace rhm {
namespace bdbstore {
@@ -50,7 +52,7 @@
/**
* An implementation of the MessageStore interface based on Berkeley DB
*/
- class BdbMessageStore : public qpid::broker::MessageStore
+ class BdbMessageStore : public qpid::broker::MessageStore, public qpid::management::Manageable
{
typedef std::map<u_int64_t, qpid::broker::RecoverableQueue::shared_ptr> queue_index;
typedef std::map<u_int64_t, qpid::broker::RecoverableExchange::shared_ptr> exchange_index;
@@ -62,8 +64,8 @@
// Default store settings
static const bool defUseAsync = false;
static const bool defForceStoreConversion = false;
- static const u_int16_t defNumJrnlFiles = 8;
- static const u_int32_t defJrnlFileSizePgs = 24;
+ static const u_int16_t defNumJrnlFiles = 8; // TODO: make configurable
+ static const u_int32_t defJrnlFileSizePgs = 24; // TODO: make configurable
std::list<Db*> dbs;
DbEnv env;
@@ -87,6 +89,7 @@
const char* envPath;
static qpid::sys::Duration defJournalGetEventsTimeout;
static qpid::sys::Duration defJournalFlushTimeout;
+ qpid::management::Store::shared_ptr mgmtObject;
qpid::sys::Mutex jrnlCreateLock;
bool mode(const bool mode, const bool force);
@@ -156,10 +159,13 @@
uint32_t jrnlFsizePgs;
};
+ typedef boost::shared_ptr<BdbMessageStore> shared_ptr;
+
BdbMessageStore(const char* envpath = 0);
virtual ~BdbMessageStore();
bool init(const qpid::Options* options);
bool init(const std::string& dir, const bool async, const bool force, u_int16_t jfiles, u_int32_t jfileSizePgs);
+ void initManagement (qpid::broker::Broker* broker);
void truncate();
@@ -203,6 +209,12 @@
void prepare(qpid::broker::TPCTransactionContext& ctxt);
void commit(qpid::broker::TransactionContext& ctxt);
void abort(qpid::broker::TransactionContext& ctxt);
+
+ qpid::management::ManagementObject::shared_ptr GetManagementObject (void) const
+ { return mgmtObject; }
+
+ qpid::management::Manageable::status_t ManagementMethod (uint32_t, qpid::management::Args&)
+ { return qpid::management::Manageable::STATUS_OK; }
};
}
}
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -26,12 +26,16 @@
#include "jrnl/jerrno.hpp"
#include "jrnl/jexception.hpp"
#include "jrnl/slock.hpp"
+#include "qpid/log/Statement.h"
+#include "qpid/management/ManagementAgent.h"
+#include "qpid/management/ArgsJournalExpand.h"
+#include "qpid/management/ArgsJournalReconfigure.h"
+#include "qpid/sys/Monitor.h"
#include "StoreException.h"
-#include <qpid/sys/Monitor.h>
-#include <qpid/log/Statement.h>
using namespace rhm::bdbstore;
using namespace rhm::journal;
+using qpid::management::ManagementAgent;
qpid::broker::Timer* JournalImpl::journalTimerPtr = 0;
u_int32_t JournalImpl::cnt = 0;
@@ -67,6 +71,24 @@
journalTimerPtr->start();
journalTimerPtr->add(inactivityFireEventPtr);
+ ManagementAgent::shared_ptr agent = ManagementAgent::getAgent ();
+
+ if (agent.get () != 0)
+ {
+ _mgmtObject = qpid::management::Journal::shared_ptr
+ (new qpid::management::Journal((qpid::management::Manageable*) this));
+
+ _mgmtObject->set_name(journalId);
+ _mgmtObject->set_journalDirectory(journalDirectory);
+ _mgmtObject->set_journalBaseFileName(journalBaseFilename);
+ _mgmtObject->set_journalWritePageSize(JRNL_WMGR_PAGE_SIZE * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE);
+ _mgmtObject->set_journalWritePages(JRNL_WMGR_PAGES);
+ _mgmtObject->set_journalReadPageSize(JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE);
+ _mgmtObject->set_journalReadPages(JRNL_RMGR_PAGES);
+
+ agent->addObject(_mgmtObject);
+ }
+
log(LOG_NOTICE, "Instantiation");
std::ostringstream oss;
oss << "Journal directory = \"" << journalDirectory << "\"; Base file name = \"" << journalBaseFilename << "\"";
@@ -96,6 +118,9 @@
journalTimerPtr = 0;
}
+ if (_mgmtObject.get() != 0)
+ _mgmtObject->resourceDestroy();
+
::pthread_mutex_destroy(&_getf_mutex);
log(LOG_DEBUG, "Destroyed");
}
@@ -109,6 +134,13 @@
log(LOG_DEBUG, oss.str());
jcntl::initialize(num_jfiles, jfsize_sblks, rd_cb, wr_cb);
log(LOG_DEBUG, "Initialization complete");
+
+ if (_mgmtObject.get() != 0)
+ {
+ _mgmtObject->set_initialFileCount(_num_jfiles);
+ _mgmtObject->set_dataFileSize(_jfsize_sblks * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE);
+ _mgmtObject->set_journalCurrentFileCount(_num_jfiles);
+ }
}
void
@@ -151,6 +183,13 @@
std::ostringstream oss2;
oss2 << "Recover complete; highest rid found = 0x" << std::hex << highest_rid;
log(LOG_DEBUG, oss2.str());
+
+ if (_mgmtObject.get() != 0)
+ {
+ _mgmtObject->set_initialFileCount(_num_jfiles);
+ _mgmtObject->set_dataFileSize(_jfsize_sblks * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE);
+ _mgmtObject->set_journalCurrentFileCount(_num_jfiles);
+ }
}
#define MAX_AIO_SLEEPS 500
@@ -216,13 +255,19 @@
const size_t this_data_len, data_tok* dtokp, const bool transient)
{
handleIoResult(jcntl::enqueue_data_record(data_buff, tot_data_len, this_data_len, dtokp, transient));
+
+ if (_mgmtObject.get() != 0)
+ _mgmtObject->inc_journalRecordEnqueues();
}
void
JournalImpl::enqueue_extern_data_record(const size_t tot_data_len, data_tok* dtokp,
const bool transient)
{
- handleIoResult(jcntl::enqueue_extern_data_record(tot_data_len, dtokp, transient));
+ handleIoResult(jcntl::enqueue_extern_data_record(tot_data_len, dtokp, transient));
+
+ if (_mgmtObject.get() != 0)
+ _mgmtObject->inc_journalRecordEnqueues();
}
void
@@ -230,6 +275,9 @@
const size_t this_data_len, data_tok* dtokp, const std::string& xid, const bool transient)
{
handleIoResult(jcntl::enqueue_txn_data_record(data_buff, tot_data_len, this_data_len, dtokp, xid, transient));
+
+ if (_mgmtObject.get() != 0)
+ _mgmtObject->inc_journalRecordEnqueues();
}
void
@@ -237,18 +285,27 @@
const std::string& xid, const bool transient)
{
handleIoResult(jcntl::enqueue_extern_txn_data_record(tot_data_len, dtokp, xid, transient));
+
+ if (_mgmtObject.get() != 0)
+ _mgmtObject->inc_journalRecordEnqueues();
}
void
JournalImpl::dequeue_data_record(data_tok* const dtokp)
{
handleIoResult(jcntl::dequeue_data_record(dtokp));
+
+ if (_mgmtObject.get() != 0)
+ _mgmtObject->inc_journalRecordDequeues();
}
void
JournalImpl::dequeue_txn_data_record(data_tok* const dtokp, const std::string& xid)
{
handleIoResult(jcntl::dequeue_txn_data_record(dtokp, xid));
+
+ if (_mgmtObject.get() != 0)
+ _mgmtObject->inc_journalRecordDequeues();
}
void
@@ -282,13 +339,13 @@
}
void
-JournalImpl::log(journal::log_level ll, const std::string& log_stmt)
+JournalImpl::log(journal::log_level ll, const std::string& log_stmt) const
{
log(ll, log_stmt.c_str());
}
void
-JournalImpl::log(journal::log_level ll, const char* const log_stmt)
+JournalImpl::log(journal::log_level ll, const char* const log_stmt) const
{
switch (ll)
{
@@ -362,6 +419,33 @@
}
}
+void
+JournalImpl::reconfigure(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
+ const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb)
+{
+ std::ostringstream oss;
+ oss << "Management reconfiguration: num_jfiles=" << num_jfiles << " jfsize_sblks=" << jfsize_sblks;
+ log(LOG_NOTICE, oss.str());
+
+ // Make sure something is actually changing before going to all the trouble...
+ if (num_jfiles == _num_jfiles && jfsize_sblks == _jfsize_sblks)
+ {
+ log(LOG_INFO, "Management reconfiguration parameters identical to existing; reconfiguration ignored.");
+ return;
+ }
+
+ stop(true);
+ jcntl::initialize(num_jfiles, jfsize_sblks, rd_cb, wr_cb);
+ log(LOG_DEBUG, "Management reconfiguration complete");
+
+ if (_mgmtObject.get() != 0)
+ {
+ _mgmtObject->set_initialFileCount(_num_jfiles);
+ _mgmtObject->set_dataFileSize(_jfsize_sblks * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE);
+ _mgmtObject->set_journalCurrentFileCount(_num_jfiles);
+ }
+}
+
// static AIO callback fns
void
@@ -392,10 +476,45 @@
}
}
-qpid::management::Manageable::status_t JournalImpl::ManagementMethod (uint32_t /*methodId*/,
- qpid::management::Args& /*args*/)
+qpid::management::Manageable::status_t JournalImpl::ManagementMethod (uint32_t methodId,
+ qpid::management::Args& args)
{
- return Manageable::STATUS_UNKNOWN_METHOD;
+ Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
+
+ switch (methodId)
+ {
+ case qpid::management::Journal::METHOD_EXPAND :
+ //qpid::management::ArgsJournalExpand& eArgs =
+ // dynamic_cast<qpid::management::ArgsJournalExpand&>(args);
+
+ // Implement "expand" using eArgs.i_by (expand-by argument)
+
+ status = Manageable::STATUS_NOT_IMPLEMENTED;
+ break;
+
+ case qpid::management::Journal::METHOD_RECONFIGURE :
+ qpid::management::ArgsJournalReconfigure& rArgs =
+ dynamic_cast<qpid::management::ArgsJournalReconfigure&>(args);
+ // Check parameter validity
+ if (rArgs.i_fileCount < JRNL_MIN_NUM_FILES || rArgs.i_fileCount > JRNL_MAX_NUM_FILES)
+ {
+ // TODO: add text indicating nature of failure
+ status = Manageable::STATUS_INVALID_PARAMETER;
+ break;
+ }
+ u_int32_t fsize_sblks = rArgs.i_fileSize * JRNL_RMGR_PAGE_SIZE;
+ if (fsize_sblks < JRNL_MIN_FILE_SIZE || fsize_sblks > JRNL_MAX_FILE_SIZE)
+ {
+ // TODO: add text indicating nature of failure
+ status = Manageable::STATUS_INVALID_PARAMETER;
+ break;
+ }
+ reconfigure(rArgs.i_fileCount, fsize_sblks);
+ status = Manageable::STATUS_OK;
+ break;
+ }
+
+ return status;
}
// void
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/JournalImpl.h 2008-04-07 16:11:44 UTC (rev 1844)
@@ -33,6 +33,8 @@
#include <qpid/sys/Time.h>
#include <boost/ptr_container/ptr_list.hpp>
#include <boost/intrusive_ptr.hpp>
+#include "qpid/management/Manageable.h"
+#include "qpid/management/Journal.h"
namespace rhm {
namespace bdbstore {
@@ -83,6 +85,7 @@
size_t _dlen;
journal::data_tok _dtok;
bool _external;
+ qpid::management::Journal::shared_ptr _mgmtObject;
public:
JournalImpl(const std::string& journalId,
@@ -143,8 +146,8 @@
void stop(bool block_till_aio_cmpl = false);
// Logging
- void log(journal::log_level level, const std::string& log_stmt);
- void log(journal::log_level level, const char* const log_stmt);
+ void log(journal::log_level level, const std::string& log_stmt) const;
+ void log(journal::log_level level, const char* const log_stmt) const;
// Overrides for get_events timer
const journal::iores flush(const bool block_till_aio_cmpl = false);
@@ -154,7 +157,7 @@
void flushFire();
qpid::management::ManagementObject::shared_ptr GetManagementObject (void) const
- { qpid::management::ManagementObject::shared_ptr p; return p; }
+ { return _mgmtObject; }
qpid::management::Manageable::status_t ManagementMethod (uint32_t,
qpid::management::Args&);
@@ -168,6 +171,11 @@
getEventsTimerSetFlag = true;
}
void handleIoResult(const journal::iores r);
+ void reconfigure(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
+ const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb);
+ inline void reconfigure(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks) {
+ reconfigure(num_jfiles, jfsize_sblks, 0, &aio_wr_callback);
+ }
static void aio_wr_callback(jcntl* journal, std::vector<journal::data_tok*>& dtokl);
// static void aio_rd_callback(jcntl* journal, std::vector<u_int16_t>& pil);
}; // class JournalImpl
Modified: store/trunk/cpp/lib/Makefile.am
===================================================================
--- store/trunk/cpp/lib/Makefile.am 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/Makefile.am 2008-04-07 16:11:44 UTC (rev 1844)
@@ -1,4 +1,5 @@
-AM_CXXFLAGS = $(WARNING_CFLAGS) $(APR_CXXFLAGS) $(QPID_CXXFLAGS) -DRHM_CLEAN -pthread
+AM_CXXFLAGS = $(WARNING_CFLAGS) $(APR_CXXFLAGS) $(QPID_CXXFLAGS) -I$(srcdir)/gen \
+ -DRHM_CLEAN -pthread
lib_LTLIBRARIES = libbdbstore.la
@@ -91,7 +92,10 @@
jrnl/txn_map.hpp \
jrnl/txn_rec.hpp \
jrnl/wmgr.hpp \
- jrnl/wrfc.hpp
+ jrnl/wrfc.hpp \
+ gen/qpid/management/PackageMrgstore.cpp \
+ gen/qpid/management/Journal.cpp \
+ gen/qpid/management/Store.cpp
BUILT_SOURCES = db-inc.h
Modified: store/trunk/cpp/lib/StorePlugin.cpp
===================================================================
--- store/trunk/cpp/lib/StorePlugin.cpp 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/StorePlugin.cpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -36,13 +36,14 @@
struct StorePlugin : public Plugin {
rhm::bdbstore::BdbMessageStore::Options options;
+ MessageStore *store;
Options* getOptions() { return &options; }
void earlyInitialize (Plugin::Target& target)
{
Broker* broker = dynamic_cast<Broker*>(&target);
- MessageStore *store = new rhm::bdbstore::BdbMessageStore ();
+ store = new rhm::bdbstore::BdbMessageStore ();
DataDir& dataDir = broker->getDataDir ();
if (options.storeDir.empty ())
@@ -62,7 +63,11 @@
broker->setStore (store);
}
- void initialize(Plugin::Target&) {}
+ void initialize(Plugin::Target& target)
+ {
+ Broker* broker = dynamic_cast<Broker*>(&target);
+ ((rhm::bdbstore::BdbMessageStore*) store)->initManagement (broker);
+ }
};
static StorePlugin instance; // Static initialization.
Added: store/trunk/cpp/lib/gen/qpid/management/ArgsJournalExpand.h
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/ArgsJournalExpand.h (rev 0)
+++ store/trunk/cpp/lib/gen/qpid/management/ArgsJournalExpand.h 2008-04-07 16:11:44 UTC (rev 1844)
@@ -0,0 +1,42 @@
+
+#ifndef _ARGS_JOURNALEXPAND_
+#define _ARGS_JOURNALEXPAND_
+
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/management/Args.h"
+#include <string>
+
+namespace qpid {
+namespace management {
+
+class ArgsJournalExpand : public Args
+{
+ public:
+ uint32_t i_by;
+
+};
+
+}}
+
+#endif /*!_ARGS_JOURNALEXPAND_*/
Added: store/trunk/cpp/lib/gen/qpid/management/ArgsJournalReconfigure.h
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/ArgsJournalReconfigure.h (rev 0)
+++ store/trunk/cpp/lib/gen/qpid/management/ArgsJournalReconfigure.h 2008-04-07 16:11:44 UTC (rev 1844)
@@ -0,0 +1,43 @@
+
+#ifndef _ARGS_JOURNALRECONFIGURE_
+#define _ARGS_JOURNALRECONFIGURE_
+
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/management/Args.h"
+#include <string>
+
+namespace qpid {
+namespace management {
+
+class ArgsJournalReconfigure : public Args
+{
+ public:
+ uint32_t i_fileCount;
+ uint32_t i_fileSize;
+
+};
+
+}}
+
+#endif /*!_ARGS_JOURNALRECONFIGURE_*/
Added: store/trunk/cpp/lib/gen/qpid/management/Journal.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Journal.cpp (rev 0)
+++ store/trunk/cpp/lib/gen/qpid/management/Journal.cpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -0,0 +1,466 @@
+
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/log/Statement.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/management/Manageable.h"
+#include "Journal.h"
+#include "qpid/management/ArgsJournalExpand.h"
+#include "qpid/management/ArgsJournalReconfigure.h"
+
+
+using namespace qpid::management;
+using namespace qpid::sys;
+using namespace qpid::framing;
+using std::string;
+
+string Journal::packageName = string ("mrgstore");
+string Journal::className = string ("journal");
+uint8_t Journal::md5Sum[16] =
+ {0x59,0x12,0x32,0xe1,0x16,0x75,0xbe,0x3,0xf,0x2,0x6,0x82,0x84,0xd5,0xf,0x52};
+
+Journal::Journal (Manageable* _core) :
+ ManagementObject(_core)
+
+{
+
+ initialFileCount = 0;
+ dataFileSize = 0;
+ journalCurrentFileCount = 0;
+ journalRecordDepth = 0;
+ journalRecordDepthHigh = 0;
+ journalRecordDepthLow = 0;
+ journalRecordEnqueues = 0;
+ journalRecordDequeues = 0;
+ journalFreeFileCount = 0;
+ journalFreeFileCountHigh = 0;
+ journalFreeFileCountLow = 0;
+ journalAvailableFileCount = 0;
+ journalAvailableFileCountHigh = 0;
+ journalAvailableFileCountLow = 0;
+ journalWriteWaitFailures = 0;
+ journalWriteBusyFailures = 0;
+ journalReadRecordCount = 0;
+ journalReadBusyFailures = 0;
+ journalWritePageCacheDepth = 0;
+ journalWritePageCacheDepthHigh = 0;
+ journalWritePageCacheDepthLow = 0;
+ journalReadPageCacheDepth = 0;
+ journalReadPageCacheDepthHigh = 0;
+ journalReadPageCacheDepthLow = 0;
+
+}
+
+Journal::~Journal () {}
+
+namespace {
+ const string NAME("name");
+ const string TYPE("type");
+ const string ACCESS("access");
+ const string INDEX("index");
+ const string UNIT("unit");
+ const string MIN("min");
+ const string MAX("max");
+ const string MAXLEN("maxlen");
+ const string DESC("desc");
+ const string ARGCOUNT("argCount");
+ const string ARGS("args");
+ const string DIR("dir");
+ const string DEFAULT("default");
+}
+
+void Journal::writeSchema (Buffer& buf)
+{
+ FieldTable ft;
+
+ // Schema class header:
+ buf.putShortString (packageName); // Package Name
+ buf.putShortString (className); // Class Name
+ buf.putBin128 (md5Sum); // Schema Hash
+ buf.putShort (7); // Config Element Count
+ buf.putShort (24); // Inst Element Count
+ buf.putShort (2); // Method Count
+ buf.putShort (0); // Event Count
+
+ // Config Elements
+ ft = FieldTable ();
+ ft.setString (NAME, "name");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 1);
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalDirectory");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setString (DESC, "Directory containing journal files");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalBaseFileName");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setString (DESC, "Base filename prefix for journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalWritePageSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setString (UNIT, "byte");
+ ft.setString (DESC, "Page size in write-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalWritePages");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setString (UNIT, "wpage");
+ ft.setString (DESC, "Number of pages in write-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalReadPageSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setString (UNIT, "byte");
+ ft.setString (DESC, "Page size in read-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalReadPages");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setString (UNIT, "rpage");
+ ft.setString (DESC, "Number of pages in read-page-cache");
+ buf.put (ft);
+
+
+ // Inst Elements
+ ft = FieldTable ();
+ ft.setString (NAME, "initialFileCount");
+ ft.setInt (TYPE, TYPE_U16);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files initially allocated to this journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "dataFileSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "byte");
+ ft.setString (DESC, "Size of each journal data file");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalCurrentFileCount");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files currently allocated to this journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalRecordDepth");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Number of enqueued records (durable messages)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalRecordDepthHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Number of enqueued records (durable messages) (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalRecordDepthLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Number of enqueued records (durable messages) (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalRecordEnqueues");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total enqueued records on journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalRecordDequeues");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total dequeued records on journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalFreeFileCount");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files free on this journal. Includes free files trapped in holes.");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalFreeFileCountHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files free on this journal. Includes free files trapped in holes. (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalFreeFileCountLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files free on this journal. Includes free files trapped in holes. (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalAvailableFileCount");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files available to be written. Excluding holes");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalAvailableFileCountHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files available to be written. Excluding holes (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalAvailableFileCountLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files available to be written. Excluding holes (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalWriteWaitFailures");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "AIO Wait failures on write");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalWriteBusyFailures");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "AIO Busy failures on write");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalReadRecordCount");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Records read from the journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalReadBusyFailures");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "AIO Busy failures on read");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalWritePageCacheDepth");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "page");
+ ft.setString (DESC, "Current depth of write-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalWritePageCacheDepthHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "page");
+ ft.setString (DESC, "Current depth of write-page-cache (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalWritePageCacheDepthLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "page");
+ ft.setString (DESC, "Current depth of write-page-cache (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalReadPageCacheDepth");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "page");
+ ft.setString (DESC, "Current depth of read-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalReadPageCacheDepthHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "page");
+ ft.setString (DESC, "Current depth of read-page-cache (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalReadPageCacheDepthLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "page");
+ ft.setString (DESC, "Current depth of read-page-cache (Low)");
+ buf.put (ft);
+
+
+ // Methods
+ ft = FieldTable ();
+ ft.setString (NAME, "expand");
+ ft.setInt (ARGCOUNT, 1);
+ ft.setString (DESC, "Increase number of files allocated for this journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "by");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (DIR, "I");
+ ft.setString (DESC, "Number of files to increase journal size by");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "reconfigure");
+ ft.setInt (ARGCOUNT, 2);
+ ft.setString (DESC, "Destructively reconfigure dimensions for this journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "fileCount");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (DIR, "I");
+ ft.setString (DESC, "Number of files in journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "fileSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (DIR, "I");
+ ft.setString (DESC, "Size of files in journal");
+ buf.put (ft);
+
+
+ // Events
+
+}
+
+void Journal::writeConfig (Buffer& buf)
+{
+ sys::RWlock::ScopedRlock readLock (accessLock);
+ configChanged = false;
+
+ writeTimestamps (buf);
+ buf.putShortString (name);
+ buf.putShortString (journalDirectory);
+ buf.putShortString (journalBaseFileName);
+ buf.putLong (journalWritePageSize);
+ buf.putLong (journalWritePages);
+ buf.putLong (journalReadPageSize);
+ buf.putLong (journalReadPages);
+
+}
+
+void Journal::writeInstrumentation (Buffer& buf, bool skipHeaders)
+{
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ instChanged = false;
+
+ if (!skipHeaders)
+ writeTimestamps (buf);
+ buf.putShort (initialFileCount);
+ buf.putLong (dataFileSize);
+ buf.putLong (journalCurrentFileCount);
+ buf.putLong (journalRecordDepth);
+ buf.putLong (journalRecordDepthHigh);
+ buf.putLong (journalRecordDepthLow);
+ buf.putLongLong (journalRecordEnqueues);
+ buf.putLongLong (journalRecordDequeues);
+ buf.putLong (journalFreeFileCount);
+ buf.putLong (journalFreeFileCountHigh);
+ buf.putLong (journalFreeFileCountLow);
+ buf.putLong (journalAvailableFileCount);
+ buf.putLong (journalAvailableFileCountHigh);
+ buf.putLong (journalAvailableFileCountLow);
+ buf.putLongLong (journalWriteWaitFailures);
+ buf.putLongLong (journalWriteBusyFailures);
+ buf.putLongLong (journalReadRecordCount);
+ buf.putLongLong (journalReadBusyFailures);
+ buf.putLong (journalWritePageCacheDepth);
+ buf.putLong (journalWritePageCacheDepthHigh);
+ buf.putLong (journalWritePageCacheDepthLow);
+ buf.putLong (journalReadPageCacheDepth);
+ buf.putLong (journalReadPageCacheDepthHigh);
+ buf.putLong (journalReadPageCacheDepthLow);
+
+
+ // Maintenance of hi-lo statistics
+ journalRecordDepthHigh = journalRecordDepth;
+ journalRecordDepthLow = journalRecordDepth;
+ journalFreeFileCountHigh = journalFreeFileCount;
+ journalFreeFileCountLow = journalFreeFileCount;
+ journalAvailableFileCountHigh = journalAvailableFileCount;
+ journalAvailableFileCountLow = journalAvailableFileCount;
+ journalWritePageCacheDepthHigh = journalWritePageCacheDepth;
+ journalWritePageCacheDepthLow = journalWritePageCacheDepth;
+ journalReadPageCacheDepthHigh = journalReadPageCacheDepth;
+ journalReadPageCacheDepthLow = journalReadPageCacheDepth;
+
+}
+
+void Journal::doMethod (string methodName, Buffer& inBuf, Buffer& outBuf)
+{
+ Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
+
+ if (methodName == "expand")
+ {
+ ArgsJournalExpand ioArgs;
+ ioArgs.i_by = inBuf.getLong ();
+ status = coreObject->ManagementMethod (METHOD_EXPAND, ioArgs);
+ outBuf.putLong (status);
+ outBuf.putShortString (Manageable::StatusText (status));
+ return;
+ }
+
+ if (methodName == "reconfigure")
+ {
+ ArgsJournalReconfigure ioArgs;
+ ioArgs.i_fileCount = inBuf.getLong ();
+ ioArgs.i_fileSize = inBuf.getLong ();
+ status = coreObject->ManagementMethod (METHOD_RECONFIGURE, ioArgs);
+ outBuf.putLong (status);
+ outBuf.putShortString (Manageable::StatusText (status));
+ return;
+ }
+
+ outBuf.putLong (status);
+ outBuf.putShortString (Manageable::StatusText (status));
+}
+
Added: store/trunk/cpp/lib/gen/qpid/management/Journal.h
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Journal.h (rev 0)
+++ store/trunk/cpp/lib/gen/qpid/management/Journal.h 2008-04-07 16:11:44 UTC (rev 1844)
@@ -0,0 +1,290 @@
+
+#ifndef _MANAGEMENT_JOURNAL_
+#define _MANAGEMENT_JOURNAL_
+
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/management/ManagementObject.h"
+#include "qpid/framing/Uuid.h"
+
+namespace qpid {
+namespace management {
+
+class Journal : public ManagementObject
+{
+ private:
+
+ static std::string packageName;
+ static std::string className;
+ static uint8_t md5Sum[16];
+
+ // Configuration Elements
+ std::string name;
+ std::string journalDirectory;
+ std::string journalBaseFileName;
+ uint32_t journalWritePageSize;
+ uint32_t journalWritePages;
+ uint32_t journalReadPageSize;
+ uint32_t journalReadPages;
+
+ // Instrumentation Elements
+ uint16_t initialFileCount;
+ uint32_t dataFileSize;
+ uint32_t journalCurrentFileCount;
+ uint32_t journalRecordDepth;
+ uint32_t journalRecordDepthHigh;
+ uint32_t journalRecordDepthLow;
+ uint64_t journalRecordEnqueues;
+ uint64_t journalRecordDequeues;
+ uint32_t journalFreeFileCount;
+ uint32_t journalFreeFileCountHigh;
+ uint32_t journalFreeFileCountLow;
+ uint32_t journalAvailableFileCount;
+ uint32_t journalAvailableFileCountHigh;
+ uint32_t journalAvailableFileCountLow;
+ uint64_t journalWriteWaitFailures;
+ uint64_t journalWriteBusyFailures;
+ uint64_t journalReadRecordCount;
+ uint64_t journalReadBusyFailures;
+ uint32_t journalWritePageCacheDepth;
+ uint32_t journalWritePageCacheDepthHigh;
+ uint32_t journalWritePageCacheDepthLow;
+ uint32_t journalReadPageCacheDepth;
+ uint32_t journalReadPageCacheDepthHigh;
+ uint32_t journalReadPageCacheDepthLow;
+
+ // Private Methods
+ static void writeSchema (qpid::framing::Buffer& buf);
+ void writeConfig (qpid::framing::Buffer& buf);
+ void writeInstrumentation (qpid::framing::Buffer& buf,
+ bool skipHeaders = false);
+ void doMethod (std::string methodName,
+ qpid::framing::Buffer& inBuf,
+ qpid::framing::Buffer& outBuf);
+ writeSchemaCall_t getWriteSchemaCall (void) { return writeSchema; }
+
+
+ public:
+
+ friend class PackageMrgstore;
+ typedef boost::shared_ptr<Journal> shared_ptr;
+
+ Journal (Manageable* coreObject);
+ ~Journal (void);
+
+ std::string getPackageName (void) { return packageName; }
+ std::string getClassName (void) { return className; }
+ uint8_t* getMd5Sum (void) { return md5Sum; }
+
+ // Method IDs
+ static const uint32_t METHOD_EXPAND = 1;
+ static const uint32_t METHOD_RECONFIGURE = 2;
+
+ // Accessor Methods
+ inline void set_name (std::string val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ name = val;
+ configChanged = true;
+ }
+ inline void set_journalDirectory (std::string val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalDirectory = val;
+ configChanged = true;
+ }
+ inline void set_journalBaseFileName (std::string val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalBaseFileName = val;
+ configChanged = true;
+ }
+ inline void set_journalWritePageSize (uint32_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalWritePageSize = val;
+ configChanged = true;
+ }
+ inline void set_journalWritePages (uint32_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalWritePages = val;
+ configChanged = true;
+ }
+ inline void set_journalReadPageSize (uint32_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalReadPageSize = val;
+ configChanged = true;
+ }
+ inline void set_journalReadPages (uint32_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalReadPages = val;
+ configChanged = true;
+ }
+ inline void set_initialFileCount (uint16_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ initialFileCount = val;
+ instChanged = true;
+ }
+ inline void set_dataFileSize (uint32_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ dataFileSize = val;
+ instChanged = true;
+ }
+ inline void set_journalCurrentFileCount (uint32_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalCurrentFileCount = val;
+ instChanged = true;
+ }
+ inline void inc_journalRecordDepth (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalRecordDepth += by;
+ if (journalRecordDepthHigh < journalRecordDepth)
+ journalRecordDepthHigh = journalRecordDepth;
+ instChanged = true;
+ }
+ inline void dec_journalRecordDepth (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalRecordDepth -= by;
+ if (journalRecordDepthLow > journalRecordDepth)
+ journalRecordDepthLow = journalRecordDepth;
+ instChanged = true;
+ }
+ inline void inc_journalRecordEnqueues (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalRecordEnqueues += by;
+ instChanged = true;
+ }
+ inline void dec_journalRecordEnqueues (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalRecordEnqueues -= by;
+ instChanged = true;
+ }
+ inline void inc_journalRecordDequeues (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalRecordDequeues += by;
+ instChanged = true;
+ }
+ inline void dec_journalRecordDequeues (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalRecordDequeues -= by;
+ instChanged = true;
+ }
+ inline void inc_journalFreeFileCount (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalFreeFileCount += by;
+ if (journalFreeFileCountHigh < journalFreeFileCount)
+ journalFreeFileCountHigh = journalFreeFileCount;
+ instChanged = true;
+ }
+ inline void dec_journalFreeFileCount (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalFreeFileCount -= by;
+ if (journalFreeFileCountLow > journalFreeFileCount)
+ journalFreeFileCountLow = journalFreeFileCount;
+ instChanged = true;
+ }
+ inline void inc_journalAvailableFileCount (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalAvailableFileCount += by;
+ if (journalAvailableFileCountHigh < journalAvailableFileCount)
+ journalAvailableFileCountHigh = journalAvailableFileCount;
+ instChanged = true;
+ }
+ inline void dec_journalAvailableFileCount (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalAvailableFileCount -= by;
+ if (journalAvailableFileCountLow > journalAvailableFileCount)
+ journalAvailableFileCountLow = journalAvailableFileCount;
+ instChanged = true;
+ }
+ inline void inc_journalWriteWaitFailures (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalWriteWaitFailures += by;
+ instChanged = true;
+ }
+ inline void dec_journalWriteWaitFailures (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalWriteWaitFailures -= by;
+ instChanged = true;
+ }
+ inline void inc_journalWriteBusyFailures (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalWriteBusyFailures += by;
+ instChanged = true;
+ }
+ inline void dec_journalWriteBusyFailures (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalWriteBusyFailures -= by;
+ instChanged = true;
+ }
+ inline void inc_journalReadRecordCount (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalReadRecordCount += by;
+ instChanged = true;
+ }
+ inline void dec_journalReadRecordCount (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalReadRecordCount -= by;
+ instChanged = true;
+ }
+ inline void inc_journalReadBusyFailures (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalReadBusyFailures += by;
+ instChanged = true;
+ }
+ inline void dec_journalReadBusyFailures (uint64_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalReadBusyFailures -= by;
+ instChanged = true;
+ }
+ inline void inc_journalWritePageCacheDepth (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalWritePageCacheDepth += by;
+ if (journalWritePageCacheDepthHigh < journalWritePageCacheDepth)
+ journalWritePageCacheDepthHigh = journalWritePageCacheDepth;
+ instChanged = true;
+ }
+ inline void dec_journalWritePageCacheDepth (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalWritePageCacheDepth -= by;
+ if (journalWritePageCacheDepthLow > journalWritePageCacheDepth)
+ journalWritePageCacheDepthLow = journalWritePageCacheDepth;
+ instChanged = true;
+ }
+ inline void inc_journalReadPageCacheDepth (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalReadPageCacheDepth += by;
+ if (journalReadPageCacheDepthHigh < journalReadPageCacheDepth)
+ journalReadPageCacheDepthHigh = journalReadPageCacheDepth;
+ instChanged = true;
+ }
+ inline void dec_journalReadPageCacheDepth (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalReadPageCacheDepth -= by;
+ if (journalReadPageCacheDepthLow > journalReadPageCacheDepth)
+ journalReadPageCacheDepthLow = journalReadPageCacheDepth;
+ instChanged = true;
+ }
+
+};
+
+}}
+
+
+#endif /*!_MANAGEMENT_JOURNAL_*/
Added: store/trunk/cpp/lib/gen/qpid/management/PackageMrgstore.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/PackageMrgstore.cpp (rev 0)
+++ store/trunk/cpp/lib/gen/qpid/management/PackageMrgstore.cpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -0,0 +1,37 @@
+
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/management/PackageMrgstore.h"
+#include "qpid/management/Store.h"
+#include "qpid/management/Journal.h"
+
+
+using namespace qpid::management;
+
+PackageMrgstore::PackageMrgstore (ManagementAgent::shared_ptr agent)
+{
+agent->RegisterClass (Store::packageName, Store::className, Store::md5Sum, Store::writeSchema);
+agent->RegisterClass (Journal::packageName, Journal::className, Journal::md5Sum, Journal::writeSchema);
+
+}
+
Added: store/trunk/cpp/lib/gen/qpid/management/PackageMrgstore.h
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/PackageMrgstore.h (rev 0)
+++ store/trunk/cpp/lib/gen/qpid/management/PackageMrgstore.h 2008-04-07 16:11:44 UTC (rev 1844)
@@ -0,0 +1,42 @@
+
+#ifndef _MANAGEMENT_PACKAGE_MRGSTORE_
+#define _MANAGEMENT_PACKAGE_MRGSTORE_
+
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/management/ManagementAgent.h"
+
+namespace qpid {
+namespace management {
+
+class PackageMrgstore
+{
+ public:
+ PackageMrgstore (ManagementAgent::shared_ptr agent);
+ ~PackageMrgstore () {}
+};
+
+}}
+
+
+#endif /*!_MANAGEMENT_PACKAGE_MRGSTORE_*/
Added: store/trunk/cpp/lib/gen/qpid/management/Store.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Store.cpp (rev 0)
+++ store/trunk/cpp/lib/gen/qpid/management/Store.cpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -0,0 +1,164 @@
+
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/log/Statement.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/management/Manageable.h"
+#include "Store.h"
+
+
+using namespace qpid::management;
+using namespace qpid::sys;
+using namespace qpid::framing;
+using std::string;
+
+string Store::packageName = string ("mrgstore");
+string Store::className = string ("store");
+uint8_t Store::md5Sum[16] =
+ {0x0,0xc6,0x7a,0x17,0x1,0xc6,0x33,0xb4,0x5d,0x75,0xd3,0x86,0xe3,0x20,0xcc,0xe2};
+
+Store::Store (Manageable* _core, Manageable* _parent) :
+ ManagementObject(_core)
+
+{
+ qpidBrokerRef = _parent->GetManagementObject ()->getObjectId ();
+
+}
+
+Store::~Store () {}
+
+namespace {
+ const string NAME("name");
+ const string TYPE("type");
+ const string ACCESS("access");
+ const string INDEX("index");
+ const string UNIT("unit");
+ const string MIN("min");
+ const string MAX("max");
+ const string MAXLEN("maxlen");
+ const string DESC("desc");
+ const string ARGCOUNT("argCount");
+ const string ARGS("args");
+ const string DIR("dir");
+ const string DEFAULT("default");
+}
+
+void Store::writeSchema (Buffer& buf)
+{
+ FieldTable ft;
+
+ // Schema class header:
+ buf.putShortString (packageName); // Package Name
+ buf.putShortString (className); // Class Name
+ buf.putBin128 (md5Sum); // Schema Hash
+ buf.putShort (5); // Config Element Count
+ buf.putShort (0); // Inst Element Count
+ buf.putShort (0); // Method Count
+ buf.putShort (0); // Event Count
+
+ // Config Elements
+ ft = FieldTable ();
+ ft.setString (NAME, "qpidBrokerRef");
+ ft.setInt (TYPE, TYPE_REF);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 1);
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "location");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setString (DESC, "Logical directory on disk");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "async");
+ ft.setInt (TYPE, TYPE_BOOL);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setString (DESC, "Asynchronous IO");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "defaultInitialFileCount");
+ ft.setInt (TYPE, TYPE_U16);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Default number of files initially allocated to each journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "defaultDataFileSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setString (UNIT, "RdPg");
+ ft.setString (DESC, "Default size of each journal data file");
+ buf.put (ft);
+
+
+ // Inst Elements
+
+ // Methods
+
+ // Events
+
+}
+
+void Store::writeConfig (Buffer& buf)
+{
+ sys::RWlock::ScopedRlock readLock (accessLock);
+ configChanged = false;
+
+ writeTimestamps (buf);
+ buf.putLongLong (qpidBrokerRef);
+ buf.putShortString (location);
+ buf.putOctet (async?1:0);
+ buf.putShort (defaultInitialFileCount);
+ buf.putLong (defaultDataFileSize);
+
+}
+
+void Store::writeInstrumentation (Buffer& buf, bool skipHeaders)
+{
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ instChanged = false;
+
+ if (!skipHeaders)
+ writeTimestamps (buf);
+
+
+ // Maintenance of hi-lo statistics
+
+}
+
+void Store::doMethod (string, Buffer&, Buffer& outBuf)
+{
+ Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
+
+ outBuf.putLong (status);
+ outBuf.putShortString (Manageable::StatusText (status));
+}
+
Added: store/trunk/cpp/lib/gen/qpid/management/Store.h
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Store.h (rev 0)
+++ store/trunk/cpp/lib/gen/qpid/management/Store.h 2008-04-07 16:11:44 UTC (rev 1844)
@@ -0,0 +1,109 @@
+
+#ifndef _MANAGEMENT_STORE_
+#define _MANAGEMENT_STORE_
+
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/management/ManagementObject.h"
+#include "qpid/framing/Uuid.h"
+
+namespace qpid {
+namespace management {
+
+class Store : public ManagementObject
+{
+ private:
+
+ static std::string packageName;
+ static std::string className;
+ static uint8_t md5Sum[16];
+
+ // Configuration Elements
+ uint64_t qpidBrokerRef;
+ std::string location;
+ uint8_t async;
+ uint16_t defaultInitialFileCount;
+ uint32_t defaultDataFileSize;
+
+ // Instrumentation Elements
+
+ // Private Methods
+ static void writeSchema (qpid::framing::Buffer& buf);
+ void writeConfig (qpid::framing::Buffer& buf);
+ void writeInstrumentation (qpid::framing::Buffer& buf,
+ bool skipHeaders = false);
+ void doMethod (std::string methodName,
+ qpid::framing::Buffer& inBuf,
+ qpid::framing::Buffer& outBuf);
+ writeSchemaCall_t getWriteSchemaCall (void) { return writeSchema; }
+
+ // Stub for getInstChanged. There are no inst elements
+ bool getInstChanged (void) { return false; }
+
+ public:
+
+ friend class PackageMrgstore;
+ typedef boost::shared_ptr<Store> shared_ptr;
+
+ Store (Manageable* coreObject, Manageable* _parent);
+ ~Store (void);
+
+ std::string getPackageName (void) { return packageName; }
+ std::string getClassName (void) { return className; }
+ uint8_t* getMd5Sum (void) { return md5Sum; }
+
+ // Method IDs
+
+ // Accessor Methods
+ inline void set_qpidBrokerRef (uint64_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ qpidBrokerRef = val;
+ configChanged = true;
+ }
+ inline void set_location (std::string val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ location = val;
+ configChanged = true;
+ }
+ inline void set_async (uint8_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ async = val;
+ configChanged = true;
+ }
+ inline void set_defaultInitialFileCount (uint16_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ defaultInitialFileCount = val;
+ configChanged = true;
+ }
+ inline void set_defaultDataFileSize (uint32_t val){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ defaultDataFileSize = val;
+ configChanged = true;
+ }
+
+};
+
+}}
+
+
+#endif /*!_MANAGEMENT_STORE_*/
Modified: store/trunk/cpp/lib/jrnl/jcfg.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcfg.hpp 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/jrnl/jcfg.hpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -71,6 +71,7 @@
#define JRNL_WMGR_PAGE_SIZE 64 ///< Journal write page size in softblocks
#define JRNL_WMGR_PAGES 32 ///< Number of pages to use in wmgr
+
#define JRNL_WMGR_MAXDTOKPP 1024 ///< Max. dtoks (data blocks) per page in wmgr
#define JRNL_WMGR_MAXWAITUS 100 ///< Max. wait time (us) before submitting AIO
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -424,13 +424,13 @@
}
void
-jcntl::log(log_level ll, const std::string& log_stmt)
+jcntl::log(log_level ll, const std::string& log_stmt) const
{
log(ll, log_stmt.c_str());
}
void
-jcntl::log(log_level ll, const char* const log_stmt)
+jcntl::log(log_level ll, const char* const log_stmt) const
{
if (ll > LOG_INFO)
{
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -590,8 +590,8 @@
inline const u_int32_t jfsize_sblks() const { return _jfsize_sblks; }
// Logging
- virtual void log(log_level level, const std::string& log_stmt);
- virtual void log(log_level level, const char* const log_stmt);
+ virtual void log(log_level level, const std::string& log_stmt) const;
+ virtual void log(log_level level, const char* const log_stmt) const;
// these are _rmgr to _wmgr interactions, remove when _rmgr contains ref to _wmgr:
void chk_wr_frot();
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -88,8 +88,11 @@
void
rmgr::clean()
{
+ pmgr::clean();
+
::free(_fhdr_buffer);
_fhdr_buffer = 0;
+
if (_iocbp)
{
delete _iocbp;
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -53,6 +53,7 @@
_cached_offset_dblks(0),
_jfsize_dblks(0),
_jfsize_pgs(0),
+ _num_jfiles(0),
_enq_busy(false),
_deq_busy(false),
_abort_busy(false),
@@ -72,6 +73,7 @@
_cached_offset_dblks(0),
_jfsize_dblks(0),
_jfsize_pgs(0),
+ _num_jfiles(0),
_enq_busy(false),
_deq_busy(false),
_abort_busy(false),
@@ -906,9 +908,9 @@
void
wmgr::initialize()
{
- const u_int16_t num_jfiles = _jc->num_jfiles();
pmgr::initialize();
- if (::posix_memalign(&_fhdr_base_ptr, _sblksize, _sblksize * num_jfiles))
+ _num_jfiles = _jc->num_jfiles();
+ if (::posix_memalign(&_fhdr_base_ptr, _sblksize, _sblksize * _num_jfiles))
{
clean();
std::ostringstream oss;
@@ -916,12 +918,12 @@
oss << " errno=" << errno;
throw jexception(jerrno::JERR__MALLOC, oss.str(), "wmgr", "initialize");
}
- _fhdr_ptr_arr = (void**)::malloc(num_jfiles * sizeof(void*));
+ _fhdr_ptr_arr = (void**)::malloc(_num_jfiles * sizeof(void*));
MALLOC_CHK(_fhdr_ptr_arr, "_fhdr_ptr_arr", "wmgr", "initialize");
- _iocba = (iocb**)::malloc(sizeof(iocb*) * num_jfiles);
+ _iocba = (iocb**)::malloc(sizeof(iocb*) * _num_jfiles);
MALLOC_CHK(_iocba, "_iocba", "wmgr", "initialize");
- ::memset(_iocba, 0, sizeof(iocb*) * num_jfiles);
- for (u_int16_t i=0; i<num_jfiles; i++)
+ ::memset(_iocba, 0, sizeof(iocb*) * _num_jfiles);
+ for (u_int16_t i=0; i<_num_jfiles; i++)
{
_fhdr_ptr_arr[i] = (void*)((char*)_fhdr_base_ptr + _sblksize * i);
_iocba[i] = new iocb;
@@ -1067,6 +1069,7 @@
void
wmgr::clean()
{
+ pmgr::clean();
// clean up allocated memory here
::free(_fhdr_base_ptr);
_fhdr_base_ptr = 0;
@@ -1076,7 +1079,7 @@
if (_iocba)
{
- for (u_int32_t i=0; i<_jc->num_jfiles(); i++)
+ for (u_int32_t i=0; i<_num_jfiles; i++)
delete _iocba[i];
::free(_iocba);
_iocba = 0;
Modified: store/trunk/cpp/lib/jrnl/wmgr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.hpp 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/lib/jrnl/wmgr.hpp 2008-04-07 16:11:44 UTC (rev 1844)
@@ -79,6 +79,7 @@
std::deque<data_tok*> _ddtokl; ///< Deferred dequeue data_tok list
u_int32_t _jfsize_dblks; ///< Journal file size in dblks (NOT sblks!)
u_int32_t _jfsize_pgs; ///< Journal file size in cache pages
+ u_int16_t _num_jfiles; ///< Number of files used in iocb mallocs
// TODO: Convert _enq_busy etc into a proper threadsafe lock
// TODO: Convert to enum? Are these encodes mutually exclusive?
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2008-04-07 15:30:19 UTC (rev 1843)
+++ store/trunk/cpp/tests/Makefile.am 2008-04-07 16:11:44 UTC (rev 1844)
@@ -4,7 +4,7 @@
AM_CXXFLAGS = $(WARNING_CFLAGS) $(APR_CXXFLAGS) $(QPID_CXXFLAGS) \
$(CPPUNIT_CXXFLAGS) -DBOOST_TEST_DYN_LINK
-INCLUDES=-I../lib
+INCLUDES=-I../lib -I../lib/gen
SUBDIRS = jrnl
16 years, 9 months
rhmessaging commits: r1843 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-07 11:30:19 -0400 (Mon, 07 Apr 2008)
New Revision: 1843
Modified:
mgmt/cumin/python/cumin/model.py
Log:
Use the base class get_title, and rename remove on registration to
"unregister".
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-04-07 14:57:29 UTC (rev 1842)
+++ mgmt/cumin/python/cumin/model.py 2008-04-07 15:30:19 UTC (rev 1843)
@@ -377,10 +377,15 @@
def __init__(self, model, name, mint_class):
super(LocalClass, self).__init__(model, name, mint_class)
- self.Add(self, "add")
- self.Edit(self, "edit")
- self.Remove(self, "remove")
+ action = self.Add(self, "add")
+ action.title = "Add"
+ action = self.Edit(self, "edit")
+ action.title = "Edit"
+
+ action = self.Remove(self, "remove")
+ action.title = "Remove"
+
class Add(CuminAction):
def __init__(self, cls, name):
super(LocalClass.Add, self).__init__(cls, name)
@@ -389,9 +394,6 @@
frame = self.cumin_class.show_object(session, object)
return frame.show_add(session)
- def get_title(self, session):
- return "Add"
-
def do_invoke(self, object, args, completion):
assert object is None
@@ -416,9 +418,6 @@
frame = self.cumin_class.show_object(session, object)
return frame.show_edit(session)
- def get_title(self, session):
- return "Edit"
-
def do_invoke(self, object, args, completion):
try:
object.set(**args)
@@ -437,9 +436,6 @@
frame = self.cumin_class.show_object(session, object)
return frame.show_remove(session)
- def get_title(self, session):
- return "Remove"
-
def do_invoke(self, object, args, completion):
try:
object.destroySelf();
@@ -974,6 +970,8 @@
prop.title = "Port"
prop.summary = True
+ self.remove.title = "Unregister"
+
def get_title(self, session):
return "Broker Registration"
16 years, 9 months
rhmessaging commits: r1842 - in mgmt/cumin/python: wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-07 10:57:29 -0400 (Mon, 07 Apr 2008)
New Revision: 1842
Modified:
mgmt/cumin/python/cumin/broker.strings
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/exchange.strings
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/system.strings
mgmt/cumin/python/cumin/widgets.strings
mgmt/cumin/python/wooly/tables.py
Log:
To deal with a rendering problem, use a column count to set the
colspan of table headers, instead of using colspan="0".
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2008-04-07 14:04:01 UTC (rev 1841)
+++ mgmt/cumin/python/cumin/broker.strings 2008-04-07 14:57:29 UTC (rev 1842)
@@ -27,7 +27,7 @@
<table class="mobjects">
<thead>
<tr>
- <th class="setnav" colspan="0">
+ <th class="setnav" colspan="{column_count}">
<div class="rfloat">{page}</div>
{count}
</th>
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2008-04-07 14:04:01 UTC (rev 1841)
+++ mgmt/cumin/python/cumin/client.strings 2008-04-07 14:57:29 UTC (rev 1842)
@@ -42,7 +42,7 @@
<table class="mobjects">
<thead>
<tr>
- <th class="setnav" colspan="0">
+ <th class="setnav" colspan="{column_count}">
<div class="rfloat">{page}</div>
{count}
</th>
@@ -166,7 +166,7 @@
<table class="mobjects">
<thead>
<tr>
- <th class="setnav" colspan="0">
+ <th class="setnav" colspan="{column_count}">
<div class="rfloat">{page}</div>
{count}
</th>
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2008-04-07 14:04:01 UTC (rev 1841)
+++ mgmt/cumin/python/cumin/exchange.strings 2008-04-07 14:57:29 UTC (rev 1842)
@@ -53,7 +53,7 @@
<table class="mobjects">
<thead>
<tr>
- <th class="setnav" colspan="0">
+ <th class="setnav" colspan="{column_count}">
<div class="rfloat">{page}</div>
{count}
</th>
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2008-04-07 14:04:01 UTC (rev 1841)
+++ mgmt/cumin/python/cumin/queue.strings 2008-04-07 14:57:29 UTC (rev 1842)
@@ -48,7 +48,7 @@
<table class="mobjects">
<thead>
<tr>
- <th class="setnav" colspan="0">
+ <th class="setnav" colspan="{column_count}">
<div class="rfloat">{page}</div>
{count}
</th>
Modified: mgmt/cumin/python/cumin/system.strings
===================================================================
--- mgmt/cumin/python/cumin/system.strings 2008-04-07 14:04:01 UTC (rev 1841)
+++ mgmt/cumin/python/cumin/system.strings 2008-04-07 14:57:29 UTC (rev 1842)
@@ -12,7 +12,7 @@
<table class="mobjects">
<thead>
<tr>
- <th class="setnav" colspan="0">
+ <th class="setnav" colspan="{column_count}">
<div class="rfloat">{page}</div>
{count}
</th>
@@ -23,10 +23,3 @@
</table>
{hidden_inputs}
</form>
-
-[SystemView.html]
-<h1><img src="resource?name=system-36.png"/>{title}</h1>
-
-{summary}
-
-{tabs}
Modified: mgmt/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/cumin/python/cumin/widgets.strings 2008-04-07 14:04:01 UTC (rev 1841)
+++ mgmt/cumin/python/cumin/widgets.strings 2008-04-07 14:57:29 UTC (rev 1842)
@@ -237,7 +237,7 @@
<table class="mobjects">
<thead>
<tr>
- <th class="setnav" colspan="0">
+ <th class="setnav" colspan="{column_count}">
<div class="rfloat">{page}</div>
{count}
</th>
Modified: mgmt/cumin/python/wooly/tables.py
===================================================================
--- mgmt/cumin/python/wooly/tables.py 2008-04-07 14:04:01 UTC (rev 1841)
+++ mgmt/cumin/python/wooly/tables.py 2008-04-07 14:57:29 UTC (rev 1842)
@@ -62,6 +62,9 @@
return writer.to_string()
+ def render_column_count(self, session, *args):
+ return len(self.columns)
+
def render_cells(self, session, item):
writer = Writer()
16 years, 9 months
rhmessaging commits: r1841 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-07 10:04:01 -0400 (Mon, 07 Apr 2008)
New Revision: 1841
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/broker.strings
mgmt/cumin/python/cumin/brokergroup.py
mgmt/cumin/python/cumin/brokergroup.strings
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/exchange.strings
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/widgets.py
mgmt/cumin/python/cumin/widgets.strings
mgmt/notes/justin-todo.txt
Log:
Drive object summaries off of metadata. This includes properties and
actions for now, and it can eventually include stats.
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/broker.py 2008-04-07 14:04:01 UTC (rev 1841)
@@ -236,49 +236,48 @@
def __init__(self, app, name):
super(BrokerView, self).__init__(app, name)
- self.status = BrokerStatus(app, "status")
- self.add_child(self.status)
+ status = BrokerStatus(app, "status")
+ self.add_child(status)
- self.body = ModeSet(app, "body")
- self.add_child(self.body)
+ self.__body = ModeSet(app, "body")
+ self.add_child(self.__body)
- self.tabs = TabbedModeSet(app, "tabs")
- self.body.add_mode(self.tabs)
+ self.__tabs = TabbedModeSet(app, "tabs")
+ self.__body.add_mode(self.__tabs)
- self.tabs.add_tab(self.BrokerQueueTab(app, "queues"))
- self.tabs.add_tab(self.BrokerExchangeTab(app, "exchanges"))
- self.tabs.add_tab(self.BrokerClientTab(app, "clients"))
- self.tabs.add_tab(PeerSet(app, "links"))
+ self.__tabs.add_tab(self.BrokerQueueTab(app, "queues"))
+ self.__tabs.add_tab(self.BrokerExchangeTab(app, "exchanges"))
+ self.__tabs.add_tab(self.BrokerClientTab(app, "clients"))
+ self.__tabs.add_tab(PeerSet(app, "links"))
- self.missing = self.BrokerMissing(app, "missing")
- self.body.add_mode(self.missing)
+ self.__missing = self.BrokerMissing(app, "missing")
+ self.__body.add_mode(self.__missing)
- self.vhost = Attribute(app, "vhost")
- self.add_attribute(self.vhost)
+ self.__vhost = Attribute(app, "vhost")
+ self.add_attribute(self.__vhost)
class BrokerMissing(Widget):
pass
- def show_config(self, session):
- return self.tabs.show_mode(session, self.config)
-
- def render_title(self, session, reg):
- return "Broker '%s'" % reg.name
-
def do_process(self, session, reg):
if reg.broker:
- self.vhost.set(session, reg.getDefaultVhost())
+ self.__vhost.set(session, reg.getDefaultVhost())
else:
- self.body.show_mode(session, self.missing)
+ self.__body.show_mode(session, self.__missing)
super(BrokerView, self).do_process(session, reg)
- def render_data_url(self, session, reg):
- return "model.xml"
+ def render_title(self, session, reg):
+ return "Broker '%s'" % reg.name
- def render_address(self, session, reg):
- return reg.host + (reg.port and ":%i" % reg.port or "")
+ def render_script(self, session, reg):
+ if reg.broker:
+ data = "model.xml?class=broker;id=%i" % reg.broker.id
+ return "wooly.setIntervalUpdate('%s', updateBroker, 3000)" % data
+ def render_icon_resource(self, session, reg):
+ return "broker-36.png"
+
def render_group_links(self, session, reg):
links = list()
@@ -290,26 +289,6 @@
return ", ".join(links)
- def render_cluster_link(self, session, reg):
- cluster = reg.cluster
-
- if cluster:
- branch = session.branch()
- self.page.show_broker_cluster(branch, cluster).show_view(branch)
- return fmt_olink(branch, cluster)
- else:
- return fmt_none()
-
- def render_profile_link(self, session, reg):
- profile = reg.profile
-
- if profile:
- branch = session.branch()
- self.page.show_broker_profile(branch, profile).show_view(branch)
- return fmt_olink(branch, profile)
- else:
- return fmt_none()
-
class BrokerQueueTab(Widget):
def __init__(self, app, name):
super(BrokerView.BrokerQueueTab, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/broker.strings 2008-04-07 14:04:01 UTC (rev 1841)
@@ -70,24 +70,14 @@
[BrokerView.html]
<script>
- wooly.setIntervalUpdate("{data_url}", updateBroker, 3000);
+{script}
</script>
{status}
-<h1><img src="resource?name=broker-36.png"/>{title}</h1>
+<h1><img src="resource?name={icon_resource}"/>{title}</h1>
-<table class="props">
- <tr><th>Address</th><td>{address}</td></tr>
- <tr><th>Groups</th><td>{group_links}</td></tr>
- <tr>
- <th class="actions" colspan="2">
- <h2>Act on This Broker:</h2>
- <a class="nav" href="{edit_href}">Edit</a>
- <a href="{remove_href}">Unregister</a>
- </th>
- </tr>
-</table>
+{summary}
{body}
Modified: mgmt/cumin/python/cumin/brokergroup.py
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.py 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/brokergroup.py 2008-04-07 14:04:01 UTC (rev 1841)
@@ -36,7 +36,8 @@
def render_content(self, session, data):
group = Identifiable(data["id"])
branch = session.branch()
- self.app.model.broker_group.show(branch, group).show_view(branch)
+ frame = self.app.model.broker_group.show_object(branch, group)
+ frame = frame.show_view(branch)
return fmt_olink(branch, group, name=data["name"])
class BrokerGroupInputSet(CheckboxInputSet):
@@ -113,20 +114,20 @@
def __init__(self, app, name):
super(BrokerGroupView, self).__init__(app, name)
- self.status = BrokerGroupStatus(app, "status")
- self.add_child(self.status)
+ status = BrokerGroupStatus(app, "status")
+ self.add_child(status)
self.tabs = TabbedModeSet(app, "tabs")
self.add_child(self.tabs)
self.tabs.add_tab(self.GroupBrokerTab(app, "brokers"))
+ def render_icon_resource(self, session, group):
+ return "group-36.png"
+
def render_title(self, session, group):
return "Broker Group '%s'" % group.name
- def render_name(self, session, group):
- return group.name
-
class GroupBrokerTab(BrokerSet):
def get_args(self, session):
return self.frame.get_args(session)
Modified: mgmt/cumin/python/cumin/brokergroup.strings
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.strings 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/brokergroup.strings 2008-04-07 14:04:01 UTC (rev 1841)
@@ -24,21 +24,3 @@
</thead>
<tbody>{items}</tbody>
</table>
-
-[BrokerGroupView.html]
-{status}
-
-<h1><img src="resource?name=group-36.png"/>{title}</h1>
-
-<table class="props">
- <tr><th>Name</th><td>{name}</td></tr>
- <tr>
- <th class="actions" colspan="2">
- <h2>Act on This Group:</h2>
- <a class="nav" href="{edit_href}">Edit</a>
- <a href="{remove_href}">Remove</a>
- </th>
- </tr>
-</table>
-
-{tabs}
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/client.py 2008-04-07 14:04:01 UTC (rev 1841)
@@ -218,24 +218,13 @@
def show_sessions(self, session):
return self.tabs.show_mode(session, self.sessions)
- def render_title(self, session, client):
- return "Client '%s'" % client.address
+ def render_script(self, session, queue):
+ data = "model.xml?class=client;id=%i" % queue.id
+ return "wooly.setIntervalUpdate('%s', updateClient, 3000)" % data
- def render_data_url(self, session, client):
- return "model.xml?class=client;id=%i" % client.id
-
- def render_created_deleted(self, session, client):
- return "%s – %s" % (fmt_datetime(client.creationTime),
- fmt_datetime(client.deletionTime))
-
- def render_updated(self, session, client):
- return fmt_datetime(client.recTime)
+ def render_icon_resource(self, session, queue):
+ return "client-36.png"
- def render_close_href(self, session, client):
- branch = session.branch()
- self.parent.show_close(branch)
- return branch.marshal()
-
class ClientStatistics(TabbedModeSet):
def __init__(self, app, name):
super(ClientStatistics, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/client.strings 2008-04-07 14:04:01 UTC (rev 1841)
@@ -113,28 +113,6 @@
cumin.runObjectListeners(client);
}
-[ClientView.html]
-<script>
- wooly.setIntervalUpdate("{data_url}", updateClient, 3000);
-</script>
-
-{status}
-
-<h1><img src="resource?name=client-36.png"/>{title}</h1>
-
-<table class="props">
- <tr><th>Created – Deleted</th><td>{created_deleted}</td></tr>
- <tr><th>Updated</th><td>{updated}</td></tr>
- <tr>
- <th class="actions" colspan="2">
- <h2>Act on This Client:</h2>
- <a href="{close_href}">Close</a>
- </th>
- </tr>
-</table>
-
-{tabs}
-
[ClientStatistics.html]
<ul class="radiotabs tabs">{tabs}</ul>
<div class="radiotabs mode">{mode}</div>
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/exchange.py 2008-04-07 14:04:01 UTC (rev 1841)
@@ -212,26 +212,13 @@
def show_bindings(self, session):
return self.tabs.show_mode(session, self.bindings);
- def render_data_url(self, session, exchange):
- return "model.xml?class=exchange;id=%i" % exchange.id
+ def render_script(self, session, queue):
+ data = "model.xml?class=exchange;id=%i" % queue.id
+ return "wooly.setIntervalUpdate('%s', updateExchange, 3000)" % data
- def render_type(self, session, exchange):
- if exchange.type == "direct":
- return "Direct"
- elif exchange.type == "topic":
- return "Topic"
- elif exchange.type == "fanout":
- return "Fan Out"
- else:
- return exchange.type
+ def render_icon_resource(self, session, queue):
+ return "exchange-36.png"
- def render_created_deleted(self, session, exchange):
- return "%s – %s" % (fmt_datetime(exchange.creationTime),
- fmt_datetime(exchange.deletionTime))
-
- def render_updated(self, session, exchange):
- return fmt_datetime(exchange.recTime)
-
class ExchangeBindingSet(BindingSet):
def get_args(self, session):
return self.frame.get_args(session)
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/exchange.strings 2008-04-07 14:04:01 UTC (rev 1841)
@@ -175,23 +175,6 @@
cumin.runObjectListeners(exchange);
}
-[ExchangeView.html]
-<script>
- wooly.setIntervalUpdate("{data_url}", updateExchange, 3000);
-</script>
-
-{status}
-
-<h1><img src="resource?name=exchange-36.png"/>{title}</h1>
-
-<table class="props">
- <tr><th>Type</th><td>{type}</td></tr>
- <tr><th>Created – Deleted</th><td>{created_deleted}</td></tr>
- <tr><th>Updated</th><td>{updated}</td></tr>
-</table>
-
-{tabs}
-
[ExchangeBindingSet.html]
<div class="rfloat">{page}</div>
<ul class="radiotabs"> </ul>
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/model.py 2008-04-07 14:04:01 UTC (rev 1841)
@@ -71,10 +71,14 @@
writer.write("</model>")
+ def show_main(self, session):
+ return self.app.main_page.show_main(session)
+
class CuminProperty(object):
def __init__(self, cls, name):
- self.model = cls.model
+ self.cumin_model = cls.cumin_model
self.cumin_class = cls
+
self.name = name
self.title = None
self.categories = ()
@@ -101,14 +105,24 @@
class CuminAction(object):
def __init__(self, cls, name):
- self.model = cls.model
+ self.cumin_model = cls.cumin_model
self.cumin_class = cls
+
self.name = name
self.title = None
self.summary = False
self.cumin_class.add_action(self)
+ def show(self, session, object):
+ raise Exception("Not implemented")
+
+ # XXX we could even cache this if it gets called a lot
+ def get_href(self, session, object):
+ branch = session.branch()
+ self.show(branch, object)
+ return branch.marshal()
+
def get_title(self, session):
if self.title:
return self.title
@@ -132,7 +146,7 @@
print_exc();
finally:
- self.model.invocations.add(invoc)
+ self.cumin_model.invocations.add(invoc)
#invoc.prt()
@@ -154,7 +168,7 @@
verb = self.action.get_title(session)
if self.object:
- cls = self.action.model.get_class_by_object(self.object)
+ cls = self.action.cumin_model.get_class_by_object(self.object)
object = cls.get_object_title(session, self.object)
else:
object = self.action.cumin_class.get_title(session)
@@ -167,8 +181,9 @@
class CuminStat(object):
def __init__(self, cls, name):
- self.model = cls.model
+ self.cumin_model = cls.cumin_model
self.cumin_class = cls
+
self.name = name
self.unit = None
self.title = None
@@ -278,7 +293,7 @@
class CuminClass(object):
def __init__(self, model, name, mint_class):
- self.model = model
+ self.cumin_model = model
self.cumin_name = name
self.mint_class = mint_class
@@ -286,7 +301,7 @@
self.stats = list()
self.actions = list()
- self.model.add_class(self)
+ self.cumin_model.add_class(self)
def add_property(self, prop):
self.properties.append(prop)
@@ -303,6 +318,14 @@
def get_title(self, session):
return "Object"
+ def get_object_href(self, session, object):
+ branch = session.branch()
+ self.show_object(branch, object)
+ return branch.marshal()
+
+ def show_object(self, session, object):
+ raise Exception("Not implemented")
+
def get_object_title(self, session, object):
title = self.get_title(session)
name = self.get_object_name(object)
@@ -359,6 +382,13 @@
self.Remove(self, "remove")
class Add(CuminAction):
+ def __init__(self, cls, name):
+ super(LocalClass.Add, self).__init__(cls, name)
+
+ def show(self, session, object):
+ frame = self.cumin_class.show_object(session, object)
+ return frame.show_add(session)
+
def get_title(self, session):
return "Add"
@@ -368,7 +398,7 @@
try:
object = self.cumin_class.mint_class(**args)
- self.model.app.broker_connect_thread.prompt()
+ self.cumin_model.app.broker_connect_thread.prompt()
completion("OK")
@@ -377,6 +407,15 @@
completion(e.message or "failed")
class Edit(CuminAction):
+ def __init__(self, cls, name):
+ super(LocalClass.Edit, self).__init__(cls, name)
+
+ self.summary = True
+
+ def show(self, session, object):
+ frame = self.cumin_class.show_object(session, object)
+ return frame.show_edit(session)
+
def get_title(self, session):
return "Edit"
@@ -389,6 +428,15 @@
completion(e.message or "failed")
class Remove(CuminAction):
+ def __init__(self, cls, name):
+ super(LocalClass.Remove, self).__init__(cls, name)
+
+ self.summary = True
+
+ def show(self, session, object):
+ frame = self.cumin_class.show_object(session, object)
+ return frame.show_remove(session)
+
def get_title(self, session):
return "Remove"
@@ -423,10 +471,13 @@
prop = CuminProperty(self, "machine")
prop.title = "Architecture"
- action = CuminAction(self, "ping")
- action.title = "Send Ping"
- action.summary = True
+ #action = CuminAction(self, "ping")
+ #action.title = "Send Ping"
+ #action.summary = True
+ def show(self, session, system):
+ return self.cumin_model.show_main(session).show_system(session, system)
+
class CuminBroker(RemoteClass):
def __init__(self, model):
super(CuminBroker, self).__init__(model, "broker", Broker, BrokerStats)
@@ -462,8 +513,7 @@
prop.title = "Data Directory"
def show(self, session, broker):
- frame = self.model.app.main_page.show_main(session)
- return frame.show_broker(session, broker)
+ return self.cumin_model.show_main(session).show_broker(session, broker)
class CuminQueue(RemoteClass):
def __init__(self, model):
@@ -652,17 +702,27 @@
stat.unit = "byte"
stat.categories = ("persistent",)
- self.Purge(self, "purge")
+ action = self.Purge(self, "purge")
+ action.summary = True
def get_title(self, session):
return "Queue"
+ def show_object(self, session, queue):
+ frame = self.cumin_model.show_main(session)
+ frame = frame.show_broker(session, queue.vhost.broker)
+ return frame.show_queue(session, queue)
+
class Purge(CuminAction):
+ def show(self, session, queue):
+ frame = self.cumin_class.show_object(session, queue)
+ return frame.show_purge(session)
+
def get_title(self, session):
return "Purge"
- def do_invoke(self, object, args, completion):
- object.purge(self.model.data, completion)
+ def do_invoke(self, queue, args, completion):
+ queue.purge(self.cumin_model.data, completion)
class CuminExchange(RemoteClass):
def __init__(self, model):
@@ -674,6 +734,7 @@
prop = CuminProperty(self, "type")
prop.title = "Type"
+ prop.summary = True
stat = CuminStat(self, "producers")
stat.title = "Producers"
@@ -717,6 +778,11 @@
stat.unit = "message"
stat.categories = ("general",)
+ def show_object(self, session, exchange):
+ frame = self.cumin_model.show_main(session)
+ frame = frame.show_broker(exchange.vhost.broker)
+ return frame.show_queue(session, exchange)
+
def get_title(self, session):
return "Exchange"
@@ -770,8 +836,14 @@
stat.unit = "frame"
stat.categories = ("general",)
- self.Close(self, "close")
+ action = self.Close(self, "close")
+ action.summary = True
+ def show_object(self, session, client):
+ frame = self.cumin_model.show_main(session)
+ frame = frame.show_broker(session, client.vhost.broker)
+ return frame.show_client(session, client)
+
def get_title(self, session):
return "Client"
@@ -779,11 +851,15 @@
return client.address
class Close(CuminAction):
+ def show(self, session, client):
+ frame = self.cumin_class.show_object(session, client)
+ return frame.show_close(session)
+
def get_title(self, session):
return "Close"
- def do_invoke(self, object, args, completion):
- object.close(self.model.data, completion)
+ def do_invoke(self, client, args, completion):
+ client.close(self.cumin_model.data, completion)
class CuminSession(RemoteClass):
def __init__(self, model):
@@ -825,28 +901,28 @@
return "Close"
def do_invoke(self, object, args, completion):
- object.close(self.model.data, completion)
+ object.close(self.cumin_model.data, completion)
class Detach(CuminAction):
def get_title(self, session):
return "Detach"
def do_invoke(self, object, args, completion):
- object.detach(self.model.data, completion)
+ object.detach(self.cumin_model.data, completion)
class ResetLifespan(CuminAction):
def get_title(self, session):
return "Reset Lifespan"
def do_invoke(self, object, args, completion):
- object.resetLifespan(self.model.data, completion)
+ object.resetLifespan(self.cumin_model.data, completion)
class SolicitAck(CuminAction):
def get_title(self, session):
return "Solicit Acknowledgment"
def do_invoke(self, object, args, completion):
- object.solicitAck(self.model.data, completion)
+ object.solicitAck(self.cumin_model.data, completion)
class CuminLink(RemoteClass):
def __init__(self, model):
@@ -890,16 +966,27 @@
super(CuminBrokerRegistration, self).__init__ \
(model, "broker_registration", BrokerRegistration)
+ prop = CuminProperty(self, "host")
+ prop.title = "Host"
+ prop.summary = True
+
+ prop = CuminProperty(self, "port")
+ prop.title = "Port"
+ prop.summary = True
+
def get_title(self, session):
return "Broker Registration"
+ def show_object(self, session, reg):
+ return self.cumin_model.show_main(session).show_broker(session, reg)
+
class CuminBrokerGroup(LocalClass):
def __init__(self, model):
super(CuminBrokerGroup, self).__init__ \
(model, "broker_group", BrokerGroup)
- def show(self, session, group):
- frame = self.model.app.main_page.show_main(session)
+ def show_object(self, session, group):
+ frame = self.cumin_model.show_main(session)
return frame.show_broker_group(session, group)
def get_title(self, session):
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/queue.py 2008-04-07 14:04:01 UTC (rev 1841)
@@ -224,8 +224,8 @@
def __init__(self, app, name):
super(QueueView, self).__init__(app, name)
- self.status = QueueStatus(app, "status")
- self.add_child(self.status)
+ status = QueueStatus(app, "status")
+ self.add_child(status)
self.tabs = TabbedModeSet(app, "tabs")
self.add_child(self.tabs)
@@ -244,30 +244,13 @@
def show_bindings(self, session):
self.tabs.show_mode(session, self.bindings);
- def render_title(self, session, queue):
- return "Queue '%s'" % queue.name
+ def render_script(self, session, queue):
+ data = "model.xml?class=queue;id=%i" % queue.id
+ return "wooly.setIntervalUpdate('%s', updateQueue, 3000)" % data
- def render_data_url(self, session, queue):
- return "model.xml?class=queue;id=%i" % queue.id
+ def render_icon_resource(self, session, queue):
+ return "queue-36.png"
- def render_durable(self, session, queue):
- return fmt_predicate(queue.durable)
-
- def render_exclusive(self, session, queue):
- return fmt_predicate(queue.exclusive)
-
- def render_created_deleted(self, session, queue):
- return "%s – %s" % (fmt_datetime(queue.creationTime),
- fmt_datetime(queue.deletionTime))
-
- def render_updated(self, session, queue):
- return fmt_datetime(queue.recTime)
-
- def render_purge_href(self, session, queue):
- branch = session.branch()
- self.parent.show_purge(branch)
- return branch.marshal()
-
class QueueBindingSet(BindingSet):
def get_args(self, session):
return self.frame.get_args(session)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/queue.strings 2008-04-07 14:04:01 UTC (rev 1841)
@@ -133,30 +133,6 @@
//throw new Error();
}
-[QueueView.html]
-<script>
- wooly.setIntervalUpdate("{data_url}", updateQueue, 3000);
-</script>
-
-{status}
-
-<h1><img src="resource?name=queue-36.png"/>{title}</h1>
-
-<table class="props">
- <tr><th>Durable?</th><td>{durable}</td></tr>
- <tr><th>Exclusive?</th><td>{exclusive}</td></tr>
- <tr><th>Created – Deleted</th><td>{created_deleted}</td></tr>
- <tr><th>Updated</th><td>{updated}</td></tr>
- <tr>
- <th class="actions" colspan="2">
- <h2>Act on This Queue:</h2>
- <a href="{purge_href}">Purge Messages</a>
- </th>
- </tr>
-</table>
-
-{tabs}
-
[QueueBindingSet.html]
<div class="rfloat">{page}</div>
<ul class="radiotabs"> </ul>
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/widgets.py 2008-04-07 14:04:01 UTC (rev 1841)
@@ -81,20 +81,32 @@
return branch.marshal()
class CuminView(Widget):
+ def __init__(self, app, name):
+ super(CuminView, self).__init__(app, name)
+
+ summary = CuminSummary(app, "summary")
+ self.add_child(summary)
+
def get_args(self, session):
- return (self.frame.get_object(session),)
+ return self.frame.get_args(session)
+ def render_script(self, session, *args):
+ return None
+
+ def render_icon_resource(self, session, *args):
+ return "action-36.png"
+
def render_title(self, session, *args):
return self.frame.render_title(session, *args)
def render_edit_href(self, session, *args):
branch = session.branch()
- self.parent.show_edit(branch)
+ self.frame.show_edit(branch)
return branch.marshal()
def render_remove_href(self, session, *args):
branch = session.branch()
- self.parent.show_remove(branch)
+ self.frame.show_remove(branch)
return branch.marshal()
class CuminForm(Form):
@@ -239,7 +251,8 @@
def do_get_items(self, session, object):
cls = self.app.model.get_class_by_object(object)
- return [("", x.get_title(session)) for x in cls.actions]
+ return [(x.get_href(session, object), x.get_title(session))
+ for x in cls.actions]
class CuminDetails(Widget):
def __init__(self, app, name):
@@ -273,7 +286,7 @@
class SummaryActions(CuminActions):
def do_get_items(self, session, object):
cls = self.app.model.get_class_by_object(object)
- return [("", x.get_title(session))
+ return [(x.get_href(session, object), x.get_title(session))
for x in cls.actions if x.summary]
class StateSwitch(ItemSet):
Modified: mgmt/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/cumin/python/cumin/widgets.strings 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/widgets.strings 2008-04-07 14:04:01 UTC (rev 1841)
@@ -1,3 +1,16 @@
+[CuminView.html]
+<script>
+{script}
+</script>
+
+{status}
+
+<h1><img src="resource?name={icon_resource}"/>{title}</h1>
+
+{summary}
+
+{tabs}
+
[CuminFieldForm.html]
<form id="{id}" class="mform" method="post" action="?">
<div class="head">{title}</div>
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/notes/justin-todo.txt 2008-04-07 14:04:01 UTC (rev 1841)
@@ -16,6 +16,10 @@
* Fix obnoxious HTML resizing bug
+ * Bulk register is failing to forget state on cancel
+
+ * client.py:159 calls add_error, which no longer exists
+
Deferred
* Change the way CuminAction.invoke works
16 years, 9 months
rhmessaging commits: r1840 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-04 12:48:11 -0400 (Fri, 04 Apr 2008)
New Revision: 1840
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/brokercluster.py
mgmt/cumin/python/cumin/brokergroup.py
mgmt/cumin/python/cumin/brokerprofile.py
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/system.py
mgmt/cumin/python/cumin/virtualhost.py
mgmt/cumin/python/cumin/widgets.py
Log:
Clean up frame's handling of attributes
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/broker.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -168,59 +168,58 @@
def __init__(self, app, name):
super(BrokerFrame, self).__init__(app, name)
- self.param = BrokerParameter(app, "id")
- self.add_parameter(self.param)
- self.set_object_parameter(self.param)
+ self.object = BrokerParameter(app, "id")
+ self.add_parameter(self.object)
- self.view = BrokerView(app, "view")
- self.add_mode(self.view)
- self.set_view_mode(self.view)
+ view = BrokerView(app, "view")
+ self.add_mode(view)
+ self.set_view_mode(view)
- self.edit = BrokerEdit(app, "edit")
- self.add_mode(self.edit)
- self.set_edit_mode(self.edit)
+ edit = BrokerEdit(app, "edit")
+ self.add_mode(edit)
+ self.set_edit_mode(edit)
- self.remove = BrokerRemove(app, "remove")
- self.add_mode(self.remove)
- self.set_remove_mode(self.remove)
+ remove = BrokerRemove(app, "remove")
+ self.add_mode(remove)
+ self.set_remove_mode(remove)
- self.queue = QueueFrame(app, "queue")
- self.add_mode(self.queue)
+ self.__queue = QueueFrame(app, "queue")
+ self.add_mode(self.__queue)
- self.queues_purge = QueueSetPurge(app, "queuespurge")
- self.add_mode(self.queues_purge)
+ self.__queues_purge = QueueSetPurge(app, "queuespurge")
+ self.add_mode(self.__queues_purge)
- self.exchange = ExchangeFrame(app, "exchange")
- self.add_mode(self.exchange)
+ self.__exchange = ExchangeFrame(app, "exchange")
+ self.add_mode(self.__exchange)
- self.client = ClientFrame(app, "client")
- self.add_mode(self.client)
+ self.__client = ClientFrame(app, "client")
+ self.add_mode(self.__client)
- self.clients_close = ClientSetClose(app, "clientsclose")
- self.add_mode(self.clients_close)
+ self.__clients_close = ClientSetClose(app, "clientsclose")
+ self.add_mode(self.__clients_close)
def show_queue(self, session, queue):
- self.queue.set_object(session, queue)
- self.page.set_current_frame(session, self.queue)
- return self.show_mode(session, self.queue)
+ self.__queue.set_object(session, queue)
+ self.page.set_current_frame(session, self.__queue)
+ return self.show_mode(session, self.__queue)
def show_queues_purge(self, session):
- self.page.set_current_frame(session, self.queues_purge)
- return self.show_mode(session, self.queues_purge)
+ self.page.set_current_frame(session, self.__queues_purge)
+ return self.show_mode(session, self.__queues_purge)
def show_exchange(self, session, exchange):
- self.exchange.set_object(session, exchange)
- self.page.set_current_frame(session, self.exchange)
- return self.show_mode(session, self.exchange)
+ self.__exchange.set_object(session, exchange)
+ self.page.set_current_frame(session, self.__exchange)
+ return self.show_mode(session, self.__exchange)
def show_client(self, session, client):
- self.client.set_object(session, client)
- self.page.set_current_frame(session, self.client)
- return self.show_mode(session, self.client)
+ self.__client.set_object(session, client)
+ self.page.set_current_frame(session, self.__client)
+ return self.show_mode(session, self.__client)
def show_clients_close(self, session):
- self.page.set_current_frame(session, self.clients_close)
- return self.show_mode(session, self.clients_close)
+ self.page.set_current_frame(session, self.__clients_close)
+ return self.show_mode(session, self.__clients_close)
def render_title(self, session, broker):
return "Broker '%s'" % broker.name
@@ -656,7 +655,7 @@
def init(self):
super(BrokerEdit, self).init()
- self.broker_name.set_object_attr(self.frame.get_object_parameter())
+ self.broker_name.set_object_attr(self.frame.object)
def get_args(self, session):
return self.frame.get_args(session)
Modified: mgmt/cumin/python/cumin/brokercluster.py
===================================================================
--- mgmt/cumin/python/cumin/brokercluster.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/brokercluster.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -44,21 +44,20 @@
def __init__(self, app, name):
super(BrokerClusterFrame, self).__init__(app, name)
- self.param = BrokerClusterParameter(app, "id")
- self.add_parameter(self.param)
- self.set_object_parameter(self.param)
+ self.object = BrokerClusterParameter(app, "id")
+ self.add_parameter(self.object)
- self.view = BrokerClusterView(app, "view")
- self.add_mode(self.view)
- self.set_view_mode(self.view)
+ view = BrokerClusterView(app, "view")
+ self.add_mode(view)
+ self.set_view_mode(view)
- self.edit = BrokerClusterEdit(app, "edit")
- self.add_mode(self.edit)
- self.set_edit_mode(self.edit)
+ edit = BrokerClusterEdit(app, "edit")
+ self.add_mode(edit)
+ self.set_edit_mode(edit)
- self.remove = BrokerClusterRemove(app, "remove")
- self.add_mode(self.remove)
- self.set_remove_mode(self.remove)
+ remove = BrokerClusterRemove(app, "remove")
+ self.add_mode(remove)
+ self.set_remove_mode(remove)
self.broker = BrokerFrame(app, "broker")
self.add_mode(self.broker)
Modified: mgmt/cumin/python/cumin/brokergroup.py
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/brokergroup.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -75,9 +75,8 @@
def __init__(self, app, name):
super(BrokerGroupFrame, self).__init__(app, name)
- param = BrokerGroupParameter(app, "id")
- self.add_parameter(param)
- self.set_object_parameter(param)
+ self.object = BrokerGroupParameter(app, "id")
+ self.add_parameter(self.object)
view = BrokerGroupView(app, "view")
self.add_child(view)
@@ -154,7 +153,7 @@
def init(self):
super(BrokerGroupForm, self).init()
- self.group_name.set_object_attr(self.frame.get_object_parameter())
+ self.group_name.set_object_attr(self.frame.object)
class BrokerGroupAdd(BrokerGroupForm):
def process_cancel(self, session):
Modified: mgmt/cumin/python/cumin/brokerprofile.py
===================================================================
--- mgmt/cumin/python/cumin/brokerprofile.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/brokerprofile.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -32,21 +32,20 @@
def __init__(self, app, name):
super(BrokerProfileFrame, self).__init__(app, name)
- self.param = BrokerProfileParameter(app, "id")
- self.add_parameter(self.param)
- self.set_object_parameter(self.param)
+ self.object = BrokerProfileParameter(app, "id")
+ self.add_parameter(self.object)
- self.view = BrokerProfileView(app, "view")
- self.add_mode(self.view)
- self.set_view_mode(self.view)
+ view = BrokerProfileView(app, "view")
+ self.add_mode(view)
+ self.set_view_mode(view)
- self.edit = BrokerProfileEdit(app, "edit")
- self.add_mode(self.edit)
- self.set_edit_mode(self.edit)
+ edit = BrokerProfileEdit(app, "edit")
+ self.add_mode(edit)
+ self.set_edit_mode(edit)
- self.remove = BrokerProfileRemove(app, "remove")
- self.add_mode(self.remove)
- self.set_remove_mode(self.remove)
+ remove = BrokerProfileRemove(app, "remove")
+ self.add_mode(remove)
+ self.set_remove_mode(remove)
def render_title(self, session, profile):
return "Broker Profile '%s'" % profile.name
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/client.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -109,35 +109,35 @@
def __init__(self, app, name):
super(ClientFrame, self).__init__(app, name)
- self.param = ClientParameter(app, "id")
- self.add_parameter(self.param)
- self.set_object_parameter(self.param)
+ self.object = ClientParameter(app, "id")
+ self.add_parameter(self.object)
- self.view = ClientView(app, "view")
- self.add_mode(self.view)
- self.set_view_mode(self.view)
+ view = ClientView(app, "view")
+ self.add_mode(view)
+ self.set_view_mode(view)
- self.close = ClientClose(app, "close")
- self.add_mode(self.close)
+ self.__close = ClientClose(app, "close")
+ self.add_mode(self.__close)
- self.sessions_detach = ClientSessionSetDetach(app, "sessionsdetach")
- self.add_mode(self.sessions_detach)
+ self.__sessions_detach = ClientSessionSetDetach(app, "sessionsdetach")
+ self.add_mode(self.__sessions_detach)
- self.sessions_close = ClientSessionSetClose(app, "sessionsclose")
- self.add_mode(self.sessions_close)
+ self.__sessions_close = ClientSessionSetClose(app, "sessionsclose")
+ self.add_mode(self.__sessions_close)
def show_close(self, session):
- return self.show_mode(session, self.close)
+ return self.show_mode(session, self.__close)
def show_sessions_detach(self, session):
- return self.show_mode(session, self.sessions_detach)
+ return self.show_mode(session, self.__sessions_detach)
def show_sessions_close(self, session):
- return self.show_mode(session, self.sessions_close)
+ return self.show_mode(session, self.__sessions_close)
def render_title(self, session, client):
return "Client %s" % client.address
+# XXX get rid of this
def doit(error, args):
pass
#print error, args
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/exchange.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -158,13 +158,12 @@
def __init__(self, app, name):
super(ExchangeFrame, self).__init__(app, name)
- self.param = ExchangeParameter(app, "id")
- self.add_parameter(self.param)
- self.set_object_parameter(self.param)
+ self.object = ExchangeParameter(app, "id")
+ self.add_parameter(self.object)
- self.view = ExchangeView(app, "view")
- self.add_mode(self.view)
- self.set_view_mode(self.view)
+ view = ExchangeView(app, "view")
+ self.add_mode(view)
+ self.set_view_mode(view)
def render_title(self, session, exchange):
return exchange.name and "Exchange '%s'" % exchange.name \
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/page.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -67,9 +67,9 @@
self.__tabs = MainFrameTabs(app, "tabs")
self.add_child(self.__tabs)
- self.__view = MainView(app, "view")
- self.add_mode(self.__view)
- self.set_view_mode(self.__view)
+ view = MainView(app, "view")
+ self.add_mode(view)
+ self.set_view_mode(view)
self.__broker = BrokerFrame(app, "broker")
self.add_mode(self.__broker)
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/queue.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -165,17 +165,16 @@
def __init__(self, app, name):
super(QueueFrame, self).__init__(app, name)
- self.param = QueueParameter(app, "id")
- self.add_parameter(self.param)
- self.set_object_parameter(self.param)
+ self.object = QueueParameter(app, "id")
+ self.add_parameter(self.object)
- self.view = QueueView(app, "view")
- self.add_mode(self.view)
- self.set_view_mode(self.view)
+ view = QueueView(app, "view")
+ self.add_mode(view)
+ self.set_view_mode(view)
- self.add = QueueAdd(app, "add")
- self.add_mode(self.add)
- self.set_add_mode(self.add)
+ add = QueueAdd(app, "add")
+ self.add_mode(add)
+ self.set_add_mode(add)
self.purge = QueuePurge(app, "purge")
self.add_mode(self.purge)
Modified: mgmt/cumin/python/cumin/system.py
===================================================================
--- mgmt/cumin/python/cumin/system.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/system.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -38,13 +38,12 @@
def __init__(self, app, name):
super(SystemFrame, self).__init__(app, name)
- self.param = SystemParameter(app, "id")
- self.add_parameter(self.param)
- self.set_object_parameter(self.param)
+ self.object = SystemParameter(app, "id")
+ self.add_parameter(self.object)
- self.view = SystemView(app, "view")
- self.add_mode(self.view)
- self.set_view_mode(self.view)
+ view = SystemView(app, "view")
+ self.add_mode(view)
+ self.set_view_mode(view)
def render_title(self, session, system):
return "System '%s'" % system.sysId
Modified: mgmt/cumin/python/cumin/virtualhost.py
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/virtualhost.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -28,34 +28,33 @@
def __init__(self, app, name):
super(VirtualHostFrame, self).__init__(app, name)
- self.param = VirtualHostParameter(app, "id")
- self.add_parameter(self.param)
- self.set_object_parameter(self.param)
+ self.object = VirtualHostParameter(app, "id")
+ self.add_parameter(self.object)
- self.view = VirtualHostView(app, "view")
- self.add_mode(self.view)
- self.set_view_mode(self.view)
+ view = VirtualHostView(app, "view")
+ self.add_mode(view)
+ self.set_view_mode(view)
- self.queue = QueueFrame(app, "queue")
- self.add_mode(self.queue)
+ self.__queue = QueueFrame(app, "queue")
+ self.add_mode(self.__queue)
- self.exchange = ExchangeFrame(app, "exchange")
- self.add_mode(self.exchange)
+ self.__exchange = ExchangeFrame(app, "exchange")
+ self.add_mode(self.__exchange)
- self.client = ClientFrame(app, "client")
- self.add_mode(self.client)
+ self.__client = ClientFrame(app, "client")
+ self.add_mode(self.__client)
def show_queue(self, session, queue):
- self.queue.set_object(session, queue)
- return self.show_mode(session, self.queue)
+ self.__queue.set_object(session, queue)
+ return self.show_mode(session, self.__queue)
def show_exchange(self, session, exchange):
- self.exchange.set_object(session, exchange)
- return self.show_mode(session, self.exchange)
+ self.__exchange.set_object(session, exchange)
+ return self.show_mode(session, self.__exchange)
def show_client(self, session, client):
- self.client.set_object(session, client)
- return self.show_mode(session, self.client)
+ self.__client.set_object(session, client)
+ return self.show_mode(session, self.__client)
def render_title(self, session, vhost):
return "Functional Host '%s'" % vhost.name
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-04-04 16:15:02 UTC (rev 1839)
+++ mgmt/cumin/python/cumin/widgets.py 2008-04-04 16:48:11 UTC (rev 1840)
@@ -18,32 +18,24 @@
def __init__(self, app, name):
super(CuminFrame, self).__init__(app, name)
- self.__param = None
+ self.object = None
self.__view = None
self.__add = None
self.__edit = None
self.__remove = None
def get_args(self, session):
- if self.__param:
+ if self.object:
return (self.get_object(session),)
else:
return ()
- # XXX these should be object_attr, not _parameter
- def set_object_parameter(self, param):
- self.__param = param
- return param
-
- def get_object_parameter(self):
- return self.__param
-
def get_object(self, session):
- if self.__param:
- return self.__param.get(session)
+ if self.object:
+ return self.object.get(session)
def set_object(self, session, object):
- return self.__param.set(session, object)
+ return self.object.set(session, object)
def set_view_mode(self, mode):
self.__view = mode
16 years, 9 months
rhmessaging commits: r1839 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-04 12:15:02 -0400 (Fri, 04 Apr 2008)
New Revision: 1839
Modified:
store/trunk/cpp/lib/jrnl/wmgr.cpp
Log:
Bugfix which may cause crash when initializing more than 32 journal files.
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-04-04 15:13:52 UTC (rev 1838)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-04-04 16:15:02 UTC (rev 1839)
@@ -916,7 +916,7 @@
oss << " errno=" << errno;
throw jexception(jerrno::JERR__MALLOC, oss.str(), "wmgr", "initialize");
}
- _fhdr_ptr_arr = (void**)::malloc(_pages * sizeof(void*));
+ _fhdr_ptr_arr = (void**)::malloc(num_jfiles * sizeof(void*));
MALLOC_CHK(_fhdr_ptr_arr, "_fhdr_ptr_arr", "wmgr", "initialize");
_iocba = (iocb**)::malloc(sizeof(iocb*) * num_jfiles);
MALLOC_CHK(_iocba, "_iocba", "wmgr", "initialize");
16 years, 9 months