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

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


public class StreamFixedServer extends TcpAdapterServer {
	public StreamFixedServer(SocketAdapterContext context) throws Exception {
		super(context);	
		
		//this.handler = new StreamFixedHandler(this);
		
		config.getFilterChain().addFirst("codec", new ProtocolCodecFilter(new FixedHeaderCodecFactory(this)));
		if ("Y".equals(context.getAckSupport())) {
			config.getFilterChain().addAfter("codec", "ack", new AckServerFilter(this));
		}
	}
}

