P - Where this is getting its Messages from.public interface MessageProducer<P extends MessageProducer<P>>
Messages that pass through them.| Modifier and Type | Method and Description |
|---|---|
int |
countConsumers()
Return the number of consumers that have been
startConsuming(MessageListener)'d and not
stopConsuming(MessageConsumer)'d. |
int |
countMetrics()
Return the number of metrics that have been
startMeasuring(MessageMeasure, String)'d and not
stopMeasuring(String)'d. |
MessageMetric<? extends Number,P> |
getMetric(String id)
Retrieve the metric for a particular ID.
|
String |
getMetricId(MessageMetric<? extends Number,P> measure)
Retrieve the ID for a particular measure.
|
boolean |
isConsuming(MessageConsumer<P> consumer)
Whether or not the particular message consumer is being notified of new
messages.
|
boolean |
isMeasuring(MessageMetric<? extends Number,P> metric)
Whether or not particular
MessageMetric is active. |
boolean |
isMeasuring(String id)
Whether or not particular
MessageMetric is active. |
MessageConsumer<P> |
startConsuming(MessageListener<P> listener)
Register a listener to be notified of new messages in this producer.
|
<T extends Number> |
startMeasuring(MessageMeasure<T,P> measure,
String id)
Request that a message property be tracked from now on.
|
boolean |
stopConsuming(MessageConsumer<P> consumer)
Tell a consumer to no longer listen to new messages in this producer.
|
boolean |
stopMeasuring(MessageMetric<? extends Number,P> metric)
Will stop the metric from being notified of new
Messages. |
boolean |
stopMeasuring(String id)
Will stop the metric from being notified of new
Messages. |
int countConsumers()
startConsuming(MessageListener)'d and not
stopConsuming(MessageConsumer)'d.int countMetrics()
startMeasuring(MessageMeasure, String)'d and not
stopMeasuring(String)'d.MessageMetric<? extends Number,P> getMetric(String id)
id - The ID under which the metric has been requested in
startMeasuring(MessageMeasure, String).startMeasuring(MessageMeasure, String)'d or already
stopMeasuring(MessageMetric)'d.String getMetricId(MessageMetric<? extends Number,P> measure)
measure - The metric retrieved by
startMeasuring(MessageMeasure, String).startMeasuring(MessageMeasure, String)'d or already
stopMeasuring(MessageMetric)'d.boolean isConsuming(MessageConsumer<P> consumer)
consumer - Consumer in question.startConsuming(MessageListener)
and stopConsuming(MessageConsumer).boolean isMeasuring(MessageMetric<? extends Number,P> metric)
MessageMetric is active.metric - Metric in question.startMeasuring(MessageMeasure, String) has
been called and before stopMeasuring(MessageMetric).boolean isMeasuring(String id)
MessageMetric is active.id - ID of the metric in question.startMeasuring(MessageMeasure, String) has
been called and before stopMeasuring(String).MessageConsumer<P> startConsuming(MessageListener<P> listener)
listener - Listener in question.IllegalArgumentException - When listener instanceof MessageConsumer
.<T extends Number> MessageMetric<T,P> startMeasuring(MessageMeasure<T,P> measure, String id)
T - The numeric type to be measured.measure - The class that measures the given property. It is highly
recommended that a measure instance be exclusive to each
metric.id - Unique identifier by which to locate the metric later.IllegalArgumentException - When a given ID has already been passed to
startMeasuring(MessageMeasure, String) and not to
stopMeasuring(String) or equivalents.boolean stopConsuming(MessageConsumer<P> consumer)
consumer - Consumer in question.isConsuming(MessageConsumer).boolean stopMeasuring(MessageMetric<? extends Number,P> metric)
Messages. From
this point on, the ID will become available for taking.metric - The metric in question.Copyright © 2015. All rights reserved.