关闭

Fix协议封装挑战-消息处理

806人阅读 评论(0) 收藏 举报
分类:

消息处理还没正式开始写,有待完善:

处理器工厂如下:

package cs.mina.client.handler;

import java.util.HashMap;
import java.util.Map;

/*
 *@author(huangxiaoping)
 *@date 2013-10-11
 */
public class ClientHandlerFactory {
	private static Map<String, ClientMessageHandler> handlerMap=new HashMap<String,ClientMessageHandler>();
	static{
		handlerMap.put("0", new HeartbeatMessageHandler());
		handlerMap.put("5", new LogoutMessageHandler());
		handlerMap.put("4", new SequenceResetMessageHandler());
		handlerMap.put("A", new LogonMessageHandler());
		handlerMap.put("1", new TestRequestMessageHandler());
		handlerMap.put("2", new ResendRequestMessageHandler());
		handlerMap.put("3", new RejectMessageHandler());
		handlerMap.put("8", new ExecutionReportMessageHandler());
		handlerMap.put("9", new OrderCancelRejectMessageHandler());
		handlerMap.put("r", new OrderMassCancelReportMessageHandler());
		handlerMap.put("AI", new QuoteStatusReportMessageHandler());
		handlerMap.put("AE", new TradeCaptureReportMessageHandler());
		handlerMap.put("AR", new TradeCaptureReportAckMessageHandler());
		handlerMap.put("j", new BusinessMessageRejectMessageHandler());
		handlerMap.put("CV", new PartyEntitlementReportMessageHandler());
	}
	
	public static ClientMessageHandler getHandler(String key){
		return handlerMap.get(key);
	}
}


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:601689次
    • 积分:8659
    • 等级:
    • 排名:第2211名
    • 原创:289篇
    • 转载:334篇
    • 译文:1篇
    • 评论:122条
    博客专栏
    文章分类
    最新评论