package com.eactive.eai.adapter.socket2.protocol.fixedpayload;

import com.eactive.eai.adapter.socket2.config.SocketAdapterContext;
import com.eactive.eai.adapter.socket2.protocol.TcpAdapterServer;
import com.eactive.eai.adapter.socket2.protocol.fixedpayload.codec.FixedPayloadCodecFactory;
import com.eactive.eai.adapter.socket2.protocol.fixedpayload.handshake.IgnoreFilter;
import org.apache.mina.filter.codec.ProtocolCodecFilter;


public class FixedPayloadServer extends TcpAdapterServer {
	public FixedPayloadServer(SocketAdapterContext context) throws Exception {
		super(context);		
		this.handler = new FixedPayloadHandler(this);		
		config.getFilterChain().addFirst("codec", new ProtocolCodecFilter(new FixedPayloadCodecFactory(this)));
		
		/**
		 * ignore PING(ACK) message
		 */
		config.getFilterChain().addAfter("codec", "ignore", new IgnoreFilter(this));
	}
}
