org.apache.mina.filter.executor
Class DefaultIoEventSizeEstimator

java.lang.Object
  extended by org.apache.mina.filter.executor.DefaultIoEventSizeEstimator
All Implemented Interfaces:
IoEventSizeEstimator

public class DefaultIoEventSizeEstimator
extends Object
implements IoEventSizeEstimator

A default IoEventSizeEstimator implementation.

Martin's Java Notes was used for estimation. For unknown types, it inspects declaring fields of the class of the specified event and the parameter of the event. The size of unknown declaring fields are approximated to the specified averageSizePerField (default: 64).

All the estimated sizes of classes are cached for performance improvement.

Version:
$Rev: 671827 $, $Date: 2008-06-26 10:49:48 +0200 (Do, 26 Jun 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
DefaultIoEventSizeEstimator()
           
 
Method Summary
 int estimateSize(IoEvent event)
           
 int estimateSize(Object message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIoEventSizeEstimator

public DefaultIoEventSizeEstimator()
Method Detail

estimateSize

public int estimateSize(IoEvent event)
Specified by:
estimateSize in interface IoEventSizeEstimator

estimateSize

public int estimateSize(Object message)


Copyright © 2004-2009 Apache MINA Project. All Rights Reserved.