Return-Path: Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: (qmail 11614 invoked from network); 15 Feb 2011 15:46:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Feb 2011 15:46:24 -0000 Received: (qmail 64215 invoked by uid 500); 15 Feb 2011 15:46:24 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 63951 invoked by uid 500); 15 Feb 2011 15:46:21 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 63941 invoked by uid 99); 15 Feb 2011 15:46:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 15:46:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 15:46:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0DCE22388906; Tue, 15 Feb 2011 15:46:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1070944 - in /qpid/trunk/qpid/cpp/src/qpid/broker: QueueObserver.h ThresholdAlerts.h Date: Tue, 15 Feb 2011 15:45:59 -0000 To: commits@qpid.apache.org From: gsim@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110215154600.0DCE22388906@eris.apache.org> Author: gsim Date: Tue Feb 15 15:45:59 2011 New Revision: 1070944 URL: http://svn.apache.org/viewvc?rev=1070944&view=rev Log: QPID-3002: Added virtual destructor for new interface; Removed some more accidentally duplicated code. Modified: qpid/trunk/qpid/cpp/src/qpid/broker/QueueObserver.h qpid/trunk/qpid/cpp/src/qpid/broker/ThresholdAlerts.h Modified: qpid/trunk/qpid/cpp/src/qpid/broker/QueueObserver.h URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/QueueObserver.h?rev=1070944&r1=1070943&r2=1070944&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/QueueObserver.h (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/QueueObserver.h Tue Feb 15 15:45:59 2011 @@ -32,47 +32,7 @@ class QueuedMessage; class QueueObserver { public: - virtual void enqueued(const QueuedMessage&) = 0; - virtual void dequeued(const QueuedMessage&) = 0; - private: -}; -}} // namespace qpid::broker - -#endif /*!QPID_BROKER_QUEUEOBSERVER_H*/ -#ifndef QPID_BROKER_QUEUEOBSERVER_H -#define QPID_BROKER_QUEUEOBSERVER_H - -/* - * - * 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. - * - */ -namespace qpid { -namespace broker { - -class QueuedMessage; -/** - * Interface for notifying classes who want to act as 'observers' of a - * queue of particular events. - */ -class QueueObserver -{ - public: + virtual ~QueueObserver() {} virtual void enqueued(const QueuedMessage&) = 0; virtual void dequeued(const QueuedMessage&) = 0; private: Modified: qpid/trunk/qpid/cpp/src/qpid/broker/ThresholdAlerts.h URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/ThresholdAlerts.h?rev=1070944&r1=1070943&r2=1070944&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/ThresholdAlerts.h (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/ThresholdAlerts.h Tue Feb 15 15:45:59 2011 @@ -71,76 +71,3 @@ class ThresholdAlerts : public QueueObse }} // namespace qpid::broker #endif /*!QPID_BROKER_THRESHOLDALERTS_H*/ -#ifndef QPID_BROKER_THRESHOLDALERTS_H -#define QPID_BROKER_THRESHOLDALERTS_H - -/* - * - * 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. - * - */ -#include "qpid/broker/QueueObserver.h" -#include "qpid/sys/Time.h" -#include "qpid/types/Variant.h" -#include - -namespace qpid { -namespace framing { -class FieldTable; -} -namespace management { -class ManagementAgent; -} -namespace broker { - -class Queue; -/** - * Class to manage generation of QMF alerts when particular thresholds - * are breached on a queue. - */ -class ThresholdAlerts : public QueueObserver -{ - public: - ThresholdAlerts(const std::string& name, - qpid::management::ManagementAgent& agent, - const uint32_t countThreshold, - const uint64_t sizeThreshold, - const long repeatInterval); - void enqueued(const QueuedMessage&); - void dequeued(const QueuedMessage&); - static void observe(Queue& queue, qpid::management::ManagementAgent& agent, - const uint64_t countThreshold, - const uint64_t sizeThreshold, - const long repeatInterval); - static void observe(Queue& queue, qpid::management::ManagementAgent& agent, - const qpid::framing::FieldTable& settings); - static void observe(Queue& queue, qpid::management::ManagementAgent& agent, - const qpid::types::Variant::Map& settings); - private: - const std::string name; - qpid::management::ManagementAgent& agent; - const uint32_t countThreshold; - const uint64_t sizeThreshold; - const qpid::sys::Duration repeatInterval; - uint64_t count; - uint64_t size; - qpid::sys::AbsTime lastAlert; -}; -}} // namespace qpid::broker - -#endif /*!QPID_BROKER_THRESHOLDALERTS_H*/ --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscribe@qpid.apache.org