Package com.oracle.coherence.grpc
Class LockingStreamObserver<V>
java.lang.Object
com.oracle.coherence.grpc.LockingStreamObserver<V>
- Type Parameters:
V
- the type of the observer
- All Implemented Interfaces:
io.grpc.stub.StreamObserver<V>
-
Constructor Summary
ConstructorsConstructorDescriptionLockingStreamObserver
(io.grpc.stub.StreamObserver<? super V> delegate) Create aLockingStreamObserver
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> LockingStreamObserver
<T> ensureLockingObserver
(io.grpc.stub.StreamObserver<T> observer) Ensure that the specifiedStreamObserver
is a safe observer.boolean
isDone()
Returnstrue
if this observer is complete.void
void
void
-
Constructor Details
-
LockingStreamObserver
Create aLockingStreamObserver
.- Parameters:
delegate
- theStreamObserver
to delegate to
-
-
Method Details
-
onNext
- Specified by:
onNext
in interfaceio.grpc.stub.StreamObserver<V>
-
onError
- Specified by:
onError
in interfaceio.grpc.stub.StreamObserver<V>
-
onCompleted
public void onCompleted()- Specified by:
onCompleted
in interfaceio.grpc.stub.StreamObserver<V>
-
isDone
public boolean isDone()Returnstrue
if this observer is complete.- Returns:
true
if this observer is complete
-
ensureLockingObserver
public static <T> LockingStreamObserver<T> ensureLockingObserver(io.grpc.stub.StreamObserver<T> observer) Ensure that the specifiedStreamObserver
is a safe observer.If the specified observer is not an instance of
LockingStreamObserver
then wrap it in aLockingStreamObserver
.- Type Parameters:
T
- the response type expected by the observer- Parameters:
observer
- theStreamObserver
to test- Returns:
- a safe
StreamObserver
-