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

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


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