public abstract class AbstractSampleConsumer extends AbstractSampleProcessor implements SampleConsumer, SampleProducer
| Constructor and Description |
|---|
AbstractSampleConsumer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSampleConsumer(SampleConsumer consumer) |
int |
getConsumedChannelCount() |
SampleMetadata |
getConsumedMetadata(int channel) |
protected SampleConsumer |
getConsumer(int i) |
protected Object |
getDataFromContext(String key)
Gets the data identified by the specified key from the current sample
context
|
String |
getName()
Gets the name of the consumer.
|
File |
getWorkingDirectory() |
void |
produce(Sample s,
int channel)
Produce a single sample on the specified channel
|
void |
removeSampleConsumer(SampleConsumer consumer) |
void |
setChannelAttribute(int channel,
String key,
Object value)
Associate an attribute to the specified channel for this sample processor
If the attribute already exist, it is replaced. |
void |
setConsumedMetadata(SampleMetadata sampleMetadata,
int channel)
Set the metadata of samples that will be consumed on the specified
channel.
|
protected void |
setDataToContext(String key,
Object value)
Store data in the current sample context with the specified key
identifier.
|
void |
setName(String name)
Sets the name of the consumer.
|
void |
setProducedMetadata(SampleMetadata metadata,
int channel)
Set the metadata associated with the specified channel
|
void |
setSampleConsumer(SampleConsumer consumer) |
void |
setSampleConsumers(List<SampleConsumer> consumers)
Sets the consumers
|
void |
setSampleContext(SampleContext sampleContext)
Set sample context that this consumer should rely on.
|
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, getSampleContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconsume, startConsuming, stopConsuminggetChannelAttribute, getSampleContextprotected final Object getDataFromContext(String key)
key - the keyprotected final void setDataToContext(String key, Object value)
key - the keyvalue - the valuepublic String getName()
public void setName(String name)
name - the new namepublic final File getWorkingDirectory()
public void setSampleContext(SampleContext sampleContext)
SampleProcessorsetSampleContext in interface SampleProcessorsetSampleContext in class AbstractSampleProcessorsampleContext - the new sample contextpublic void setSampleConsumers(List<SampleConsumer> consumers)
consumers - for the samples (must not be null)public void addSampleConsumer(SampleConsumer consumer)
public void setSampleConsumer(SampleConsumer consumer)
public void removeSampleConsumer(SampleConsumer consumer)
public void setConsumedMetadata(SampleMetadata sampleMetadata, int channel)
SampleConsumersetConsumedMetadata in interface SampleConsumersampleMetadata - The sample metadata that are being consumed for the
associated channelchannel - The channel whose sample metadata are being definedpublic SampleMetadata getConsumedMetadata(int channel)
public int getConsumedChannelCount()
public void setChannelAttribute(int channel,
String key,
Object value)
SampleProcessorsetChannelAttribute in interface SampleProcessorsetChannelAttribute in class AbstractSampleProcessorchannel - The channel number to associate the attribute onkey - The attribute keyvalue - The attribute value to be setpublic void setProducedMetadata(SampleMetadata metadata, int channel)
SampleProducersetProducedMetadata in interface SampleProducermetadata - The metadata to be associated to the specified channelchannel - The channel whoses metadata are being associated withprotected SampleConsumer getConsumer(int i)
public void startProducing()
SampleProducerproduce()startProducing in interface SampleProducerpublic void produce(Sample s, int channel)
SampleProducerproduce in interface SampleProducers - The sample producedchannel - The channel on which is produced the samplepublic void stopProducing()
SampleProducerproduce() call should occur after
this service has been called.stopProducing in interface SampleProducerCopyright © 1998-2023 Apache Software Foundation. All Rights Reserved.