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

import com.eactive.eai.adapter.EAIException;
import com.eactive.eai.adapter.socket2.config.SocketAdapterContext;
import com.eactive.eai.adapter.socket2.protocol.TcpAdapterClient;
import com.eactive.eai.adapter.socket2.protocol.object.codec.ObjectSerializationCodecFactory;
import org.apache.mina.filter.codec.ProtocolCodecFilter;


public class ObjectClient extends TcpAdapterClient {
	public ObjectClient(SocketAdapterContext context) throws Exception {
		super(context);		
		this.handler = new ObjectHandler(this);
		
		config.getFilterChain().addFirst("codec", new ProtocolCodecFilter(new ObjectSerializationCodecFactory(this)));
	}
	
	@Override
	public Object sendMessage(Object message) throws EAIException {
		return super.sendMessage(message);
	}		
}
