| Modifier and Type | Class and Description |
|---|---|
| private static class | HeapMemoryManager.
Information about thread associated memory pool. |
| private static class | |
| private static class | HeapMemoryManager.
|
| Modifier and Type | Field and Description |
|---|---|
| private static final ThreadCache. | |
| private static final ThreadCache. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public HeapBuffer | allocate(final int size)
Implements org. Allocated |
| public HeapBuffer | allocateAtLeast(final int size)
Implements org. Allocated |
| protected HeapBuffer | allocateHeapBuffer(final int
size of buffer created size)Creates a new HeapBuffer with a a specified size. |
| protected HeapBuffer | |
| private ByteBufferWrapper | |
| protected Object | |
| public ThreadLocalPool | |
| pack-priv HeapMemoryManager. | |
| pack-priv HeapMemoryManager. | |
| private static HeapMemoryManager. | getHeapBufferThreadLocalPool()
Gets the thread local buffer pool If the pool is not an instance of HeapBufferThreadLocalPool then null is returned |
| public MonitoringConfig | getMonitoringConfig()
Implements org. Return the object associated |
| public HeapBuffer | reallocate(final HeapBuffer oldBuffer, final int newSize)
Implements org. Reallocate |
| protected HeapBuffer | |
| private void | |
| public void | release(final HeapBuffer buffer)
Implements org. Release |
| protected final void | |
| public boolean | willAllocateDirect(int size)
Implements org. Return true if next |
| public HeapBuffer | wrap(final byte[] data)
Implements org. Returns |
| public HeapBuffer | wrap(final byte[] data, final int offset, final int length)
Implements org. Returns |
| public HeapBuffer | |
| public HeapBuffer | |
| public Buffer | wrap(final ByteBuffer byteBuffer)
Implements org. Returns |
| BBW_CACHE_IDX | back to summary |
|---|---|
| private static final ThreadCache. | |
| CACHE_IDX | back to summary |
|---|---|
| private static final ThreadCache. | |
| HeapMemoryManager | back to summary |
|---|---|
| public HeapMemoryManager() | |
| HeapMemoryManager | back to summary |
|---|---|
| public HeapMemoryManager(final int maxBufferSize) | |
| allocate | back to summary |
|---|---|
| public HeapBuffer allocate(final int size) Implements org. Doc from org. Allocated
| |
| allocateAtLeast | back to summary |
|---|---|
| public HeapBuffer allocateAtLeast(final int size) Implements org. Doc from org. Allocated
| |
| allocateHeapBuffer | back to summary |
|---|---|
| protected HeapBuffer allocateHeapBuffer(final int size) Creates a new HeapBuffer with a a specified size.
| |
| allocateHeapBufferAtLeast | back to summary |
|---|---|
| protected HeapBuffer allocateHeapBufferAtLeast(final int size) | |
| createByteBufferWrapper | back to summary |
|---|---|
| private ByteBufferWrapper createByteBufferWrapper(final ByteBuffer underlyingByteBuffer) | |
| createJmxManagementObject | back to summary |
|---|---|
| protected Object createJmxManagementObject() Implements abstract org.
| |
| createThreadLocalPool | back to summary |
|---|---|
| public ThreadLocalPool Implements org.
| |
| createTrimAwareBuffer | back to summary |
|---|---|
| pack-priv HeapMemoryManager. | |
| createTrimAwareBuffer | back to summary |
|---|---|
| pack-priv HeapMemoryManager. | |
| getHeapBufferThreadLocalPool | back to summary |
|---|---|
| private static HeapMemoryManager. Gets the thread local buffer pool If the pool is not an instance of HeapBufferThreadLocalPool then null is returned
| |
| getMonitoringConfig | back to summary |
|---|---|
| public MonitoringConfig Implements org. Doc from org. Return the object associated
| |
| reallocate | back to summary |
|---|---|
| public HeapBuffer reallocate(final HeapBuffer oldBuffer, final int newSize) Implements org. Doc from org. Reallocate
| |
| reallocateHeapBuffer | back to summary |
|---|---|
| protected HeapBuffer reallocateHeapBuffer(HeapBuffer oldHeapBuffer, int newSize) | |
| reallocatePoolBuffer | back to summary |
|---|---|
| private void reallocatePoolBuffer() | |
| release | back to summary |
|---|---|
| public void release(final HeapBuffer buffer) Implements org. Doc from org. Release
| |
| releaseHeapBuffer | back to summary |
|---|---|
| protected final void releaseHeapBuffer(final HeapBuffer heapBuffer) | |
| willAllocateDirect | back to summary |
|---|---|
| public boolean willAllocateDirect(int size) Implements org. Doc from org. Return true if next
| |
| wrap | back to summary |
|---|---|
| public HeapBuffer wrap(final byte[] data) Implements org. Doc from org. Returns
| |
| wrap | back to summary |
|---|---|
| public HeapBuffer wrap(final byte[] data, final int offset, final int length) Implements org. Doc from org. Returns
| |
| wrap | back to summary |
|---|---|
| public HeapBuffer wrap(final String s) Implements org. Doc from org. Returns
| |
| wrap | back to summary |
|---|---|
| public HeapBuffer wrap(final String s, final Charset charset) Implements org. Doc from org. Returns
| |
| wrap | back to summary |
|---|---|
| public Buffer wrap(final ByteBuffer byteBuffer) Implements org. Doc from org. Returns
| |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBuffer[] | |
| private int | |
| private int | |
| private int | |
| private final HeapMemoryManager | |
| private byte[] | pool
Memory pool |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public HeapBuffer | allocate(final int size)
Implements org. Creates a buffer with a given capacity and limit |
| private void | |
| public boolean | hasRemaining()
Implements org. Whether there are elements between the current position and the end |
| public boolean | isLastAllocated(final HeapBuffer oldHeapBuffer)
Implements org. Whether the last element in the buffer has been set |
| private boolean | |
| public HeapBuffer | reallocate(final HeapBuffer heapBuffer, final int newSize)
Implements org. Creates a new Buffer with a set size and assigns it the data that was held in the old one as long as the given size is not smaller than the data held. |
| public HeapBuffer | reduceLastAllocated(final HeapBuffer heapBuffer)
Implements org. Reduces the buffer to the last data allocated |
| public boolean | release(final HeapBuffer heapBuffer)
Implements org. deallocates the data in the buffer |
| public int | remaining()
Implements org. Gets the number of elements between the current position and the limit |
| public void | reset(final HeapBuffer heapBuffer)
Implements org. Resets the Buffer to empty values and empties the pool |
| public void | |
| public String | |
| public boolean | wantReset(final int size)
Implements org. Checks if the size of the Buffer should be reset. |
| byteBufferCache | back to summary |
|---|---|
| private final ByteBuffer[] byteBufferCache | |
| byteBufferCacheSize | back to summary |
|---|---|
| private int byteBufferCacheSize | |
| end | back to summary |
|---|---|
| private int end | |
| leftPos | back to summary |
|---|---|
| private int leftPos | |
| mm | back to summary |
|---|---|
| private final HeapMemoryManager mm | |
| pool | back to summary |
|---|---|
| private byte[] pool Memory pool | |
| rightPos | back to summary |
|---|---|
| private int rightPos | |
| start | back to summary |
|---|---|
| private int start | |
| HeapBufferThreadLocalPool | back to summary |
|---|---|
| public HeapBufferThreadLocalPool(final HeapMemoryManager mm) | |
| HeapBufferThreadLocalPool | back to summary |
|---|---|
| public HeapBufferThreadLocalPool(final HeapMemoryManager mm, final int maxByteBufferCacheSize) | |
| allocate | back to summary |
|---|---|
| public HeapBuffer allocate(final int size) Implements org. Doc from org. Creates a buffer with a given capacity and limit
| |
| clearByteBufferCache | back to summary |
|---|---|
| private void clearByteBufferCache() | |
| hasRemaining | back to summary |
|---|---|
| public boolean hasRemaining() Implements org. Doc from org. Whether there are elements between the current position and the end
| |
| isLastAllocated | back to summary |
|---|---|
| public boolean isLastAllocated(final HeapBuffer oldHeapBuffer) Implements org. Doc from org. Whether the last element in the buffer has been set
| |
| isReleasableLeft | back to summary |
|---|---|
| private boolean isReleasableLeft(final HeapBuffer oldHeapBuffer) | |
| reallocate | back to summary |
|---|---|
| public HeapBuffer reallocate(final HeapBuffer heapBuffer, final int newSize) Implements org. Doc from org. Creates a new Buffer with a set size and assigns it the data that was held in the old one as long as the given size is not smaller than the data held.
| |
| reduceLastAllocated | back to summary |
|---|---|
| public HeapBuffer reduceLastAllocated(final HeapBuffer heapBuffer) Implements org. Doc from org. Reduces the buffer to the last data allocated
| |
| release | back to summary |
|---|---|
| public boolean release(final HeapBuffer heapBuffer) Implements org. Doc from org. deallocates the data in the buffer
| |
| remaining | back to summary |
|---|---|
| public int remaining() Implements org. Doc from org. Gets the number of elements between the current position and the limit
| |
| reset | back to summary |
|---|---|
| public void reset(final HeapBuffer heapBuffer) Implements org. Doc from org. Resets the Buffer to empty values and empties the pool
| |
| reset | back to summary |
|---|---|
| public void reset(final byte[] heap, final int offset, final int capacity) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| wantReset | back to summary |
|---|---|
| public boolean wantReset(final int size) Implements org. Doc from org. Checks if the size of the Buffer should be reset.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | dispose()
Overrides org. Implements org. Notify the allocator that the space for this Buffer is no longer needed. |
| private void | |
| public void |
| RecyclableByteBufferWrapper | back to summary |
|---|---|
| private RecyclableByteBufferWrapper(final ByteBuffer underlyingByteBuffer) | |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides org. Implements org. Doc from org. Notify the allocator that the space for this Buffer is no longer needed. All calls to methods on a Buffer will fail after a call to dispose().
| |
| initialize | back to summary |
|---|---|
| private void initialize(final ByteBuffer underlyingByteBuffer) | |
| recycle | back to summary |
|---|---|
| public void recycle() Implements org.
| |
HeapBuffer implementation, which supports trimming. In other words it's possible to return unused
org.glassfish.grizzly.Buffer space to pool.
| Modifier and Type | Field and Description |
|---|---|
| private HeapMemoryManager |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected HeapBuffer | createHeapBuffer(final int offs, final int capacity)
Overrides org. Create a new |
| public void | dispose()
Overrides org. Implements org. Notify the allocator that the space for this Buffer is no longer needed. |
| pack-priv void | |
| public void | |
| public void | trim()
Overrides org. Implements org. Trim the buffer by reducing capacity to position, if possible. |
| mm | back to summary |
|---|---|
| private HeapMemoryManager mm | |
| TrimmableHeapBuffer | back to summary |
|---|---|
| private TrimmableHeapBuffer(final HeapMemoryManager mm, byte[] heap, int offset, int capacity) | |
| createHeapBuffer | back to summary |
|---|---|
| protected HeapBuffer createHeapBuffer(final int offs, final int capacity) Overrides org. Doc from org. Create a new
| |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides org. Implements org. Doc from org. Notify the allocator that the space for this Buffer is no longer needed. All calls to methods on a Buffer will fail after a call to dispose().
| |
| initialize | back to summary |
|---|---|
| pack-priv void initialize(final HeapMemoryManager mm, final byte[] heap, final int offset, final int length) | |
| recycle | back to summary |
|---|---|
| public void recycle() Implements org.
| |
| trim | back to summary |
|---|---|
| public void trim() Overrides org. Implements org. Doc from org. Trim the buffer by reducing capacity to position, if possible. May return without changing capacity. Also resets the
position to 0, like
| |