Class MappedBufferManager

All Implemented Interfaces:
ByteBufferManager

public class MappedBufferManager extends AbstractBufferManager
Manages a ByteBuffer on a file.
Since:
Coherence 2.2
Author:
cp 2002.09.18
See Also:
  • Field Details

    • DEFAULT_MIN_SIZE

      public static final int DEFAULT_MIN_SIZE
      Default minimum size for a memory mapped file.
      See Also:
    • DEFAULT_MAX_SIZE

      public static final int DEFAULT_MAX_SIZE
      Default maximum size for a memory mapped file.
      See Also:
  • Constructor Details

    • MappedBufferManager

      public MappedBufferManager()
      Construct a MappedBufferManager using defaults.
    • MappedBufferManager

      public MappedBufferManager(int cbInitial, int cbMaximum, File file)
      Construct a MappedBufferManager that supports a buffer of a certain initial and maximum size.
      Parameters:
      cbInitial - the initial size
      cbMaximum - the maximum size
      file - the file to use, or the directory to use, or null to generate a temporary file in the default location
  • Method Details

    • configureFile

      protected void configureFile(File file)
      Configure the buffer manager based on the passed file, which may be null to imply a default temp file, a directory to imply that a file be created in that directory, or it may be the temp file itself.
      Parameters:
      file - the file to use, or the directory to use, or null to generate a temporary file in the default location
    • getFile

      protected RandomAccessFile getFile()
      Obtain the RandomAccessFile that the buffer is constructed on.
      Returns:
      the RandomAccessFile object
    • setFile

      protected void setFile(RandomAccessFile file)
      Specify the RandomAccessFile that the buffer will be constructed on.
      Parameters:
      file - the RandomAccessFile object
    • allocateBuffer

      protected void allocateBuffer()
      Allocate a new buffer, copying old data if there is any.
      Specified by:
      allocateBuffer in class AbstractBufferManager
      See Also:
    • close

      public void close()
      Close the underlying resources.
    • finalize

      protected void finalize()
      Perform cleanup during garbage collection.
      Overrides:
      finalize in class Object