2015/07/26 - Apache DirectMemory has been retired.

For more information, please explore the Attic.

public class

MemoryManagerServiceImpl

extends AbstractMemoryManager<V>
implements MemoryManagerService<V>
java.lang.Object
   ↳ org.apache.directmemory.memory.AbstractMemoryManager<V>
     ↳ org.apache.directmemory.memory.MemoryManagerServiceImpl<V>

Summary

[Expand]
Inherited Constants
From class org.apache.directmemory.memory.AbstractMemoryManager
Fields
protected final AllocationPolicy allocationPolicy
protected static final Logger logger
[Expand]
Inherited Fields
From class org.apache.directmemory.memory.AbstractMemoryManager
Public Constructors
MemoryManagerServiceImpl()
MemoryManagerServiceImpl(boolean returnNullWhenFull)
MemoryManagerServiceImpl(AllocationPolicy allocationPolicy, boolean returnNullWhenFull)
Public Methods
<T extends V> Pointer<V> allocate(Class<T> type, int size, long expiresIn, long expires)
long capacity()
void clear()
void close()
Pointer<V> free(Pointer<V> pointer)
void init(int numberOfBuffers, int size)
Initialize the internal structure.
byte[] retrieve(Pointer<V> pointer)
Pointer<V> store(byte[] payload, long expiresIn)
Protected Methods
Allocator getAllocator(int allocatorIndex)
List<Allocator> getAllocators()
Allocator getCurrentAllocator()
Allocator instanciateByteBufferAllocator(int allocatorNumber, int size)
Pointer<V> instanciatePointer(MemoryBuffer buffer, int allocatorIndex, long expiresIn, long expires)
[Expand]
Inherited Methods
From class org.apache.directmemory.memory.AbstractMemoryManager
From class java.lang.Object
From interface java.io.Closeable
From interface org.apache.directmemory.memory.MemoryManagerService

Fields

protected final AllocationPolicy allocationPolicy

protected static final Logger logger

Public Constructors

public MemoryManagerServiceImpl ()

public MemoryManagerServiceImpl (boolean returnNullWhenFull)

public MemoryManagerServiceImpl (AllocationPolicy allocationPolicy, boolean returnNullWhenFull)

Public Methods

public Pointer<V> allocate (Class<T> type, int size, long expiresIn, long expires)

public long capacity ()

public void clear ()

public void close ()

Throws
IOException

public Pointer<V> free (Pointer<V> pointer)

public void init (int numberOfBuffers, int size)

Initialize the internal structure. Need to be called before the service can be used.

Parameters
numberOfBuffers : number of internal bucket
size : size in B of internal buckets

public byte[] retrieve (Pointer<V> pointer)

public Pointer<V> store (byte[] payload, long expiresIn)

Protected Methods

protected Allocator getAllocator (int allocatorIndex)

protected List<Allocator> getAllocators ()

protected Allocator getCurrentAllocator ()

protected Allocator instanciateByteBufferAllocator (int allocatorNumber, int size)

protected Pointer<V> instanciatePointer (MemoryBuffer buffer, int allocatorIndex, long expiresIn, long expires)