org.apache.mina.filter.traffic
Class DefaultMessageSizeEstimator

java.lang.Object
  extended by org.apache.mina.filter.traffic.DefaultMessageSizeEstimator
All Implemented Interfaces:
MessageSizeEstimator

public class DefaultMessageSizeEstimator
extends Object
implements MessageSizeEstimator

A default MessageSizeEstimator implementation.

Martin's Java Notes was used for estimation of the size of non-IoBuffers. For unknown types, it inspects declaring fields of the class of the specified message. 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: 595517 $, $Date: 2007-11-16 02:31:56 +0100 (Fri, 16 Nov 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)

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

Constructor Detail

DefaultMessageSizeEstimator

public DefaultMessageSizeEstimator()
Method Detail

estimateSize

public int estimateSize(Object message)
Specified by:
estimateSize in interface MessageSizeEstimator


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