Package org.osgi.util.pushstream
Interface PushStreamBuilder<T,U extends 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 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
Modifier and TypeMethodDescriptionTells thisPushStreamBuilder
to create an unbuffered stream which delivers events directly to its consumer using the incoming delivery thread.withBuffer
(U queue) The BlockingQueue implementation to use as a bufferwithExecutor
(Executor executor) Set theExecutor
that should be used to deliver events from this bufferwithParallelism
(int parallelism) Set the maximum permitted number of concurrent event deliveries allowed from this bufferwithPushbackPolicy
(PushbackPolicy<T, U> pushbackPolicy) Set thePushbackPolicy
of this builderwithPushbackPolicy
(PushbackPolicyOption pushbackPolicyOption, long time) Set thePushbackPolicy
of this builderwithQueuePolicy
(QueuePolicy<T, U> queuePolicy) Set theQueuePolicy
of this BuilderwithQueuePolicy
(QueuePolicyOption queuePolicyOption) Set theQueuePolicy
of this BuilderwithScheduler
(ScheduledExecutorService scheduler) Set theScheduledExecutorService
that should be used to trigger timed events after this bufferMethods inherited from interface org.osgi.util.pushstream.BufferBuilder
build
-
Method Details
-
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
Description copied from interface:BufferBuilder
The BlockingQueue implementation to use as a buffer- Specified by:
withBuffer
in interfaceBufferBuilder<PushStream<T>,
T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withQueuePolicy
Description copied from interface:BufferBuilder
Set theQueuePolicy
of this Builder- Specified by:
withQueuePolicy
in interfaceBufferBuilder<PushStream<T>,
T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withQueuePolicy
Description copied from interface:BufferBuilder
Set theQueuePolicy
of this Builder- Specified by:
withQueuePolicy
in interfaceBufferBuilder<PushStream<T>,
T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withPushbackPolicy
Description copied from interface:BufferBuilder
Set thePushbackPolicy
of this builder- Specified by:
withPushbackPolicy
in interfaceBufferBuilder<PushStream<T>,
T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withPushbackPolicy
Description copied from interface:BufferBuilder
Set thePushbackPolicy
of this builder- Specified by:
withPushbackPolicy
in interfaceBufferBuilder<PushStream<T>,
T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withParallelism
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 BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withExecutor
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 BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withScheduler
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 BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-