oemware.core.pool
Class ByteBufferPoolableObjectFactory

java.lang.Object
  extended by oemware.core.pool.ByteBufferPoolableObjectFactory
All Implemented Interfaces:
org.apache.commons.pool.PoolableObjectFactory

public class ByteBufferPoolableObjectFactory
extends java.lang.Object
implements org.apache.commons.pool.PoolableObjectFactory

The byte buffer object factory.

Version:
$Id: ByteBufferPoolableObjectFactory.java 13 2008-06-15 19:43:04Z oemware $

Constructor Summary
ByteBufferPoolableObjectFactory(int pBufferSize)
          Construct the object and set the size of the buffer.
ByteBufferPoolableObjectFactory(int pBufferSize, boolean pUseDirect)
          Construct the object and set the size of the buffer.
 
Method Summary
 void activateObject(java.lang.Object pObject)
           
 void destroyObject(java.lang.Object pObject)
           
 java.lang.Object makeObject()
           
 void passivateObject(java.lang.Object pObject)
           
 boolean validateObject(java.lang.Object pObject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteBufferPoolableObjectFactory

public ByteBufferPoolableObjectFactory(int pBufferSize)
Construct the object and set the size of the buffer.

Parameters:
pBufferSize - The buffer size in bytes.

ByteBufferPoolableObjectFactory

public ByteBufferPoolableObjectFactory(int pBufferSize,
                                       boolean pUseDirect)
Construct the object and set the size of the buffer.

Parameters:
pBufferSize - The buffer size in bytes.
pUseDirect - Set to true to use direct memory.
Method Detail

makeObject

public final java.lang.Object makeObject()
Specified by:
makeObject in interface org.apache.commons.pool.PoolableObjectFactory

validateObject

public final boolean validateObject(java.lang.Object pObject)
Specified by:
validateObject in interface org.apache.commons.pool.PoolableObjectFactory

activateObject

public final void activateObject(java.lang.Object pObject)
Specified by:
activateObject in interface org.apache.commons.pool.PoolableObjectFactory

destroyObject

public final void destroyObject(java.lang.Object pObject)
Specified by:
destroyObject in interface org.apache.commons.pool.PoolableObjectFactory

passivateObject

public final void passivateObject(java.lang.Object pObject)
Specified by:
passivateObject in interface org.apache.commons.pool.PoolableObjectFactory


Copyright © 2008 Deft Labs - Released under LGPL, Version 3.0