Author: chirino
Date: Thu Mar 31 14:23:09 2011
New Revision: 1087309
URL: http://svn.apache.org/viewvc?rev=1087309&view=rev
Log:
Fixed MutableSink bug
Modified:
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.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=1087309&r1=1087308&r2=1087309&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
Thu Mar 31 14:23:09 2011
@@ -164,13 +164,18 @@ class MutableSink[T] extends Sink[T] {
def downstream = _downstream
+ /**
+ * When the downstream sink is not set, then the sink
+ * is considered full otherwise it's full if the downstream
+ * sink is full.
+ */
def full = _downstream.map(_.full).getOrElse(true)
/**
- * @return true always even when full since those messages just get stored
in a
- * overflow list
+ * If the downstream is not set, then this returns false, otherwise
+ * it true.
*/
- def offer(value:T) = ! _downstream.map(_.offer(value)).getOrElse(false)
+ def offer(value:T) = _downstream.map(x=> x.offer(value)).getOrElse(false)
}