public class MuleGrizzlyHeapMemoryManager extends org.glassfish.grizzly.memory.AbstractMemoryManager<HeapBuffer> implements org.glassfish.grizzly.memory.WrapperAware
MemoryManager that behaves exactly like
HeapMemoryManager but that delegates the retrieval of ByteBuffer and arrays to a
managed mule ByteBufferProvider.| Constructor and Description |
|---|
MuleGrizzlyHeapMemoryManager() |
MuleGrizzlyHeapMemoryManager(int maxBufferSize) |
| Modifier and Type | Method and Description |
|---|---|
HeapBuffer |
allocate(int size) |
HeapBuffer |
allocateAtLeast(int size) |
protected HeapBuffer |
allocateHeapBuffer(int size)
Creates a new HeapBuffer with a a specified size.
|
protected HeapBuffer |
allocateHeapBufferAtLeast(int size) |
protected Object |
createJmxManagementObject() |
org.glassfish.grizzly.memory.ThreadLocalPool |
createThreadLocalPool() |
org.glassfish.grizzly.monitoring.MonitoringConfig<org.glassfish.grizzly.memory.MemoryProbe> |
getMonitoringConfig() |
HeapBuffer |
reallocate(HeapBuffer oldBuffer,
int newSize) |
protected HeapBuffer |
reallocateHeapBuffer(HeapBuffer oldHeapBuffer,
int newSize) |
void |
release(HeapBuffer buffer) |
protected void |
releaseHeapBuffer(HeapBuffer heapBuffer) |
static void |
setMemoryManagerByteBufferProvider(org.mule.runtime.api.memory.provider.ByteBufferProvider byteBufferProvider)
Sets the
ByteBufferProvider for the Grizzly Memory Management. |
boolean |
willAllocateDirect(int size) |
HeapBuffer |
wrap(byte[] data) |
HeapBuffer |
wrap(byte[] data,
int offset,
int length) |
org.glassfish.grizzly.Buffer |
wrap(ByteBuffer byteBuffer) |
HeapBuffer |
wrap(String s) |
HeapBuffer |
wrap(String s,
Charset charset) |
public MuleGrizzlyHeapMemoryManager()
public MuleGrizzlyHeapMemoryManager(int maxBufferSize)
public static void setMemoryManagerByteBufferProvider(org.mule.runtime.api.memory.provider.ByteBufferProvider byteBufferProvider)
ByteBufferProvider for the Grizzly Memory Management. This is needed because the memory management is set in
a static block so there is no way to provide a managed ByteBufferProvider without setting it as a static attribute.byteBufferProvider - org.glassfish.grizzly.memory.MemoryManagerInitializer#initManager()}public HeapBuffer allocate(int size)
allocate in interface org.glassfish.grizzly.memory.MemoryManager<HeapBuffer>public HeapBuffer allocateAtLeast(int size)
allocateAtLeast in interface org.glassfish.grizzly.memory.MemoryManager<HeapBuffer>public HeapBuffer reallocate(HeapBuffer oldBuffer, int newSize)
reallocate in interface org.glassfish.grizzly.memory.MemoryManager<HeapBuffer>public void release(HeapBuffer buffer)
release in interface org.glassfish.grizzly.memory.MemoryManager<HeapBuffer>public boolean willAllocateDirect(int size)
willAllocateDirect in interface org.glassfish.grizzly.memory.MemoryManager<HeapBuffer>public org.glassfish.grizzly.monitoring.MonitoringConfig<org.glassfish.grizzly.memory.MemoryProbe> getMonitoringConfig()
getMonitoringConfig in interface org.glassfish.grizzly.monitoring.MonitoringAware<org.glassfish.grizzly.memory.MemoryProbe>public org.glassfish.grizzly.memory.ThreadLocalPool createThreadLocalPool()
createThreadLocalPool in interface org.glassfish.grizzly.memory.ThreadLocalPoolProviderprotected Object createJmxManagementObject()
createJmxManagementObject in class org.glassfish.grizzly.memory.AbstractMemoryManager<HeapBuffer>public HeapBuffer wrap(byte[] data)
wrap in interface org.glassfish.grizzly.memory.WrapperAwarepublic HeapBuffer wrap(byte[] data, int offset, int length)
wrap in interface org.glassfish.grizzly.memory.WrapperAwarepublic HeapBuffer wrap(String s)
wrap in interface org.glassfish.grizzly.memory.WrapperAwarepublic HeapBuffer wrap(String s, Charset charset)
wrap in interface org.glassfish.grizzly.memory.WrapperAwarepublic org.glassfish.grizzly.Buffer wrap(ByteBuffer byteBuffer)
wrap in interface org.glassfish.grizzly.memory.WrapperAwareprotected HeapBuffer allocateHeapBuffer(int size)
size - size of buffer createdprotected HeapBuffer allocateHeapBufferAtLeast(int size)
protected HeapBuffer reallocateHeapBuffer(HeapBuffer oldHeapBuffer, int newSize)
protected final void releaseHeapBuffer(HeapBuffer heapBuffer)
Copyright © 2003–2022 MuleSoft, Inc.. All rights reserved.