From commits-return-15830-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Wed Mar 30 03:49:33 2011 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 70176 invoked from network); 30 Mar 2011 03:49:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Mar 2011 03:49:33 -0000 Received: (qmail 99831 invoked by uid 500); 30 Mar 2011 03:49:33 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 99805 invoked by uid 500); 30 Mar 2011 03:49:32 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 99798 invoked by uid 99); 30 Mar 2011 03:49:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2011 03:49:32 +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; Wed, 30 Mar 2011 03:49:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 99E6D238890A; Wed, 30 Mar 2011 03:49:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1086828 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala Date: Wed, 30 Mar 2011 03:49:08 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110330034908.99E6D238890A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: chirino Date: Wed Mar 30 03:49:08 2011 New Revision: 1086828 URL: http://svn.apache.org/viewvc?rev=1086828&view=rev Log: make the add/remove destination methods assignable functions so that composite routers can trap when destinations get created/deleted. Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala?rev=1086828&r1=1086827&r2=1086828&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala (original) +++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala Wed Mar 30 03:49:08 2011 @@ -136,7 +136,7 @@ class LocalRouter(val virtual_host:Virtu getOrElse( create_destination(path, destination, security)) } - def add_destination(path:Path, dest:D) = { + var add_destination = (path:Path, dest:D) => { destination_by_path.put(path, dest) destination_by_id.put(dest.id, dest) @@ -154,10 +154,11 @@ class LocalRouter(val virtual_host:Virtu } } - def remove_destination(path:Path, dest:D) = { + var remove_destination = (path:Path, dest:D) => { destination_by_path.remove(path, dest) destination_by_id.remove(dest.id) } + def can_bind_one(path:Path, destination:DestinationDTO, consumer:DeliveryConsumer, security:SecurityContext):Boolean def can_bind_all(path:Path, destination:DestinationDTO, consumer:DeliveryConsumer, security:SecurityContext):Result[Zilch, String] = { @@ -609,7 +610,6 @@ class LocalRouter(val virtual_host:Virtu dispatch_queue ! { val failures = paths.map(x=> domain(x._2).can_connect_all(x._1, x._2, producer, security) ).flatMap( _.failure_option ) - if( !failures.isEmpty ) { producer.release Failure(failures.mkString("; "))