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

import com.eactive.eai.adapter.socket2.config.SocketAdapterContext;
import com.eactive.eai.adapter.socket2.protocol.TcpAdapterServer;
import com.eactive.eai.adapter.socket2.protocol.fixedheader.codec.FixedHeaderCodecFactory;
import com.eactive.eai.adapter.socket2.protocol.xc3epb.handshake.Xc3EpbServerFilter;
import org.apache.mina.filter.codec.ProtocolCodecFilter;

public class Xc3EpbServer extends TcpAdapterServer {

	public Xc3EpbServer(SocketAdapterContext context) throws Exception {
		super(context);
		this.handler = new Xc3EpbHandler(this);
		
		config.getFilterChain().addFirst("codec", new ProtocolCodecFilter(new FixedHeaderCodecFactory(this)));

		config.getFilterChain().addAfter("codec","xc3epb.fixed", new Xc3EpbServerFilter(this));
	}
}
