de.root1.simon.codec.base
Class AbstractMessageEncoder<T extends AbstractMessage>

java.lang.Object
  extended by de.root1.simon.codec.base.AbstractMessageEncoder<T>
All Implemented Interfaces:
org.apache.mina.filter.codec.demux.MessageEncoder<T>
Direct Known Subclasses:
MsgCloseRawChannelEncoder, MsgCloseRawChannelReturnEncoder, MsgEqualsEncoder, MsgEqualsReturnEncoder, MsgErrorEncoder, MsgHashCodeEncoder, MsgHashCodeReturnEncoder, MsgInterfaceLookupEncoder, MsgInterfaceLookupReturnEncoder, MsgInvokeEncoder, MsgInvokeReturnEncoder, MsgNameLookupEncoder, MsgNameLookupReturnEncoder, MsgOpenRawChannelEncoder, MsgOpenRawChannelReturnEncoder, MsgPingEncoder, MsgPongEncoder, MsgRawChannelDataEncoder, MsgRawChannelDataReturnEncoder, MsgToStringEncoder, MsgToStringReturnEncoder

public abstract class AbstractMessageEncoder<T extends AbstractMessage>
extends java.lang.Object
implements org.apache.mina.filter.codec.demux.MessageEncoder<T>

A MessageEncoder that encodes message header and forwards the encoding of body to a subclass.

Author:
ACHR

Constructor Summary
AbstractMessageEncoder()
           
 
Method Summary
 void encode(org.apache.mina.core.session.IoSession session, T message, org.apache.mina.filter.codec.ProtocolEncoderOutput out)
           
protected abstract  void encodeBody(org.apache.mina.core.session.IoSession session, T message, org.apache.mina.core.buffer.IoBuffer out)
          Encodes the body of the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMessageEncoder

public AbstractMessageEncoder()
Method Detail

encode

public void encode(org.apache.mina.core.session.IoSession session,
                   T message,
                   org.apache.mina.filter.codec.ProtocolEncoderOutput out)
            throws java.lang.Exception
Specified by:
encode in interface org.apache.mina.filter.codec.demux.MessageEncoder<T extends AbstractMessage>
Throws:
java.lang.Exception

encodeBody

protected abstract void encodeBody(org.apache.mina.core.session.IoSession session,
                                   T message,
                                   org.apache.mina.core.buffer.IoBuffer out)
Encodes the body of the message. This method has to be implemented by the message encoder class that extends this class

Parameters:
session -
message -
out -


Copyright © 2011. All Rights Reserved.