|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jacorb.orb.BufferManager
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.
Method Summary | |
---|---|
static void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
configures the BufferManager, in turn configures the singleton. |
byte[] |
getBuffer(int initial)
|
byte[] |
getBuffer(int initial,
boolean cdrStr)
getBuffer returns a new buffer. |
static BufferManager |
getInstance()
May only be called after configure() |
byte[] |
getPreferredMemoryBuffer()
|
void |
release()
|
void |
returnBuffer(byte[] current)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
public static BufferManager getInstance() throws BAD_INV_ORDER
BAD_INV_ORDER
- if not previously configuredpublic byte[] getPreferredMemoryBuffer()
public byte[] getBuffer(int initial)
public byte[] getBuffer(int initial, boolean cdrStr)
getBuffer
returns a new buffer.
initial
- an int
valuecdrStr
- a boolean
value to denote if CDROuputStream is caller
(may use cache in this situation)
byte[]
valuepublic void returnBuffer(byte[] current)
public void release()
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |