Package org.osgi.util.pushstream
Class PushStreamProvider.PushEventPipe<T>
java.lang.Object
org.osgi.util.pushstream.PushStreamProvider.PushEventPipe<T>
- All Implemented Interfaces:
PushEventConsumer<T>
,PushEventSource<T>
- Enclosing class:
- PushStreamProvider
static final class PushStreamProvider.PushEventPipe<T>
extends Object
implements PushEventConsumer<T>, PushEventSource<T>
-
Field Summary
FieldsFields inherited from interface org.osgi.util.pushstream.PushEventConsumer
ABORT, CONTINUE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Accept an event from a source.open
(PushEventConsumer<? super T> pec) Open the asynchronous channel between the source and the consumer.
-
Field Details
-
delegate
-
-
Constructor Details
-
PushEventPipe
PushEventPipe()
-
-
Method Details
-
open
Description copied from interface:PushEventSource
Open the asynchronous channel between the source and the consumer. The call returns anAutoCloseable
. This can be closed, and should close the channel, including sending a Close event if the channel was not already closed. The returned object must be able to be closed multiple times without sending more than one Close events.- Specified by:
open
in interfacePushEventSource<T>
- Parameters:
pec
- the consumer (not null)- Returns:
- a
AutoCloseable
that can be used to close the stream - Throws:
Exception
-
accept
Description copied from interface:PushEventConsumer
Accept an event from a source. Events can be delivered on multiple threads simultaneously. However, Close and Error events are the last events received, no more events must be sent after them.- Specified by:
accept
in interfacePushEventConsumer<T>
- Parameters:
event
- The event- Returns:
- less than 0 means abort, 0 means continue, more than 0 means delay ms
- Throws:
Exception
- to indicate that an error has occurred and that no further events should be delivered to thisPushEventConsumer
-