Class AbstractProtocolEncoderOutput
java.lang.Object
org.apache.mina.filter.codec.AbstractProtocolEncoderOutput
- All Implemented Interfaces:
ProtocolEncoderOutput
- Direct Known Subclasses:
ProtocolCodecFilter.ProtocolEncoderOutputImpl
A
ProtocolEncoderOutput based on queue.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanThe queue where the decoded messages are stored -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of AbstractProtocolEncoderOutput -
Method Summary
Modifier and TypeMethodDescriptionvoidmergeAll()Merges all buffers you wrote viaProtocolEncoderOutput.write(Object)into oneIoBufferand replaces the old fragmented ones with it.voidCallback forProtocolEncoderto generate an encoded message such as anIoBuffer.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ProtocolEncoderOutput
flush
-
Field Details
-
messageQueue
-
buffersOnly
private boolean buffersOnly
-
-
Constructor Details
-
AbstractProtocolEncoderOutput
public AbstractProtocolEncoderOutput()Creates an instance of AbstractProtocolEncoderOutput
-
-
Method Details
-
getMessageQueue
-
write
Callback forProtocolEncoderto generate an encoded message such as anIoBuffer.ProtocolEncodermust callProtocolEncoderOutput.write(Object)for each encoded message.- Specified by:
writein interfaceProtocolEncoderOutput- Parameters:
encodedMessage- the encoded message, typically anIoBufferor aFileRegion.
-
mergeAll
public void mergeAll()Merges all buffers you wrote viaProtocolEncoderOutput.write(Object)into oneIoBufferand 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 calledProtocolEncoderOutput.write(Object)method with onlyIoBuffers.- Specified by:
mergeAllin interfaceProtocolEncoderOutput
-