Package org.osgi.util.pushstream
Interface PushStreamBuilder<T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
-
- Type Parameters:
T
- The type of objects in thePushEvent
U
- The type of the Queue used in the user specified buffer
- All Superinterfaces:
BufferBuilder<PushStream<T>,T,U>
@ProviderType public interface PushStreamBuilder<T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>> extends BufferBuilder<PushStream<T>,T,U>
A Builder for a PushStream. This Builder extends the support of a standard BufferBuilder by allowing the PushStream to be unbuffered.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PushStreamBuilder<T,U>
unbuffered()
Tells thisPushStreamBuilder
to create an unbuffered stream which delivers events directly to its consumer using the incoming delivery thread.PushStreamBuilder<T,U>
withBuffer(U queue)
The BlockingQueue implementation to use as a bufferPushStreamBuilder<T,U>
withExecutor(java.util.concurrent.Executor executor)
Set theExecutor
that should be used to deliver events from this bufferPushStreamBuilder<T,U>
withParallelism(int parallelism)
Set the maximum permitted number of concurrent event deliveries allowed from this bufferPushStreamBuilder<T,U>
withPushbackPolicy(PushbackPolicy<T,U> pushbackPolicy)
Set thePushbackPolicy
of this builderPushStreamBuilder<T,U>
withPushbackPolicy(PushbackPolicyOption pushbackPolicyOption, long time)
Set thePushbackPolicy
of this builderPushStreamBuilder<T,U>
withQueuePolicy(QueuePolicy<T,U> queuePolicy)
Set theQueuePolicy
of this BuilderPushStreamBuilder<T,U>
withQueuePolicy(QueuePolicyOption queuePolicyOption)
Set theQueuePolicy
of this BuilderPushStreamBuilder<T,U>
withScheduler(java.util.concurrent.ScheduledExecutorService scheduler)
Set theScheduledExecutorService
that should be used to trigger timed events after this buffer-
Methods inherited from interface org.osgi.util.pushstream.BufferBuilder
build
-
-
-
-
Method Detail
-
unbuffered
PushStreamBuilder<T,U> unbuffered()
Tells thisPushStreamBuilder
to create an unbuffered stream which delivers events directly to its consumer using the incoming delivery thread. Setting thePushStreamBuilder
to be unbuffered means that any buffer, queue policy or push back policy will be ignored. Note that calling one of: after this method will reset this builder to require a buffer.- Returns:
- the builder
-
withBuffer
PushStreamBuilder<T,U> withBuffer(U queue)
Description copied from interface:BufferBuilder
The BlockingQueue implementation to use as a buffer- Specified by:
withBuffer
in interfaceBufferBuilder<PushStream<T>,T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
- Returns:
- this builder
-
withQueuePolicy
PushStreamBuilder<T,U> withQueuePolicy(QueuePolicy<T,U> queuePolicy)
Description copied from interface:BufferBuilder
Set theQueuePolicy
of this Builder- Specified by:
withQueuePolicy
in interfaceBufferBuilder<PushStream<T>,T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
- Returns:
- this builder
-
withQueuePolicy
PushStreamBuilder<T,U> withQueuePolicy(QueuePolicyOption queuePolicyOption)
Description copied from interface:BufferBuilder
Set theQueuePolicy
of this Builder- Specified by:
withQueuePolicy
in interfaceBufferBuilder<PushStream<T>,T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
- Returns:
- this builder
-
withPushbackPolicy
PushStreamBuilder<T,U> withPushbackPolicy(PushbackPolicy<T,U> pushbackPolicy)
Description copied from interface:BufferBuilder
Set thePushbackPolicy
of this builder- Specified by:
withPushbackPolicy
in interfaceBufferBuilder<PushStream<T>,T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
- Returns:
- this builder
-
withPushbackPolicy
PushStreamBuilder<T,U> withPushbackPolicy(PushbackPolicyOption pushbackPolicyOption, long time)
Description copied from interface:BufferBuilder
Set thePushbackPolicy
of this builder- Specified by:
withPushbackPolicy
in interfaceBufferBuilder<PushStream<T>,T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
- Returns:
- this builder
-
withParallelism
PushStreamBuilder<T,U> withParallelism(int parallelism)
Description copied from interface:BufferBuilder
Set the maximum permitted number of concurrent event deliveries allowed from this buffer- Specified by:
withParallelism
in interfaceBufferBuilder<PushStream<T>,T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
- Returns:
- this builder
-
withExecutor
PushStreamBuilder<T,U> withExecutor(java.util.concurrent.Executor executor)
Description copied from interface:BufferBuilder
Set theExecutor
that should be used to deliver events from this buffer- Specified by:
withExecutor
in interfaceBufferBuilder<PushStream<T>,T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
- Returns:
- this builder
-
withScheduler
PushStreamBuilder<T,U> withScheduler(java.util.concurrent.ScheduledExecutorService scheduler)
Description copied from interface:BufferBuilder
Set theScheduledExecutorService
that should be used to trigger timed events after this buffer- Specified by:
withScheduler
in interfaceBufferBuilder<PushStream<T>,T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
- Returns:
- this builder
-
-