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 Details

  • Constructor Details

    • PushEventPipe

      PushEventPipe()
  • Method Details

    • open

      public AutoCloseable open(PushEventConsumer<? super T> pec) throws Exception
      Description copied from interface: PushEventSource
      Open the asynchronous channel between the source and the consumer. The call returns an AutoCloseable. 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 interface PushEventSource<T>
      Parameters:
      pec - the consumer (not null)
      Returns:
      a AutoCloseable that can be used to close the stream
      Throws:
      Exception
    • accept

      public long accept(PushEvent<? extends T> event) throws Exception
      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 interface PushEventConsumer<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 this PushEventConsumer