Package org.osgi.util.pushstream
Interface BufferBuilder<R,T,U extends BlockingQueue<PushEvent<? extends T>>>
- Type Parameters:
R- The type of object being builtT- The type of objects in thePushEventU- The type of the Queue used in the user specified buffer
- All Known Subinterfaces:
PushStreamBuilder<T,U>
Create a buffered section of a Push-based stream
-
Method Summary
Modifier and TypeMethodDescriptionbuild()BufferBuilder<R,T, U> withBuffer(U queue) The BlockingQueue implementation to use as a bufferBufferBuilder<R,T, U> withExecutor(Executor executor) Set theExecutorthat should be used to deliver events from this bufferBufferBuilder<R,T, U> withParallelism(int parallelism) Set the maximum permitted number of concurrent event deliveries allowed from this bufferBufferBuilder<R,T, U> withPushbackPolicy(PushbackPolicy<T, U> pushbackPolicy) Set thePushbackPolicyof this builderBufferBuilder<R,T, U> withPushbackPolicy(PushbackPolicyOption pushbackPolicyOption, long time) Set thePushbackPolicyof this builderBufferBuilder<R,T, U> withQueuePolicy(QueuePolicy<T, U> queuePolicy) Set theQueuePolicyof this BuilderBufferBuilder<R,T, U> withQueuePolicy(QueuePolicyOption queuePolicyOption) Set theQueuePolicyof this BuilderBufferBuilder<R,T, U> withScheduler(ScheduledExecutorService scheduler) Set theScheduledExecutorServicethat should be used to trigger timed events after this buffer
-
Method Details
-
withBuffer
The BlockingQueue implementation to use as a buffer- Parameters:
queue-- Returns:
- this builder
-
withQueuePolicy
Set theQueuePolicyof this Builder- Parameters:
queuePolicy-- Returns:
- this builder
-
withQueuePolicy
Set theQueuePolicyof this Builder- Parameters:
queuePolicyOption-- Returns:
- this builder
-
withPushbackPolicy
Set thePushbackPolicyof this builder- Parameters:
pushbackPolicy-- Returns:
- this builder
-
withPushbackPolicy
Set thePushbackPolicyof this builder- Parameters:
pushbackPolicyOption-time-- Returns:
- this builder
-
withParallelism
Set the maximum permitted number of concurrent event deliveries allowed from this buffer- Parameters:
parallelism-- Returns:
- this builder
-
withExecutor
Set theExecutorthat should be used to deliver events from this buffer- Parameters:
executor-- Returns:
- this builder
-
withScheduler
Set theScheduledExecutorServicethat should be used to trigger timed events after this buffer- Parameters:
scheduler-- Returns:
- this builder
-
build
R build()- Returns:
- the object being built
-