@NoExtend public abstract class AbstractCursorStreamProviderFactory extends AbstractComponent implements CursorStreamProviderFactory
CursorStreamProviderFactory
which contains all the base behaviour and template methods.
It interacts with the CursorManager
in order to track all allocated resources and make sure they're properly disposed
of once they're no longer necessary.
Modifier and Type | Field and Description |
---|---|
protected StreamingManager |
streamingManager |
LOCATION_KEY, ROOT_CONTAINER_NAME_KEY
ANNOTATIONS_PROPERTY_NAME
Modifier | Constructor and Description |
---|---|
protected |
AbstractCursorStreamProviderFactory(ByteBufferManager bufferManager,
StreamingManager streamingManager)
Creates a new instance
|
Modifier and Type | Method and Description |
---|---|
protected ByteBufferManager |
getBufferManager() |
Object |
of(CoreEvent event,
InputStream inputStream)
Optionally creates a new
CursorProvider to buffer the given value . |
protected abstract Object |
resolve(InputStream inputStream,
CoreEvent event)
Implementations should use this method to actually create the output value
|
getAnnotation, getAnnotations, getLocation, getRootContainerLocation, setAnnotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accepts
protected final StreamingManager streamingManager
protected AbstractCursorStreamProviderFactory(ByteBufferManager bufferManager, StreamingManager streamingManager)
bufferManager
- the ByteBufferManager
that will be used to allocate all bufferspublic final Object of(CoreEvent event, InputStream inputStream)
CursorProvider
to buffer the given value
.
Implementations might resolve that the given stream is/should not be buffered and thus it will return the same given stream. In that case, the stream will be unaltered.
of
in interface CursorProviderFactory<InputStream>
event
- the event on which buffering is talking placeinputStream
- the stream to be cursoredCursorProvider
or the same given inputStream
protected ByteBufferManager getBufferManager()
ByteBufferManager
that MUST to be used to allocate byte buffersprotected abstract Object resolve(InputStream inputStream, CoreEvent event)
inputStream
- event
- Copyright © 2018. All rights reserved.