use of quickfix.ScreenLogFactory 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.ScreenLogFactory in project camel by apache.
the class QuickfixjEngine method inferLogFactory.
private LogFactory inferLogFactory(SessionSettings settings) throws ConfigError {
Set<LogFactory> impliedLogFactories = new HashSet<LogFactory>();
isFileLog(settings, impliedLogFactories);
isScreenLog(settings, impliedLogFactories);
isSL4JLog(settings, impliedLogFactories);
isJdbcLog(settings, impliedLogFactories);
if (impliedLogFactories.size() > 1) {
throw new ConfigError("Ambiguous log factory implied in configuration");
}
LogFactory sessionLogFactory;
if (impliedLogFactories.size() == 1) {
sessionLogFactory = impliedLogFactories.iterator().next();
} else {
// Default
sessionLogFactory = new ScreenLogFactory(settings);
}
LOG.info("Inferring log factory: {}", sessionLogFactory.getClass().getName());
return sessionLogFactory;
}
Aggregations