T - the element typepublic class RefCount<T> extends java.lang.Object implements Observable<T>
| Modifier and Type | Field and Description |
|---|---|
protected java.io.Closeable |
connection
The active connection.
|
protected int |
count
The registration count.
|
protected java.util.concurrent.locks.Lock |
lock
The lock.
|
protected ConnectableObservable<? extends T> |
source
The source .
|
| Constructor and Description |
|---|
RefCount(ConnectableObservable<? extends T> source)
Constructor with a default fair reentrant lock.
|
RefCount(ConnectableObservable<? extends T> source,
java.util.concurrent.locks.Lock lock)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.Closeable |
register(Observer<? super T> observer)
Registers an observer for the notification of Ts.
|
@Nonnull protected final java.util.concurrent.locks.Lock lock
@Nonnull protected final ConnectableObservable<? extends T> source
protected java.io.Closeable connection
protected int count
public RefCount(ConnectableObservable<? extends T> source)
source - the source of Tspublic RefCount(ConnectableObservable<? extends T> source, java.util.concurrent.locks.Lock lock)
source - the source of Tslock - the lock@Nonnull
public java.io.Closeable register(@Nonnull
Observer<? super T> observer)
Observableregister in interface Observable<T>observer - the observer of Ts or any supertype of it