activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1128415 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala apollo-util/src/main/scala/org/apache/activemq/apollo/util/Dispatched.scala
Date Fri, 27 May 2011 18:14:16 GMT
Author: chirino
Date: Fri May 27 18:14:15 2011
New Revision: 1128415

URL: http://svn.apache.org/viewvc?rev=1128415&view=rev
Log:
Use better assert handling.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Dispatched.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala?rev=1128415&r1=1128414&r2=1128415&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
Fri May 27 18:14:15 2011
@@ -229,7 +229,7 @@ class SinkMux[T](val downstream:Sink[T],
   }
 
   overflow.refiller = ^{
-    assert(getCurrentQueue eq consumer_queue)
+    consumer_queue.assertExecuting()
     // overflow is not full anymore.. lets release those credits so we can get more messages.
     sessions.foreach(_.credit_adder.resume)
   }
@@ -302,12 +302,12 @@ class Session[T](val producer_queue:Disp
   def remaining_capacity = credits
 
   override def full = {
-    assert(producer_queue.isExecuting)
+    producer_queue.assertExecuting()
     _full
   }
 
   override def offer(value: T) = {
-    assert(getCurrentQueue eq producer_queue)
+    producer_queue.assertExecuting()
     if( _full || closed ) {
       false
     } else {
@@ -318,9 +318,9 @@ class Session[T](val producer_queue:Disp
   }
 
   def close = {
+    producer_queue.assertExecuting()
     if( !closed ) {
       closed=true
-      assert(producer_queue.isExecuting)
     }
   }
 

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Dispatched.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Dispatched.scala?rev=1128415&r1=1128414&r2=1128415&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Dispatched.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Dispatched.scala
Fri May 27 18:14:15 2011
@@ -28,10 +28,6 @@ import org.fusesource.hawtdispatch._
 trait Dispatched {
   def dispatch_queue:DispatchQueue
 
-  def assert_executing = assert( dispatch_queue.isExecuting,
-    "Dispatch queue '%s' was not executing, (currently executing: %s)".format(
-      Option(dispatch_queue.getLabel).getOrElse(""),
-      Option(getCurrentQueue).map(_.getLabel).getOrElse("None") )
-  )
+  def assert_executing = dispatch_queue.assertExecuting()
 
 }
\ No newline at end of file



Mime
View raw message