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

import com.eactive.eai.adapter.socket2.config.SocketAdapterContext;
import com.eactive.eai.adapter.socket2.protocol.TcpAdapterClient;
import com.eactive.eai.adapter.socket2.protocol.fixedheader.codec.FixedHeaderCodecFactory;
import com.eactive.eai.adapter.socket2.protocol.tcseed.handshake.TcseedClientFilter;
import org.apache.mina.filter.codec.ProtocolCodecFilter;


public class TcseedClient extends TcpAdapterClient {

	public TcseedClient(SocketAdapterContext context) throws Exception {
		super(context);

		this.handler = new TcseedHandler(this);
		
		config.getFilterChain().addFirst("codec", new ProtocolCodecFilter(new FixedHeaderCodecFactory(this)));
		config.getFilterChain().addAfter("codec", "tcseed", new TcseedClientFilter(this));
	}
}
