public class LocalPool extends java.lang.Object implements DiscoveryService, ProvidingService
Publishers. (this class is both a DiscoveryService and a
ProvidingService). The most important feature of the LocalPool is that it supports the lazy creation
of the streams, specifically, they are created when discovered using StreamFactorys. When a StreamId
is discovered, the discovery is delegated to a new instance of TrackKeepingDiscoveryService. The
TrackKeepingDiscoveryService then tries to create the stream using the provided TypedStreamFactorys
if no matching StreamId has already been provided.| Constructor and Description |
|---|
LocalPool() |
LocalPool(java.util.List<StreamFactory> factories) |
| Modifier and Type | Method and Description |
|---|---|
<T> org.reactivestreams.Publisher<T> |
discover(StreamId<T> id)
Given a
StreamId, this method returns the correspondent Publisher. |
<T> void |
provide(StreamId<T> id,
org.reactivestreams.Publisher<T> obs)
Provides the stream with the specified id.
|
public LocalPool()
public LocalPool(java.util.List<StreamFactory> factories)
public <T> void provide(StreamId<T> id, org.reactivestreams.Publisher<T> obs)
ProvidingServiceDiscoveryService using the same StreamId.provide in interface ProvidingServiceid - the StreamId that identifies the specified streamobs - the Publisher to be providedpublic <T> org.reactivestreams.Publisher<T> discover(StreamId<T> id)
DiscoveryServiceStreamId, this method returns the correspondent Publisher. This method should not
return null, instead is preferred to throw a specific exception in the case the given id is not present in the
system. From the API level, this behavior is not forced.discover in interface DiscoveryServiceid - the identifier of the stream to be discoveredPublisher