You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2011/03/30 05:49:08 UTC
svn commit: r1086828 -
/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
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("; "))