Package org.osgi.util.pushstream
Interface BufferBuilder<R,T,U extends java.util.concurrent.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>
@ProviderType public interface BufferBuilder<R,T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
Create a buffered section of a Push-based stream
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description R
build()
BufferBuilder<R,T,U>
withBuffer(U queue)
The BlockingQueue implementation to use as a bufferBufferBuilder<R,T,U>
withExecutor(java.util.concurrent.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(java.util.concurrent.ScheduledExecutorService scheduler)
Set theScheduledExecutorService
that should be used to trigger timed events after this buffer
-
-
-
Method Detail
-
withBuffer
BufferBuilder<R,T,U> withBuffer(U queue)
The BlockingQueue implementation to use as a buffer- Parameters:
queue
-- Returns:
- this builder
-
withQueuePolicy
BufferBuilder<R,T,U> withQueuePolicy(QueuePolicy<T,U> queuePolicy)
Set theQueuePolicy
of this Builder- Parameters:
queuePolicy
-- Returns:
- this builder
-
withQueuePolicy
BufferBuilder<R,T,U> withQueuePolicy(QueuePolicyOption queuePolicyOption)
Set theQueuePolicy
of this Builder- Parameters:
queuePolicyOption
-- Returns:
- this builder
-
withPushbackPolicy
BufferBuilder<R,T,U> withPushbackPolicy(PushbackPolicy<T,U> pushbackPolicy)
Set thePushbackPolicy
of this builder- Parameters:
pushbackPolicy
-- Returns:
- this builder
-
withPushbackPolicy
BufferBuilder<R,T,U> withPushbackPolicy(PushbackPolicyOption pushbackPolicyOption, long time)
Set thePushbackPolicy
of this builder- Parameters:
pushbackPolicyOption
-time
-- Returns:
- this builder
-
withParallelism
BufferBuilder<R,T,U> withParallelism(int parallelism)
Set the maximum permitted number of concurrent event deliveries allowed from this buffer- Parameters:
parallelism
-- Returns:
- this builder
-
withExecutor
BufferBuilder<R,T,U> withExecutor(java.util.concurrent.Executor executor)
Set theExecutor
that should be used to deliver events from this buffer- Parameters:
executor
-- Returns:
- this builder
-
withScheduler
BufferBuilder<R,T,U> withScheduler(java.util.concurrent.ScheduledExecutorService scheduler)
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
-
-