@Test public void testMessageCreate() throws Exception { assertMessage(quickfix.fix40.Advertisement.class, MsgType.ADVERTISEMENT, factory.create(BEGINSTRING_FIX40, MsgType.ADVERTISEMENT)); assertMessage(quickfix.fix41.Advertisement.class, MsgType.ADVERTISEMENT, factory.create(BEGINSTRING_FIX41, MsgType.ADVERTISEMENT)); assertMessage(quickfix.fix42.Advertisement.class, MsgType.ADVERTISEMENT, factory.create(BEGINSTRING_FIX42, MsgType.ADVERTISEMENT)); assertMessage(quickfix.fix43.Advertisement.class, MsgType.ADVERTISEMENT, factory.create(BEGINSTRING_FIX43, MsgType.ADVERTISEMENT)); assertMessage(quickfix.fix44.Advertisement.class, MsgType.ADVERTISEMENT, factory.create(BEGINSTRING_FIX44, MsgType.ADVERTISEMENT)); assertMessage(quickfix.fix50.Advertisement.class, MsgType.ADVERTISEMENT, factory.create(FIX50, MsgType.ADVERTISEMENT)); assertMessage(quickfix.Message.class, MsgType.ADVERTISEMENT, factory.create("unknown", MsgType.ADVERTISEMENT)); }
public Message create(String beginString, String msgType) { MessageFactory messageFactory = messageFactories.get(beginString); if (beginString.equals(BEGINSTRING_FIXT11)) { if (!MessageUtils.isAdminMessage(msgType)) { messageFactory = messageFactories.get(FIX50); } } if (messageFactory != null) { return messageFactory.create(beginString, msgType); } Message message = new Message(); message.getHeader().setString(MsgType.FIELD, msgType); return message; }
DefaultMessageFactory implements MessageFactory { public Message create(String beginString, String msgType) { MessageFactory messageFactory = messageFactories.get(beginString); if (beginString.equals(BEGINSTRING_FIXT11)) { if (!MessageUtils.isAdminMessage(msgType)) { messageFactory = messageFactories.get(FIX50); } } if (messageFactory != null) { return messageFactory.create(beginString, msgType); } Message message = new Message(); message.getHeader().setString(MsgType.FIELD, msgType); return message; } }
DefaultMessageFactory implements MessageFactory { public Message create(String beginString, String msgType) { MessageFactory messageFactory = messageFactories.get(beginString); if (beginString.equals(BEGINSTRING_FIXT11)) { if (!MessageUtils.isAdminMessage(msgType)) { messageFactory = messageFactories.get(FIX50); } } if (messageFactory != null) { return messageFactory.create(beginString, msgType); } Message message = new Message(); message.getHeader().setString(MsgType.FIELD, msgType); return message; } DefaultMessageFactory(); }
DefaultMessageFactory implements MessageFactory { public Message create(String beginString, String msgType) { MessageFactory messageFactory = messageFactories.get(beginString); if (beginString.equals(BEGINSTRING_FIXT11)) { if (!MessageUtils.isAdminMessage(msgType)) { messageFactory = messageFactories.get(FIX50); } } if (messageFactory != null) { return messageFactory.create(beginString, msgType); } Message message = new Message(); message.getHeader().setString(MsgType.FIELD, msgType); return message; } DefaultMessageFactory(); Message create(String beginString, String msgType); Group create(String beginString, String msgType, int correspondingFieldID); }
DefaultMessageFactory implements MessageFactory { public Message create(String beginString, String msgType) { MessageFactory messageFactory = messageFactories.get(beginString); if (beginString.equals(BEGINSTRING_FIXT11)) { if (!MessageUtils.isAdminMessage(msgType)) { messageFactory = messageFactories.get(FIX50); } } if (messageFactory != null) { return messageFactory.create(beginString, msgType); } Message message = new Message(); message.getHeader().setString(MsgType.FIELD, msgType); return message; } DefaultMessageFactory(); Message create(String beginString, String msgType); Group create(String beginString, String msgType, int correspondingFieldID);  }