public final class MetricExpectationManager<T extends Number,P extends MessageProducer<P>> extends Object
| Constructor and Description |
|---|
MetricExpectationManager(MessageMetric<T,P> metric) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isStopped()
Whether or not
MessageConsumer.stop() has been called. |
void |
messageReceived(Message msg,
MessageDeliveryStatus status,
P producer)
Notify the code of a new message becoming available in the log.
|
Future<Message> |
setExpectation(C condition)
The resulting future will only return after such a message is received
that makes the condition true.
|
Future<Message> |
setExpectation(C condition,
MessageAction<P> action)
The resulting future will only return after such a message is received
that makes the condition true.
|
boolean |
stop()
This consumer will no longer receive any messages.
|
public MetricExpectationManager(MessageMetric<T,P> metric)
public boolean isStopped()
MessageConsumerMessageConsumer.stop() has been called.isStopped in interface MessageConsumer<P extends MessageProducer<P>>public void messageReceived(Message msg, MessageDeliveryStatus status, P producer)
MessageListenermessageReceived in interface MessageListener<P extends MessageProducer<P>>msg - Message in question.status - Current status of the message.producer - The code that is notifying us of this event.public Future<Message> setExpectation(C condition)
condition - Condition to be true.public Future<Message> setExpectation(C condition, MessageAction<P> action)
condition - Condition to be true.public boolean stop()
MessageConsumerMessageProducer
do not send any more Messages here.stop in interface MessageConsumer<P extends MessageProducer<P>>MessageConsumer.isStopped().Copyright © 2015. All rights reserved.