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, setSubscriptionListenerpublic CompositeRecordProvider(RecordProvider... providers)
CompositeRecordProvider for a given list of individual providers.public RecordMode getMode()
AbstractRecordProviderretrieve method.getMode in interface RecordProvidergetMode in class AbstractRecordProviderpublic boolean retrieve(RecordSink sink)
AbstractRecordProviderhas capacity.
Returns true if some records still remains in the provider
or false if all accumulated records were retrieved.retrieve in interface RecordProviderretrieve in class AbstractRecordProvidersink - the sink.true if some records still remains in the provider,
false if all accumulated records were retrieved.public void setRecordListener(RecordListener listener)
AbstractRecordProvidernull 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 RecordProvidersetRecordListener in class AbstractRecordProviderlistener - the listener.Copyright © 2002–2025 Devexperts LLC. All rights reserved.