package com.eactive.eai.adapter.socket2.protocol.delimiter.codec;

import com.eactive.eai.adapter.socket2.protocol.ISocketAdapter;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class DelimiterCodecFactory implements ProtocolCodecFactory {
	private ProtocolEncoder encoder;
	private ProtocolDecoder decoder;
	
	public DelimiterCodecFactory(ISocketAdapter adapter) {
		encoder = new DelimiterEncoder(adapter);
		decoder = new DelimiterDecoder(adapter);
	}

	public ProtocolDecoder getDecoder() throws Exception {
		return decoder;
	}

	public ProtocolEncoder getEncoder() throws Exception {
		return encoder;
	}
}
