Package org.drools.ruleunits.api
Interface DataSource<T>
-
- Type Parameters:
T
- The type of objects managed by this DataSource.
- All Known Subinterfaces:
DataStore<T>
,DataStream<T>
,SingletonStore<T>
public interface DataSource<T>
A strongly typed source of data for aRuleUnit
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
DataSource.Factory
static class
DataSource.FactoryHolder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T> DataStream<T>
createBufferedStream(int bufferSize)
Creates aDataStream
, a DataSource of immutable facts, without a buffer retaining at most the number of facts defined in bufferSize.static <T> SingletonStore<T>
createSingleton()
Creates aSingletonStore
, a data store that contains at most one value.static <T> DataStore<T>
createStore()
Creates aDataStore
, a DataSource of mutable facts.static <T> DataStream<T>
createStream()
Creates aDataStream
, a DataSource of immutable facts, without any buffer.void
subscribe(DataProcessor<T> subscriber)
Subscribes this DataSource to aDataProcessor
that will be notified of all the changes occurred to the facts going through the DataSource.
-
-
-
Method Detail
-
subscribe
void subscribe(DataProcessor<T> subscriber)
Subscribes this DataSource to aDataProcessor
that will be notified of all the changes occurred to the facts going through the DataSource.
-
createStream
static <T> DataStream<T> createStream()
Creates aDataStream
, a DataSource of immutable facts, without any buffer.
-
createBufferedStream
static <T> DataStream<T> createBufferedStream(int bufferSize)
Creates aDataStream
, a DataSource of immutable facts, without a buffer retaining at most the number of facts defined in bufferSize.
-
createStore
static <T> DataStore<T> createStore()
Creates aDataStore
, a DataSource of mutable facts.
-
createSingleton
static <T> SingletonStore<T> createSingleton()
Creates aSingletonStore
, a data store that contains at most one value.
-
-