com.browseengine.bobo.util
Class MemoryManager<T>

java.lang.Object
  extended by com.browseengine.bobo.util.MemoryManager<T>
All Implemented Interfaces:
MemoryManagerAdminMBean

public class MemoryManager<T>
extends Object
implements MemoryManagerAdminMBean

Author:
"Xiaoyang Gu"

Nested Class Summary
static interface MemoryManager.Initializer<E>
           
 
Constructor Summary
MemoryManager(MemoryManager.Initializer<T> initializer)
           
 
Method Summary
 T get(int reqsize)
           
 MemoryManagerAdminMBean getAdminMBean()
           
 double getHitRate()
           
 long getNumCacheHits()
           
 long getNumCacheMisses()
           
 void release(T buf)
          return the instance to the manager after use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryManager

public MemoryManager(MemoryManager.Initializer<T> initializer)
Method Detail

getAdminMBean

public MemoryManagerAdminMBean getAdminMBean()

getNumCacheMisses

public long getNumCacheMisses()
Specified by:
getNumCacheMisses in interface MemoryManagerAdminMBean

getNumCacheHits

public long getNumCacheHits()
Specified by:
getNumCacheHits in interface MemoryManagerAdminMBean

getHitRate

public double getHitRate()
Specified by:
getHitRate in interface MemoryManagerAdminMBean

get

public T get(int reqsize)
Returns:
an initialized instance of type T. The size of the instance may not be the same as the requested size.

release

public void release(T buf)
return the instance to the manager after use

Parameters:
buf -


Copyright © 2011. All Rights Reserved.