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 thePushEvent
U
- 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 theExecutor
that 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 thePushbackPolicy
of this builderBufferBuilder<R,
T, U> withPushbackPolicy
(PushbackPolicyOption pushbackPolicyOption, long time) Set thePushbackPolicy
of this builderBufferBuilder<R,
T, U> withQueuePolicy
(QueuePolicy<T, U> queuePolicy) Set theQueuePolicy
of this BuilderBufferBuilder<R,
T, U> withQueuePolicy
(QueuePolicyOption queuePolicyOption) Set theQueuePolicy
of this BuilderBufferBuilder<R,
T, U> withScheduler
(ScheduledExecutorService scheduler) Set theScheduledExecutorService
that 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 theQueuePolicy
of this Builder- Parameters:
queuePolicy
-- Returns:
- this builder
-
withQueuePolicy
Set theQueuePolicy
of this Builder- Parameters:
queuePolicyOption
-- Returns:
- this builder
-
withPushbackPolicy
Set thePushbackPolicy
of this builder- Parameters:
pushbackPolicy
-- Returns:
- this builder
-
withPushbackPolicy
Set thePushbackPolicy
of 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 theExecutor
that should be used to deliver events from this buffer- Parameters:
executor
-- Returns:
- this builder
-
withScheduler
Set theScheduledExecutorService
that should be used to trigger timed events after this buffer- Parameters:
scheduler
-- Returns:
- this builder
-
build
R build()- Returns:
- the object being built
-