use of quickfix.MemoryStoreFactory in project camel by apache.
the class QuickfixjComponentTest method setUpComponent.
private void setUpComponent(boolean injectQfjPlugins) throws IOException, MalformedURLException, NoSuchMethodException {
camelContext = new DefaultCamelContext();
component = new QuickfixjComponent();
component.setCamelContext(camelContext);
camelContext.addComponent("quickfix", component);
if (injectQfjPlugins) {
engineMessageFactory = new DefaultMessageFactory();
engineMessageStoreFactory = new MemoryStoreFactory();
engineLogFactory = new ScreenLogFactory();
component.setMessageFactory(engineMessageFactory);
component.setMessageStoreFactory(engineMessageStoreFactory);
component.setLogFactory(engineLogFactory);
}
assertThat(component.getEngines().size(), is(0));
Method converterMethod = QuickfixjConverters.class.getMethod("toSessionID", new Class<?>[] { String.class });
camelContext.getTypeConverterRegistry().addTypeConverter(SessionID.class, String.class, new StaticMethodTypeConverter(converterMethod, false));
}
use of quickfix.MemoryStoreFactory in project camel by apache.
the class QuickfixjEngine method inferMessageStoreFactory.
private MessageStoreFactory inferMessageStoreFactory(SessionSettings settings) throws ConfigError {
Set<MessageStoreFactory> impliedMessageStoreFactories = new HashSet<MessageStoreFactory>();
isJdbcStore(settings, impliedMessageStoreFactories);
isFileStore(settings, impliedMessageStoreFactories);
isSleepycatStore(settings, impliedMessageStoreFactories);
if (impliedMessageStoreFactories.size() > 1) {
throw new ConfigError("Ambiguous message store implied in configuration.");
}
MessageStoreFactory messageStoreFactory;
if (impliedMessageStoreFactories.size() == 1) {
messageStoreFactory = impliedMessageStoreFactories.iterator().next();
} else {
messageStoreFactory = new MemoryStoreFactory();
}
LOG.info("Inferring message store factory: {}", messageStoreFactory.getClass().getName());
return messageStoreFactory;
}
Aggregations