Package org.osgi.util.pushstream
Class AbstractBufferBuilder<R,T,U extends BlockingQueue<PushEvent<? extends T>>>
java.lang.Object
org.osgi.util.pushstream.AbstractBufferBuilder<R,T,U>
- All Implemented Interfaces:
BufferBuilder<R,T, U>
- Direct Known Subclasses:
PushStreamBuilderImpl
abstract class AbstractBufferBuilder<R,T,U extends BlockingQueue<PushEvent<? extends T>>>
extends Object
implements BufferBuilder<R,T,U>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PushbackPolicy<T, U> protected Uprotected QueuePolicy<T, U> protected intprotected ScheduledExecutorServiceprotected Executor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBufferBuilder<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 bufferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.osgi.util.pushstream.BufferBuilder
build
-
Field Details
-
worker
-
timer
-
concurrency
protected int concurrency -
backPressure
-
bufferingPolicy
-
buffer
-
-
Constructor Details
-
AbstractBufferBuilder
AbstractBufferBuilder()
-
-
Method Details
-
withBuffer
Description copied from interface:BufferBuilderThe BlockingQueue implementation to use as a buffer- Specified by:
withBufferin interfaceBufferBuilder<R,T, U extends BlockingQueue<PushEvent<? extends T>>> - Parameters:
queue-- Returns:
- this builder
-
withQueuePolicy
Description copied from interface:BufferBuilderSet theQueuePolicyof this Builder- Specified by:
withQueuePolicyin interfaceBufferBuilder<R,T, U extends BlockingQueue<PushEvent<? extends T>>> - Parameters:
queuePolicy-- Returns:
- this builder
-
withQueuePolicy
Description copied from interface:BufferBuilderSet theQueuePolicyof this Builder- Specified by:
withQueuePolicyin interfaceBufferBuilder<R,T, U extends BlockingQueue<PushEvent<? extends T>>> - Parameters:
queuePolicyOption-- Returns:
- this builder
-
withPushbackPolicy
Description copied from interface:BufferBuilderSet thePushbackPolicyof this builder- Specified by:
withPushbackPolicyin interfaceBufferBuilder<R,T, U extends BlockingQueue<PushEvent<? extends T>>> - Parameters:
pushbackPolicy-- Returns:
- this builder
-
withPushbackPolicy
public BufferBuilder<R,T, withPushbackPolicyU> (PushbackPolicyOption pushbackPolicyOption, long time) Description copied from interface:BufferBuilderSet thePushbackPolicyof this builder- Specified by:
withPushbackPolicyin interfaceBufferBuilder<R,T, U extends BlockingQueue<PushEvent<? extends T>>> - Parameters:
pushbackPolicyOption-time-- 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<R,T, U extends BlockingQueue<PushEvent<? extends T>>> - Parameters:
parallelism-- Returns:
- this builder
-
withExecutor
Description copied from interface:BufferBuilderSet theExecutorthat should be used to deliver events from this buffer- Specified by:
withExecutorin interfaceBufferBuilder<R,T, U extends BlockingQueue<PushEvent<? extends T>>> - Parameters:
executor-- Returns:
- this builder
-
withScheduler
Description copied from interface:BufferBuilderSet theScheduledExecutorServicethat should be used to trigger timed events after this buffer- Specified by:
withSchedulerin interfaceBufferBuilder<R,T, U extends BlockingQueue<PushEvent<? extends T>>> - Parameters:
scheduler-- Returns:
- this builder
-