项目:Camel
文件:DefaultCamelContext.java
private boolean doCheckMultipleConsumerSupportClash(Endpoint endpoint,List<Endpoint> routeInputs) {
// is multiple consumers supported
boolean multipleConsumeRSSupported = false;
if (endpoint instanceof MultipleConsumeRSSupport) {
multipleConsumeRSSupported = ((MultipleConsumeRSSupport) endpoint).isMultipleConsumeRSSupported();
}
if (multipleConsumeRSSupported) {
// multiple consumer allowed,so return true
return true;
}
// check in progress list
if (routeInputs.contains(endpoint)) {
return false;
}
return true;
}
项目:Camel
文件:QuickfixjComponentTest.java
@Test
public void createEndpointBeforeComponentStart() throws Exception {
setUpComponent();
settings.setString(sessionID,SessionFactory.SETTING_CONNECTION_TYPE,SessionFactory.INITIATOR_CONNECTION_TYPE);
settings.setLong(sessionID,Initiator.SETTING_SOCKET_CONNECT_PORT,1234);
writeSettings(settings,true);
// Should use cached QFJ engine
Endpoint e1 = component.createEndpoint(getEndpointUri(settingsFile.getName(),null));
assertthat(component.getProvisionalEngines().size(),is(1));
assertthat(component.getProvisionalEngines().get(settingsFile.getName()),is(notNullValue()));
assertthat(component.getProvisionalEngines().get(settingsFile.getName()).isInitialized(),is(true));
assertthat(component.getProvisionalEngines().get(settingsFile.getName()).isstarted(),is(false));
assertthat(component.getEngines().size(),is(0));
assertthat(((QuickfixjEndpoint)e1).getSessionID(),is(nullValue()));
writeSettings(settings,false);
// Should use cached QFJ engine
Endpoint e2 = component.createEndpoint(getEndpointUri(settingsFile2.getName(),is(2));
assertthat(component.getProvisionalEngines().get(settingsFile.getName()),is(0));
assertthat(((QuickfixjEndpoint)e2).getSessionID(),is(nullValue()));
// will start the component
camelContext.start();
assertthat(component.getProvisionalEngines().size(),is(0));
assertthat(component.getEngines().size(),is(2));
assertthat(component.getEngines().get(settingsFile.getName()).isInitialized(),is(true));
assertthat(component.getEngines().get(settingsFile.getName()).isstarted(),is(true));
// Move these too an endpoint testcase if one exists
assertthat(e1.isSingleton(),is(true));
assertthat(((MultipleConsumeRSSupport)e1).isMultipleConsumeRSSupported(),is(true));
assertthat(e2.isSingleton(),is(true));
assertthat(((MultipleConsumeRSSupport)e2).isMultipleConsumeRSSupported(),is(true));
}