org.apache.mina.filter.codec
Class AbstractProtocolEncoderOutput

java.lang.Object
  extended by org.apache.mina.filter.codec.AbstractProtocolEncoderOutput
All Implemented Interfaces:
ProtocolEncoderOutput

public abstract class AbstractProtocolEncoderOutput
extends Object
implements ProtocolEncoderOutput

A ProtocolEncoderOutput based on queue.

Author:
Apache MINA Project

Constructor Summary
AbstractProtocolEncoderOutput()
           
 
Method Summary
 Queue<Object> getMessageQueue()
           
 void mergeAll()
          Merges all buffers you wrote via ProtocolEncoderOutput.write(Object) into one IoBuffer and replaces the old fragmented ones with it.
 void write(Object encodedMessage)
          Callback for ProtocolEncoder to generate an encoded message such as an IoBuffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.mina.filter.codec.ProtocolEncoderOutput
flush
 

Constructor Detail

AbstractProtocolEncoderOutput

public AbstractProtocolEncoderOutput()
Method Detail

getMessageQueue

public Queue<Object> getMessageQueue()

write

public void write(Object encodedMessage)
Description copied from interface: ProtocolEncoderOutput
Callback for ProtocolEncoder to generate an encoded message such as an IoBuffer. ProtocolEncoder must call ProtocolEncoderOutput.write(Object) for each encoded message.

Specified by:
write in interface ProtocolEncoderOutput
Parameters:
encodedMessage - the encoded message, typically an IoBuffer or a FileRegion.

mergeAll

public void mergeAll()
Description copied from interface: ProtocolEncoderOutput
Merges all buffers you wrote via ProtocolEncoderOutput.write(Object) into one IoBuffer and replaces the old fragmented ones with it. This method is useful when you want to control the way MINA generates network packets. Please note that this method only works when you called ProtocolEncoderOutput.write(Object) method with only IoBuffers.

Specified by:
mergeAll in interface ProtocolEncoderOutput


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