org.apache.mina.examples.sumup.codec
Class AbstractMessageEncoder
java.lang.Object
org.apache.mina.examples.sumup.codec.AbstractMessageEncoder
- All Implemented Interfaces:
- MessageEncoder, ProtocolEncoder
- Direct Known Subclasses:
- AddMessageEncoder, ResultMessageEncoder
public abstract class AbstractMessageEncoder
- extends Object
- implements MessageEncoder
A MessageEncoder
that encodes message header and forwards
the encoding of body to a subclass.
- Version:
- $Rev: 327113 $, $Date: 2005-10-21 15:59:15 +0900 $
- Author:
- The Apache Directory Project
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractMessageEncoder
protected AbstractMessageEncoder(int type)
encode
public void encode(ProtocolSession session,
Object message,
ProtocolEncoderOutput out)
throws ProtocolViolationException
- Description copied from interface:
ProtocolEncoder
- Encodes higher-level message objects into binary or protocol-specific data.
MINA invokes
ProtocolEncoder.encode(ProtocolSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then
the encoder implementation puts encoded ByteBuffer
s into
ProtocolEncoderOutput
.
- Specified by:
encode
in interface ProtocolEncoder
- Throws:
ProtocolViolationException
- if the message violated protocol
specification
encodeBody
protected abstract void encodeBody(ProtocolSession session,
AbstractMessage message,
ByteBuffer out)
Copyright © 2004-2005 . All Rights Reserved.