public final class CompositeRecordProvider extends AbstractRecordProvider
RecordProvider
that listens for multiple
RecordProvider
instances and on retrieve
method invocation only retrieves
data from the providers that have data available.
This class is thread-safe and lock-free. Change carefully.VOID
Constructor and Description |
---|
CompositeRecordProvider(RecordProvider... providers)
Constructs an instance of
CompositeRecordProvider for a given list of individual providers. |
Modifier and Type | Method and Description |
---|---|
RecordMode |
getMode()
Returns record mode at which the records are provided
by
retrieve method. |
boolean |
retrieve(RecordSink sink)
Retrieves accumulated records into the specified record sink
while the sink
has capacity . |
void |
setRecordListener(RecordListener listener)
Sets new record listener to receive notifications about available records.
|
retrieveData, retrieveSubscription, setDataListener, setSubscriptionListener
public CompositeRecordProvider(RecordProvider... providers)
CompositeRecordProvider
for a given list of individual providers.public RecordMode getMode()
AbstractRecordProvider
retrieve
method.getMode
in interface RecordProvider
getMode
in class AbstractRecordProvider
public boolean retrieve(RecordSink sink)
AbstractRecordProvider
has capacity
.
Returns true
if some records still remains in the provider
or false
if all accumulated records were retrieved.retrieve
in interface RecordProvider
retrieve
in class AbstractRecordProvider
sink
- the sink.true
if some records still remains in the provider,
false
if all accumulated records were retrieved.public void setRecordListener(RecordListener listener)
AbstractRecordProvider
null
to set empty data listener (no notifications).
NOTE: if there are accumulated data available, then specified listener will be notified by this method.
This implementation throws UnsupportedOperationException
.
setRecordListener
in interface RecordProvider
setRecordListener
in class AbstractRecordProvider
listener
- the listener.Copyright © 2002–2025 Devexperts LLC. All rights reserved.