| java.lang.Object org.jacorb.orb.BufferManager
BufferManager | final public class BufferManager (Code) | | A BufferManager is used to share a pool of buffers and to implement
a buffer allocation policy. This reduces the number of memory
allocations and deallocations and the overall memory footprint.
Buffers are generally created on demand.
The BufferManager uses a singleton pattern, so will only be a single
shared BuffferManager across all ORBs in a process.
author: Gerald Brose, FU Berlin version: $Id: BufferManager.java,v 1.26 2006/07/20 13:18:20 alphonse.bendt Exp $ |
Method Summary | |
public static synchronized void | configure(Configuration configuration) configures the BufferManager, in turn configures the singleton. | public byte[] | getBuffer(int initial) | public synchronized byte[] | getBuffer(int initial, boolean cdrStr) getBuffer returns a new buffer. | public static synchronized BufferManager | getInstance() | public byte[] | getPreferredMemoryBuffer() | public synchronized void | release() | public void | returnBuffer(byte[] current) | public synchronized void | returnBuffer(byte[] current, boolean cdrStr) Describe returnBuffer method here. |
configure | public static synchronized void configure(Configuration configuration)(Code) | | configures the BufferManager, in turn configures the singleton.
Must be called before getInstance() !
|
getBuffer | public byte[] getBuffer(int initial)(Code) | | |
getBuffer | public synchronized byte[] getBuffer(int initial, boolean cdrStr)(Code) | | getBuffer returns a new buffer.
Parameters: initial - an int value Parameters: cdrStr - a boolean value to denote if CDROuputStream is caller(may use cache in this situation) a byte[] value |
getPreferredMemoryBuffer | public byte[] getPreferredMemoryBuffer()(Code) | | |
release | public synchronized void release()(Code) | | |
returnBuffer | public void returnBuffer(byte[] current)(Code) | | |
returnBuffer | public synchronized void returnBuffer(byte[] current, boolean cdrStr)(Code) | | Describe returnBuffer method here.
Parameters: current - a byte[] value Parameters: cdrStr - a boolean value value to denote if CDROuputStream iscaller (may use cache in this situation) |
|
|