public class BufferManagerConfigurer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BufferManagerConfigurer.FileStoreStrategy
An enum of file store strategies.
|
static class |
BufferManagerConfigurer.StoreMode
An enum of filters that can be applied to buffers stored at a buffer hierarchy level.
|
Modifier and Type | Method and Description |
---|---|
BufferManagerConfigurer |
bufferSize(int size)
Set the size of the buffers to be managed by the buffer manager.
|
BufferManagerConfigurer |
bufferStoreFile(File file)
Set the file to be used to store buffers.
|
static BufferManagerConfigurer |
configure()
Return a BufferManagerConfigurer to be used to configure a BufferManager.
|
BufferManagerConfigurer |
fileStoreMode(BufferManagerConfigurer.StoreMode mode)
Set how buffers are stored in the buffer file.
|
BufferManagerConfigurer |
fileStoreStrategy(BufferManagerConfigurer.FileStoreStrategy strategy)
Set how the buffer file is accessed.
|
void |
install()
Create the configured BufferManager and install it as the process-wide default buffer manager.
|
BufferManagerConfigurer |
memoryBuffers(int count)
Set the number of buffers to keep in memory.
|
public static BufferManagerConfigurer configure()
public BufferManagerConfigurer bufferSize(int size)
IllegalArgumentException
if the given size is not within the range of reasonable values.size
- the buffer size to be usedpublic BufferManagerConfigurer memoryBuffers(int count)
count
times buffer size set via bufferSize(int)
of heap. Larger values will
improve performance (in particular with large documents) at the expense of increased heap use.
The default is 80 buffers, i.e. ~5MB of memory buffers. Reasonable values are in the range of
10..1000. The maximal accepted number of buffers are smaller then 10000.count
- the number of buffers in memoryIllegalArgumentException
if the given number is smaller as 10 or greater
than 10000.public BufferManagerConfigurer bufferStoreFile(File file)
file
- the file to store the buffersIllegalArgumentException
if the provided file is null.public BufferManagerConfigurer fileStoreMode(BufferManagerConfigurer.StoreMode mode)
BufferManagerConfigurer.StoreMode
enables a trade-off between
performance and security.
The default is BufferManagerConfigurer.StoreMode.PLAIN
IllegalArgumentException
if the provided mode is nullmode
- the mode how buffers are storedBufferManagerConfigurer.StoreMode.PLAIN
,
BufferManagerConfigurer.StoreMode.SCRAMBLED
,
BufferManagerConfigurer.StoreMode.ENCRYPTED
public BufferManagerConfigurer fileStoreStrategy(BufferManagerConfigurer.FileStoreStrategy strategy)
BufferManagerConfigurer.FileStoreStrategy
enables the selection of an IO
strategy. Selecting an IO stategy should not generally be needed, as the default is to choose a
suitable method based on a heuristic.
The default is BufferManagerConfigurer.FileStoreStrategy.AUTO
strategy
- the file store IO strategyIllegalArgumentException
- if the provided strategy is nullpublic void install() throws JadiceException
JadiceException
- if the BufferManager could not be created based on the given
configurationCopyright © 2024 levigo holding gmbh. All rights reserved.