public interface SampleProducer extends SampleProcessor
A sample producer is able to produce sample on different channels.
Typically, a SampleProducer
can be connected to
SampleConsumer
where it will produced sample that will be consumed by
the sample consumer.
A sample producer can produce samples of different metadata for reach channel/
The following production sequence must be observed:
setProducedMetadata()
for each produced channelstartProducing()
produce()
for each sample to produce for every channelstopProducing()
Modifier and Type | Method and Description |
---|---|
void |
produce(Sample s,
int channel)
Produce a single sample on the specified channel
|
void |
setProducedMetadata(SampleMetadata metadata,
int channel)
Set the metadata associated with the specified channel
|
void |
startProducing()
Start producing samples, must be invoked before any call to
produce() |
void |
stopProducing()
Stop producing samples, no
produce() call should occur after
this service has been called. |
getChannelAttribute, getSampleContext, setChannelAttribute, setSampleContext
void setProducedMetadata(SampleMetadata metadata, int channel)
metadata
- The metadata to be associated to the specified channelchannel
- The channel whoses metadata are being associated withvoid startProducing()
produce()
void produce(Sample s, int channel)
s
- The sample producedchannel
- The channel on which is produced the samplevoid stopProducing()
produce()
call should occur after
this service has been called.Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.