Package org.osgi.util.pushstream
Interface PushStreamBuilder<T,U extends BlockingQueue<PushEvent<? extends T>>>
- Type Parameters:
T- The type of objects in thePushEventU- 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 thisPushStreamBuilderto 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 theExecutorthat 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 thePushbackPolicyof this builderwithPushbackPolicy(PushbackPolicyOption pushbackPolicyOption, long time) Set thePushbackPolicyof this builderwithQueuePolicy(QueuePolicy<T, U> queuePolicy) Set theQueuePolicyof this BuilderwithQueuePolicy(QueuePolicyOption queuePolicyOption) Set theQueuePolicyof this BuilderwithScheduler(ScheduledExecutorService scheduler) Set theScheduledExecutorServicethat 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 thisPushStreamBuilderto create an unbuffered stream which delivers events directly to its consumer using the incoming delivery thread. Setting thePushStreamBuilderto 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:BufferBuilderThe BlockingQueue implementation to use as a buffer- Specified by:
withBufferin interfaceBufferBuilder<PushStream<T>,T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withQueuePolicy
Description copied from interface:BufferBuilderSet theQueuePolicyof this Builder- Specified by:
withQueuePolicyin interfaceBufferBuilder<PushStream<T>,T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withQueuePolicy
Description copied from interface:BufferBuilderSet theQueuePolicyof this Builder- Specified by:
withQueuePolicyin interfaceBufferBuilder<PushStream<T>,T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withPushbackPolicy
Description copied from interface:BufferBuilderSet thePushbackPolicyof this builder- Specified by:
withPushbackPolicyin interfaceBufferBuilder<PushStream<T>,T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withPushbackPolicy
Description copied from interface:BufferBuilderSet thePushbackPolicyof this builder- Specified by:
withPushbackPolicyin interfaceBufferBuilder<PushStream<T>,T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withParallelism
Description copied from interface:BufferBuilderSet the maximum permitted number of concurrent event deliveries allowed from this buffer- Specified by:
withParallelismin interfaceBufferBuilder<PushStream<T>,T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withExecutor
Description copied from interface:BufferBuilderSet theExecutorthat should be used to deliver events from this buffer- Specified by:
withExecutorin interfaceBufferBuilder<PushStream<T>,T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-
withScheduler
Description copied from interface:BufferBuilderSet theScheduledExecutorServicethat should be used to trigger timed events after this buffer- Specified by:
withSchedulerin interfaceBufferBuilder<PushStream<T>,T, U extends BlockingQueue<PushEvent<? extends T>>> - Returns:
- this builder
-